Skip to content

Commit f161272

Browse files
committed
test(e2e): run chrome headless by default for local runs
Local wdio launched headed chrome on the WSLg desktop, so browser windows popped up on the host display during every test run. Default to headless (with --enable-unsafe-swiftshader, since chrome no longer auto-falls back to software WebGL) and add a HEADED=1 escape hatch for watching tests. CI behavior is unchanged.
1 parent 0753de5 commit f161272

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

wdio.chrome.conf.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { config as sharedConfig, TEMP_DIR } from './wdio.shared.conf';
22

3+
const IS_CI = !!(process.env.CI || process.env.GITHUB_ACTIONS);
4+
35
// Chrome arguments for CI environments
46
const chromeArgs: string[] = [];
5-
if (process.env.CI || process.env.GITHUB_ACTIONS) {
7+
if (IS_CI) {
68
chromeArgs.push(
79
'--no-sandbox',
810
'--disable-dev-shm-usage',
@@ -11,6 +13,10 @@ if (process.env.CI || process.env.GITHUB_ACTIONS) {
1113
);
1214
}
1315

16+
if (!IS_CI && !process.env.HEADED) {
17+
chromeArgs.push('--headless=new', '--enable-unsafe-swiftshader');
18+
}
19+
1420
export const config = {
1521
...sharedConfig,
1622
capabilities: [

0 commit comments

Comments
 (0)