Unverified Commit 6321e40e authored by Bryce Taylor's avatar Bryce Taylor Committed by GitHub

Merge pull request #4420 from BryceLTaylor/pin-remote-chrome

Pin chrome version for saucelabs to chromedriver version
parents add1dd25 2e79da8a
const webdriver = require('selenium-webdriver');
const bindAll = require('lodash.bindall');
require('chromedriver');
const chromedriverVersion = require('chromedriver').version;
const headless = process.env.SMOKE_HEADLESS || false;
const remote = process.env.SMOKE_REMOTE || false;
......@@ -62,13 +63,23 @@ class SeleniumHelper {
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) {
const chromeVersion = this.getChromeVersionNumber();
// Driver configs can be generated with the Sauce Platform Configurator
// https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
let driverConfig = {
browserName: 'chrome',
platform: 'macOS 10.14',
version: '84.0'
version: chromeVersion
};
var driver = new webdriver.Builder()
.withCapabilities({
......
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