From a676f94eb6dd6369aff9d2411f6ee5db2f5f69cb Mon Sep 17 00:00:00 2001 From: Andy Gout Date: Sat, 10 Jan 2026 17:05:01 +0000 Subject: [PATCH 1/2] Update Karma's configuration to fix Chrome's startup on CI Use the same `--no-sandbox` and `--disable-setuid-sandbox` flags as on GOV.UK Frontend to enable Chrome to run on CI. --- test/karma.config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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' From 96025fd0a2e57f8720a6151ea74b90dc4825db11 Mon Sep 17 00:00:00 2001 From: Andy Gout Date: Sat, 10 Jan 2026 17:10:11 +0000 Subject: [PATCH 2/2] Add flags to Chrome startup in WDIO config Similarly to Karma, Chrome won't launch on CI unless the `--no-sandbox` and `--disable-setuid-sandbox` are set. --- test/wdio.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() } }