selenium-webdriver 4.2.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +154 -137
- package/chrome.js +10 -36
- package/chromium.js +4 -2
- package/devtools/CDPConnection.js +1 -1
- package/edge.js +8 -32
- package/firefox.js +1 -1
- package/ie.js +3 -3
- package/index.js +1 -1
- package/lib/command.js +9 -0
- package/lib/http.js +40 -0
- package/lib/input.js +76 -23
- package/lib/virtual_authenticator.js +230 -0
- package/lib/webdriver.js +120 -11
- package/net/index.js +9 -2
- package/package.json +10 -10
- package/testing/index.js +17 -19
package/testing/index.js
CHANGED
|
@@ -39,14 +39,14 @@ const firefox = require('../firefox')
|
|
|
39
39
|
const ie = require('../ie')
|
|
40
40
|
const remote = require('../remote')
|
|
41
41
|
const safari = require('../safari')
|
|
42
|
-
const { Browser
|
|
42
|
+
const { Browser } = require('../lib/capabilities')
|
|
43
43
|
const { Builder } = require('../index')
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Describes a browser targeted by a {@linkplain suite test suite}.
|
|
47
47
|
* @record
|
|
48
48
|
*/
|
|
49
|
-
function TargetBrowser() {
|
|
49
|
+
function TargetBrowser() {}
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* The {@linkplain Browser name} of the targeted browser.
|
|
@@ -208,7 +208,7 @@ function init(force = false) {
|
|
|
208
208
|
if (seleniumJar && seleniumUrl) {
|
|
209
209
|
throw Error(
|
|
210
210
|
'Ambiguous test configuration: both SELENIUM_REMOTE_URL' +
|
|
211
|
-
|
|
211
|
+
' && SELENIUM_SERVER_JAR environment variables are set'
|
|
212
212
|
)
|
|
213
213
|
}
|
|
214
214
|
|
|
@@ -216,8 +216,8 @@ function init(force = false) {
|
|
|
216
216
|
if ((seleniumJar || seleniumUrl) && envBrowsers.length === 0) {
|
|
217
217
|
throw Error(
|
|
218
218
|
'Ambiguous test configuration: when either the SELENIUM_REMOTE_URL or' +
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
' SELENIUM_SERVER_JAR environment variable is set, the' +
|
|
220
|
+
' SELENIUM_BROWSER variable must also be set.'
|
|
221
221
|
)
|
|
222
222
|
}
|
|
223
223
|
|
|
@@ -234,7 +234,8 @@ function init(force = false) {
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
const TARGET_MAP = /** !WeakMap<!Environment, !TargetBrowser> */ new WeakMap()
|
|
237
|
-
const URL_MAP =
|
|
237
|
+
const URL_MAP =
|
|
238
|
+
/** !WeakMap<!Environment, ?(string|remote.SeleniumServer)> */ new WeakMap()
|
|
238
239
|
|
|
239
240
|
/**
|
|
240
241
|
* Defines the environment a {@linkplain suite test suite} is running against.
|
|
@@ -247,9 +248,9 @@ class Environment {
|
|
|
247
248
|
* Selenium server to test against.
|
|
248
249
|
*/
|
|
249
250
|
constructor(browser, url = undefined) {
|
|
250
|
-
browser = /** @type {!TargetBrowser} */ (
|
|
251
|
-
Object.assign({}, browser)
|
|
252
|
-
)
|
|
251
|
+
browser = /** @type {!TargetBrowser} */ (
|
|
252
|
+
Object.seal(Object.assign({}, browser))
|
|
253
|
+
)
|
|
253
254
|
|
|
254
255
|
TARGET_MAP.set(this, browser)
|
|
255
256
|
URL_MAP.set(this, url || null)
|
|
@@ -284,19 +285,16 @@ class Environment {
|
|
|
284
285
|
const builder = new Builder()
|
|
285
286
|
builder.disableEnvironmentOverrides()
|
|
286
287
|
|
|
287
|
-
|
|
288
|
-
|
|
289
288
|
const realBuild = builder.build
|
|
290
289
|
builder.build = function () {
|
|
291
|
-
builder.forBrowser(browser.name, browser.version, browser.platform)
|
|
292
|
-
|
|
290
|
+
builder.forBrowser(browser.name, browser.version, browser.platform)
|
|
293
291
|
|
|
294
292
|
if (browser.capabilities) {
|
|
295
|
-
builder.getCapabilities().merge(browser.capabilities)
|
|
293
|
+
builder.getCapabilities().merge(browser.capabilities)
|
|
296
294
|
}
|
|
297
295
|
|
|
298
296
|
if (browser.name === 'firefox') {
|
|
299
|
-
builder.setCapability('moz:debuggerAddress', true)
|
|
297
|
+
builder.setCapability('moz:debuggerAddress', true)
|
|
300
298
|
}
|
|
301
299
|
|
|
302
300
|
if (typeof urlOrServer === 'string') {
|
|
@@ -315,7 +313,7 @@ class Environment {
|
|
|
315
313
|
* Configuration options for a {@linkplain ./index.suite test suite}.
|
|
316
314
|
* @record
|
|
317
315
|
*/
|
|
318
|
-
function SuiteOptions() {
|
|
316
|
+
function SuiteOptions() {}
|
|
319
317
|
|
|
320
318
|
/**
|
|
321
319
|
* The browsers to run the test suite against.
|
|
@@ -442,7 +440,7 @@ function suite(fn, options = undefined) {
|
|
|
442
440
|
* @param {function(): boolean} predicateFn A predicate to call to determine
|
|
443
441
|
* if the test should be suppressed. This function MUST be synchronous.
|
|
444
442
|
* @return {{describe: !Function, it: !Function}} an object with wrapped
|
|
445
|
-
* versions of the `describe` and `it`
|
|
443
|
+
* versions of the `describe` and `it` test functions.
|
|
446
444
|
*/
|
|
447
445
|
function ignore(predicateFn) {
|
|
448
446
|
const isJasmine = global.jasmine && typeof global.jasmine === 'object'
|
|
@@ -490,8 +488,8 @@ function getTestHook(name) {
|
|
|
490
488
|
if (type !== 'function') {
|
|
491
489
|
throw TypeError(
|
|
492
490
|
`Expected global.${name} to be a function, but is ${type}.` +
|
|
493
|
-
|
|
494
|
-
|
|
491
|
+
' This can happen if you try using this module when running with' +
|
|
492
|
+
' node directly instead of using jasmine or mocha'
|
|
495
493
|
)
|
|
496
494
|
}
|
|
497
495
|
return fn
|