selenium-webdriver 4.19.0 → 4.21.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.
Files changed (61) hide show
  1. package/CHANGES.md +21 -0
  2. package/README.md +1 -1
  3. package/bidi/addInterceptParameters.js +28 -2
  4. package/bidi/browser.js +17 -0
  5. package/bidi/browsingContext.js +206 -39
  6. package/bidi/browsingContextInspector.js +51 -0
  7. package/bidi/browsingContextTypes.js +31 -0
  8. package/bidi/captureScreenshotParameters.js +96 -0
  9. package/bidi/clipRectangle.js +127 -0
  10. package/bidi/continueRequestParameters.js +39 -0
  11. package/bidi/continueResponseParameters.js +40 -0
  12. package/bidi/cookieFilter.js +60 -0
  13. package/bidi/createContextParameters.js +73 -0
  14. package/bidi/evaluateResult.js +17 -0
  15. package/bidi/index.js +0 -1
  16. package/bidi/input.js +27 -3
  17. package/bidi/interceptPhase.js +4 -0
  18. package/bidi/logEntries.js +66 -0
  19. package/bidi/network.js +102 -0
  20. package/bidi/networkTypes.js +346 -1
  21. package/bidi/partialCookie.js +48 -0
  22. package/bidi/partitionDescriptor.js +33 -0
  23. package/bidi/partitionKey.js +17 -0
  24. package/bidi/protocolType.js +20 -0
  25. package/bidi/protocolValue.js +129 -2
  26. package/bidi/provideResponseParameters.js +40 -0
  27. package/bidi/realmInfo.js +27 -0
  28. package/bidi/resultOwnership.js +4 -0
  29. package/bidi/scriptManager.js +119 -1
  30. package/bidi/scriptTypes.js +36 -0
  31. package/bidi/storage.js +30 -0
  32. package/bidi/urlPattern.js +35 -0
  33. package/bin/linux/selenium-manager +0 -0
  34. package/bin/macos/selenium-manager +0 -0
  35. package/bin/windows/selenium-manager.exe +0 -0
  36. package/chromium.js +12 -9
  37. package/common/driverFinder.js +36 -4
  38. package/common/seleniumManager.js +7 -39
  39. package/eslint.config.js +107 -0
  40. package/firefox.js +20 -6
  41. package/http/index.js +6 -6
  42. package/ie.js +8 -4
  43. package/index.js +11 -0
  44. package/io/exec.js +1 -1
  45. package/io/index.js +3 -2
  46. package/io/zip.js +1 -1
  47. package/lib/atoms/find-elements.js +2 -2
  48. package/lib/http.js +5 -4
  49. package/lib/input.js +0 -1
  50. package/lib/pinnedScript.js +1 -1
  51. package/lib/select.js +102 -60
  52. package/lib/until.js +3 -3
  53. package/lib/util.js +1 -0
  54. package/lib/webdriver.js +2 -2
  55. package/net/index.js +1 -1
  56. package/net/portprober.js +1 -1
  57. package/package.json +13 -7
  58. package/remote/index.js +1 -1
  59. package/remote/util.js +2 -2
  60. package/safari.js +3 -3
  61. package/testing/index.js +12 -8
package/lib/webdriver.js CHANGED
@@ -32,9 +32,9 @@ const Symbols = require('./symbols')
32
32
  const cdp = require('../devtools/CDPConnection')
33
33
  const WebSocket = require('ws')
34
34
  const http = require('../http/index')
35
- const fs = require('fs')
35
+ const fs = require('node:fs')
36
36
  const { Capabilities } = require('./capabilities')
37
- const path = require('path')
37
+ const path = require('node:path')
38
38
  const { NoSuchElementError } = require('./error')
39
39
  const cdpTargets = ['page', 'browser']
40
40
  const { Credential } = require('./virtual_authenticator')
package/net/index.js CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  'use strict'
19
19
 
20
- const os = require('os')
20
+ const os = require('node:os')
21
21
 
22
22
  function getLoInterface() {
23
23
  let name
package/net/portprober.js CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  'use strict'
19
19
 
20
- const net = require('net')
20
+ const net = require('node:net')
21
21
 
22
22
  /**
23
23
  * Tests if a port is free.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "selenium-webdriver",
3
- "version": "4.19.0",
3
+ "version": "4.21.0",
4
4
  "description": "The official WebDriver JavaScript bindings from the Selenium project",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -20,7 +20,7 @@
20
20
  "url": "https://github.com/SeleniumHQ/selenium.git"
21
21
  },
22
22
  "engines": {
23
- "node": ">= 14.20.0"
23
+ "node": ">= 14.21.0"
24
24
  },
25
25
  "dependencies": {
26
26
  "jszip": "^3.10.1",
@@ -29,13 +29,16 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@bazel/runfiles": "^5.8.1",
32
- "eslint": "^8.57.0",
32
+ "@eslint/js": "^9.1.1",
33
+ "eslint": "^9.1.0",
33
34
  "eslint-config-prettier": "^9.1.0",
35
+ "eslint-plugin-mocha": "^10.4.3",
36
+ "eslint-plugin-n": "^17.2.1",
34
37
  "eslint-plugin-no-only-tests": "^3.1.0",
35
- "eslint-plugin-node": "^11.1.0",
36
38
  "eslint-plugin-prettier": "^5.1.3",
37
39
  "express": "^4.19.2",
38
- "mocha": "^10.3.0",
40
+ "globals": "^15.0.0",
41
+ "mocha": "^10.4.0",
39
42
  "mocha-junit-reporter": "^2.2.1",
40
43
  "multer": "^1.4.5-lts.1",
41
44
  "prettier": "^3.2.5",
@@ -43,13 +46,16 @@
43
46
  "sinon": "^17.0.1"
44
47
  },
45
48
  "scripts": {
46
- "lint": "eslint --ignore-pattern node_modules --ignore-pattern generator --ext js lib/http.js \"**/*.js\"",
47
- "lint:fix": "eslint --ignore-pattern node_modules --ignore-pattern generator --ext js lib/http.js \"**/*.js\" --fix",
49
+ "lint": "eslint .",
50
+ "lint:fix": "eslint . --fix",
48
51
  "test": "npm run lint && mocha -t 600000 --recursive test",
49
52
  "test-jasmine": "bazel test //javascript/node/selenium-webdriver:tests"
50
53
  },
