diff options
author | Antoine Musso <hashar@free.fr> | 2018-04-12 14:02:40 +0200 |
---|---|---|
committer | Antoine Musso <hashar@free.fr> | 2018-04-12 14:26:13 +0200 |
commit | 4ff5652501b6cd1467072290b61241a559a48844 (patch) | |
tree | eecd4a6fae2f49b8dbc69192cd102e73d47a7518 /tests/selenium/wdio.conf.js | |
parent | 4e7673c5b0aa1d53e69c850ccc58446abf29b3d5 (diff) | |
download | mediawikicore-4ff5652501b6cd1467072290b61241a559a48844.tar.gz mediawikicore-4ff5652501b6cd1467072290b61241a559a48844.zip |
Selenium: pass -no-sandbox to Chrome under Docker
When running webdriver.io in a Jessie Docker container, the sandboxing
fails:
Failed to move to new namespace: PID namespaces supported, Network
namespace supported, but failed: errno = Operation not permitted
Detect whether we are in a Docker container by checking /.dockerenv and
if present append --no-sandbox to Chrome options.
Change-Id: Ie5c276d12553e4473c01b3407e0f7622e0a678e0
Diffstat (limited to 'tests/selenium/wdio.conf.js')
-rw-r--r-- | tests/selenium/wdio.conf.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/selenium/wdio.conf.js b/tests/selenium/wdio.conf.js index 7b743280804d..0b374c848a67 100644 --- a/tests/selenium/wdio.conf.js +++ b/tests/selenium/wdio.conf.js @@ -1,6 +1,7 @@ 'use strict'; const password = 'vagrant', + fs = require( 'fs' ), path = require( 'path' ), username = 'Admin'; @@ -83,7 +84,12 @@ exports.config = { chromeOptions: { // Run headless when there is no DISPLAY // --headless: since Chrome 59 https://chromium.googlesource.com/chromium/src/+/59.0.3030.0/headless/README.md - args: process.env.DISPLAY ? [] : [ '--headless' ] + args: ( + process.env.DISPLAY ? [] : [ '--headless' ] + ).concat( + // Disable Chrome sandbox when running in Docker + fs.existsSync( '/.dockerenv' ) ? [ '--no-sandbox' ] : [] + ) } } ], // |