Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions packages/cli/src/lib/webdriver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,30 +90,17 @@ describe('startDriver', () => {
assert.equal(chromedriverPath, config.chromedriverPath);
});

it('passes the --no-sandbox argument to chromeOptions', async () => {
browser = 'chrome-headless';
config.chromeOptions = ['--no-sandbox'];
driver = await startDriver(config);

const options = config?.builder?.getChromeOptions();
assert.isArray(options?.get('goog:chromeOptions').args);
assert.deepEqual(options?.get('goog:chromeOptions').args, [
'headless',
'--no-sandbox'
]);
});

it('passes multiple arguments argument to chromeOptions', async () => {
browser = 'chrome-headless';
config.chromeOptions = ['no-sandbox', 'disable-dev-shm-usage'];
config.chromeOptions = ['disable-dev-shm-usage'];
driver = await startDriver(config);

const options = config?.builder?.getChromeOptions();
assert.isArray(options?.get('goog:chromeOptions').args);
assert.deepEqual(options?.get('goog:chromeOptions').args, [
'headless',
'no-sandbox',
'disable-dev-shm-usage'
'disable-dev-shm-usage',
'no-sandbox'
]);
});

Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/lib/webdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const startDriver = async (

if (CHROME_TEST_PATH) {
options.setChromeBinaryPath(path.resolve(CHROME_TEST_PATH));
// Required for CI runners using >=Ubuntu 24.04
// @see https://github.com/SeleniumHQ/selenium/issues/14609
options.addArguments('no-sandbox');
}

if (config.chromePath) {
Expand Down
7 changes: 6 additions & 1 deletion packages/webdriverio/test/axe-webdriverio.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ describe('@axe-core/webdriverio', () => {
capabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
args: ['--headless'],
args: [
'--headless',
// Required for CI runners using >=Ubuntu 24.04
// @see https://github.com/SeleniumHQ/selenium/issues/14609
'--no-sandbox'
],
binary: process.env.CHROME_TEST_PATH as string
}
},
Expand Down
7 changes: 6 additions & 1 deletion packages/webdriverjs/test/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ export const Webdriver = (): WebDriver => {
// Weird type change since 4.23.1 release
// @see https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/69724
const options = new chrome.Options();
options.addArguments('headless');
options
.addArguments('headless')
// Required for CI runners using >=Ubuntu 24.04
// @see https://github.com/SeleniumHQ/selenium/issues/14609
.addArguments('no-sandbox');

options.setBinaryPath(process.env.CHROME_TEST_PATH as string);

const builder = new Builder()
Expand Down