mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 23:57:55 -05:00
Put back changes that shouldn't overwritten
I made some merge mistakes and selenium-helpers.js shouldn't have a diff.
This commit is contained in:
parent
dbea248f4a
commit
0d836101b4
1 changed files with 12 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
const webdriver = require('selenium-webdriver');
|
const webdriver = require('selenium-webdriver');
|
||||||
const bindAll = require('lodash.bindall');
|
const bindAll = require('lodash.bindall');
|
||||||
require('chromedriver');
|
require('chromedriver');
|
||||||
|
const chromedriverVersion = require('chromedriver').version;
|
||||||
|
|
||||||
const headless = process.env.SMOKE_HEADLESS || false;
|
const headless = process.env.SMOKE_HEADLESS || false;
|
||||||
const remote = process.env.SMOKE_REMOTE || false;
|
const remote = process.env.SMOKE_REMOTE || false;
|
||||||
|
@ -62,13 +63,23 @@ class SeleniumHelper {
|
||||||
return driver;
|
return driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getChromeVersionNumber () {
|
||||||
|
const versionFinder = /\d+\.\d+/;
|
||||||
|
const versionArray = versionFinder.exec(chromedriverVersion);
|
||||||
|
if (versionArray === null) {
|
||||||
|
throw new Error('couldn\'t find version of chromedriver');
|
||||||
|
}
|
||||||
|
return versionArray[0];
|
||||||
|
}
|
||||||
|
|
||||||
getSauceDriver (username, accessKey, name) {
|
getSauceDriver (username, accessKey, name) {
|
||||||
|
const chromeVersion = this.getChromeVersionNumber();
|
||||||
// Driver configs can be generated with the Sauce Platform Configurator
|
// Driver configs can be generated with the Sauce Platform Configurator
|
||||||
// https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
|
// https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
|
||||||
let driverConfig = {
|
let driverConfig = {
|
||||||
browserName: 'chrome',
|
browserName: 'chrome',
|
||||||
platform: 'macOS 10.14',
|
platform: 'macOS 10.14',
|
||||||
version: '84.0'
|
version: chromeVersion
|
||||||
};
|
};
|
||||||
var driver = new webdriver.Builder()
|
var driver = new webdriver.Builder()
|
||||||
.withCapabilities({
|
.withCapabilities({
|
||||||
|
|
Loading…
Reference in a new issue