Skip to content

Commit 509dfd1

Browse files
committed
ci: use headless chrome on travis
1 parent 861b32b commit 509dfd1

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

Diff for: .travis.yml

-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ matrix:
9292

9393

9494
before_install:
95-
# Use a virtual display.
96-
- export DISPLAY=:99.0
97-
- sh -e /etc/init.d/xvfb start
9895
# Install yarn.
9996
- curl -o- -L https://yarnpkg.com/install.sh | bash
10097
- export PATH="$HOME/.yarn/bin:$PATH"

Diff for: tests/e2e/assets/1.0.0-proj/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"jasmine-core": "~2.5.2",
3434
"jasmine-spec-reporter": "~3.2.0",
3535
"karma": "~1.4.1",
36-
"karma-chrome-launcher": "~2.0.0",
36+
"karma-chrome-launcher": "~2.1.1",
3737
"karma-cli": "~1.0.1",
3838
"karma-jasmine": "~1.1.0",
3939
"karma-jasmine-html-reporter": "^0.2.2",

Diff for: tests/e2e/setup/500-create-project.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,22 @@ export default function() {
3939
// There's a race condition happening in Chrome. Enabling logging in chrome used by
4040
// protractor actually fixes it. Logging is piped to a file so it doesn't affect our setup.
4141
// --no-sandbox is needed for Circle CI.
42+
// Travis can use headless chrome, but not appveyor.
4243
.then(() => replaceInFile('protractor.conf.js', `'browserName': 'chrome'`,
4344
`'browserName': 'chrome',
4445
chromeOptions: {
4546
args: [
4647
"--enable-logging",
4748
"--no-sandbox",
49+
${process.env['TRAVIS'] ? '"--headless", "--disable-gpu"' : ''}
4850
]
4951
}
5052
`))
5153
.then(() => replaceInFile('karma.conf.js', `browsers: ['Chrome'],`,
52-
`browsers: ['ChromeNoSandbox'],
54+
`browsers: ['ChromeCI'],
5355
customLaunchers: {
54-
ChromeNoSandbox: {
55-
base: 'Chrome',
56+
ChromeCI: {
57+
base: '${process.env['TRAVIS'] ? 'ChromeHeadless' : 'Chrome'}',
5658
flags: ['--no-sandbox']
5759
}
5860
},

Diff for: tests/e2e/tests/misc/breaking-change.ts

+21
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createProjectFromAsset } from '../../utils/assets';
2+
import { replaceInFile } from '../../utils/fs';
23
import { ng } from '../../utils/process';
34

45
// This test ensures a project generated with 1.0.0 will still work.
@@ -7,6 +8,26 @@ import { ng } from '../../utils/process';
78
export default function () {
89
return Promise.resolve()
910
.then(() => createProjectFromAsset('1.0.0-proj'))
11+
// Update chrome configs.
12+
.then(() => replaceInFile('protractor.conf.js', `'browserName': 'chrome'`,
13+
`'browserName': 'chrome',
14+
chromeOptions: {
15+
args: [
16+
"--enable-logging",
17+
"--no-sandbox",
18+
${process.env['TRAVIS'] ? '"--headless", "--disable-gpu"' : ''}
19+
]
20+
}
21+
`))
22+
.then(() => replaceInFile('karma.conf.js', `browsers: ['Chrome'],`,
23+
`browsers: ['ChromeCI'],
24+
customLaunchers: {
25+
ChromeCI: {
26+
base: '${process.env['TRAVIS'] ? 'ChromeHeadless' : 'Chrome'}',
27+
flags: ['--no-sandbox']
28+
}
29+
},
30+
`))
1031
.then(() => ng('generate', 'component', 'my-comp'))
1132
.then(() => ng('lint'))
1233
.then(() => ng('test', '--single-run'))

0 commit comments

Comments
 (0)