diff --git a/test/karma.config.js b/test/karma.config.js index fceb351..d3b2b27 100644 --- a/test/karma.config.js +++ b/test/karma.config.js @@ -14,7 +14,16 @@ module.exports = function (config) { frameworks: ['mocha', 'webpack'], reporters: ['mocha'], - browsers: ['ChromeHeadless'], + // Chrome won't run on CI unless the `--no-sandbox` and `--disable-setuid-sandbox` flags are applied + // Karma's Chrome Headless seems based on Puppeteer and runs into this issue: + // https://github.com/Googlechrome/puppeteer/issues/290 + browsers: ['ChromeHeadlessNoSandbox'], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: 'ChromeHeadless', + flags: ['--no-sandbox', '--disable-setuid-sandbox'] + } + }, files: [ 'test/functional/**/*.js' diff --git a/test/wdio.config.js b/test/wdio.config.js index 60ba09b..5304e87 100644 --- a/test/wdio.config.js +++ b/test/wdio.config.js @@ -24,7 +24,10 @@ const capabilitiesLocal = [ { browserName: 'chrome', 'goog:chromeOptions': { - args: ['--headless=new'], + // Chrome won't run on CI unless the `--no-sandbox` and `--disable-setuid-sandbox` flags are applied + // otherwise, it runs into the same kind of issue as Karma and Puppeteer: + // https://github.com/Googlechrome/puppeteer/issues/290 + args: ['--headless=new', '--no-sandbox', '--disable-setuid-sandbox'], binary: puppeteer.executablePath() } }