webdriver 9.0.7 → 9.1.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/index.js
CHANGED
|
@@ -22,6 +22,9 @@ import { URL } from "node:url";
|
|
|
22
22
|
import logger3 from "@wdio/logger";
|
|
23
23
|
import { transformCommandLogResult as transformCommandLogResult2 } from "@wdio/utils";
|
|
24
24
|
|
|
25
|
+
// src/request/constants.ts
|
|
26
|
+
var RETRYABLE_STATUS_CODES = [408, 413, 429, 500, 502, 503, 504];
|
|
27
|
+
|
|
25
28
|
// src/utils.ts
|
|
26
29
|
import { deepmergeCustom } from "deepmerge-ts";
|
|
27
30
|
import logger2 from "@wdio/logger";
|
|
@@ -875,20 +878,23 @@ var BROWSER_DRIVER_ERRORS = [
|
|
|
875
878
|
// iedriver
|
|
876
879
|
];
|
|
877
880
|
async function startWebDriverSession(params) {
|
|
878
|
-
const
|
|
879
|
-
if (
|
|
880
|
-
|
|
881
|
+
const capabilities = params.capabilities && "alwaysMatch" in params.capabilities ? params.capabilities : { alwaysMatch: params.capabilities, firstMatch: [{}] };
|
|
882
|
+
if (
|
|
883
|
+
/**
|
|
884
|
+
* except, if user does not want to opt-in
|
|
885
|
+
*/
|
|
886
|
+
!capabilities.alwaysMatch["wdio:enforceWebDriverClassic"] && /**
|
|
887
|
+
* or user requests a Safari session which does not support Bidi
|
|
888
|
+
*/
|
|
889
|
+
typeof capabilities.alwaysMatch.browserName === "string" && capabilities.alwaysMatch.browserName.toLowerCase() !== "safari"
|
|
890
|
+
) {
|
|
891
|
+
capabilities.alwaysMatch.webSocketUrl = true;
|
|
881
892
|
}
|
|
882
|
-
validateCapabilities(
|
|
893
|
+
validateCapabilities(capabilities.alwaysMatch);
|
|
883
894
|
const sessionRequest = new FetchRequest(
|
|
884
895
|
"POST",
|
|
885
896
|
"/session",
|
|
886
|
-
{
|
|
887
|
-
capabilities: w3cCaps,
|
|
888
|
-
// W3C compliant
|
|
889
|
-
desiredCapabilities: jsonwpCaps
|
|
890
|
-
// JSONWP compliant
|
|
891
|
-
}
|
|
897
|
+
{ capabilities }
|
|
892
898
|
);
|
|
893
899
|
let response;
|
|
894
900
|
try {
|
|
@@ -1078,7 +1084,7 @@ It seems like the service failed to start or is rejecting any connections.`;
|
|
|
1078
1084
|
}
|
|
1079
1085
|
return err.message;
|
|
1080
1086
|
};
|
|
1081
|
-
function
|
|
1087
|
+
function getRequestError(error, requestOptions, url) {
|
|
1082
1088
|
const cmdName = getExecCmdName(url);
|
|
1083
1089
|
const cmdArgs = getExecCmdArgs(requestOptions);
|
|
1084
1090
|
const cmdInfoMsg = `when running "${cmdName}" with method "${requestOptions.method}"`;
|
|
@@ -1136,7 +1142,7 @@ function parseBidiMessage(data) {
|
|
|
1136
1142
|
// package.json
|
|
1137
1143
|
var package_default = {
|
|
1138
1144
|
name: "webdriver",
|
|
1139
|
-
version: "9.0.
|
|
1145
|
+
version: "9.0.8",
|
|
1140
1146
|
description: "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
|
|
1141
1147
|
author: "Christian Bromann <mail@bromann.dev>",
|
|
1142
1148
|
homepage: "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
|
|
@@ -1155,7 +1161,7 @@ var package_default = {
|
|
|
1155
1161
|
types: "./build/index.d.ts",
|
|
1156
1162
|
typeScriptVersion: "3.8.3",
|
|
1157
1163
|
engines: {
|
|
1158
|
-
node: ">=18"
|
|
1164
|
+
node: ">=18.20.0"
|
|
1159
1165
|
},
|
|
1160
1166
|
repository: {
|
|
1161
1167
|
type: "git",
|
|
@@ -1298,9 +1304,14 @@ var WebDriverRequest = class extends EventEmitter {
|
|
|
1298
1304
|
};
|
|
1299
1305
|
if (response instanceof Error) {
|
|
1300
1306
|
if (response.code === "ETIMEDOUT") {
|
|
1301
|
-
const error2 =
|
|
1307
|
+
const error2 = getRequestError(response, fullRequestOptions, url);
|
|
1302
1308
|
return retry(error2, 'Request timed out! Consider increasing the "connectionRetryTimeout" option.');
|
|
1303
1309
|
}
|
|
1310
|
+
const statusCode = response.statusCode;
|
|
1311
|
+
if (statusCode && RETRYABLE_STATUS_CODES.includes(statusCode)) {
|
|
1312
|
+
const error2 = getRequestError(response, fullRequestOptions, url);
|
|
1313
|
+
return retry(error2, "Request failed with status code " + statusCode);
|
|
1314
|
+
}
|
|
1304
1315
|
this.emit("performance", { request: fullRequestOptions, durationMillisecond, success: false, error: response, retryCount });
|
|
1305
1316
|
throw response;
|
|
1306
1317
|
}
|
|
@@ -1513,7 +1524,7 @@ var WebDriver = class _WebDriver {
|
|
|
1513
1524
|
capabilities["wdio:driverPID"] = driverProcess.pid;
|
|
1514
1525
|
}
|
|
1515
1526
|
const bidiPrototype = {};
|
|
1516
|
-
if (isBidi(capabilities)) {
|
|
1527
|
+
if (isBidi(requestedCapabilities, capabilities)) {
|
|
1517
1528
|
log5.info(`Register BiDi handler for session with id ${sessionId}`);
|
|
1518
1529
|
Object.assign(bidiPrototype, initiateBidi(capabilities.webSocketUrl, options.strictSSL));
|
|
1519
1530
|
}
|
|
@@ -1528,9 +1539,9 @@ var WebDriver = class _WebDriver {
|
|
|
1528
1539
|
}
|
|
1529
1540
|
);
|
|
1530
1541
|
const client = monad(sessionId, customCommandWrapper);
|
|
1531
|
-
if (isBidi(capabilities)) {
|
|
1542
|
+
if (isBidi(requestedCapabilities, capabilities)) {
|
|
1532
1543
|
await client._bidiHandler.connect();
|
|
1533
|
-
client._bidiHandler
|
|
1544
|
+
client._bidiHandler.socket.on("message", parseBidiMessage.bind(client));
|
|
1534
1545
|
}
|
|
1535
1546
|
if (params.enableDirectConnect) {
|
|
1536
1547
|
setupDirectConnect(client);
|
|
@@ -1558,7 +1569,7 @@ var WebDriver = class _WebDriver {
|
|
|
1558
1569
|
const environmentPrototype = getEnvironmentVars(options);
|
|
1559
1570
|
const protocolCommands = getPrototype(options);
|
|
1560
1571
|
const bidiPrototype = {};
|
|
1561
|
-
if (isBidi(options.capabilities)) {
|
|
1572
|
+
if (isBidi(options.requestedCapabilities || {}, options.capabilities || {})) {
|
|
1562
1573
|
const webSocketUrl = options.capabilities?.webSocketUrl;
|
|
1563
1574
|
log5.info(`Register BiDi handler for session with id ${options.sessionId}`);
|
|
1564
1575
|
Object.assign(bidiPrototype, initiateBidi(webSocketUrl, options.strictSSL));
|
|
@@ -1566,7 +1577,7 @@ var WebDriver = class _WebDriver {
|
|
|
1566
1577
|
const prototype = { ...protocolCommands, ...environmentPrototype, ...userPrototype, ...bidiPrototype };
|
|
1567
1578
|
const monad = webdriverMonad(options, modifier, prototype);
|
|
1568
1579
|
const client = monad(options.sessionId, commandWrapper);
|
|
1569
|
-
if (isBidi(options.capabilities)) {
|
|
1580
|
+
if (isBidi(options.requestedCapabilities || {}, options.capabilities || {})) {
|
|
1570
1581
|
client._bidiHandler?.socket.on("message", parseBidiMessage.bind(client));
|
|
1571
1582
|
}
|
|
1572
1583
|
return client;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/request/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,sBAAsB,UAAsC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAO1C,KAA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,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIxF,SAAS,CAAC,kBAAkB,IAAI,MAAM;YAIxB,QAAQ;CAqIzB"}
|
package/build/utils.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare const getSessionError: (err: JSONWPCommandError, params?: Partial
|
|
|
58
58
|
/**
|
|
59
59
|
* return timeout error with information about the executing command on which the test hangs
|
|
60
60
|
*/
|
|
61
|
-
export declare function
|
|
61
|
+
export declare function getRequestError(error: Error, requestOptions: RequestInit, url: URL): Error;
|
|
62
62
|
/**
|
|
63
63
|
* Enhance the monad with WebDriver Bidi primitives if a connection can be established successfully
|
|
64
64
|
* @param socketUrl url to bidi interface
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAW/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAO1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAYxF;;GAEG;AACH,wBAAsB,qBAAqB,CAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,WAAW,CAAC,YAAY,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAW/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAO1C,OAAO,KAAK,EAAE,iBAAiB,EA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wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,GAAG,KAAK,CAS1F;AA+BD;;;;GAIG;AACH,wBAAgB,YAAY,CAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAE,OAAc,GAAG,qBAAqB,CAejG;AAED,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,QAWjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webdriver",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.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",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"types": "./build/index.d.ts",
|
|
20
20
|
"typeScriptVersion": "3.8.3",
|
|
21
21
|
"engines": {
|
|
22
|
-
"node": ">=18"
|
|
22
|
+
"node": ">=18.20.0"
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@types/node": "^20.1.0",
|
|
37
37
|
"@types/ws": "^8.5.3",
|
|
38
|
-
"@wdio/config": "9.0
|
|
39
|
-
"@wdio/logger": "9.0
|
|
40
|
-
"@wdio/protocols": "9.0.
|
|
41
|
-
"@wdio/types": "9.0
|
|
42
|
-
"@wdio/utils": "9.0
|
|
38
|
+
"@wdio/config": "9.1.0",
|
|
39
|
+
"@wdio/logger": "9.1.0",
|
|
40
|
+
"@wdio/protocols": "9.0.8",
|
|
41
|
+
"@wdio/types": "9.1.0",
|
|
42
|
+
"@wdio/utils": "9.1.0",
|
|
43
43
|
"deepmerge-ts": "^7.0.3",
|
|
44
44
|
"ws": "^8.8.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e6b005f5a150c335a105cfc2e386d43ac526adac"
|
|
47
47
|
}
|