Skip to content

Commit

Permalink
feat: support of all e2e tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime committed Apr 11, 2020
1 parent cb1d7c9 commit 937564f
Show file tree
Hide file tree
Showing 18 changed files with 627 additions and 27 deletions.
68 changes: 62 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,78 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: root-cache-{{ checksum "package-lock.json" }}
- run:
name: install-dependencies
name: install-root-dependencies
command: npm install

- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: root-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: angular-test
name: root-lint
command: npm run lint
- run:
name: root-test
command: npm run test -- --single-run --no-progress
- store_test_results:
path: ./test-reports
- store_artifacts:
path: ./test-reports/coverage
prefix: coverage

- restore_cache:
key: a6-cache-{{ checksum "e2e/angular6/package-lock.json" }}
- restore_cache:
key: a7-cache-{{ checksum "e2e/angular7/package-lock.json" }}
- restore_cache:
key: a8-cache-{{ checksum "e2e/angular8/package-lock.json" }}
- restore_cache:
key: a9-cache-{{ checksum "e2e/angular9/package-lock.json" }}
- run:
name: angular-lint
command: npm run lint
name: install-a-dependencies
command: npm run i:a
- save_cache:
key: a6-cache-{{ checksum "e2e/angular6/package-lock.json" }}
paths:
- ./e2e/angular6/node_modules
- save_cache:
key: a7-cache-{{ checksum "e2e/angular7/package-lock.json" }}
paths:
- ./e2e/angular7/node_modules
- save_cache:
key: a8-cache-{{ checksum "e2e/angular8/package-lock.json" }}
paths:
- ./e2e/angular8/node_modules
- save_cache:
key: a9-cache-{{ checksum "e2e/angular9/package-lock.json" }}
paths:
- ./e2e/angular9/node_modules
- run:
name: root-spread
command: npm run build && npm run s:a
- run:
name: e2e:a6
command: npm run e2e:a6
- run:
name: e2e:a7
command: npm run e2e:a7
- run:
name: e2e:a8
command: npm run e2e:a8
- run:
name: e2e:a9
command: npm run e2e:a9
- run:
name: build:a6
command: npm run b:a6
- run:
name: build:a7
command: npm run b:a7
- run:
name: build:a8
command: npm run b:a8
- run:
name: build:a9
command: npm run b:a9
5 changes: 4 additions & 1 deletion e2e/angular6/e2e/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ exports.config = {
specs: ['./src/**/*.e2e-spec.ts'],
capabilities: {
browserName: 'chrome',
chromeOptions: {args: ['--headless', '--disable-gpu', '--window-size=800,600']},
chromeOptions: {
args: ['--headless', '--disable-gpu', '--window-size=800,600', '--no-sandbox', '--disable-dev-shm-usage'],
binary: require('puppeteer').executablePath(),
},
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
Expand Down
127 changes: 127 additions & 0 deletions e2e/angular6/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion e2e/angular6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"e2e": "ng e2e --webdriver-update=false",
"postinstall": "node_modules/protractor/bin/webdriver-manager update --versions.chrome 80.0.3987.106"
},
"private": true,
"peerDependencies": {
Expand Down Expand Up @@ -46,6 +47,7 @@
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"puppeteer": "^2.1.1",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
Expand Down
2 changes: 2 additions & 0 deletions e2e/angular6/src/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

process.env.CHROME_BIN = require('puppeteer').executablePath();

module.exports = function (config) {
config.set({
basePath: '',
Expand Down
5 changes: 4 additions & 1 deletion e2e/angular7/e2e/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ exports.config = {
specs: ['./src/**/*.e2e-spec.ts'],
capabilities: {
browserName: 'chrome',
chromeOptions: {args: ['--headless', '--disable-gpu', '--window-size=800,600']},
chromeOptions: {
args: ['--headless', '--disable-gpu', '--window-size=800,600', '--no-sandbox', '--disable-dev-shm-usage'],
binary: require('puppeteer').executablePath(),
},
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
Expand Down
Loading

0 comments on commit 937564f

Please sign in to comment.