@wdio/utils 9.11.0 → 9.12.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.
@@ -25,6 +25,8 @@ export declare function capabilitiesEnvironmentDetector(capabilities: WebdriverI
25
25
  isSauce: boolean;
26
26
  isBidi: boolean;
27
27
  isChromium: boolean;
28
+ isWindowsApp: boolean;
29
+ isMacApp: boolean;
28
30
  };
29
31
  /**
30
32
  * returns information about the environment when the session is created
@@ -46,5 +48,7 @@ export declare function sessionEnvironmentDetector({ capabilities, requestedCapa
46
48
  isSeleniumStandalone: boolean;
47
49
  isBidi: boolean;
48
50
  isChromium: boolean;
51
+ isWindowsApp: boolean;
52
+ isMacApp: boolean;
49
53
  };
50
54
  //# sourceMappingURL=envDetector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"envDetector.d.ts","sourceRoot":"","sources":["../src/envDetector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAS/C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,WAqC5D;AAgKD;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,YAAY,WAM5D;AAoCD;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,WAAW,CAAC,YAAY;;;;;;;;;EAWrF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,EACvC,YAAY,EACZ,qBAAqB,EACxB,EAAE;IACC,YAAY,EAAE,WAAW,CAAC,YAAY,CAAC;IACvC,qBAAqB,EAAE,YAAY,CAAC,+BAA+B,CAAA;CACtE;;;;;;;;;;;EAaA"}
1
+ {"version":3,"file":"envDetector.d.ts","sourceRoot":"","sources":["../src/envDetector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAS/C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,WAqC5D;AAgND;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,YAAY,WAM5D;AAoCD;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,WAAW,CAAC,YAAY;;;;;;;;;;;EAarF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,EACvC,YAAY,EACZ,qBAAqB,EACxB,EAAE;IACC,YAAY,EAAE,WAAW,CAAC,YAAY,CAAC;IACvC,qBAAqB,EAAE,YAAY,CAAC,+BAA+B,CAAA;CACtE;;;;;;;;;;;;;EAeA"}
package/build/index.js CHANGED
@@ -1303,11 +1303,14 @@ function isFirefox(capabilities) {
1303
1303
  }
1304
1304
  return capabilities.browserName === "firefox" || Boolean(Object.keys(capabilities).find((cap) => cap.startsWith("moz:")));
1305
1305
  }
1306
+ function getAutomationName(capabilities) {
1307
+ return capabilities["appium:options"]?.automationName || capabilities["appium:automationName"];
1308
+ }
1306
1309
  function isMobile(capabilities) {
1307
1310
  const browserName = (capabilities.browserName || "").toLowerCase();
1308
1311
  const bsOptions = capabilities["bstack:options"] || {};
1309
1312
  const browserstackBrowserName = (bsOptions.browserName || "").toLowerCase();
1310
- const automationName = capabilities["appium:options"]?.automationName || capabilities["appium:automationName"];
1313
+ const automationName = getAutomationName(capabilities);
1311
1314
  if (automationName && ["gecko", "safari", "chrome", "chromium"].includes(automationName.toLocaleLowerCase())) {
1312
1315
  return false;
1313
1316
  }
@@ -1345,6 +1348,22 @@ function isAndroid(capabilities) {
1345
1348
  capabilities.platformName && capabilities.platformName.match(/Android/i) || /Android/i.test(bsOptions.platformName || "") || /Android/i.test(bsOptions.browserName || "") || capabilities.browserName && capabilities.browserName.match(/Android/i)
1346
1349
  );
1347
1350
  }
1351
+ function matchesAppAutomationName(automationNameValue, capabilities) {
1352
+ if (!capabilities) {
1353
+ return false;
1354
+ }
1355
+ const automationName = getAutomationName(capabilities);
1356
+ if (!automationName) {
1357
+ return false;
1358
+ }
1359
+ return Boolean(automationName.match(new RegExp(automationNameValue, "i")));
1360
+ }
1361
+ function isWindowsApp(capabilities) {
1362
+ return matchesAppAutomationName("windows", capabilities);
1363
+ }
1364
+ function isMacApp(capabilities) {
1365
+ return matchesAppAutomationName("mac2", capabilities);
1366
+ }
1348
1367
  function isSauce(capabilities) {
1349
1368
  if (!capabilities) {
1350
1369
  return false;
@@ -1390,7 +1409,9 @@ function capabilitiesEnvironmentDetector(capabilities) {
1390
1409
  isAndroid: isAndroid(capabilities),
1391
1410
  isSauce: isSauce(capabilities),
1392
1411
  isBidi: isBidi(capabilities),
1393
- isChromium: isChromium(capabilities)
1412
+ isChromium: isChromium(capabilities),
1413
+ isWindowsApp: isWindowsApp(capabilities),
1414
+ isMacApp: isMacApp(capabilities)
1394
1415
  };
1395
1416
  }
1396
1417
  function sessionEnvironmentDetector({
@@ -1407,7 +1428,9 @@ function sessionEnvironmentDetector({
1407
1428
  isSauce: isSauce(requestedCapabilities),
1408
1429
  isSeleniumStandalone: isSeleniumStandalone(capabilities),
1409
1430
  isBidi: isBidi(capabilities),
1410
- isChromium: isChromium(capabilities)
1431
+ isChromium: isChromium(capabilities),
1432
+ isWindowsApp: isWindowsApp(capabilities),
1433
+ isMacApp: isMacApp(capabilities)
1411
1434
  };
1412
1435
  }
1413
1436
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"startWebDriver.d.ts","sourceRoot":"","sources":["../../src/node/startWebDriver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,MAAM,oBAAoB,CAAA;AAQ1D,OAAO,EAA8B,KAAK,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAC7G,OAAO,EAA6B,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACnF,OAAO,EAA0C,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAC9F,OAAO,KAAK,EAAE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,CAAC,GACjF,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAC3C,CAAA;AACD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,WAAW,CAAC;QAClB,UAAU,mBAAoB,SAAQ,sBAAsB;SAAG;QAC/D,UAAU,kBAAmB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC;SAAG;QAC3E,UAAU,iBAAkB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;SAAG;QACzE,UAAU,mBAAoB,SAAQ,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC;SAAG;KAChF;CACJ;AAMD,wBAAsB,cAAc,CAAE,OAAO,EAAE,YAAY,CAAC,YAAY,wCAwJvE"}
package/build/node.js CHANGED
@@ -284,6 +284,7 @@ function isEdge(browserName) {
284
284
  // src/node/startWebDriver.ts
285
285
  var log2 = logger2("@wdio/utils");
286
286
  var DRIVER_WAIT_TIMEOUT = 10 * 1e3;
287
+ var DRIVER_RETRY_INTERVAL = 100;
287
288
  async function startWebDriver(options) {
288
289
  if (process.env.WDIO_SKIP_DRIVER_SETUP) {
289
290
  options.hostname = "localhost";
@@ -376,7 +377,7 @@ If you like to run a local browser session make sure to pick from one of the fol
376
377
  driverProcess.stdout?.pipe(split2()).on("data", driverLog.info.bind(driverLog));
377
378
  driverProcess.stderr?.pipe(split2()).on("data", driverLog.warn.bind(driverLog));
378
379
  }
379
- await waitPort({ port, output: "silent", timeout: DRIVER_WAIT_TIMEOUT }).catch((e) => {
380
+ await waitPort({ port, output: "silent", timeout: DRIVER_WAIT_TIMEOUT, interval: DRIVER_RETRY_INTERVAL }).catch((e) => {
380
381
  throw new Error(`Timed out to connect to ${driver}: ${e.message}`);
381
382
  });
382
383
  options.hostname = "localhost";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/utils",
3
- "version": "9.11.0",
3
+ "version": "9.12.2",
4
4
  "description": "A WDIO helper utility to provide several utility functions used across the project.",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-utils",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@puppeteer/browsers": "^2.2.0",
41
41
  "@wdio/logger": "9.4.4",
42
- "@wdio/types": "9.10.1",
42
+ "@wdio/types": "9.12.2",
43
43
  "decamelize": "^6.0.0",
44
44
  "deepmerge-ts": "^7.0.3",
45
45
  "edgedriver": "^6.1.1",
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "79a39e09a5eeabebac2f068b8d29f0ae4921fa20"
57
+ "gitHead": "dc30cc8863706e3522c78ebb75b0c4a44746aa5b"
58
58
  }