webdriver 9.5.4 → 9.6.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/README.md CHANGED
@@ -13,8 +13,8 @@ The package supports the following protocols:
13
13
  - [Chromium](http://chromedriver.chromium.org/) (additional Chromedriver specific commands)
14
14
  - [Selenium](https://www.selenium.dev/) (additional Selenium WebDriver specific commands)
15
15
  - [Sauce Labs](https://saucelabs.com/) (Sauce Labs specific WebDriver extensions)
16
- - [JSONWireProtocol](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol) (depcrecated)
17
- - [Mobile JSONWireProtocol](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md) (depcrecated)
16
+ - [JSONWireProtocol](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol) (deprecated)
17
+ - [Mobile JSONWireProtocol](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md) (deprecated)
18
18
 
19
19
  Commands are added to the client's protocol based on assumptions of provided capabilities. You can find more details about the commands by checking out the [`@wdio/protocols`](https://www.npmjs.com/package/@wdio/protocols) package. All commands come with TypeScript support.
20
20
 
@@ -34,4 +34,5 @@ export declare class BidiCore {
34
34
  send(params: Omit<CommandData, 'id'>): Promise<CommandResponse>;
35
35
  sendAsync(params: Omit<CommandData, 'id'>): number;
36
36
  }
37
+ export declare function parseBidiCommand(params: Omit<CommandData, 'id'>): string[];
37
38
  //# sourceMappingURL=core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/bidi/core.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAI3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,iBAAiB,CAAA;AAErE,OAAO,KAAK,EAAE,MAAM,EAAE,M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IAAI,CAAC,EAAE,aAAa;IAS5D;;;OAGG;IACH,gBAAgB;IAIhB,IAAI,MAAM,cAET;IAED,IAAI,WAAW,YAEd;IAED;;;OAGG;IACH,IAAI,gBAAgB,WAIG,OAAO,UAF7B;IAyBY,IAAI,CAAE,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;IA+BtE,SAAS,CAAE,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC;CAWpD;AAED,wBAAgB,gBAAgB,CAAE,MAAM,EAAG,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAwCjE"}
package/build/index.js CHANGED
@@ -317,6 +317,8 @@ import { CAPABILITY_KEYS } from "@wdio/protocols";
317
317
 
318
318
  // src/bidi/core.ts
319
319
  import logger2 from "@wdio/logger";
320
+ var SCRIPT_PREFIX = "/* __wdio script__ */";
321
+ var SCRIPT_SUFFIX = "/* __wdio script end__ */";
320
322
  var log2 = logger2("webdriver");
321
323
  var RESPONSE_TIMEOUT = 1e3 * 60;
322
324
  var _id, _ws, _waitForConnected, _webSocketUrl, _pendingCommands, _BidiCore_instances, handleResponse_fn;
@@ -473,9 +475,24 @@ function parseBidiCommand(params) {
473
475
  return [commandName, logString];
474
476
  } else if (commandName === "script.callFunction") {
475
477
  const param = params.params;
478
+ const fn = param.functionDeclaration;
479
+ let fnName = "";
480
+ if (fn.includes(SCRIPT_PREFIX)) {
481
+ const internalFn = fn.slice(
482
+ fn.indexOf(SCRIPT_PREFIX) + SCRIPT_PREFIX.length,
483
+ fn.indexOf(SCRIPT_SUFFIX)
484
+ );
485
+ const functionPrefix = "function ";
486
+ if (internalFn.startsWith(functionPrefix)) {
487
+ fnName = internalFn.slice(
488
+ internalFn.indexOf(functionPrefix) + functionPrefix.length,
489
+ internalFn.indexOf("(")
490
+ );
491
+ }
492
+ }
476
493
  const logString = JSON.stringify({
477
494
  ...param,
478
- functionDeclaration: "<Function[".concat(new TextEncoder().encode(param.functionDeclaration).length, " bytes]>")
495
+ functionDeclaration: "<Function[".concat(new TextEncoder().encode(param.functionDeclaration).length, " bytes] ").concat(fnName || "anonymous", ">")
479
496
  });
480
497
  return [commandName, logString];
481
498
  }
@@ -1558,7 +1575,7 @@ var WebDriverResponseError = class _WebDriverResponseError extends WebDriverErro
1558
1575
  // package.json
1559
1576
  var package_default = {
1560
1577
  name: "webdriver",
1561
- version: "9.5.3",
1578
+ version: "9.6.0",
1562
1579
  description: "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
1563
1580
  author: "Christian Bromann <mail@bromann.dev>",
1564
1581
  homepage: "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
package/build/node.js CHANGED
@@ -309,6 +309,8 @@ import { CAPABILITY_KEYS } from "@wdio/protocols";
309
309
 
310
310
  // src/bidi/core.ts
311
311
  import logger2 from "@wdio/logger";
312
+ var SCRIPT_PREFIX = "/* __wdio script__ */";
313
+ var SCRIPT_SUFFIX = "/* __wdio script end__ */";
312
314
  var log2 = logger2("webdriver");
313
315
  var RESPONSE_TIMEOUT = 1e3 * 60;
314
316
  var BidiCore = class {
@@ -458,9 +460,24 @@ function parseBidiCommand(params) {
458
460
  return [commandName, logString];
459
461
  } else if (commandName === "script.callFunction") {
460
462
  const param = params.params;
463
+ const fn = param.functionDeclaration;
464
+ let fnName = "";
465
+ if (fn.includes(SCRIPT_PREFIX)) {
466
+ const internalFn = fn.slice(
467
+ fn.indexOf(SCRIPT_PREFIX) + SCRIPT_PREFIX.length,
468
+ fn.indexOf(SCRIPT_SUFFIX)
469
+ );
470
+ const functionPrefix = "function ";
471
+ if (internalFn.startsWith(functionPrefix)) {
472
+ fnName = internalFn.slice(
473
+ internalFn.indexOf(functionPrefix) + functionPrefix.length,
474
+ internalFn.indexOf("(")
475
+ );
476
+ }
477
+ }
461
478
  const logString = JSON.stringify({
462
479
  ...param,
463
- functionDeclaration: `<Function[${new TextEncoder().encode(param.functionDeclaration).length} bytes]>`
480
+ functionDeclaration: `<Function[${new TextEncoder().encode(param.functionDeclaration).length} bytes] ${fnName || "anonymous"}>`
464
481
  });
465
482
  return [commandName, logString];
466
483
  }
@@ -1497,7 +1514,7 @@ var WebDriverResponseError = class _WebDriverResponseError extends WebDriverErro
1497
1514
  // package.json
1498
1515
  var package_default = {
1499
1516
  name: "webdriver",
1500
- version: "9.5.3",
1517
+ version: "9.6.0",
1501
1518
  description: "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
1502
1519
  author: "Christian Bromann <mail@bromann.dev>",
1503
1520
  homepage: "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webdriver",
3
- "version": "9.5.4",
3
+ "version": "9.6.2",
4
4
  "description": "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
@@ -38,14 +38,14 @@
38
38
  "dependencies": {
39
39
  "@types/node": "^20.1.0",
40
40
  "@types/ws": "^8.5.3",
41
- "@wdio/config": "9.5.0",
41
+ "@wdio/config": "9.6.2",
42
42
  "@wdio/logger": "9.4.4",
43
43
  "@wdio/protocols": "9.4.4",
44
- "@wdio/types": "9.5.0",
45
- "@wdio/utils": "9.5.0",
44
+ "@wdio/types": "9.6.2",
45
+ "@wdio/utils": "9.6.2",
46
46
  "deepmerge-ts": "^7.0.3",
47
47
  "undici": "^6.20.1",
48
48
  "ws": "^8.8.0"
49
49
  },
50
- "gitHead": "b4e5733841d26e9b3e29cac5630f9bb67e33e00e"
50
+ "gitHead": "918477b20c54c27b98655b08f55a2a304495f0fa"
51
51
  }