Skip to content

Commit 50cdb22

Browse files
committed
test: fix on docker
1 parent 9ccb6fc commit 50cdb22

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/helpers/selenium-helper.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const fs = require('fs');
88
const {By, until, Button} = webdriver;
99

1010
const USE_HEADLESS = process.env.USE_HEADLESS !== 'no';
11+
const IS_ROOT_USER = process.getuid() == 0;
1112

1213
// The main reason for this timeout is so that we can control the timeout message and report details;
1314
// if we hit the Jasmine default timeout then we get a terse message that we can't control.
@@ -63,6 +64,15 @@ class SeleniumHelper {
6364
args.push('--headless');
6465
}
6566

67+
if (IS_ROOT_USER) {
68+
args.push('--no-sandbox');
69+
args.push('--disable-setuid-sandbox');
70+
}
71+
72+
args.push('--disable-gpu');
73+
args.push('--disable-dev-shm-usage');
74+
args.push('--disable-extensions');
75+
6676
// Stub getUserMedia to always not allow access
6777
args.push('--use-fake-ui-for-media-stream=deny');
6878

0 commit comments

Comments
 (0)