mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Add option to run chrome headless. (#21972)
* Add opton to run chrome headless. Mainly for windows tests which can't use xvfb. * Update from review comments Make environment variable Boolean, remove single quotes from keys, remove window size.
This commit is contained in:
parent
63df7cb2e4
commit
a344624a58
1 changed files with 7 additions and 1 deletions
|
@ -30,7 +30,13 @@ let attemptCounter = 0;
|
|||
async function attemptToCreateCommand(log, server, driverApi) {
|
||||
const attemptId = ++attemptCounter;
|
||||
log.debug('[leadfoot:command] Creating session');
|
||||
const session = await server.createSession({}, driverApi.getRequiredCapabilities());
|
||||
|
||||
let browserOptions = {};
|
||||
if (process.env.TEST_BROWSER_HEADLESS) {
|
||||
browserOptions = { chromeOptions: { args: ['headless', 'disable-gpu'] } };
|
||||
}
|
||||
const session = await server.createSession(browserOptions, driverApi.getRequiredCapabilities());
|
||||
|
||||
if (attemptId !== attemptCounter) return; // abort
|
||||
|
||||
log.debug('[leadfoot:command] Registering session for teardown');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue