selenium-webdriver 4.8.2 → 4.9.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/lib/http.js CHANGED
@@ -189,7 +189,10 @@ function toExecuteAtomCommand(command, atom, name, ...params) {
189
189
 
190
190
  return new cmd.Command(cmd.Name.EXECUTE_SCRIPT)
191
191
  .setParameter('sessionId', command.getParameter('sessionId'))
192
- .setParameter('script', `/* ${name} */return (${atom}).apply(null, arguments)`)
192
+ .setParameter(
193
+ 'script',
194
+ `/* ${name} */return (${atom}).apply(null, arguments)`
195
+ )
193
196
  .setParameter(
194
197
  'args',
195
198
  params.map((param) => command.getParameter(param))
@@ -252,7 +255,12 @@ const W3C_COMMAND_MAP = new Map([
252
255
  [
253
256
  cmd.Name.FIND_ELEMENTS_RELATIVE,
254
257
  (cmd) => {
255
- return toExecuteAtomCommand(cmd, Atom.FIND_ELEMENTS, 'findElements', 'args')
258
+ return toExecuteAtomCommand(
259
+ cmd,
260
+ Atom.FIND_ELEMENTS,
261
+ 'findElements',
262
+ 'args'
263
+ )
256
264
  },
257
265
  ],
258
266
  [
@@ -272,7 +280,13 @@ const W3C_COMMAND_MAP = new Map([
272
280
  [
273
281
  cmd.Name.GET_ELEMENT_ATTRIBUTE,
274
282
  (cmd) => {
275
- return toExecuteAtomCommand(cmd, Atom.GET_ATTRIBUTE, 'getAttribute', 'id', 'name')
283
+ return toExecuteAtomCommand(
284
+ cmd,
285
+ Atom.GET_ATTRIBUTE,
286
+ 'getAttribute',
287
+ 'id',
288
+ 'name'
289
+ )
276
290
  },
277
291
  ],
278
292
  [
package/lib/webdriver.js CHANGED
@@ -2252,11 +2252,13 @@ class Window {
2252
2252
  */
2253
2253
  async getSize(windowHandle = 'current') {
2254
2254
  if (windowHandle !== 'current') {
2255
- console.warn(`Only 'current' window is supported for W3C compatible browsers.`);
2255
+ console.warn(
2256
+ `Only 'current' window is supported for W3C compatible browsers.`
2257
+ )
2256
2258
  }
2257
2259
 
2258
- const rect = await this.getRect();
2259
- return {height: rect.height, width: rect.width};
2260
+ const rect = await this.getRect()
2261
+ return { height: rect.height, width: rect.width }
2260
2262
  }
2261
2263
 
2262
2264
  /**
@@ -2268,12 +2270,17 @@ class Window {
2268
2270
  * @param windowHandle
2269
2271
  * @returns {Promise<void>}
2270
2272
  */
2271
- async setSize({x = 0, y = 0, width = 0, height = 0}, windowHandle = 'current') {
2273
+ async setSize(
2274
+ { x = 0, y = 0, width = 0, height = 0 },
2275
+ windowHandle = 'current'
2276
+ ) {
2272
2277
  if (windowHandle !== 'current') {
2273
- console.warn(`Only 'current' window is supported for W3C compatible browsers.`);
2278
+ console.warn(
2279
+ `Only 'current' window is supported for W3C compatible browsers.`
2280
+ )
2274
2281
  }
2275
2282
 
2276
- await this.setRect({x, y, width, height});
2283
+ await this.setRect({ x, y, width, height })
2277
2284
  }
2278
2285
  }
2279
2286
 
@@ -3006,7 +3013,7 @@ class WebElement {
3006
3013
  "e.initEvent('submit', true, true);\n" +
3007
3014
  'if (form.dispatchEvent(e)) { HTMLFormElement.prototype.submit.call(form) }\n'
3008
3015
 
3009
- this.driver_.executeScript(script, this)
3016
+ return this.driver_.executeScript(script, this)
3010
3017
  }
3011
3018
 
3012
3019
  /**
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
+
1
2
  {
2
3
  "name": "selenium-webdriver",
3
- "version": "4.8.2",
4
+ "version": "4.9.0",
4
5
  "description": "The official WebDriver JavaScript bindings from the Selenium project",
5
6
  "license": "Apache-2.0",
6
7
  "keywords": [
@@ -23,25 +24,25 @@
23
24
  "node": ">= 14.20.0"
24
25
  },
25
26
  "dependencies": {
26
- "jszip": "^3.10.0",
27
+ "jszip": "^3.10.1",
27
28
  "tmp": "^0.2.1",
28
- "ws": ">=8.11.0"
29
+ "ws": ">=8.13.0"
29
30
  },
30
31
  "devDependencies": {
31
- "eslint": "^8.31.0",
32
- "eslint-config-prettier": "^8.6.0",
32
+ "eslint": "^8.37.0",
33
+ "eslint-config-prettier": "^8.8.0",
33
34
  "eslint-plugin-no-only-tests": "^3.1.0",
34
35
  "eslint-plugin-node": "^11.1.0",
35
36
  "eslint-plugin-prettier": "^4.2.1",
36
37
  "express": "^4.18.2",
37
38
  "mocha": "^10.2.0",
38
39
  "multer": "^1.4.5-lts.1",
39
- "prettier": "^2.7.1",
40
+ "prettier": "^2.8.7",
40
41
  "serve-index": "^1.9.1",
41
- "sinon": "^14.0.2"
42
+ "sinon": "^15.0.3"
42
43
  },
43
44
  "scripts": {
44
- "lint": "eslint --ignore-pattern node_modules --ignore-pattern generator --fix --ext js lib/http.js \"**/*.js\"",
45
+ "lint": "eslint --ignore-pattern node_modules --ignore-pattern generator --ext js lib/http.js \"**/*.js\"",
45
46
  "test": "npm run lint && mocha -t 600000 --recursive test",
46
47
  "test-jasmine": "bazel test //javascript/node/selenium-webdriver:tests"
47
48
  },
package/remote/index.js CHANGED
@@ -167,6 +167,14 @@ class DriverService {
167
167
  this.address_ = null
168
168
  }
169
169
 
170
+ getExecutable() {
171
+ return this.executable_
172
+ }
173
+
174
+ setExecutable(value) {
175
+ this.executable_ = value
176
+ }
177
+
170
178
  /**
171
179
  * @return {!Promise<string>} A promise that resolves to the server's address.
172
180
  * @throws {Error} If the server has not been started.
@@ -318,10 +326,6 @@ DriverService.Builder = class {
318
326
  * @throws {Error} If the provided executable path does not exist.
319
327
  */
320
328
  constructor(exe) {
321
- if (!fs.existsSync(exe)) {
322
- throw Error(`The specified executable path does not exist: ${exe}`)
323
- }
324
-
325
329
  /** @private @const {string} */
326
330
  this.exe_ = exe
327
331
 
package/remote/util.js CHANGED
@@ -52,7 +52,9 @@ function isSelenium3x(seleniumStandalonePath) {
52
52
  */
53
53
  function formatSpawnArgs(seleniumStandalonePath, args) {
54
54
  if (isSelenium3x(seleniumStandalonePath)) {
55
- console.warn('Deprecation: Support for Standalone Server 3.x will be removed soon. Please update to version 4.x')
55
+ console.warn(
56
+ 'Deprecation: Support for Standalone Server 3.x will be removed soon. Please update to version 4.x'
57
+ )
56
58
  return args
57
59
  }
58
60