From 8e7dc320ca5c382399c61d3bd90e6aed0121b538 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Sun, 26 Nov 2017 12:58:10 +0100 Subject: [PATCH] build: run tests in chrome headless local 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. --- test/browser-providers.js | 2 +- test/karma.conf.js | 2 +- test/remote_browsers.json | 11 ++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/test/browser-providers.js b/test/browser-providers.js index cc0c20584065..d475817c573f 100644 --- a/test/browser-providers.js +++ b/test/browser-providers.js @@ -5,7 +5,7 @@ * Target can be either: BS (Browserstack) | SL (Saucelabs) | TC (Travis CI) | null (To not run) */ const browserConfig = { - 'ChromeHeadless_CI': { unitTest: {target: 'TC', required: true }}, + 'ChromeHeadlessCI': { unitTest: {target: 'TC', required: true }}, 'FirefoxHeadless': { unitTest: {target: 'TC', required: true }}, 'ChromeBeta': { unitTest: {target: null, required: false }}, 'FirefoxBeta': { unitTest: {target: null, required: false }}, diff --git a/test/karma.conf.js b/test/karma.conf.js index 30399610d2ab..c1440ad28ec4 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -80,7 +80,7 @@ module.exports = (config) => { browserDisconnectTimeout: 20000, browserNoActivityTimeout: 240000, captureTimeout: 120000, - browsers: ['Chrome_1024x768'], + browsers: ['ChromeHeadlessLocal'], singleRun: false, diff --git a/test/remote_browsers.json b/test/remote_browsers.json index ae2c2cdce1c2..fc5f3f0c831d 100644 --- a/test/remote_browsers.json +++ b/test/remote_browsers.json @@ -1,22 +1,19 @@ { - "ChromeHeadless_CI": { + "ChromeHeadlessLocal": { "base": "ChromeHeadless", "flags": [ "--window-size=1024,768" ] }, - "Chrome_1024x768": { - "base": "Chrome", - "flags": [ - "--window-size=1024,768" - ] - }, "FirefoxHeadless": { "base": "Firefox", "flags": [ "-headless" ] }, + "ChromeHeadlessCI": { + "base": "ChromeHeadlessLocal" + }, "SL_CHROME": { "base": "SauceLabs", "browserName": "chrome",