Skip to content

Commit ebaf931

Browse files
committed
build: migrate integration tests to manual Protractor setup
Removes the use of the private Protractor builder (`@angular-devkit/build-angular:private-protractor`) from all integration test projects. Projects that still require E2E tests now invoke Protractor directly via NPM scripts using `concurrently` to manage the development server.
1 parent 18003a3 commit ebaf931

16 files changed

Lines changed: 283 additions & 186 deletions

File tree

integration/cli-hello-world-ivy-i18n/angular.json

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@
2626
"browser": ""
2727
},
2828
"index": "src/index.html",
29-
"polyfills": [
30-
"zone.js",
31-
"@angular/localize/init"
32-
],
29+
"polyfills": ["zone.js", "@angular/localize/init"],
3330
"tsConfig": "tsconfig.app.json",
3431
"assets": ["src/favicon.ico", "src/assets"],
3532
"styles": ["src/styles.css"],
@@ -97,11 +94,7 @@
9794
"test": {
9895
"builder": "@angular-devkit/build-angular:karma",
9996
"options": {
100-
"polyfills": [
101-
"zone.js",
102-
"zone.js/testing",
103-
"@angular/localize/init"
104-
],
97+
"polyfills": ["zone.js", "zone.js/testing", "@angular/localize/init"],
10598
"tsConfig": "tsconfig.spec.json",
10699
"karmaConfig": "karma.conf.js",
107100
"assets": ["src/favicon.ico", "src/assets"],
@@ -117,29 +110,6 @@
117110
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"],
118111
"exclude": ["**/node_modules/**"]
119112
}
120-
},
121-
"e2e": {
122-
"builder": "@angular-devkit/build-angular:private-protractor",
123-
"options": {
124-
"protractorConfig": "e2e/protractor.conf.js",
125-
"devServerTarget": "cli-hello-world-ivy-i18n:serve",
126-
"webdriverUpdate": false,
127-
"specs": ["./en/app.e2e-spec.ts"]
128-
},
129-
"configurations": {
130-
"production": {
131-
"devServerTarget": "cli-hello-world-ivy-i18n:serve:production",
132-
"protractorConfig": "e2e/protractor.conf.js"
133-
},
134-
"fr": {
135-
"devServerTarget": "cli-hello-world-ivy-i18n:serve:fr",
136-
"specs": ["./fr/app.e2e-spec.ts"]
137-
},
138-
"de": {
139-
"devServerTarget": "cli-hello-world-ivy-i18n:serve:de",
140-
"specs": ["./de/app.e2e-spec.ts"]
141-
}
142-
}
143113
}
144114
}
145115
}

integration/cli-hello-world-ivy-i18n/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
"license": "MIT",
55
"scripts": {
66
"build": "ng build --configuration production",
7-
"e2e": "ng e2e --port 0",
7+
"e2e": "concurrently \"ng serve --port 4200\" \"protractor e2e/protractor.conf.js --baseUrl=http://localhost:4200 --specs='e2e/en/*.e2e-spec.ts'\" --kill-others --success first",
8+
"e2e:production": "concurrently \"ng serve --configuration production --port 4200\" \"protractor e2e/protractor.conf.js --baseUrl=http://localhost:4200 --specs='e2e/en/*.e2e-spec.ts'\" --kill-others --success first",
9+
"e2e:fr": "concurrently \"ng serve --configuration fr --port 4201\" \"protractor e2e/protractor.conf.js --baseUrl=http://localhost:4201 --specs='e2e/fr/*.e2e-spec.ts'\" --kill-others --success first",
10+
"e2e:de": "concurrently \"ng serve --configuration de --port 4202\" \"protractor e2e/protractor.conf.js --baseUrl=http://localhost:4202 --specs='e2e/de/*.e2e-spec.ts'\" --kill-others --success first",
811
"lint": "ng lint",
912
"ng": "ng",
1013
"start": "ng serve",
1114
"pretest": "ng version",
12-
"test": "ng e2e --port 0 --configuration production && ng extract-i18n && pnpm translate && ng e2e --port 0 --configuration fr && ng e2e --port 0 --configuration de",
15+
"test": "pnpm e2e:production && ng extract-i18n && pnpm translate && pnpm e2e:fr && pnpm e2e:de",
1316
"translate": "cp src/locale/messages.xlf src/locale/messages.fr.xlf && cp src/locale/messages.xlf src/locale/messages.de.xlf && sed -i.bak -e 's/source>/target>/g' -e 's/Hello/Bonjour/' src/locale/messages.fr.xlf && sed -i.bak -e 's/source>/target>/g' -e 's/Hello/Hallo/' src/locale/messages.de.xlf",
1417
"serve": "serve --no-clipboard --listen 4200"
1518
},
@@ -34,6 +37,7 @@
3437
"@types/jasmine": "^6.0.0",
3538
"@types/jasminewd2": "^2.0.8",
3639
"@types/node": "^20.14.8",
40+
"concurrently": "9.2.1",
3741
"jasmine-core": "6.0.1",
3842
"jasmine-spec-reporter": "~7.0.0",
3943
"npm-run-all": "4.1.5",

integration/cli-hello-world-ivy-i18n/pnpm-lock.yaml

Lines changed: 58 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration/cli-signal-inputs/angular.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -92,25 +92,6 @@
9292
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"],
9393
"exclude": ["**/node_modules/**"]
9494
}
95-
},
96-
"e2e": {
97-
"builder": "@angular-devkit/build-angular:private-protractor",
98-
"options": {
99-
"protractorConfig": "e2e/protractor.conf.js",
100-
"devServerTarget": "cli-signal-inputs:serve",
101-
"webdriverUpdate": false
102-
},
103-
"configurations": {
104-
"production": {
105-
"devServerTarget": "cli-signal-inputs:serve:production"
106-
},
107-
"ci": {
108-
"devServerTarget": "cli-signal-inputs:serve:ci"
109-
},
110-
"ci-production": {
111-
"devServerTarget": "cli-signal-inputs:serve:ci-production"
112-
}
113-
}
11495
}
11596
}
11697
}

integration/cli-signal-inputs/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"start": "ng serve",
77
"build": "ng build --configuration production",
88
"pretest": "ng version",
9-
"test": "ng test && ng e2e && ng build --configuration=production",
9+
"test": "ng test && pnpm run e2e && ng build --configuration=production",
1010
"lint": "ng lint",
11-
"e2e": "ng e2e --port 0"
11+
"e2e": "concurrently \"ng serve --port 4200\" \"protractor e2e/protractor.conf.js\" --kill-others --success first"
1212
},
1313
"packageManager": "pnpm@10.29.1",
1414
"private": true,
@@ -31,6 +31,7 @@
3131
"@types/jasmine": "^6.0.0",
3232
"@types/jasminewd2": "^2.0.8",
3333
"@types/node": "^20.14.8",
34+
"concurrently": "9.2.1",
3435
"jasmine-core": "6.0.0",
3536
"jasmine-spec-reporter": "~7.0.0",
3637
"karma": "~6.4.0",

0 commit comments

Comments
 (0)