Skip to content

Commit

Permalink
fix(config): remove phantomjs in favor of chrome headless (#3175)
Browse files Browse the repository at this point in the history
* use custom launcher with --no-sandbox, see https://docs.travis-ci.com/user/chrome
  • Loading branch information
lusarz authored and johnjbarton committed Oct 14, 2018
1 parent f28a454 commit 0f8b2b1
Show file tree
Hide file tree
Showing 19 changed files with 1,353 additions and 1,099 deletions.
7 changes: 3 additions & 4 deletions package.json
Expand Up @@ -378,6 +378,7 @@
"mime": "^2.3.1",
"minimatch": "^3.0.2",
"optimist": "^0.6.1",
"puppeteer": "^1.9.0",
"qjobs": "^1.1.4",
"range-parser": "^1.2.0",
"rimraf": "^2.6.0",
Expand Down Expand Up @@ -406,8 +407,8 @@
"grunt-auto-release": "^0.0.7",
"grunt-browserify": "^5.0.0",
"grunt-bump": "^0.8.0",
"grunt-cli": "^1.1.0",
"grunt-check-clean": "^0.1.2",
"grunt-cli": "^1.1.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-conventional-changelog": "^6.0.1",
"grunt-conventional-github-releaser": "^1.0.0",
Expand All @@ -422,7 +423,7 @@
"karma-browserify": "^5.0.1",
"karma-browserstack-launcher": "^1.0.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "*",
"karma-chrome-launcher": "^2.2.0",
"karma-coffee-preprocessor": "*",
"karma-commonjs": "*",
"karma-coverage": "*",
Expand All @@ -435,7 +436,6 @@
"karma-mocha": "^1.0.1",
"karma-mocha-reporter": "^2.0.0",
"karma-ng-scenario": "*",
"karma-phantomjs-launcher": "*",
"karma-qunit": "*",
"karma-requirejs": "*",
"karma-sauce-launcher": "*",
Expand All @@ -444,7 +444,6 @@
"mkdirp": "^0.5.0",
"mocha": "^4.0.1",
"mocks": "^0.0.15",
"phantomjs-prebuilt": "^2.1.3",
"proxyquire": "^1.7.11",
"qunitjs": "^2.1.1",
"requirejs": "^2.1.20",
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/basic.feature
Expand Up @@ -3,21 +3,21 @@ Feature: Basic Testrunner
As a person who wants to write great tests
I want to be able to run tests from the command line.

Scenario: Execute a test in PhantomJS
Scenario: Execute a test in ChromeHeadless
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with:
"""
..
PhantomJS
HeadlessChrome
"""
@not-jenkins
Scenario: Execute a test in Chrome
Expand Down
34 changes: 17 additions & 17 deletions test/e2e/browser_console.feature
Expand Up @@ -7,10 +7,10 @@ Feature: Browser Console Configuration
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Expand Down Expand Up @@ -44,10 +44,10 @@ Feature: Browser Console Configuration
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
path: 'test/e2e/console.log',
Expand All @@ -68,10 +68,10 @@ Feature: Browser Console Configuration
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
path: 'test/e2e/console.log',
Expand All @@ -92,10 +92,10 @@ Feature: Browser Console Configuration
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
path: 'test/e2e/console.log',
Expand All @@ -115,10 +115,10 @@ Feature: Browser Console Configuration
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
path: 'test/e2e/console.log',
Expand All @@ -128,17 +128,17 @@ Feature: Browser Console Configuration
When I start Karma
Then the file at test/e2e/console.log contains:
"""
Phantom
HeadlessChrome
"""

Scenario: Execute logging program and disabling terminal
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
path: 'test/e2e/console.log',
Expand All @@ -150,17 +150,17 @@ Feature: Browser Console Configuration
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""

Scenario: Execute logging program and disabling terminal
Given a configuration with:
"""
files = ['browser-console/log.js', 'browser-console/test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
browserConsoleLogOptions = {
terminal: false
Expand All @@ -170,5 +170,5 @@ Feature: Browser Console Configuration
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""
6 changes: 3 additions & 3 deletions test/e2e/custom-context.feature
Expand Up @@ -7,16 +7,16 @@ Feature: Custom Context File
Given a configuration with:
"""
files = ['context/*.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
customContextFile = 'context/context2.html'
"""
When I start Karma
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""
12 changes: 6 additions & 6 deletions test/e2e/displayname.feature
Expand Up @@ -3,18 +3,18 @@ Feature: Custom Display-name
As a person who wants to write great tests
I want to Karma to send custom display-name.

Scenario: Execute a test in PhantomJS
Scenario: Execute a test in ChromeHeadless
Given a configuration with:
"""
files = ['basic/plus.js', 'basic/test.js'];
browsers = ['customPhantom'];
browsers = ['customChrome'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
customLaunchers = {
customPhantom: {
base: 'PhantomJS',
customChrome: {
base: 'ChromeHeadlessNoSandbox',
displayName: '42'
}
};
Expand All @@ -24,4 +24,4 @@ Feature: Custom Display-name
"""
..
42
"""
"""
6 changes: 3 additions & 3 deletions test/e2e/error.feature
Expand Up @@ -7,14 +7,14 @@ Feature: Error Display
Given a configuration with:
"""
files = ['error/test.js', 'error/under-test.js'];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it fails with:
"""
SyntaxError: Parser error
SyntaxError: Unexpected token }
"""
42 changes: 21 additions & 21 deletions test/e2e/files.feature
Expand Up @@ -10,17 +10,17 @@ Feature: Including files
{pattern: 'files/log_foo.js', included: false},
'files/*.js'
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with:
"""
.
PhantomJS
HeadlessChrome
"""

Scenario: Execute a test excluding an explicitly included file
Expand All @@ -31,17 +31,17 @@ Feature: Including files
{pattern: 'files/log_foo.js', included: false},
'files/*.js'
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
Expand All @@ -56,17 +56,17 @@ Feature: Including files
{pattern: 'files/log_foo.js', included: true},
{pattern: 'files/log_foo.js', included: false}
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
Expand All @@ -81,17 +81,17 @@ Feature: Including files
{pattern: 'files/log_foo.js', included: false},
{pattern: 'files/{log,bug}_foo.js', included: true}
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
Expand All @@ -106,17 +106,17 @@ Feature: Including files
{pattern: 'files/+(log|bug)_foo.js', included: false},
{pattern: 'files/*.js', included: true}
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
Expand All @@ -131,17 +131,17 @@ Feature: Including files
{pattern: 'files/*.js', included: false},
{pattern: 'files/**', included: true}
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
Expand All @@ -157,17 +157,17 @@ Feature: Including files
{pattern: 'files/{log,bug}_foo.js', included: true}
];
browsers = ['PhantomJS'];
browsers = ['ChromeHeadlessNoSandbox'];
plugins = [
'karma-jasmine',
'karma-phantomjs-launcher'
'karma-chrome-launcher'
];
"""
When I start Karma
Then it passes with like:
"""
.
PhantomJS
HeadlessChrome
"""
And it passes with like:
"""
Expand Down

0 comments on commit 0f8b2b1

Please sign in to comment.