Commit f15a8bd7 authored by BryceLTaylor's avatar BryceLTaylor

Make selenium-helpers.js build driver in headless mode

parent 55f72e74
var webdriver = require('selenium-webdriver');
const driver = new webdriver.Builder()
.forBrowser('chrome')
.build();
const headless = process.env.SMOKE_HEADLESS || false;
const getDriver = function () {
const chromeCapabilities = webdriver.Capabilities.chrome();
let args = [];
if (headless) {
args.push('--headless');
args.push('window-size=1024,1680');
args.push('--no-sandbox');
}
chromeCapabilities.set('chromeOptions', {args});
const newDriver = new webdriver.Builder()
.forBrowser('chrome')
.withCapabilities(chromeCapabilities)
.build();
return newDriver;
};
const driver = getDriver();
const {By, until} = webdriver;
......@@ -70,5 +86,6 @@ module.exports = {
clickButton,
findByCss,
clickCss,
getLogs
getLogs,
getDriver
};
......@@ -12,9 +12,9 @@ var seleniumWebdriver = require('selenium-webdriver');
// Selenium's promise driver will be deprecated, so we should not rely on it
seleniumWebdriver.SELENIUM_PROMISE_MANAGER = 0;
// chrome driver
var driver = new seleniumWebdriver.Builder().withCapabilities(seleniumWebdriver.Capabilities.chrome())
.build();
const {
driver
} = require('../selenium-helpers.js');
var rootUrl = process.env.ROOT_URL || 'https://scratch.ly';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment