Skip to content

Commit 09bbaeb

Browse files
committed
fix(test): fix tests on Travis by disabling Chrome sandbox on Linux CI
Travis documentation suggests that disabling the sandbox might be necessary to get Chrome to run.
1 parent 3c295ff commit 09bbaeb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/jsunit/test_runner.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
require('chromedriver');
22
var webdriver = require('selenium-webdriver');
3-
var browser = new webdriver.Builder()
4-
.forBrowser('chrome')
5-
.build();
3+
var chrome = require('selenium-webdriver/chrome');
4+
var builder = new webdriver.Builder().forBrowser('chrome');
5+
6+
if (process.env.CI) {
7+
const options = new chrome.Options().headless();
8+
if (process.platform === 'linux') {
9+
options.addArguments('no-sandbox');
10+
}
11+
builder.setChromeOptions(options);
12+
}
13+
14+
var browser = builder.build();
615

716
// Parse jsunit html report, exit(1) if there are any failures.
817
var testHtml = function (htmlString) {

0 commit comments

Comments
 (0)