51
54
  "mocha": {
52
55
  "recursive": true,
53
56
  "timeout": 600000
57
+ },
58
+ "publishConfig": {
59
+ "registry": "https://registry.npmjs.org/"
54
60
  }
55
61
  }
package/remote/index.js CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  'use strict'
19
19
 
20
- const url = require('url')
20
+ const url = require('node:url')
21
21
 
22
22
  const httpUtil = require('../http/util')
23
23
  const io = require('../io')
package/remote/util.js CHANGED
@@ -17,8 +17,8 @@
17
17
 
18
18
  'use strict'
19
19
 
20
- const path = require('path')
21
- const cp = require('child_process')
20
+ const path = require('node:path')
21
+ const cp = require('node:child_process')
22
22
  const logging = require('../lib/logging')
23
23
 
24
24
  /**
package/safari.js CHANGED
@@ -25,10 +25,10 @@ const http = require('./http')
25
25
  const remote = require('./remote')
26
26
  const webdriver = require('./lib/webdriver')
27
27
  const { Browser, Capabilities } = require('./lib/capabilities')
28
- const { getPath } = require('./common/driverFinder')
28
+ const { getBinaryPaths } = require('./common/driverFinder')
29
29
 
30
30
  /**
31
- * Creates {@link selenium-webdriver/remote.DriverService} instances that manage
31
+ * Creates {@link remote.DriverService} instances that manage
32
32
  * a [safaridriver] server in a child process.
33
33
  *
34
34
  * [safaridriver]: https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_10_0.html#//apple_ref/doc/uid/TP40014305-CH11-DontLinkElementID_28
@@ -123,7 +123,7 @@ class Driver extends webdriver.WebDriver {
123
123
 
124
124
  let service = new ServiceBuilder(exe).build()
125
125
  if (!service.getExecutable()) {
126
- service.setExecutable(getPath(caps).driverPath)
126
+ service.setExecutable(getBinaryPaths(caps).driverPath)
127
127
  }
128
128
  let executor = new http.Executor(service.start().then((url) => new http.HttpClient(url)))
129
129
 
package/testing/index.js CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  'use strict'
34
34
 
35
- const { isatty } = require('tty')
35
+ const { isatty } = require('node:tty')
36
36
  const chrome = require('../chrome')
37
37
  const edge = require('../edge')
38
38
  const firefox = require('../firefox')
@@ -41,7 +41,7 @@ const remote = require('../remote')
41
41
  const safari = require('../safari')
42
42
  const { Browser } = require('../lib/capabilities')
43
43
  const { Builder } = require('../index')
44
- const { getPath } = require('../common/driverFinder')
44
+ const { getBinaryPaths } = require('../common/driverFinder')
45
45
 
46
46
  /**
47
47
  * Describes a browser targeted by a {@linkplain suite test suite}.
@@ -122,15 +122,15 @@ function getAvailableBrowsers() {
122
122
  info(`Searching for WebDriver executables installed on the current system...`)
123
123
 
124
124
  let targets = [
125
- [getPath(new chrome.Options()), Browser.CHROME],
126
- [getPath(new edge.Options()), Browser.EDGE],
127
- [getPath(new firefox.Options()), Browser.FIREFOX],
125
+ [getBinaryPaths(new chrome.Options()), Browser.CHROME],
126
+ [getBinaryPaths(new edge.Options()), Browser.EDGE],
127
+ [getBinaryPaths(new firefox.Options()), Browser.FIREFOX],
128
128
  ]
129
129
  if (process.platform === 'win32') {
130
- targets.push([getPath(new ie.Options()), Browser.INTERNET_EXPLORER])
130
+ targets.push([getBinaryPaths(new ie.Options()), Browser.INTERNET_EXPLORER])
131
131
  }
132
132
  if (process.platform === 'darwin') {
133
- targets.push([getPath(new safari.Options()), Browser.SAFARI])
133
+ targets.push([getBinaryPaths(new safari.Options()), Browser.SAFARI])
134
134
  }
135
135
 
136
136
  let availableBrowsers = []
@@ -302,6 +302,11 @@ class Environment {
302
302
  builder.setCapability('moz:debuggerAddress', true)
303
303
  }
304
304
 
305
+ // Enable BiDi for supporting browsers.
306
+ if (browser.name === Browser.FIREFOX || browser.name === Browser.CHROME || browser.name === Browser.EDGE) {
307
+ builder.setCapability('webSocketUrl', true)
308
+ }
309
+
305
310
  if (typeof urlOrServer === 'string') {
306
311
  builder.usingServer(urlOrServer)
307
312
  } else if (urlOrServer) {
@@ -401,7 +406,6 @@ function suite(fn, options = undefined) {
401
406
 
402
407
  const startTimeout = 65 * 1000
403
408
 
404
- // eslint-disable-next-line no-inner-declarations
405
409
  function startSelenium() {
406
410
  if (typeof this.timeout === 'function') {
407
411
  this.timeout(startTimeout) // For mocha.