selenium-webdriver 4.0.0-beta.2 → 4.0.0-rc-2
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 +45 -0
- package/README.md +4 -2
- package/chrome.js +3 -4
- package/chromium.js +38 -2
- package/devtools/networkinterceptor.js +89 -0
- package/edge.js +14 -20
- package/firefox.js +18 -1
- package/http/index.js +25 -3
- package/ie.js +8 -8
- package/index.js +24 -8
- package/io/exec.js +5 -4
- package/io/index.js +8 -9
- package/io/zip.js +5 -6
- package/lib/atoms/get-attribute.js +25 -25
- package/lib/by.js +39 -20
- package/lib/capabilities.js +10 -1
- package/lib/command.js +0 -15
- package/lib/http.js +2 -30
- package/lib/input.js +6 -301
- package/lib/promise.js +4 -16
- package/lib/until.js +14 -16
- package/lib/webdriver.js +128 -44
- package/opera.js +3 -3
- package/package.json +11 -11
- package/remote/index.js +8 -9
- package/safari.js +3 -3
- package/testing/index.js +7 -6
- package/lib/actions.js +0 -627
package/opera.js
CHANGED
|
@@ -383,9 +383,9 @@ class Driver extends webdriver.WebDriver {
|
|
|
383
383
|
caps = options.toCapabilities(caps)
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
-
return /** @type {!Driver} */ (
|
|
387
|
-
service.kill()
|
|
388
|
-
)
|
|
386
|
+
return /** @type {!Driver} */ (
|
|
387
|
+
super.createSession(executor, caps, () => service.kill())
|
|
388
|
+
)
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "selenium-webdriver",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-rc-2",
|
|
4
4
|
"description": "The official WebDriver JavaScript bindings from the Selenium project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
"node": ">= 10.15.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"jszip": "^3.
|
|
27
|
-
"rimraf": "^
|
|
26
|
+
"jszip": "^3.6.0",
|
|
27
|
+
"rimraf": "^3.0.2",
|
|
28
28
|
"tmp": "^0.2.1",
|
|
29
|
-
"ws": "
|
|
29
|
+
"ws": ">=7.4.6"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"eslint": "^7.
|
|
33
|
-
"eslint-config-prettier": "^
|
|
34
|
-
"eslint-plugin-no-only-tests": "^2.
|
|
32
|
+
"eslint": "^7.26.0",
|
|
33
|
+
"eslint-config-prettier": "^8.3.0",
|
|
34
|
+
"eslint-plugin-no-only-tests": "^2.6.0",
|
|
35
35
|
"eslint-plugin-node": "^11.1.0",
|
|
36
|
-
"eslint-plugin-prettier": "^3.
|
|
36
|
+
"eslint-plugin-prettier": "^3.4.0",
|
|
37
37
|
"express": "^4.17.1",
|
|
38
|
-
"jasmine": "^3.
|
|
38
|
+
"jasmine": "^3.8.0",
|
|
39
39
|
"mocha": "^8.1.0",
|
|
40
40
|
"multer": "^1.4.2",
|
|
41
|
-
"prettier": "^2.
|
|
41
|
+
"prettier": "^2.3.0",
|
|
42
42
|
"serve-index": "^1.9.1",
|
|
43
|
-
"sinon": "^
|
|
43
|
+
"sinon": "^10.0.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"lint": "eslint --ignore-pattern node_modules --ignore-pattern generator --ext js lib/http.js \"**/*.js\"",
|
package/remote/index.js
CHANGED
|
@@ -210,7 +210,7 @@ class DriverService {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
return resolveCommandLineFlags(this.args_).then((args) => {
|
|
213
|
-
|
|
213
|
+
const command = exec(self.executable_, {
|
|
214
214
|
args: args,
|
|
215
215
|
env: self.env_,
|
|
216
216
|
stdio: self.stdio_,
|
|
@@ -218,8 +218,8 @@ class DriverService {
|
|
|
218
218
|
|
|
219
219
|
resolveCommand(command)
|
|
220
220
|
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
const earlyTermination = command.result().then(function (result) {
|
|
222
|
+
const error =
|
|
223
223
|
result.code == null
|
|
224
224
|
? Error('Server was killed with ' + result.signal)
|
|
225
225
|
: Error('Server terminated early with status ' + result.code)
|
|
@@ -229,7 +229,7 @@ class DriverService {
|
|
|
229
229
|
throw error
|
|
230
230
|
})
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
let hostname = self.hostname_
|
|
233
233
|
if (!hostname) {
|
|
234
234
|
hostname =
|
|
235
235
|
(!self.loopbackOnly_ && net.getAddress()) ||
|
|
@@ -338,9 +338,8 @@ DriverService.Builder = class {
|
|
|
338
338
|
* @this {THIS}
|
|
339
339
|
* @template THIS
|
|
340
340
|
*/
|
|
341
|
-
addArguments(
|
|
342
|
-
|
|
343
|
-
this.options_.args = this.options_.args.concat(args)
|
|
341
|
+
addArguments(...arguments_) {
|
|
342
|
+
this.options_.args = this.options_.args.concat(arguments_)
|
|
344
343
|
return this
|
|
345
344
|
}
|
|
346
345
|
|
|
@@ -449,7 +448,7 @@ DriverService.Builder = class {
|
|
|
449
448
|
|
|
450
449
|
/**
|
|
451
450
|
* Manages the life and death of the
|
|
452
|
-
* <a href="
|
|
451
|
+
* <a href="https://www.selenium.dev/downloads/">
|
|
453
452
|
* standalone Selenium server</a>.
|
|
454
453
|
*/
|
|
455
454
|
class SeleniumServer extends DriverService {
|
|
@@ -563,7 +562,7 @@ SeleniumServer.Options = class {
|
|
|
563
562
|
/**
|
|
564
563
|
* A {@link webdriver.FileDetector} that may be used when running
|
|
565
564
|
* against a remote
|
|
566
|
-
* [Selenium server](
|
|
565
|
+
* [Selenium server](https://www.selenium.dev/downloads/).
|
|
567
566
|
*
|
|
568
567
|
* When a file path on the local machine running this script is entered with
|
|
569
568
|
* {@link webdriver.WebElement#sendKeys WebElement#sendKeys}, this file detector
|
package/safari.js
CHANGED
|
@@ -154,9 +154,9 @@ class Driver extends webdriver.WebDriver {
|
|
|
154
154
|
service.start().then((url) => new http.HttpClient(url))
|
|
155
155
|
)
|
|
156
156
|
|
|
157
|
-
return /** @type {!Driver} */ (
|
|
158
|
-
service.kill()
|
|
159
|
-
)
|
|
157
|
+
return /** @type {!Driver} */ (
|
|
158
|
+
super.createSession(executor, caps, () => service.kill())
|
|
159
|
+
)
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
package/testing/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const ie = require('../ie')
|
|
|
40
40
|
const remote = require('../remote')
|
|
41
41
|
const safari = require('../safari')
|
|
42
42
|
const opera = require('../opera')
|
|
43
|
-
const { Browser } = require('../lib/capabilities')
|
|
43
|
+
const { Browser, Capabilities } = require('../lib/capabilities')
|
|
44
44
|
const { Builder } = require('../index')
|
|
45
45
|
|
|
46
46
|
/**
|
|
@@ -236,7 +236,8 @@ function init(force = false) {
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
const TARGET_MAP = /** !WeakMap<!Environment, !TargetBrowser> */ new WeakMap()
|
|
239
|
-
const URL_MAP =
|
|
239
|
+
const URL_MAP =
|
|
240
|
+
/** !WeakMap<!Environment, ?(string|remote.SeleniumServer)> */ new WeakMap()
|
|
240
241
|
|
|
241
242
|
/**
|
|
242
243
|
* Defines the environment a {@linkplain suite test suite} is running against.
|
|
@@ -249,9 +250,9 @@ class Environment {
|
|
|
249
250
|
* Selenium server to test against.
|
|
250
251
|
*/
|
|
251
252
|
constructor(browser, url = undefined) {
|
|
252
|
-
browser = /** @type {!TargetBrowser} */ (
|
|
253
|
-
Object.assign({}, browser)
|
|
254
|
-
)
|
|
253
|
+
browser = /** @type {!TargetBrowser} */ (
|
|
254
|
+
Object.seal(Object.assign({}, browser))
|
|
255
|
+
)
|
|
255
256
|
|
|
256
257
|
TARGET_MAP.set(this, browser)
|
|
257
258
|
URL_MAP.set(this, url || null)
|
|
@@ -289,7 +290,7 @@ class Environment {
|
|
|
289
290
|
const realBuild = builder.build
|
|
290
291
|
builder.build = function () {
|
|
291
292
|
|
|
292
|
-
builder.
|
|
293
|
+
builder.withCapabilities(Capabilities[browser.name].apply(Capabilities))
|
|
293
294
|
|
|
294
295
|
if (browser.capabilities) {
|
|
295
296
|
builder.getCapabilities().merge(browser.capabilities)
|