selenium-standalone
Advanced tools
Comparing version 6.23.0 to 6.24.0
@@ -0,1 +1,6 @@ | ||
# 6.24.0 (2021-06-16) | ||
* selenium 4 support | ||
* update default versions | ||
* package updates | ||
# 6.23.0 (2020-12-02) | ||
@@ -2,0 +7,0 @@ * allow specifying `fullURL` to download selenium or browser driver #520 |
@@ -5,3 +5,3 @@ module.exports = checkPathsExistence; | ||
function checkPathsExistence(paths, cb) { | ||
function checkPathsExistence(paths, opts, cb) { | ||
const pathValues = Object.keys(paths).map((key) => { | ||
@@ -25,4 +25,4 @@ return paths[key]; | ||
) | ||
.then(() => cb()) | ||
.then(() => cb(undefined, opts)) | ||
.catch((err) => cb(err)); | ||
} |
@@ -7,4 +7,4 @@ module.exports = checkStarted; | ||
async function checkStarted(seleniumArgs) { | ||
const seleniumStatusUrl = statusUrl.getSeleniumStatusUrl(seleniumArgs); | ||
async function checkStarted(seleniumArgs, opts) { | ||
const seleniumStatusUrl = statusUrl.getSeleniumStatusUrl(seleniumArgs, opts); | ||
const options = { | ||
@@ -11,0 +11,0 @@ responseType: 'json', |
@@ -5,5 +5,7 @@ module.exports = computeDownloadUrls; | ||
const util = require('util'); | ||
const { isSelenium4 } = require('./isSelenium4'); | ||
const urls = { | ||
selenium: '%s/%s/selenium-server-standalone-%s.jar', | ||
seleniumV4: '%s/%s/selenium-server-%s.jar', | ||
chrome: '%s/%s/chromedriver_%s.zip', | ||
@@ -49,3 +51,3 @@ ie: '%s/%s/IEDriverServer_%s_%s.zip', | ||
util.format( | ||
urls.selenium, | ||
isSelenium4(opts.seleniumVersion) ? urls.seleniumV4 : urls.selenium, | ||
opts.seleniumBaseURL, | ||
@@ -305,3 +307,3 @@ opts.seleniumVersion.replace(/(\d+\.\d+)\.\d+/, '$1'), | ||
if (wantedArchitecture !== 'x64') { | ||
throw new Error('Only x64 architecture is available for chroimum edge driver for linux'); | ||
throw new Error('Only x64 architecture is available for chromium edge driver for linux'); | ||
} | ||
@@ -315,3 +317,3 @@ | ||
if (wantedArchitecture !== 'x64') { | ||
throw new Error('Only x64 architecture is available for chroimum edge driver for mac'); | ||
throw new Error('Only x64 architecture is available for chromium edge driver for mac'); | ||
} | ||
@@ -387,7 +389,9 @@ | ||
const response = await got(url, { timeout: 10000 }); | ||
// edgewebdriver latest version file contains invalid characters | ||
const version = response.body.replace(/\r|\n/g, '').replace(/[^\d|.]/g, ''); | ||
if (!version) { | ||
return false; | ||
} | ||
// eslint-disable-next-line no-param-reassign | ||
opts.drivers[browserDriver].version = response.body | ||
// edgewebdriver latest version file contains invalid characters | ||
.replace(/\r|\n/g, '') | ||
.replace(/[^\d|.]/g, ''); | ||
opts.drivers[browserDriver].version = version; | ||
return true; | ||
@@ -398,3 +402,3 @@ } | ||
const response = await got(url, { timeout: 10000, responseType: 'json' }); | ||
if (typeof response.body.name === 'string') { | ||
if (typeof response.body.name === 'string' && response.body.name) { | ||
// eslint-disable-next-line no-param-reassign | ||
@@ -401,0 +405,0 @@ opts.drivers[browserDriver].version = response.body.name; |
@@ -8,3 +8,3 @@ module.exports = () => { | ||
version: 'latest', | ||
fallbackVersion: '87.0.4280.20', | ||
fallbackVersion: '91.0.4472.101', | ||
arch: process.arch, | ||
@@ -20,3 +20,3 @@ baseURL: 'https://chromedriver.storage.googleapis.com', | ||
version: 'latest', | ||
fallbackVersion: '0.28.0', | ||
fallbackVersion: '0.29.1', | ||
arch: process.arch, | ||
@@ -28,16 +28,12 @@ baseURL: 'https://github.com/mozilla/geckodriver/releases/download', | ||
}, | ||
chromiumedge: { | ||
version: 'latest', | ||
fallbackVersion: '91.0.864.53', | ||
arch: process.arch, | ||
baseURL: 'https://msedgedriver.azureedge.net', | ||
}, | ||
}, | ||
}; | ||
// disabled chromiumedge because https://msedgedriver.azureedge.net doesn't support caching | ||
if (!process.env.SS_TESTING) { | ||
config.drivers.chromiumedge = { | ||
version: 'latest', | ||
fallbackVersion: '87.0.637.0', | ||
arch: process.arch, | ||
baseURL: 'https://msedgedriver.azureedge.net', | ||
}; | ||
} | ||
return config; | ||
}; |
const fs = require('fs'); | ||
const { isSelenium4 } = require('./isSelenium4'); | ||
@@ -34,3 +35,3 @@ const PROCESS_TYPES = { | ||
exports.getSeleniumStatusUrl = function (seleniumArgs) { | ||
exports.getSeleniumStatusUrl = function (seleniumArgs, opts) { | ||
const nodeConfigArg = seleniumArgs.indexOf('-nodeConfig'); | ||
@@ -72,3 +73,3 @@ const portArg = seleniumArgs.indexOf('-port'); | ||
const statusURI = new URL('http://' + host); | ||
const nodeStatusAPIPath = '/wd/hub/status'; | ||
const nodeStatusAPIPath = isSelenium4(opts.version) ? '/status' : '/wd/hub/status'; | ||
const hubStatusAPIPath = '/grid/api/hub'; | ||
@@ -75,0 +76,0 @@ |
@@ -15,2 +15,3 @@ module.exports = start; | ||
const { checkArgs } = require('./check-args'); | ||
const { isSelenium4 } = require('./isSelenium4'); | ||
@@ -32,2 +33,6 @@ function start(_opts, _cb) { | ||
if (isSelenium4(opts.version) && opts.seleniumArgs.length === 0) { | ||
opts.seleniumArgs.push('standalone'); | ||
} | ||
if (!opts.spawnCb) { | ||
@@ -106,3 +111,3 @@ opts.spawnCb = noop; | ||
checkPathsExistence(getInstallPaths(fsPaths), (errExist) => { | ||
checkPathsExistence(getInstallPaths(fsPaths), opts, (errExist) => { | ||
if (errExist) { | ||
@@ -121,3 +126,3 @@ cb(errExist); | ||
checkStarted(args).then(function started(errStarted) { | ||
checkStarted(args, opts).then(function started(errStarted) { | ||
process.nextTick(() => { | ||
@@ -124,0 +129,0 @@ // Add empty handler to stdout and stderr so the buffers can be flushed |
{ | ||
"name": "selenium-standalone", | ||
"version": "6.23.0", | ||
"version": "6.24.0", | ||
"description": "installs a `selenium-standalone` command line to install and start a standalone selenium server", | ||
@@ -35,3 +35,3 @@ "main": "index.js", | ||
"debug": "^4.3.1", | ||
"got": "^11.8.0", | ||
"got": "^11.8.2", | ||
"lodash.mapvalues": "^4.6.0", | ||
@@ -42,3 +42,3 @@ "lodash.merge": "^4.6.2", | ||
"progress": "2.0.3", | ||
"tar-stream": "2.1.4", | ||
"tar-stream": "2.2.0", | ||
"which": "^2.0.2", | ||
@@ -48,13 +48,13 @@ "yauzl": "^2.10.0" | ||
"devDependencies": { | ||
"chai": "4.2.0", | ||
"doctoc": "1.4.0", | ||
"eslint": "7.14.0", | ||
"eslint-config-prettier": "6.15.0", | ||
"eslint-plugin-prettier": "3.1.4", | ||
"husky": "4.3.0", | ||
"json": "10.0.0", | ||
"mocha": "6.2.3", | ||
"chai": "4.3.4", | ||
"doctoc": "2.0.1", | ||
"eslint": "7.28.0", | ||
"eslint-config-prettier": "8.3.0", | ||
"eslint-plugin-prettier": "3.4.0", | ||
"husky": "6.0.0", | ||
"json": "11.0.0", | ||
"mocha": "9.0.1", | ||
"mversion": "2.0.1", | ||
"prettier": "2.2.1" | ||
"prettier": "2.3.1" | ||
} | ||
} |
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
- [selenium-standalone](#selenium-standalone) | ||
@@ -6,0 +5,0 @@ - [Install & Run](#install--run) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85661
39
1386
85
+ Addedtar-stream@2.2.0(transitive)
- Removedtar-stream@2.1.4(transitive)
Updatedgot@^11.8.2
Updatedtar-stream@2.2.0