pass --no-sandbox to puppeteer

This commit is contained in:
Bruno Windels 2019-04-05 16:45:07 +02:00
parent 4e1ddf85a4
commit 53eab479ec

View File

@ -26,6 +26,7 @@ program
.option('--windowed', "dont run tests headless", false)
.option('--slow-mo', "run tests slower to follow whats going on", false)
.option('--dev-tools', "open chrome devtools in browser window", false)
.option('--no-sandbox', "same as puppeteer arg", false)
.parse(process.argv);
const hsUrl = 'http://localhost:5005';
@ -37,7 +38,11 @@ async function runTests() {
slowMo: program.slowMo ? 20 : undefined,
devtools: program.devTools,
headless: !program.windowed,
args: [],
};
if (!program.sandbox) {
options.args.push('--no-sandbox');
}
if (process.env.CHROME_PATH) {
const path = process.env.CHROME_PATH;
console.log(`(using external chrome/chromium at ${path}, make sure it's compatible with puppeteer)`);