webdriver 9.4.1 → 9.4.3

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.
@@ -1 +1 @@
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,GAAG,EAAE,KAAG,OAAO,CAAC,iBAAiB,GAAG,aAAa,GAAG,IAAI,CAAC,CA0K9H"}
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,GAAG,EAAE,KAAG,OAAO,CAAC,iBAAiB,GAAG,aAAa,GAAG,IAAI,CAAC,CA6K9H"}
package/build/index.js CHANGED
@@ -146,6 +146,9 @@ function command_default(method, endpointUri, commandInfo, doubleEncodeVariables
146
146
  }
147
147
  }
148
148
  return result.value;
149
+ }).catch((error) => {
150
+ this.emit("result", { command, method, endpoint, body, result: { error } });
151
+ throw error;
149
152
  });
150
153
  };
151
154
  }
@@ -1202,6 +1205,21 @@ var getSessionError = (err, params = {}) => {
1202
1205
  return err.message;
1203
1206
  };
1204
1207
  function initiateBidi(socketUrl, strictSSL = true) {
1208
+ const isUnitTesting = process.env.WDIO_UNIT_TESTS;
1209
+ if (isUnitTesting) {
1210
+ log3.info("Skip connecting to WebDriver Bidi interface due to unit tests");
1211
+ return {
1212
+ _bidiHandler: {
1213
+ value: {
1214
+ isConnected: true,
1215
+ waitForConnected: () => Promise.resolve(),
1216
+ socket: { on: () => {
1217
+ }, off: () => {
1218
+ } }
1219
+ }
1220
+ }
1221
+ };
1222
+ }
1205
1223
  socketUrl = socketUrl.replace("localhost", "127.0.0.1");
1206
1224
  const bidiReqOpts = strictSSL ? {} : { rejectUnauthorized: false };
1207
1225
  const handler = new BidiHandler(socketUrl, bidiReqOpts);
@@ -1260,7 +1278,7 @@ var WebDriver = class _WebDriver {
1260
1278
  capabilities["wdio:driverPID"] = driverProcess.pid;
1261
1279
  }
1262
1280
  const bidiPrototype = {};
1263
- if (isBidi(requestedCapabilities, capabilities)) {
1281
+ if (isBidi(capabilities)) {
1264
1282
  log4.info("Register BiDi handler for session with id ".concat(sessionId));
1265
1283
  Object.assign(bidiPrototype, initiateBidi(capabilities.webSocketUrl, options.strictSSL));
1266
1284
  }
@@ -1275,7 +1293,7 @@ var WebDriver = class _WebDriver {
1275
1293
  }
1276
1294
  );
1277
1295
  const client = monad(sessionId, customCommandWrapper);
1278
- if (isBidi(requestedCapabilities, capabilities)) {
1296
+ if (isBidi(capabilities)) {
1279
1297
  await client._bidiHandler.waitForConnected();
1280
1298
  client._bidiHandler.socket.on("message", parseBidiMessage.bind(client));
1281
1299
  }
@@ -1306,7 +1324,7 @@ var WebDriver = class _WebDriver {
1306
1324
  const environmentPrototype = getEnvironmentVars(options);
1307
1325
  const protocolCommands = getPrototype(options);
1308
1326
  const bidiPrototype = {};
1309
- if (isBidi(options.requestedCapabilities || {}, options.capabilities || {})) {
1327
+ if (isBidi(options.capabilities || {})) {
1310
1328
  const webSocketUrl = (_a = options.capabilities) == null ? void 0 : _a.webSocketUrl;
1311
1329
  log4.info("Register BiDi handler for session with id ".concat(options.sessionId));
1312
1330
  Object.assign(bidiPrototype, initiateBidi(webSocketUrl, options.strictSSL));
@@ -1314,7 +1332,7 @@ var WebDriver = class _WebDriver {
1314
1332
  const prototype = { ...protocolCommands, ...environmentPrototype, ...userPrototype, ...bidiPrototype };
1315
1333
  const monad = webdriverMonad(options, modifier, prototype);
1316
1334
  const client = monad(options.sessionId, commandWrapper);
1317
- if (isBidi(options.requestedCapabilities || {}, options.capabilities || {})) {
1335
+ if (isBidi(options.capabilities || {})) {
1318
1336
  (_b = client._bidiHandler) == null ? void 0 : _b.socket.on("message", parseBidiMessage.bind(client));
1319
1337
  }
1320
1338
  return client;
@@ -1359,7 +1377,7 @@ var WebDriver = class _WebDriver {
1359
1377
  instance.capabilities = newSessionCapabilities;
1360
1378
  instance.capabilities["wdio:driverPID"] = driverPid;
1361
1379
  Object.assign(instance.requestedCapabilities, capabilities);
1362
- if (isBidi(instance.requestedCapabilities || {}, instance.capabilities || {})) {
1380
+ if (isBidi(instance.capabilities || {})) {
1363
1381
  const bidiReqOpts = instance.options.strictSSL ? {} : { rejectUnauthorized: false };
1364
1382
  await ((_a = instance._bidiHandler) == null ? void 0 : _a.reconnect(newSessionCapabilities.webSocketUrl, bidiReqOpts));
1365
1383
  }
@@ -1529,7 +1547,7 @@ var WebDriverResponseError = class _WebDriverResponseError extends WebDriverErro
1529
1547
  // package.json
1530
1548
  var package_default = {
1531
1549
  name: "webdriver",
1532
- version: "9.4.0",
1550
+ version: "9.4.2",
1533
1551
  description: "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
1534
1552
  author: "Christian Bromann <mail@bromann.dev>",
1535
1553
  homepage: "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
package/build/node.js CHANGED
@@ -138,6 +138,9 @@ Actual: ${actual}` + moreInfo
138
138
  }
139
139
  }
140
140
  return result.value;
141
+ }).catch((error) => {
142
+ this.emit("result", { command, method, endpoint, body, result: { error } });
143
+ throw error;
141
144
  });
142
145
  };
143
146
  }
@@ -1185,6 +1188,21 @@ It seems like the service failed to start or is rejecting any connections.`;
1185
1188
  return err.message;
1186
1189
  };
1187
1190
  function initiateBidi(socketUrl, strictSSL = true) {
1191
+ const isUnitTesting = process.env.WDIO_UNIT_TESTS;
1192
+ if (isUnitTesting) {
1193
+ log3.info("Skip connecting to WebDriver Bidi interface due to unit tests");
1194
+ return {
1195
+ _bidiHandler: {
1196
+ value: {
1197
+ isConnected: true,
1198
+ waitForConnected: () => Promise.resolve(),
1199
+ socket: { on: () => {
1200
+ }, off: () => {
1201
+ } }
1202
+ }
1203
+ }
1204
+ };
1205
+ }
1188
1206
  socketUrl = socketUrl.replace("localhost", "127.0.0.1");
1189
1207
  const bidiReqOpts = strictSSL ? {} : { rejectUnauthorized: false };
1190
1208
  const handler = new BidiHandler(socketUrl, bidiReqOpts);
@@ -1243,7 +1261,7 @@ var WebDriver = class _WebDriver {
1243
1261
  capabilities["wdio:driverPID"] = driverProcess.pid;
1244
1262
  }
1245
1263
  const bidiPrototype = {};
1246
- if (isBidi(requestedCapabilities, capabilities)) {
1264
+ if (isBidi(capabilities)) {
1247
1265
  log4.info(`Register BiDi handler for session with id ${sessionId}`);
1248
1266
  Object.assign(bidiPrototype, initiateBidi(capabilities.webSocketUrl, options.strictSSL));
1249
1267
  }
@@ -1258,7 +1276,7 @@ var WebDriver = class _WebDriver {
1258
1276
  }
1259
1277
  );
1260
1278
  const client = monad(sessionId, customCommandWrapper);
1261
- if (isBidi(requestedCapabilities, capabilities)) {
1279
+ if (isBidi(capabilities)) {
1262
1280
  await client._bidiHandler.waitForConnected();
1263
1281
  client._bidiHandler.socket.on("message", parseBidiMessage.bind(client));
1264
1282
  }
@@ -1288,7 +1306,7 @@ var WebDriver = class _WebDriver {
1288
1306
  const environmentPrototype = getEnvironmentVars(options);
1289
1307
  const protocolCommands = getPrototype(options);
1290
1308
  const bidiPrototype = {};
1291
- if (isBidi(options.requestedCapabilities || {}, options.capabilities || {})) {
1309
+ if (isBidi(options.capabilities || {})) {
1292
1310
  const webSocketUrl = options.capabilities?.webSocketUrl;
1293
1311
  log4.info(`Register BiDi handler for session with id ${options.sessionId}`);
1294
1312
  Object.assign(bidiPrototype, initiateBidi(webSocketUrl, options.strictSSL));
@@ -1296,7 +1314,7 @@ var WebDriver = class _WebDriver {
1296
1314
  const prototype = { ...protocolCommands, ...environmentPrototype, ...userPrototype, ...bidiPrototype };
1297
1315
  const monad = webdriverMonad(options, modifier, prototype);
1298
1316
  const client = monad(options.sessionId, commandWrapper);
1299
- if (isBidi(options.requestedCapabilities || {}, options.capabilities || {})) {
1317
+ if (isBidi(options.capabilities || {})) {
1300
1318
  client._bidiHandler?.socket.on("message", parseBidiMessage.bind(client));
1301
1319
  }
1302
1320
  return client;
@@ -1340,7 +1358,7 @@ var WebDriver = class _WebDriver {
1340
1358
  instance.capabilities = newSessionCapabilities;
1341
1359
  instance.capabilities["wdio:driverPID"] = driverPid;
1342
1360
  Object.assign(instance.requestedCapabilities, capabilities);
1343
- if (isBidi(instance.requestedCapabilities || {}, instance.capabilities || {})) {
1361
+ if (isBidi(instance.capabilities || {})) {
1344
1362
  const bidiReqOpts = instance.options.strictSSL ? {} : { rejectUnauthorized: false };
1345
1363
  await instance._bidiHandler?.reconnect(newSessionCapabilities.webSocketUrl, bidiReqOpts);
1346
1364
  }
@@ -1467,7 +1485,7 @@ var WebDriverResponseError = class _WebDriverResponseError extends WebDriverErro
1467
1485
  // package.json
1468
1486
  var package_default = {
1469
1487
  name: "webdriver",
1470
- version: "9.4.0",
1488
+ version: "9.4.2",
1471
1489
  description: "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol",
1472
1490
  author: "Christian Bromann <mail@bromann.dev>",
1473
1491
  homepage: "https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver",
@@ -1 +1 @@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K;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,QAgBhD;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAS,kBAAkB,WAAU,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,WAmD1F,CAAA;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAE,OAAc,GAAG,qBAAqB,CA0CjG;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.4.1",
3
+ "version": "9.4.3",
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.2.8",
41
+ "@wdio/config": "9.4.3",
42
42
  "@wdio/logger": "9.1.3",
43
43
  "@wdio/protocols": "9.2.2",
44
- "@wdio/types": "9.2.2",
45
- "@wdio/utils": "9.2.8",
44
+ "@wdio/types": "9.4.3",
45
+ "@wdio/utils": "9.4.3",
46
46
  "deepmerge-ts": "^7.0.3",
47
47
  "undici": "^6.20.1",
48
48
  "ws": "^8.8.0"
49
49
  },
50
- "gitHead": "237685b97c0cee717c98ae9e906f738dab81004f"
50
+ "gitHead": "8ee63eaefd86cf06eea832bb8d4c1920e9cc4e55"
51
51
  }