Skip to content

Commit

Permalink
fix(test): fix tests on Travis by disabling Chrome sandbox on Linux CI
Browse files Browse the repository at this point in the history
Travis documentation suggests that disabling the sandbox might be
necessary to get Chrome to run.
  • Loading branch information
cwillisf committed Jul 1, 2021
1 parent 3c295ff commit 09bbaeb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/jsunit/test_runner.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
require('chromedriver');
var webdriver = require('selenium-webdriver');
var browser = new webdriver.Builder()
.forBrowser('chrome')
.build();
var chrome = require('selenium-webdriver/chrome');
var builder = new webdriver.Builder().forBrowser('chrome');

if (process.env.CI) {
const options = new chrome.Options().headless();
if (process.platform === 'linux') {
options.addArguments('no-sandbox');
}
builder.setChromeOptions(options);
}

var browser = builder.build();

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

0 comments on commit 09bbaeb

Please # to comment.