Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Protractor Builder #28632

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"projectType": "application",
"targets": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"builder": "@angular-devkit/build-angular:private-protractor",
"options": {
"protractorConfig": "protractor.conf.js",
"devServerTarget": "app:serve",
Expand Down
23 changes: 0 additions & 23 deletions packages/angular/cli/lib/config/workspace-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@
"@angular-devkit/build-angular:prerender",
"@angular-devkit/build-angular:jest",
"@angular-devkit/build-angular:web-test-runner",
"@angular-devkit/build-angular:protractor",
"@angular-devkit/build-angular:server",
"@angular-devkit/build-angular:ssr-dev-server"
]
Expand Down Expand Up @@ -656,28 +655,6 @@
}
}
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"builder": {
"const": "@angular-devkit/build-angular:protractor"
},
"defaultConfiguration": {
"type": "string",
"description": "A default named configuration to use when a target configuration is not provided."
},
"options": {
"$ref": "../../../../angular_devkit/build_angular/src/builders/protractor/schema.json"
},
"configurations": {
"type": "object",
"additionalProperties": {
"$ref": "../../../../angular_devkit/build_angular/src/builders/protractor/schema.json"
}
}
}
},
{
"type": "object",
"additionalProperties": false,
Expand Down
4 changes: 2 additions & 2 deletions packages/angular_devkit/build_angular/builders.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"schema": "./src/builders/web-test-runner/schema.json",
"description": "Run unit tests with Web Test Runner."
},
"protractor": {
"private-protractor": {
"implementation": "./src/builders/protractor",
"schema": "./src/builders/protractor/schema.json",
"description": "Run protractor over a dev server."
"description": "PRIVATE API - Do not use."
},
"server": {
"implementation": "./src/builders/server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"prefix": "",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any changes with core can be reverted as this are just test file.

"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"builder": "@angular-devkit/build-angular:private-protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "my-app:serve"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"builder": "@angular-devkit/build-angular:private-protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "my-app:serve"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"builder": "@angular-devkit/build-angular:private-protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "my-app:serve"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"builder": "@angular-devkit/build-angular:private-protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "my-app:serve"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"builder": "@angular-devkit/build-angular:private-protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "my-app:serve"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"builder": "@angular-devkit/build-angular:private-protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "my-app:serve"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"builder": "@angular-devkit/build-angular:private-protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "my-app:serve"
Expand Down
4 changes: 2 additions & 2 deletions packages/schematics/angular/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"schema": "./application/schema.json",
"description": "Create an Angular application."
},
"e2e": {
dgp1130 marked this conversation as resolved.
Show resolved Hide resolved
"private-e2e": {
"factory": "./e2e",
"schema": "./e2e/schema.json",
"description": "Create an Angular e2e application.",
"description": "PRIVATE API - Do not use.",
"hidden": true
},
"class": {
Expand Down
16 changes: 12 additions & 4 deletions packages/schematics/angular/e2e/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Application Schematic', () => {
});

it('should create all files of e2e in an application', async () => {
const tree = await schematicRunner.runSchematic('e2e', defaultOptions, applicationTree);
const tree = await schematicRunner.runSchematic('private-e2e', defaultOptions, applicationTree);

const files = tree.files;
expect(files).toEqual(
Expand All @@ -64,15 +64,23 @@ describe('Application Schematic', () => {

describe('workspace config', () => {
it('should add e2e targets for the app', async () => {
const tree = await schematicRunner.runSchematic('e2e', defaultOptions, applicationTree);
const tree = await schematicRunner.runSchematic(
'private-e2e',
defaultOptions,
applicationTree,
);

const workspace = JSON.parse(tree.readContent('/angular.json'));
const targets = workspace.projects.foo.architect;
expect(targets.e2e).toBeDefined();
});

it('should set the e2e options', async () => {
const tree = await schematicRunner.runSchematic('e2e', defaultOptions, applicationTree);
const tree = await schematicRunner.runSchematic(
'private-e2e',
defaultOptions,
applicationTree,
);

const workspace = JSON.parse(tree.readContent('/angular.json'));
const { options, configurations } = workspace.projects.foo.architect.e2e;
Expand All @@ -82,7 +90,7 @@ describe('Application Schematic', () => {
});

it('should add an e2e script in package.json', async () => {
const tree = await schematicRunner.runSchematic('e2e', defaultOptions, applicationTree);
const tree = await schematicRunner.runSchematic('private-e2e', defaultOptions, applicationTree);

const pkg = JSON.parse(tree.readContent('/package.json'));
expect(pkg.scripts['e2e']).toBe('ng e2e');
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/utility/workspace-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export enum Builders {
NgPackagr = '@angular-devkit/build-angular:ng-packagr',
DevServer = '@angular-devkit/build-angular:dev-server',
ExtractI18n = '@angular-devkit/build-angular:extract-i18n',
Protractor = '@angular-devkit/build-angular:protractor',
Protractor = '@angular-devkit/build-angular:private-protractor',
BuildApplication = '@angular/build:application',
}

Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/build/jit-ngmodule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { updateJsonFile, useCIChrome, useCIDefaults } from '../../utils/project'

export default async function () {
await ng('generate', 'app', 'test-project-two', '--no-standalone', '--skip-install');
await ng('generate', 'e2e', '--related-app-name=test-project-two');
await ng('generate', 'private-e2e', '--related-app-name=test-project-two');

// Setup testing to use CI Chrome.
await useCIChrome('test-project-two', './projects/test-project-two/e2e');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default async function () {
await rimraf('node_modules/@angular/ssr');

await ng('generate', 'app', 'test-project-two', '--no-standalone', '--skip-install');
await ng('generate', 'e2e', '--related-app-name=test-project-two');
await ng('generate', 'private-e2e', '--related-app-name=test-project-two');

// Setup testing to use CI Chrome.
await useCIChrome('test-project-two', 'projects/test-project-two/e2e/');
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/update/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default async function () {
await ng('update', '@angular/cli', ...extraUpdateArgs);

// Generate E2E setup
await ng('generate', 'e2e', '--related-app-name=fifteen-project');
await ng('generate', 'private-e2e', '--related-app-name=fifteen-project');

// Setup testing to use CI Chrome.
await useCIChrome('fifteen-project', './');
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/utils/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function prepareProjectForE2e(name: string) {

console.log(`Project ${name} created... Installing packages.`);
await installWorkspacePackages();
await ng('generate', 'e2e', '--related-app-name', name);
await ng('generate', 'private-e2e', '--related-app-name', name);

await useCIChrome(name, 'e2e');
await useCIChrome(name, '');
Expand Down