Skip to content

Commit a0075ff

Browse files
devversiontinayuangao
authored andcommitted
build: run tests in chrome headless local (#8651)
Runs local tests in Chrome Headless. This speeds up the tests and also ensures more test stability. On Windows there are a lot of pixel deviation failures because the tests seemed to be affected by the screen resolution or window frame. By running the tests headless, the Chrome launcher has more control about the rendering and pixel deviations like before won't happen anymore. It's still the same Chrome that runs, just that the screen is kind of emulated like in XVFB.
1 parent 1a383ce commit a0075ff

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

test/browser-providers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Target can be either: BS (Browserstack) | SL (Saucelabs) | TC (Travis CI) | null (To not run)
66
*/
77
const browserConfig = {
8-
'ChromeHeadless_CI': { unitTest: {target: 'TC', required: true }},
8+
'ChromeHeadlessCI': { unitTest: {target: 'TC', required: true }},
99
'FirefoxHeadless': { unitTest: {target: 'TC', required: true }},
1010
'ChromeBeta': { unitTest: {target: null, required: false }},
1111
'FirefoxBeta': { unitTest: {target: null, required: false }},

test/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module.exports = (config) => {
8080
browserDisconnectTimeout: 20000,
8181
browserNoActivityTimeout: 240000,
8282
captureTimeout: 120000,
83-
browsers: ['Chrome_1024x768'],
83+
browsers: ['ChromeHeadlessLocal'],
8484

8585
singleRun: false,
8686

test/remote_browsers.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
{
2-
"ChromeHeadless_CI": {
2+
"ChromeHeadlessLocal": {
33
"base": "ChromeHeadless",
44
"flags": [
55
"--window-size=1024,768"
66
]
77
},
8-
"Chrome_1024x768": {
9-
"base": "Chrome",
10-
"flags": [
11-
"--window-size=1024,768"
12-
]
13-
},
148
"FirefoxHeadless": {
159
"base": "Firefox",
1610
"flags": [
1711
"-headless"
1812
]
1913
},
14+
"ChromeHeadlessCI": {
15+
"base": "ChromeHeadlessLocal"
16+
},
2017
"SL_CHROME": {
2118
"base": "SauceLabs",
2219
"browserName": "chrome",

0 commit comments

Comments
 (0)