webdriver 9.5.3 → 9.6.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/build/bidi/core.d.ts +1 -0
- package/build/bidi/core.d.ts.map +1 -1
- package/build/command.d.ts.map +1 -1
- package/build/index.js +46 -23
- package/build/node.js +43 -23
- package/build/request/request.d.ts +4 -4
- package/build/request/request.d.ts.map +1 -1
- package/build/request/types.d.ts +22 -0
- package/build/request/types.d.ts.map +1 -1
- package/build/types.d.ts +5 -7
- package/build/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/build/request/index.d.ts +0 -26
- package/build/request/index.d.ts.map +0 -1
package/build/bidi/core.d.ts
CHANGED
|
@@ -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
|
package/build/bidi/core.d.ts.map
CHANGED
|
@@ -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,MAAM,aAAa,CAAA;
|
|
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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E,eAAe,EAC5B,qBAAqB,UAAQ,UAIgB,UAAU,WAAW,OAAO,EAAE,KAAG,OAAO,CAAC,iBAAiB,GAAG,aAAa,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAI7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAgB,aAAa,EAAE,MAAM,YAAY,CAAA;AAKzE,MAAM,CAAC,OAAO,WACV,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,eAAe,EAC5B,qBAAqB,UAAQ,UAIgB,UAAU,WAAW,OAAO,EAAE,KAAG,OAAO,CAAC,iBAAiB,GAAG,aAAa,GAAG,IAAI,CAAC,CAiLlI"}
|
package/build/index.js
CHANGED
|
@@ -103,8 +103,12 @@ function command_default(method, endpointUri, commandInfo, doubleEncodeVariables
|
|
|
103
103
|
}
|
|
104
104
|
body[commandParams[i].name] = arg;
|
|
105
105
|
}
|
|
106
|
-
const request = new environment.value.Request(method, endpoint, body, isHubCommand
|
|
107
|
-
|
|
106
|
+
const request = new environment.value.Request(method, endpoint, body, isHubCommand, {
|
|
107
|
+
onPerformance: (data) => this.emit("request.performance", data),
|
|
108
|
+
onRequest: (data) => this.emit("request.start", data),
|
|
109
|
+
onResponse: (data) => this.emit("request.end", data),
|
|
110
|
+
onRetry: (data) => this.emit("request.retry", data)
|
|
111
|
+
});
|
|
108
112
|
this.emit("command", { command, method, endpoint, body });
|
|
109
113
|
log.info("COMMAND", commandCallStructure(command, args));
|
|
110
114
|
return request.makeRequest(this.options, this.sessionId).then((result) => {
|
|
@@ -181,8 +185,8 @@ var DEFAULTS = {
|
|
|
181
185
|
*/
|
|
182
186
|
path: {
|
|
183
187
|
type: "string",
|
|
184
|
-
validate: (
|
|
185
|
-
if (!
|
|
188
|
+
validate: (path) => {
|
|
189
|
+
if (!path.startsWith("/")) {
|
|
186
190
|
throw new TypeError('The option "path" needs to start with a "/"');
|
|
187
191
|
}
|
|
188
192
|
return true;
|
|
@@ -313,6 +317,8 @@ import { CAPABILITY_KEYS } from "@wdio/protocols";
|
|
|
313
317
|
|
|
314
318
|
// src/bidi/core.ts
|
|
315
319
|
import logger2 from "@wdio/logger";
|
|
320
|
+
var SCRIPT_PREFIX = "/* __wdio script__ */";
|
|
321
|
+
var SCRIPT_SUFFIX = "/* __wdio script end__ */";
|
|
316
322
|
var log2 = logger2("webdriver");
|
|
317
323
|
var RESPONSE_TIMEOUT = 1e3 * 60;
|
|
318
324
|
var _id, _ws, _waitForConnected, _webSocketUrl, _pendingCommands, _BidiCore_instances, handleResponse_fn;
|
|
@@ -469,9 +475,24 @@ function parseBidiCommand(params) {
|
|
|
469
475
|
return [commandName, logString];
|
|
470
476
|
} else if (commandName === "script.callFunction") {
|
|
471
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
|
+
}
|
|
472
493
|
const logString = JSON.stringify({
|
|
473
494
|
...param,
|
|
474
|
-
functionDeclaration: "<Function[".concat(new TextEncoder().encode(param.functionDeclaration).length, " bytes]>")
|
|
495
|
+
functionDeclaration: "<Function[".concat(new TextEncoder().encode(param.functionDeclaration).length, " bytes] ").concat(fnName || "anonymous", ">")
|
|
475
496
|
});
|
|
476
497
|
return [commandName, logString];
|
|
477
498
|
}
|
|
@@ -1439,8 +1460,6 @@ _callbacks = new WeakMap();
|
|
|
1439
1460
|
_ws2 = new WeakMap();
|
|
1440
1461
|
|
|
1441
1462
|
// src/request/request.ts
|
|
1442
|
-
import path from "node:path";
|
|
1443
|
-
import { EventEmitter } from "node:events";
|
|
1444
1463
|
import logger5 from "@wdio/logger";
|
|
1445
1464
|
import { transformCommandLogResult as transformCommandLogResult2, sleep } from "@wdio/utils";
|
|
1446
1465
|
|
|
@@ -1556,7 +1575,7 @@ var WebDriverResponseError = class _WebDriverResponseError extends WebDriverErro
|
|
|
1556
1575
|
// package.json
|
|
1557
1576
|
var package_default = {
|
|
1558
1577
|
name: "webdriver",
|
|
1559
|
-
version: "9.5.
|
|
1578
|
+
version: "9.5.4",
|
|
1560
1579
|
description: "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
|
|
1561
1580
|
author: "Christian Bromann <mail@bromann.dev>",
|
|
1562
1581
|
homepage: "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
|
|
@@ -1617,23 +1636,25 @@ var DEFAULT_HEADERS = {
|
|
|
1617
1636
|
"User-Agent": "webdriver/" + package_default.version
|
|
1618
1637
|
};
|
|
1619
1638
|
var log5 = logger5("webdriver");
|
|
1620
|
-
var WebDriverRequest = class
|
|
1621
|
-
constructor(method, endpoint, body, isHubCommand = false) {
|
|
1622
|
-
super();
|
|
1639
|
+
var WebDriverRequest = class {
|
|
1640
|
+
constructor(method, endpoint, body, isHubCommand = false, eventHandler = {}) {
|
|
1623
1641
|
__publicField(this, "body");
|
|
1624
1642
|
__publicField(this, "method");
|
|
1625
1643
|
__publicField(this, "endpoint");
|
|
1626
1644
|
__publicField(this, "isHubCommand");
|
|
1627
1645
|
__publicField(this, "requiresSessionId");
|
|
1646
|
+
__publicField(this, "eventHandler");
|
|
1628
1647
|
this.body = body;
|
|
1629
1648
|
this.method = method;
|
|
1630
1649
|
this.endpoint = endpoint;
|
|
1631
1650
|
this.isHubCommand = isHubCommand;
|
|
1632
1651
|
this.requiresSessionId = Boolean(this.endpoint.match(/:sessionId/));
|
|
1652
|
+
this.eventHandler = eventHandler;
|
|
1633
1653
|
}
|
|
1634
1654
|
async makeRequest(options, sessionId) {
|
|
1655
|
+
var _a, _b;
|
|
1635
1656
|
const { url, requestOptions } = await this.createOptions(options, sessionId);
|
|
1636
|
-
this.
|
|
1657
|
+
(_b = (_a = this.eventHandler).onRequest) == null ? void 0 : _b.call(_a, requestOptions);
|
|
1637
1658
|
return this._request(url, requestOptions, options.transformResponse, options.connectionRetryCount, 0);
|
|
1638
1659
|
}
|
|
1639
1660
|
async createOptions(options, sessionId, isBrowser = false) {
|
|
@@ -1659,7 +1680,7 @@ var WebDriverRequest = class extends EventEmitter {
|
|
|
1659
1680
|
}
|
|
1660
1681
|
endpoint = endpoint.replace(":sessionId", sessionId);
|
|
1661
1682
|
}
|
|
1662
|
-
const url = new URL("".concat(options.protocol, "://").concat(options.hostname, ":").concat(options.port).concat(this.isHubCommand ? this.endpoint :
|
|
1683
|
+
const url = new URL("".concat(options.protocol, "://").concat(options.hostname, ":").concat(options.port).concat(this.isHubCommand ? this.endpoint : "".concat(options.path || "", "/").concat(endpoint).replace(/(\/){2,}/g, "/")));
|
|
1663
1684
|
if (searchParams) {
|
|
1664
1685
|
url.search = new URLSearchParams(searchParams).toString();
|
|
1665
1686
|
}
|
|
@@ -1698,6 +1719,7 @@ var WebDriverRequest = class extends EventEmitter {
|
|
|
1698
1719
|
}
|
|
1699
1720
|
}
|
|
1700
1721
|
async _request(url, fullRequestOptions, transformResponse, totalRetryCount = 0, retryCount = 0) {
|
|
1722
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
1701
1723
|
log5.info("[".concat(fullRequestOptions.method, "] ").concat(url.href));
|
|
1702
1724
|
if (fullRequestOptions.body && Object.keys(fullRequestOptions.body).length) {
|
|
1703
1725
|
log5.info("DATA", transformCommandLogResult2(fullRequestOptions.body));
|
|
@@ -1707,18 +1729,19 @@ var WebDriverRequest = class extends EventEmitter {
|
|
|
1707
1729
|
let response = await this._libRequest(url, requestLibOptions).catch((err) => err);
|
|
1708
1730
|
const durationMillisecond = performance.now() - startTime;
|
|
1709
1731
|
const retry = async (error2) => {
|
|
1732
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
1710
1733
|
if (retryCount >= totalRetryCount || error2.message.includes("invalid session id")) {
|
|
1711
1734
|
log5.error(error2.message);
|
|
1712
|
-
this.
|
|
1713
|
-
this.
|
|
1735
|
+
(_b2 = (_a2 = this.eventHandler).onResponse) == null ? void 0 : _b2.call(_a2, { error: error2 });
|
|
1736
|
+
(_d2 = (_c2 = this.eventHandler).onPerformance) == null ? void 0 : _d2.call(_c2, { request: fullRequestOptions, durationMillisecond, success: false, error: error2, retryCount });
|
|
1714
1737
|
throw error2;
|
|
1715
1738
|
}
|
|
1716
1739
|
if (retryCount > 0) {
|
|
1717
1740
|
await sleep(Math.min(1e4, 250 * Math.pow(2, retryCount)));
|
|
1718
1741
|
}
|
|
1719
1742
|
++retryCount;
|
|
1720
|
-
this.
|
|
1721
|
-
this.
|
|
1743
|
+
(_f2 = (_e2 = this.eventHandler).onRetry) == null ? void 0 : _f2.call(_e2, { error: error2, retryCount });
|
|
1744
|
+
(_h2 = (_g2 = this.eventHandler).onPerformance) == null ? void 0 : _h2.call(_g2, { request: fullRequestOptions, durationMillisecond, success: false, error: error2, retryCount });
|
|
1722
1745
|
log5.warn(error2.message);
|
|
1723
1746
|
log5.info("Retrying ".concat(retryCount, "/").concat(totalRetryCount));
|
|
1724
1747
|
return this._request(url, fullRequestOptions, transformResponse, totalRetryCount, retryCount);
|
|
@@ -1728,29 +1751,29 @@ var WebDriverRequest = class extends EventEmitter {
|
|
|
1728
1751
|
if (resError.code && RETRYABLE_ERROR_CODES.includes(resError.code) || resError.statusCode && RETRYABLE_STATUS_CODES.includes(resError.statusCode)) {
|
|
1729
1752
|
return retry(resError);
|
|
1730
1753
|
}
|
|
1731
|
-
this.
|
|
1754
|
+
(_b = (_a = this.eventHandler).onPerformance) == null ? void 0 : _b.call(_a, { request: fullRequestOptions, durationMillisecond, success: false, error: response, retryCount });
|
|
1732
1755
|
throw response;
|
|
1733
1756
|
}
|
|
1734
1757
|
if (typeof transformResponse === "function") {
|
|
1735
1758
|
response = transformResponse(response, fullRequestOptions);
|
|
1736
1759
|
}
|
|
1737
1760
|
if (isSuccessfulResponse(response.statusCode, response.body)) {
|
|
1738
|
-
this.
|
|
1739
|
-
this.
|
|
1761
|
+
(_d = (_c = this.eventHandler).onResponse) == null ? void 0 : _d.call(_c, { result: response.body });
|
|
1762
|
+
(_f = (_e = this.eventHandler).onPerformance) == null ? void 0 : _f.call(_e, { request: fullRequestOptions, durationMillisecond, success: true, retryCount });
|
|
1740
1763
|
return response.body;
|
|
1741
1764
|
}
|
|
1742
1765
|
const error = new WebDriverResponseError(response, url, fullRequestOptions);
|
|
1743
1766
|
if (this.isHubCommand) {
|
|
1744
1767
|
if (typeof response.body === "string" && response.body.startsWith("<!DOCTYPE html>")) {
|
|
1745
|
-
this.
|
|
1768
|
+
(_h = (_g = this.eventHandler).onPerformance) == null ? void 0 : _h.call(_g, { request: fullRequestOptions, durationMillisecond, success: false, error, retryCount });
|
|
1746
1769
|
return Promise.reject(new Error("Command can only be called to a Selenium Hub"));
|
|
1747
1770
|
}
|
|
1748
1771
|
return { value: response.body || null };
|
|
1749
1772
|
}
|
|
1750
1773
|
if (error.name === "stale element reference") {
|
|
1751
1774
|
log5.warn("Request encountered a stale element - terminating request");
|
|
1752
|
-
this.
|
|
1753
|
-
this.
|
|
1775
|
+
(_j = (_i = this.eventHandler).onResponse) == null ? void 0 : _j.call(_i, { error });
|
|
1776
|
+
(_l = (_k = this.eventHandler).onPerformance) == null ? void 0 : _l.call(_k, { request: fullRequestOptions, durationMillisecond, success: false, error, retryCount });
|
|
1754
1777
|
throw error;
|
|
1755
1778
|
}
|
|
1756
1779
|
if (ERRORS_TO_EXCLUDE_FROM_RETRY.includes(error.name)) {
|
package/build/node.js
CHANGED
|
@@ -96,8 +96,12 @@ Actual: ${actual}` + moreInfo
|
|
|
96
96
|
}
|
|
97
97
|
body[commandParams[i].name] = arg;
|
|
98
98
|
}
|
|
99
|
-
const request = new environment.value.Request(method, endpoint, body, isHubCommand
|
|
100
|
-
|
|
99
|
+
const request = new environment.value.Request(method, endpoint, body, isHubCommand, {
|
|
100
|
+
onPerformance: (data) => this.emit("request.performance", data),
|
|
101
|
+
onRequest: (data) => this.emit("request.start", data),
|
|
102
|
+
onResponse: (data) => this.emit("request.end", data),
|
|
103
|
+
onRetry: (data) => this.emit("request.retry", data)
|
|
104
|
+
});
|
|
101
105
|
this.emit("command", { command, method, endpoint, body });
|
|
102
106
|
log.info("COMMAND", commandCallStructure(command, args));
|
|
103
107
|
return request.makeRequest(this.options, this.sessionId).then((result) => {
|
|
@@ -173,8 +177,8 @@ var DEFAULTS = {
|
|
|
173
177
|
*/
|
|
174
178
|
path: {
|
|
175
179
|
type: "string",
|
|
176
|
-
validate: (
|
|
177
|
-
if (!
|
|
180
|
+
validate: (path) => {
|
|
181
|
+
if (!path.startsWith("/")) {
|
|
178
182
|
throw new TypeError('The option "path" needs to start with a "/"');
|
|
179
183
|
}
|
|
180
184
|
return true;
|
|
@@ -305,6 +309,8 @@ import { CAPABILITY_KEYS } from "@wdio/protocols";
|
|
|
305
309
|
|
|
306
310
|
// src/bidi/core.ts
|
|
307
311
|
import logger2 from "@wdio/logger";
|
|
312
|
+
var SCRIPT_PREFIX = "/* __wdio script__ */";
|
|
313
|
+
var SCRIPT_SUFFIX = "/* __wdio script end__ */";
|
|
308
314
|
var log2 = logger2("webdriver");
|
|
309
315
|
var RESPONSE_TIMEOUT = 1e3 * 60;
|
|
310
316
|
var BidiCore = class {
|
|
@@ -454,9 +460,24 @@ function parseBidiCommand(params) {
|
|
|
454
460
|
return [commandName, logString];
|
|
455
461
|
} else if (commandName === "script.callFunction") {
|
|
456
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
|
+
}
|
|
457
478
|
const logString = JSON.stringify({
|
|
458
479
|
...param,
|
|
459
|
-
functionDeclaration: `<Function[${new TextEncoder().encode(param.functionDeclaration).length} bytes]>`
|
|
480
|
+
functionDeclaration: `<Function[${new TextEncoder().encode(param.functionDeclaration).length} bytes] ${fnName || "anonymous"}>`
|
|
460
481
|
});
|
|
461
482
|
return [commandName, logString];
|
|
462
483
|
}
|
|
@@ -1384,8 +1405,6 @@ import dns from "node:dns";
|
|
|
1384
1405
|
import { fetch as fetch2, Agent, ProxyAgent } from "undici";
|
|
1385
1406
|
|
|
1386
1407
|
// src/request/request.ts
|
|
1387
|
-
import path from "node:path";
|
|
1388
|
-
import { EventEmitter } from "node:events";
|
|
1389
1408
|
import logger5 from "@wdio/logger";
|
|
1390
1409
|
import { transformCommandLogResult as transformCommandLogResult2, sleep } from "@wdio/utils";
|
|
1391
1410
|
|
|
@@ -1495,7 +1514,7 @@ var WebDriverResponseError = class _WebDriverResponseError extends WebDriverErro
|
|
|
1495
1514
|
// package.json
|
|
1496
1515
|
var package_default = {
|
|
1497
1516
|
name: "webdriver",
|
|
1498
|
-
version: "9.5.
|
|
1517
|
+
version: "9.5.4",
|
|
1499
1518
|
description: "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
|
|
1500
1519
|
author: "Christian Bromann <mail@bromann.dev>",
|
|
1501
1520
|
homepage: "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
|
|
@@ -1556,23 +1575,24 @@ var DEFAULT_HEADERS = {
|
|
|
1556
1575
|
"User-Agent": "webdriver/" + package_default.version
|
|
1557
1576
|
};
|
|
1558
1577
|
var log5 = logger5("webdriver");
|
|
1559
|
-
var WebDriverRequest = class
|
|
1578
|
+
var WebDriverRequest = class {
|
|
1560
1579
|
body;
|
|
1561
1580
|
method;
|
|
1562
1581
|
endpoint;
|
|
1563
1582
|
isHubCommand;
|
|
1564
1583
|
requiresSessionId;
|
|
1565
|
-
|
|
1566
|
-
|
|
1584
|
+
eventHandler;
|
|
1585
|
+
constructor(method, endpoint, body, isHubCommand = false, eventHandler = {}) {
|
|
1567
1586
|
this.body = body;
|
|
1568
1587
|
this.method = method;
|
|
1569
1588
|
this.endpoint = endpoint;
|
|
1570
1589
|
this.isHubCommand = isHubCommand;
|
|
1571
1590
|
this.requiresSessionId = Boolean(this.endpoint.match(/:sessionId/));
|
|
1591
|
+
this.eventHandler = eventHandler;
|
|
1572
1592
|
}
|
|
1573
1593
|
async makeRequest(options, sessionId) {
|
|
1574
1594
|
const { url, requestOptions } = await this.createOptions(options, sessionId);
|
|
1575
|
-
this.
|
|
1595
|
+
this.eventHandler.onRequest?.(requestOptions);
|
|
1576
1596
|
return this._request(url, requestOptions, options.transformResponse, options.connectionRetryCount, 0);
|
|
1577
1597
|
}
|
|
1578
1598
|
async createOptions(options, sessionId, isBrowser = false) {
|
|
@@ -1598,7 +1618,7 @@ var WebDriverRequest = class extends EventEmitter {
|
|
|
1598
1618
|
}
|
|
1599
1619
|
endpoint = endpoint.replace(":sessionId", sessionId);
|
|
1600
1620
|
}
|
|
1601
|
-
const url = new URL(`${options.protocol}://${options.hostname}:${options.port}${this.isHubCommand ? this.endpoint :
|
|
1621
|
+
const url = new URL(`${options.protocol}://${options.hostname}:${options.port}${this.isHubCommand ? this.endpoint : `${options.path || ""}/${endpoint}`.replace(/(\/){2,}/g, "/")}`);
|
|
1602
1622
|
if (searchParams) {
|
|
1603
1623
|
url.search = new URLSearchParams(searchParams).toString();
|
|
1604
1624
|
}
|
|
@@ -1647,16 +1667,16 @@ var WebDriverRequest = class extends EventEmitter {
|
|
|
1647
1667
|
const retry = async (error2) => {
|
|
1648
1668
|
if (retryCount >= totalRetryCount || error2.message.includes("invalid session id")) {
|
|
1649
1669
|
log5.error(error2.message);
|
|
1650
|
-
this.
|
|
1651
|
-
this.
|
|
1670
|
+
this.eventHandler.onResponse?.({ error: error2 });
|
|
1671
|
+
this.eventHandler.onPerformance?.({ request: fullRequestOptions, durationMillisecond, success: false, error: error2, retryCount });
|
|
1652
1672
|
throw error2;
|
|
1653
1673
|
}
|
|
1654
1674
|
if (retryCount > 0) {
|
|
1655
1675
|
await sleep(Math.min(1e4, 250 * Math.pow(2, retryCount)));
|
|
1656
1676
|
}
|
|
1657
1677
|
++retryCount;
|
|
1658
|
-
this.
|
|
1659
|
-
this.
|
|
1678
|
+
this.eventHandler.onRetry?.({ error: error2, retryCount });
|
|
1679
|
+
this.eventHandler.onPerformance?.({ request: fullRequestOptions, durationMillisecond, success: false, error: error2, retryCount });
|
|
1660
1680
|
log5.warn(error2.message);
|
|
1661
1681
|
log5.info(`Retrying ${retryCount}/${totalRetryCount}`);
|
|
1662
1682
|
return this._request(url, fullRequestOptions, transformResponse, totalRetryCount, retryCount);
|
|
@@ -1666,29 +1686,29 @@ var WebDriverRequest = class extends EventEmitter {
|
|
|
1666
1686
|
if (resError.code && RETRYABLE_ERROR_CODES.includes(resError.code) || resError.statusCode && RETRYABLE_STATUS_CODES.includes(resError.statusCode)) {
|
|
1667
1687
|
return retry(resError);
|
|
1668
1688
|
}
|
|
1669
|
-
this.
|
|
1689
|
+
this.eventHandler.onPerformance?.({ request: fullRequestOptions, durationMillisecond, success: false, error: response, retryCount });
|
|
1670
1690
|
throw response;
|
|
1671
1691
|
}
|
|
1672
1692
|
if (typeof transformResponse === "function") {
|
|
1673
1693
|
response = transformResponse(response, fullRequestOptions);
|
|
1674
1694
|
}
|
|
1675
1695
|
if (isSuccessfulResponse(response.statusCode, response.body)) {
|
|
1676
|
-
this.
|
|
1677
|
-
this.
|
|
1696
|
+
this.eventHandler.onResponse?.({ result: response.body });
|
|
1697
|
+
this.eventHandler.onPerformance?.({ request: fullRequestOptions, durationMillisecond, success: true, retryCount });
|
|
1678
1698
|
return response.body;
|
|
1679
1699
|
}
|
|
1680
1700
|
const error = new WebDriverResponseError(response, url, fullRequestOptions);
|
|
1681
1701
|
if (this.isHubCommand) {
|
|
1682
1702
|
if (typeof response.body === "string" && response.body.startsWith("<!DOCTYPE html>")) {
|
|
1683
|
-
this.
|
|
1703
|
+
this.eventHandler.onPerformance?.({ request: fullRequestOptions, durationMillisecond, success: false, error, retryCount });
|
|
1684
1704
|
return Promise.reject(new Error("Command can only be called to a Selenium Hub"));
|
|
1685
1705
|
}
|
|
1686
1706
|
return { value: response.body || null };
|
|
1687
1707
|
}
|
|
1688
1708
|
if (error.name === "stale element reference") {
|
|
1689
1709
|
log5.warn("Request encountered a stale element - terminating request");
|
|
1690
|
-
this.
|
|
1691
|
-
this.
|
|
1710
|
+
this.eventHandler.onResponse?.({ error });
|
|
1711
|
+
this.eventHandler.onPerformance?.({ request: fullRequestOptions, durationMillisecond, success: false, error, retryCount });
|
|
1692
1712
|
throw error;
|
|
1693
1713
|
}
|
|
1694
1714
|
if (ERRORS_TO_EXCLUDE_FROM_RETRY.includes(error.name)) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { EventEmitter } from 'node:events';
|
|
2
1
|
import type { Options } from '@wdio/types';
|
|
3
|
-
import type { WebDriverResponse, RequestLibResponse, RequestOptions } from './types.js';
|
|
4
|
-
export declare abstract class WebDriverRequest
|
|
2
|
+
import type { WebDriverResponse, RequestLibResponse, RequestOptions, RequestEventHandler } from './types.js';
|
|
3
|
+
export declare abstract class WebDriverRequest {
|
|
5
4
|
protected abstract fetch(url: URL, opts: RequestInit): Promise<Response>;
|
|
6
5
|
body?: Record<string, unknown>;
|
|
7
6
|
method: string;
|
|
8
7
|
endpoint: string;
|
|
9
8
|
isHubCommand: boolean;
|
|
10
9
|
requiresSessionId: boolean;
|
|
11
|
-
|
|
10
|
+
eventHandler: RequestEventHandler;
|
|
11
|
+
constructor(method: string, endpoint: string, body?: Record<string, unknown>, isHubCommand?: boolean, eventHandler?: RequestEventHandler);
|
|
12
12
|
makeRequest(options: RequestOptions, sessionId?: string): Promise<WebDriverResponse<unknown>>;
|
|
13
13
|
createOptions(options: RequestOptions, sessionId?: string, isBrowser?: boolean): Promise<{
|
|
14
14
|
url: URL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request/request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request/request.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAI1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAoB5G,8BAAsB,gBAAgB;IAClC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAExE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;IACrB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,YAAY,EAAE,mBAAmB,CAAA;gBAEpB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAE,OAAe,EAAE,YAAY,GAAE,mBAAwB;IAS9I,WAAW,CAAE,OAAO,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM;IAMxD,aAAa,CAAE,OAAO,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,GAAE,OAAe,GAAG,OAAO,CAAC;QAAC,GAAG,EAAE,GAAG,CAAC;QAAC,cAAc,EAAE,WAAW,CAAC;KAAC,CAAC;cA2DhI,WAAW,CAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC;cA6B9E,QAAQ,CACpB,GAAG,EAAE,GAAG,EACR,kBAAkB,EAAE,WAAW,EAC/B,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,KAAK,kBAAkB,EACrG,eAAe,SAAI,EACnB,UAAU,SAAI,GACf,OAAO,CAAC,iBAAiB,CAAC;CA0HhC"}
|
package/build/request/types.d.ts
CHANGED
|
@@ -16,4 +16,26 @@ export interface WebDriverResponse<T = unknown> {
|
|
|
16
16
|
}
|
|
17
17
|
export type RequestLibResponse = Options.RequestLibResponse;
|
|
18
18
|
export type RequestOptions = Omit<Options.WebDriver, 'capabilities'>;
|
|
19
|
+
export interface RequestEventHandler {
|
|
20
|
+
onRequest?: (ev: RequestStartEvent) => void;
|
|
21
|
+
onResponse?: (ev: RequestEndEvent) => void;
|
|
22
|
+
onRetry?: (ev: RequestRetryEvent) => void;
|
|
23
|
+
onPerformance?: (ev: RequestPerformanceEvent) => void;
|
|
24
|
+
}
|
|
25
|
+
export type RequestStartEvent = RequestInit;
|
|
26
|
+
export type RequestEndEvent = {
|
|
27
|
+
result?: unknown;
|
|
28
|
+
error?: Error;
|
|
29
|
+
};
|
|
30
|
+
export type RequestRetryEvent = {
|
|
31
|
+
error: Error;
|
|
32
|
+
retryCount: number;
|
|
33
|
+
};
|
|
34
|
+
export type RequestPerformanceEvent = {
|
|
35
|
+
request: RequestInit;
|
|
36
|
+
durationMillisecond: number;
|
|
37
|
+
success: boolean;
|
|
38
|
+
error?: Error;
|
|
39
|
+
retryCount: number;
|
|
40
|
+
};
|
|
19
41
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/request/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO;IAC1C,KAAK,EAAE,CAAC,CAAA;IACR;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;AAC3D,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/request/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO;IAC1C,KAAK,EAAE,CAAC,CAAA;IACR;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;AAC3D,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA;AAEpE,MAAM,WAAW,mBAAmB;IAChC,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAC3C,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,eAAe,KAAK,IAAI,CAAA;IAC1C,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,iBAAiB,KAAK,IAAI,CAAA;IACzC,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,uBAAuB,KAAK,IAAI,CAAA;CACxD;AAED,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAA;AAC3C,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AACpE,MAAM,MAAM,uBAAuB,GAAG;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
package/build/types.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { BidiHandler } from './bidi/handler.js';
|
|
|
5
5
|
import type { EventData } from './bidi/localTypes.js';
|
|
6
6
|
import type { CommandData } from './bidi/remoteTypes.js';
|
|
7
7
|
import type { CommandResponse } from './bidi/localTypes.js';
|
|
8
|
+
import type { RequestStartEvent, RequestEndEvent, RequestPerformanceEvent, RequestRetryEvent } from './request/types.js';
|
|
8
9
|
export interface JSONWPCommandError extends Error {
|
|
9
10
|
code?: string;
|
|
10
11
|
statusCode?: string;
|
|
@@ -49,13 +50,10 @@ type WebDriverClassicEvents = {
|
|
|
49
50
|
};
|
|
50
51
|
bidiCommand: Omit<CommandData, 'id'>;
|
|
51
52
|
bidiResult: CommandResponse;
|
|
52
|
-
'request.performance':
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
retryCount: number;
|
|
57
|
-
success: boolean;
|
|
58
|
-
};
|
|
53
|
+
'request.performance': RequestPerformanceEvent;
|
|
54
|
+
'request.retry': RequestRetryEvent;
|
|
55
|
+
'request.start': RequestStartEvent;
|
|
56
|
+
'request.end': RequestEndEvent;
|
|
59
57
|
};
|
|
60
58
|
export type BidiEventMap = {
|
|
61
59
|
[Event in keyof Omit<WebDriverBidiCommands, 'sendCommand' | 'sendAsyncCommand'>]: BidiInterface[WebDriverBidiCommands[Event]['socket']['command']];
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,MAAM,WAAW,kBAAmB,SAAQ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AAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAA;IAClG,IAAI,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAA;CACvG;AAED,MAAM,WAAW,UAAW,SAAQ,YAAY,EAAE,YAAY;IAE1D,SAAS,EAAE,MAAM,CAAA;IAEjB,YAAY,EAAE,WAAW,CAAC,YAAY,CAAA;IAEtC,qBAAqB,EAAE,YAAY,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAA;IAE7E,OAAO,EAAE,OAAO,CAAC,SAAS,CAAA;CAC7B;AAED,MAAM,WAAW,MAAO,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB;CAAG;AAE5H,MAAM,WAAW,aAAc,SAAQ,OAAO,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IACpF,SAAS,EAAE,MAAM,CAAA;IAEjB,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,CAAA;IAEvC,qBAAqB,CAAC,EAAE,YAAY,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAA;CACjF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webdriver",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.0",
|
|
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",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"undici": "^6.20.1",
|
|
48
48
|
"ws": "^8.8.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "bea75d896564c2285012cd7c77948dce6ab45804"
|
|
51
51
|
}
|
package/build/request/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'node:events';
|
|
2
|
-
import { URL } from 'node:url';
|
|
3
|
-
import type { Options } from '@wdio/types';
|
|
4
|
-
import type { WebDriverResponse } from './types.js';
|
|
5
|
-
type RequestLibResponse = Options.RequestLibResponse;
|
|
6
|
-
type RequestOptions = Omit<Options.WebDriver, 'capabilities'>;
|
|
7
|
-
export declare const COMMANDS_WITHOUT_RETRY: string[];
|
|
8
|
-
export default abstract class WebDriverRequest extends EventEmitter {
|
|
9
|
-
#private;
|
|
10
|
-
body?: Record<string, unknown>;
|
|
11
|
-
method: string;
|
|
12
|
-
endpoint: string;
|
|
13
|
-
isHubCommand: boolean;
|
|
14
|
-
requiresSessionId: boolean;
|
|
15
|
-
constructor(method: string, endpoint: string, body?: Record<string, unknown>, isHubCommand?: boolean);
|
|
16
|
-
makeRequest(options: RequestOptions, sessionId?: string): Promise<WebDriverResponse<unknown>>;
|
|
17
|
-
protected _createOptions(options: RequestOptions, sessionId?: string, isBrowser?: boolean): Promise<{
|
|
18
|
-
url: URL;
|
|
19
|
-
requestOptions: RequestInit;
|
|
20
|
-
}>;
|
|
21
|
-
protected _libRequest(_url: URL, _options: RequestInit): Promise<RequestLibResponse>;
|
|
22
|
-
protected _libPerformanceNow(): number;
|
|
23
|
-
private _request;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE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