mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 09:35:56 -05:00
Pin chrome version for saucelabs to chromedriver version
This commit is contained in:
parent
3286ec6dc3
commit
8d5b139595
1 changed files with 10 additions and 1 deletions
|
@ -8,6 +8,7 @@ const ci = process.env.CI || false;
|
||||||
const buildID = process.env.TRAVIS_BUILD_NUMBER;
|
const buildID = process.env.TRAVIS_BUILD_NUMBER;
|
||||||
const {SAUCE_USERNAME, SAUCE_ACCESS_KEY} = process.env;
|
const {SAUCE_USERNAME, SAUCE_ACCESS_KEY} = process.env;
|
||||||
const {By, Key, until} = webdriver;
|
const {By, Key, until} = webdriver;
|
||||||
|
const pkg = require('../../package.json');
|
||||||
|
|
||||||
const DEFAULT_TIMEOUT_MILLISECONDS = 20 * 1000;
|
const DEFAULT_TIMEOUT_MILLISECONDS = 20 * 1000;
|
||||||
|
|
||||||
|
@ -62,13 +63,21 @@ class SeleniumHelper {
|
||||||
return driver;
|
return driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getChromeVersionNumber () {
|
||||||
|
let chromedriverVersion = pkg.devDependencies.chromedriver;
|
||||||
|
let versionFinder = /\d+\.\d+/;
|
||||||
|
let versionArray = versionFinder.exec(chromedriverVersion);
|
||||||
|
return versionArray[0];
|
||||||
|
}
|
||||||
|
|
||||||
getSauceDriver (username, accessKey, name) {
|
getSauceDriver (username, accessKey, name) {
|
||||||
|
let 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