Skip to content

Commit 0f8b2b1

Browse files
lusarzjohnjbarton
authored andcommittedOct 14, 2018
fix(config): remove phantomjs in favor of chrome headless (#3175)
* use custom launcher with --no-sandbox, see https://docs.travis-ci.com/user/chrome
1 parent f28a454 commit 0f8b2b1

19 files changed

+1353
-1099
lines changed
 

‎package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@
378378
"mime": "^2.3.1",
379379
"minimatch": "^3.0.2",
380380
"optimist": "^0.6.1",
381+
"puppeteer": "^1.9.0",
381382
"qjobs": "^1.1.4",
382383
"range-parser": "^1.2.0",
383384
"rimraf": "^2.6.0",
@@ -406,8 +407,8 @@
406407
"grunt-auto-release": "^0.0.7",
407408
"grunt-browserify": "^5.0.0",
408409
"grunt-bump": "^0.8.0",
409-
"grunt-cli": "^1.1.0",
410410
"grunt-check-clean": "^0.1.2",
411+
"grunt-cli": "^1.1.0",
411412
"grunt-contrib-watch": "^1.0.0",
412413
"grunt-conventional-changelog": "^6.0.1",
413414
"grunt-conventional-github-releaser": "^1.0.0",
@@ -422,7 +423,7 @@
422423
"karma-browserify": "^5.0.1",
423424
"karma-browserstack-launcher": "^1.0.0",
424425
"karma-chai": "^0.1.0",
425-
"karma-chrome-launcher": "*",
426+
"karma-chrome-launcher": "^2.2.0",
426427
"karma-coffee-preprocessor": "*",
427428
"karma-commonjs": "*",
428429
"karma-coverage": "*",
@@ -435,7 +436,6 @@
435436
"karma-mocha": "^1.0.1",
436437
"karma-mocha-reporter": "^2.0.0",
437438
"karma-ng-scenario": "*",
438-
"karma-phantomjs-launcher": "*",
439439
"karma-qunit": "*",
440440
"karma-requirejs": "*",
441441
"karma-sauce-launcher": "*",
@@ -444,7 +444,6 @@
444444
"mkdirp": "^0.5.0",
445445
"mocha": "^4.0.1",
446446
"mocks": "^0.0.15",
447-
"phantomjs-prebuilt": "^2.1.3",
448447
"proxyquire": "^1.7.11",
449448
"qunitjs": "^2.1.1",
450449
"requirejs": "^2.1.20",

‎test/e2e/basic.feature

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ Feature: Basic Testrunner
33
As a person who wants to write great tests
44
I want to be able to run tests from the command line.
55

6-
Scenario: Execute a test in PhantomJS
6+
Scenario: Execute a test in ChromeHeadless
77
Given a configuration with:
88
"""
99
files = ['basic/plus.js', 'basic/test.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
"""
1616
When I start Karma
1717
Then it passes with:
1818
"""
1919
..
20-
PhantomJS
20+
HeadlessChrome
2121
"""
2222
@not-jenkins
2323
Scenario: Execute a test in Chrome

‎test/e2e/browser_console.feature

+17-17
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Feature: Browser Console Configuration
77
Given a configuration with:
88
"""
99
files = ['browser-console/log.js', 'browser-console/test.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
"""
1616
When I start Karma
@@ -44,10 +44,10 @@ Feature: Browser Console Configuration
4444
Given a configuration with:
4545
"""
4646
files = ['browser-console/log.js', 'browser-console/test.js'];
47-
browsers = ['PhantomJS'];
47+
browsers = ['ChromeHeadlessNoSandbox'];
4848
plugins = [
4949
'karma-jasmine',
50-
'karma-phantomjs-launcher'
50+
'karma-chrome-launcher'
5151
];
5252
browserConsoleLogOptions = {
5353
path: 'test/e2e/console.log',
@@ -68,10 +68,10 @@ Feature: Browser Console Configuration
6868
Given a configuration with:
6969
"""
7070
files = ['browser-console/log.js', 'browser-console/test.js'];
71-
browsers = ['PhantomJS'];
71+
browsers = ['ChromeHeadlessNoSandbox'];
7272
plugins = [
7373
'karma-jasmine',
74-
'karma-phantomjs-launcher'
74+
'karma-chrome-launcher'
7575
];
7676
browserConsoleLogOptions = {
7777
path: 'test/e2e/console.log',
@@ -92,10 +92,10 @@ Feature: Browser Console Configuration
9292
Given a configuration with:
9393
"""
9494
files = ['browser-console/log.js', 'browser-console/test.js'];
95-
browsers = ['PhantomJS'];
95+
browsers = ['ChromeHeadlessNoSandbox'];
9696
plugins = [
9797
'karma-jasmine',
98-
'karma-phantomjs-launcher'
98+
'karma-chrome-launcher'
9999
];
100100
browserConsoleLogOptions = {
101101
path: 'test/e2e/console.log',
@@ -115,10 +115,10 @@ Feature: Browser Console Configuration
115115
Given a configuration with:
116116
"""
117117
files = ['browser-console/log.js', 'browser-console/test.js'];
118-
browsers = ['PhantomJS'];
118+
browsers = ['ChromeHeadlessNoSandbox'];
119119
plugins = [
120120
'karma-jasmine',
121-
'karma-phantomjs-launcher'
121+
'karma-chrome-launcher'
122122
];
123123
browserConsoleLogOptions = {
124124
path: 'test/e2e/console.log',
@@ -128,17 +128,17 @@ Feature: Browser Console Configuration
128128
When I start Karma
129129
Then the file at test/e2e/console.log contains:
130130
"""
131-
Phantom
131+
HeadlessChrome
132132
"""
133133

134134
Scenario: Execute logging program and disabling terminal
135135
Given a configuration with:
136136
"""
137137
files = ['browser-console/log.js', 'browser-console/test.js'];
138-
browsers = ['PhantomJS'];
138+
browsers = ['ChromeHeadlessNoSandbox'];
139139
plugins = [
140140
'karma-jasmine',
141-
'karma-phantomjs-launcher'
141+
'karma-chrome-launcher'
142142
];
143143
browserConsoleLogOptions = {
144144
path: 'test/e2e/console.log',
@@ -150,17 +150,17 @@ Feature: Browser Console Configuration
150150
Then it passes with:
151151
"""
152152
.
153-
PhantomJS
153+
HeadlessChrome
154154
"""
155155

156156
Scenario: Execute logging program and disabling terminal
157157
Given a configuration with:
158158
"""
159159
files = ['browser-console/log.js', 'browser-console/test.js'];
160-
browsers = ['PhantomJS'];
160+
browsers = ['ChromeHeadlessNoSandbox'];
161161
plugins = [
162162
'karma-jasmine',
163-
'karma-phantomjs-launcher'
163+
'karma-chrome-launcher'
164164
];
165165
browserConsoleLogOptions = {
166166
terminal: false
@@ -170,5 +170,5 @@ Feature: Browser Console Configuration
170170
Then it passes with:
171171
"""
172172
.
173-
PhantomJS
173+
HeadlessChrome
174174
"""

‎test/e2e/custom-context.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ Feature: Custom Context File
77
Given a configuration with:
88
"""
99
files = ['context/*.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
customContextFile = 'context/context2.html'
1616
"""
1717
When I start Karma
1818
Then it passes with:
1919
"""
2020
.
21-
PhantomJS
21+
HeadlessChrome
2222
"""

‎test/e2e/displayname.feature

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ Feature: Custom Display-name
33
As a person who wants to write great tests
44
I want to Karma to send custom display-name.
55

6-
Scenario: Execute a test in PhantomJS
6+
Scenario: Execute a test in ChromeHeadless
77
Given a configuration with:
88
"""
99
files = ['basic/plus.js', 'basic/test.js'];
10-
browsers = ['customPhantom'];
10+
browsers = ['customChrome'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
customLaunchers = {
16-
customPhantom: {
17-
base: 'PhantomJS',
16+
customChrome: {
17+
base: 'ChromeHeadlessNoSandbox',
1818
displayName: '42'
1919
}
2020
};
@@ -24,4 +24,4 @@ Feature: Custom Display-name
2424
"""
2525
..
2626
42
27-
"""
27+
"""

‎test/e2e/error.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Feature: Error Display
77
Given a configuration with:
88
"""
99
files = ['error/test.js', 'error/under-test.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
"""
1616
When I start Karma
1717
Then it fails with:
1818
"""
19-
SyntaxError: Parser error
19+
SyntaxError: Unexpected token }
2020
"""

‎test/e2e/files.feature

+21-21
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ Feature: Including files
1010
{pattern: 'files/log_foo.js', included: false},
1111
'files/*.js'
1212
];
13-
browsers = ['PhantomJS'];
13+
browsers = ['ChromeHeadlessNoSandbox'];
1414
plugins = [
1515
'karma-jasmine',
16-
'karma-phantomjs-launcher'
16+
'karma-chrome-launcher'
1717
];
1818
"""
1919
When I start Karma
2020
Then it passes with:
2121
"""
2222
.
23-
PhantomJS
23+
HeadlessChrome
2424
"""
2525

2626
Scenario: Execute a test excluding an explicitly included file
@@ -31,17 +31,17 @@ Feature: Including files
3131
{pattern: 'files/log_foo.js', included: false},
3232
'files/*.js'
3333
];
34-
browsers = ['PhantomJS'];
34+
browsers = ['ChromeHeadlessNoSandbox'];
3535
plugins = [
3636
'karma-jasmine',
37-
'karma-phantomjs-launcher'
37+
'karma-chrome-launcher'
3838
];
3939
"""
4040
When I start Karma
4141
Then it passes with like:
4242
"""
4343
.
44-
PhantomJS
44+
HeadlessChrome
4545
"""
4646
And it passes with like:
4747
"""
@@ -56,17 +56,17 @@ Feature: Including files
5656
{pattern: 'files/log_foo.js', included: true},
5757
{pattern: 'files/log_foo.js', included: false}
5858
];
59-
browsers = ['PhantomJS'];
59+
browsers = ['ChromeHeadlessNoSandbox'];
6060
plugins = [
6161
'karma-jasmine',
62-
'karma-phantomjs-launcher'
62+
'karma-chrome-launcher'
6363
];
6464
"""
6565
When I start Karma
6666
Then it passes with like:
6767
"""
6868
.
69-
PhantomJS
69+
HeadlessChrome
7070
"""
7171
And it passes with like:
7272
"""
@@ -81,17 +81,17 @@ Feature: Including files
8181
{pattern: 'files/log_foo.js', included: false},
8282
{pattern: 'files/{log,bug}_foo.js', included: true}
8383
];
84-
browsers = ['PhantomJS'];
84+
browsers = ['ChromeHeadlessNoSandbox'];
8585
plugins = [
8686
'karma-jasmine',
87-
'karma-phantomjs-launcher'
87+
'karma-chrome-launcher'
8888
];
8989
"""
9090
When I start Karma
9191
Then it passes with like:
9292
"""
9393
.
94-
PhantomJS
94+
HeadlessChrome
9595
"""
9696
And it passes with like:
9797
"""
@@ -106,17 +106,17 @@ Feature: Including files
106106
{pattern: 'files/+(log|bug)_foo.js', included: false},
107107
{pattern: 'files/*.js', included: true}
108108
];
109-
browsers = ['PhantomJS'];
109+
browsers = ['ChromeHeadlessNoSandbox'];
110110
plugins = [
111111
'karma-jasmine',
112-
'karma-phantomjs-launcher'
112+
'karma-chrome-launcher'
113113
];
114114
"""
115115
When I start Karma
116116
Then it passes with like:
117117
"""
118118
.
119-
PhantomJS
119+
HeadlessChrome
120120
"""
121121
And it passes with like:
122122
"""
@@ -131,17 +131,17 @@ Feature: Including files
131131
{pattern: 'files/*.js', included: false},
132132
{pattern: 'files/**', included: true}
133133
];
134-
browsers = ['PhantomJS'];
134+
browsers = ['ChromeHeadlessNoSandbox'];
135135
plugins = [
136136
'karma-jasmine',
137-
'karma-phantomjs-launcher'
137+
'karma-chrome-launcher'
138138
];
139139
"""
140140
When I start Karma
141141
Then it passes with like:
142142
"""
143143
.
144-
PhantomJS
144+
HeadlessChrome
145145
"""
146146
And it passes with like:
147147
"""
@@ -157,17 +157,17 @@ Feature: Including files
157157
{pattern: 'files/{log,bug}_foo.js', included: true}
158158
159159
];
160-
browsers = ['PhantomJS'];
160+
browsers = ['ChromeHeadlessNoSandbox'];
161161
plugins = [
162162
'karma-jasmine',
163-
'karma-phantomjs-launcher'
163+
'karma-chrome-launcher'
164164
];
165165
"""
166166
When I start Karma
167167
Then it passes with like:
168168
"""
169169
.
170-
PhantomJS
170+
HeadlessChrome
171171
"""
172172
And it passes with like:
173173
"""

‎test/e2e/headers.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Feature: Custom Headers
77
Given a configuration with:
88
"""
99
files = ['headers/*.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
customHeaders = [{
1616
match: 'foo.js',
@@ -22,5 +22,5 @@ Feature: Custom Headers
2222
Then it passes with:
2323
"""
2424
.
25-
PhantomJS
25+
HeadlessChrome
2626
"""

‎test/e2e/load.feature

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Feature: Basic Testrunner
77
Given a configuration with:
88
"""
99
files = ['basic/plus.js', 'basic/test.js'];
10-
browsers = ['NonExistingBrowser', 'PhantomJS'];
10+
browsers = ['NonExistingBrowser', 'ChromeHeadless'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
singleRun = false
1616
"""
@@ -28,11 +28,11 @@ Feature: Basic Testrunner
2828
Given a configuration with:
2929
"""
3030
files = ['basic/plus.js', 'basic/test.js'];
31-
browsers = ['PhantomJS'];
31+
browsers = ['ChromeHeadlessNoSandbox'];
3232
plugins = [
3333
'karma-totally-non-existing-plugin',
3434
'karma-jasmine',
35-
'karma-phantomjs-launcher'
35+
'karma-chrome-launcher'
3636
];
3737
singleRun = false
3838
"""
@@ -52,11 +52,11 @@ Feature: Basic Testrunner
5252
Given a configuration with:
5353
"""
5454
files = ['basic/plus.js', 'basic/test.js'];
55-
browsers = ['PhantomJS'];
55+
browsers = ['ChromeHeadlessNoSandbox'];
5656
reporters = ['unreal-reporter']
5757
plugins = [
5858
'karma-jasmine',
59-
'karma-phantomjs-launcher'
59+
'karma-chrome-launcher'
6060
];
6161
singleRun = false
6262
"""
@@ -75,12 +75,12 @@ Feature: Basic Testrunner
7575
Given a configuration with:
7676
"""
7777
files = ['basic/plus.js', 'basic/test.js'];
78-
browsers = ['NonExistingBrowser', 'PhantomJS'];
78+
browsers = ['NonExistingBrowser', 'ChromeHeadless'];
7979
reporters = ['unreal-reporter']
8080
plugins = [
8181
'karma-totally-non-existing-plugin',
8282
'karma-jasmine',
83-
'karma-phantomjs-launcher'
83+
'karma-chrome-launcher'
8484
];
8585
singleRun = false
8686
"""

‎test/e2e/middleware.feature

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Feature: Middleware
77
Given a configuration with:
88
"""
99
files = ['middleware/test.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher',
13+
'karma-chrome-launcher',
1414
_resolve('middleware/middleware')
1515
];
1616
middleware = [
@@ -21,17 +21,17 @@ Feature: Middleware
2121
Then it passes with:
2222
"""
2323
.
24-
PhantomJS
24+
HeadlessChrome
2525
"""
2626

2727
Scenario: Frameworks can add middleware
2828
Given a configuration with:
2929
"""
3030
files = ['middleware/test.js'];
31-
browsers = ['PhantomJS'];
31+
browsers = ['ChromeHeadlessNoSandbox'];
3232
plugins = [
3333
'karma-jasmine',
34-
'karma-phantomjs-launcher',
34+
'karma-chrome-launcher',
3535
_resolve('middleware/middleware')
3636
];
3737
frameworks = ['jasmine', 'foo']
@@ -40,5 +40,5 @@ Feature: Middleware
4040
Then it passes with:
4141
"""
4242
.
43-
PhantomJS
43+
HeadlessChrome
4444
"""

‎test/e2e/mocharepoter.feature

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ Feature: Mocha reporter
33
As a person who wants to write great tests
44
I want to be able to use the mocha reporter.
55

6-
Scenario: Execute a test in PhantomJS with colors
6+
Scenario: Execute a test in ChromeHeadless with colors
77
Given a configuration with:
88
"""
99
files = ['mocha/plus.js', 'mocha/test.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
frameworks = ['mocha', 'chai']
1212
colors = true
1313
plugins = [
1414
'karma-jasmine',
15-
'karma-phantomjs-launcher',
15+
'karma-chrome-launcher',
1616
'karma-mocha-reporter',
1717
'karma-mocha',
1818
'karma-chai'
@@ -25,16 +25,16 @@ Feature: Mocha reporter
2525
2 tests completed
2626
"""
2727

28-
Scenario: Execute a test in PhantomJS with no-colors
28+
Scenario: Execute a test in ChromeHeadless with no-colors
2929
Given a configuration with:
3030
"""
3131
files = ['mocha/plus.js', 'mocha/test.js'];
32-
browsers = ['PhantomJS'];
32+
browsers = ['ChromeHeadlessNoSandbox'];
3333
frameworks = ['mocha', 'chai']
3434
colors = false
3535
plugins = [
3636
'karma-jasmine',
37-
'karma-phantomjs-launcher',
37+
'karma-chrome-launcher',
3838
'karma-mocha-reporter',
3939
'karma-mocha',
4040
'karma-chai'
@@ -45,4 +45,4 @@ Feature: Mocha reporter
4545
Then it passes with like:
4646
"""
4747
✔ 2 tests completed
48-
"""
48+
"""

‎test/e2e/pass-opts.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Feature: Passing Options
77
Given a configuration with:
88
"""
99
files = ['pass-opts/test.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
singleRun = false;
1616
"""

‎test/e2e/proxy.feature

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Feature: Proxying
77
Given a configuration with:
88
"""
99
files = ['proxy/test.js', 'proxy/foo.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
proxies = {
1616
'/foo.js': '/base/proxy/foo.js'
@@ -20,17 +20,17 @@ Feature: Proxying
2020
Then it passes with:
2121
"""
2222
.
23-
PhantomJS
23+
HeadlessChrome
2424
"""
2525

2626
Scenario: Added by a framework
2727
Given a configuration with:
2828
"""
2929
files = ['proxy/test.js', 'proxy/foo.js'];
30-
browsers = ['PhantomJS'];
30+
browsers = ['ChromeHeadlessNoSandbox'];
3131
plugins = [
3232
'karma-jasmine',
33-
'karma-phantomjs-launcher',
33+
'karma-chrome-launcher',
3434
_resolve('proxy/plugin')
3535
];
3636
frameworks = ['jasmine', 'foo']
@@ -39,17 +39,17 @@ Feature: Proxying
3939
Then it passes with:
4040
"""
4141
.
42-
PhantomJS
42+
HeadlessChrome
4343
"""
4444

4545
Scenario: URLRoot
4646
Given a configuration with:
4747
"""
4848
files = ['proxy/test.js', 'proxy/foo.js'];
49-
browsers = ['PhantomJS'];
49+
browsers = ['ChromeHeadlessNoSandbox'];
5050
plugins = [
5151
'karma-jasmine',
52-
'karma-phantomjs-launcher'
52+
'karma-chrome-launcher'
5353
];
5454
urlRoot = '/__karma__/';
5555
proxies = {
@@ -60,5 +60,5 @@ Feature: Proxying
6060
Then it passes with:
6161
"""
6262
.
63-
PhantomJS
63+
HeadlessChrome
6464
"""

‎test/e2e/reconnecting.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ Feature: Passing Options
77
Given a configuration with:
88
"""
99
files = ['reconnecting/test.js', 'reconnecting/plus.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
"""
1616
When I start Karma
1717
Then it passes with:
1818
"""
1919
.....
20-
PhantomJS
20+
HeadlessChrome
2121
"""

‎test/e2e/runInParent.feature

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ Feature: runInParent option
33
As a person who wants to write great tests
44
I want Karma to run without iframe or opening new window
55

6-
Scenario: Execute a test in PhantomJS
6+
Scenario: Execute a test in ChromeHeadless
77
Given a configuration with:
88
"""
99
files = ['basic/plus.js', 'basic/test.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
client = {
1616
useIframe: false,
@@ -21,7 +21,7 @@ Feature: runInParent option
2121
Then it passes with:
2222
"""
2323
..
24-
PhantomJS
24+
HeadlessChrome
2525
"""
2626
@not-jenkins
2727
Scenario: Execute a test in Chrome

‎test/e2e/stop.feature

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Feature: Stop karma
1414
Given a configuration with:
1515
"""
1616
files = ['basic/plus.js', 'basic/test.js'];
17-
browsers = ['PhantomJS'];
17+
browsers = ['ChromeHeadlessNoSandbox'];
1818
plugins = [
1919
'karma-jasmine',
20-
'karma-phantomjs-launcher'
20+
'karma-chrome-launcher'
2121
];
2222
singleRun = false;
2323
"""
@@ -29,10 +29,10 @@ Feature: Stop karma
2929
Given a configuration with:
3030
"""
3131
files = ['basic/plus.js', 'basic/test.js'];
32-
browsers = ['PhantomJS'];
32+
browsers = ['ChromeHeadlessNoSandbox'];
3333
plugins = [
3434
'karma-jasmine',
35-
'karma-phantomjs-launcher'
35+
'karma-chrome-launcher'
3636
];
3737
singleRun = false;
3838
"""
@@ -48,10 +48,10 @@ Feature: Stop karma
4848
Given a configuration with:
4949
"""
5050
files = ['basic/plus.js', 'basic/test.js'];
51-
browsers = ['PhantomJS'];
51+
browsers = ['ChromeHeadlessNoSandbox'];
5252
plugins = [
5353
'karma-jasmine',
54-
'karma-phantomjs-launcher'
54+
'karma-chrome-launcher'
5555
];
5656
singleRun = false;
5757
logLevel = 'error';

‎test/e2e/support/world.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ const cucumber = require('cucumber')
88

99
function World () {
1010
this.proxy = require('./proxy')
11-
12-
this.template = _.template('module.exports = function (config) {\n config.set(\n <%= content %>\n );\n};')
11+
this.template = _.template(`process.env.CHROME_BIN = require('puppeteer').executablePath(); module.exports = function (config) {\n config.set(\n <%= content %>\n );\n};`)
1312

1413
this.configFile = {
1514
singleRun: true,
@@ -52,7 +51,11 @@ function World () {
5251

5352
this.generateJS = function (config) {
5453
return this.template({
55-
content: JSON.stringify(config)
54+
content: JSON.stringify(Object.assign({}, config, {
55+
customLaunchers: Object.assign({
56+
ChromeHeadlessNoSandbox: {base: 'ChromeHeadless', flags: ['--no-sandbox']}
57+
}, config.customLaunchers)
58+
}))
5659
})
5760
}
5861

‎test/e2e/upstream-proxy.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Feature: UpstreamProxy
77
Given a configuration with:
88
"""
99
files = ['behind-proxy/plus.js', 'behind-proxy/test.js'];
10-
browsers = ['PhantomJS'];
10+
browsers = ['ChromeHeadlessNoSandbox'];
1111
plugins = [
1212
'karma-jasmine',
13-
'karma-phantomjs-launcher'
13+
'karma-chrome-launcher'
1414
];
1515
urlRoot = '/__karma__/';
1616
upstreamProxy = {
@@ -21,5 +21,5 @@ Feature: UpstreamProxy
2121
Then it passes with:
2222
"""
2323
..
24-
PhantomJS
24+
HeadlessChrome
2525
"""

‎yarn.lock

+1,239-987
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.