diff --git a/.travis.yml b/.travis.yml index 735b95651ab6..04cc589e5552 100644 --- a/.travis.yml +++ b/.travis.yml @@ -92,9 +92,6 @@ matrix: before_install: - # Use a virtual display. - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start # Install yarn. - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH="$HOME/.yarn/bin:$PATH" diff --git a/tests/e2e/assets/1.0.0-proj/package.json b/tests/e2e/assets/1.0.0-proj/package.json index decc11c482fc..76f5af43c004 100644 --- a/tests/e2e/assets/1.0.0-proj/package.json +++ b/tests/e2e/assets/1.0.0-proj/package.json @@ -33,7 +33,7 @@ "jasmine-core": "~2.5.2", "jasmine-spec-reporter": "~3.2.0", "karma": "~1.4.1", - "karma-chrome-launcher": "~2.0.0", + "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", diff --git a/tests/e2e/setup/500-create-project.ts b/tests/e2e/setup/500-create-project.ts index 4d6f546c0304..69f42bb8fcb1 100644 --- a/tests/e2e/setup/500-create-project.ts +++ b/tests/e2e/setup/500-create-project.ts @@ -39,20 +39,22 @@ export default function() { // There's a race condition happening in Chrome. Enabling logging in chrome used by // protractor actually fixes it. Logging is piped to a file so it doesn't affect our setup. // --no-sandbox is needed for Circle CI. + // Travis can use headless chrome, but not appveyor. .then(() => replaceInFile('protractor.conf.js', `'browserName': 'chrome'`, `'browserName': 'chrome', chromeOptions: { args: [ "--enable-logging", "--no-sandbox", + ${process.env['TRAVIS'] ? '"--headless", "--disable-gpu"' : ''} ] } `)) .then(() => replaceInFile('karma.conf.js', `browsers: ['Chrome'],`, - `browsers: ['ChromeNoSandbox'], + `browsers: ['ChromeCI'], customLaunchers: { - ChromeNoSandbox: { - base: 'Chrome', + ChromeCI: { + base: '${process.env['TRAVIS'] ? 'ChromeHeadless' : 'Chrome'}', flags: ['--no-sandbox'] } }, diff --git a/tests/e2e/tests/misc/breaking-change.ts b/tests/e2e/tests/misc/breaking-change.ts index b63fa90af62d..e087e959cf84 100644 --- a/tests/e2e/tests/misc/breaking-change.ts +++ b/tests/e2e/tests/misc/breaking-change.ts @@ -1,4 +1,5 @@ import { createProjectFromAsset } from '../../utils/assets'; +import { replaceInFile } from '../../utils/fs'; import { ng } from '../../utils/process'; // This test ensures a project generated with 1.0.0 will still work. @@ -7,6 +8,26 @@ import { ng } from '../../utils/process'; export default function () { return Promise.resolve() .then(() => createProjectFromAsset('1.0.0-proj')) + // Update chrome configs. + .then(() => replaceInFile('protractor.conf.js', `'browserName': 'chrome'`, + `'browserName': 'chrome', + chromeOptions: { + args: [ + "--enable-logging", + "--no-sandbox", + ${process.env['TRAVIS'] ? '"--headless", "--disable-gpu"' : ''} + ] + } + `)) + .then(() => replaceInFile('karma.conf.js', `browsers: ['Chrome'],`, + `browsers: ['ChromeCI'], + customLaunchers: { + ChromeCI: { + base: '${process.env['TRAVIS'] ? 'ChromeHeadless' : 'Chrome'}', + flags: ['--no-sandbox'] + } + }, + `)) .then(() => ng('generate', 'component', 'my-comp')) .then(() => ng('lint')) .then(() => ng('test', '--single-run'))