@wdio/utils 9.2.8 → 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.
@@ -6,11 +6,11 @@ import type { Capabilities } from '@wdio/types';
6
6
  */
7
7
  export declare function isW3C(capabilities?: WebdriverIO.Capabilities): boolean;
8
8
  /**
9
- * detects if session has support for WebDriver Bidi
10
- * @param {object} capabilities session capabilities
9
+ * Detects if session has support for WebDriver Bidi.
10
+ * @param {object} capabilities resolved session capabilities send back from the driver
11
11
  * @return {Boolean} true if session has WebDriver Bidi support
12
12
  */
13
- export declare function isBidi(requestedCapabilities: Capabilities.RequestedStandaloneCapabilities, capabilities: WebdriverIO.Capabilities): boolean;
13
+ export declare function isBidi(capabilities: WebdriverIO.Capabilities): boolean;
14
14
  /**
15
15
  * returns information about the environment before the session is created
16
16
  * @param {Object} capabilities caps provided by user
@@ -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;AAU/C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,WAqC5D;AAsJD;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,qBAAqB,EAAE,YAAY,CAAC,+BAA+B,EAAE,YAAY,EAAE,WAAW,CAAC,YAAY,WAUjI;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;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"}
package/build/index.js CHANGED
@@ -1227,7 +1227,6 @@ function addMochaCommands(origFn, newFn) {
1227
1227
  }
1228
1228
 
1229
1229
  // src/envDetector.ts
1230
- var APPIUM_CAPABILITY_PREFIX = "appium:";
1231
1230
  var MOBILE_BROWSER_NAMES = ["ipad", "iphone", "android"];
1232
1231
  var MOBILE_CAPABILITIES = [
1233
1232
  "appium-version",
@@ -1286,6 +1285,10 @@ function isMobile(capabilities) {
1286
1285
  const browserName = (capabilities.browserName || "").toLowerCase();
1287
1286
  const bsOptions = capabilities["bstack:options"] || {};
1288
1287
  const browserstackBrowserName = (bsOptions.browserName || "").toLowerCase();
1288
+ const automationName = capabilities["appium:options"]?.automationName || capabilities["appium:automationName"];
1289
+ if (automationName && ["gecko", "safari", "chrome", "chromium"].includes(automationName.toLocaleLowerCase())) {
1290
+ return false;
1291
+ }
1289
1292
  return Boolean(
1290
1293
  /**
1291
1294
  * If the device is ios, tvos or android, the device might be mobile.
@@ -1329,16 +1332,10 @@ function isSauce(capabilities) {
1329
1332
  caps["sauce:options"] && caps["sauce:options"].extendedDebugging
1330
1333
  );
1331
1334
  }
1332
- function isAppiumCapability2(capabilityName) {
1333
- return capabilityName.startsWith(APPIUM_CAPABILITY_PREFIX);
1334
- }
1335
- function isBidi(requestedCapabilities, capabilities) {
1335
+ function isBidi(capabilities) {
1336
1336
  if (!capabilities) {
1337
1337
  return false;
1338
1338
  }
1339
- if (Object.keys(requestedCapabilities).some(isAppiumCapability2)) {
1340
- return false;
1341
- }
1342
1339
  return typeof capabilities.webSocketUrl === "string";
1343
1340
  }
1344
1341
  function isSeleniumStandalone(capabilities) {
@@ -1370,7 +1367,7 @@ function capabilitiesEnvironmentDetector(capabilities) {
1370
1367
  isIOS: isIOS(capabilities),
1371
1368
  isAndroid: isAndroid(capabilities),
1372
1369
  isSauce: isSauce(capabilities),
1373
- isBidi: isBidi({}, capabilities),
1370
+ isBidi: isBidi(capabilities),
1374
1371
  isChromium: isChromium(capabilities)
1375
1372
  };
1376
1373
  }
@@ -1387,7 +1384,7 @@ function sessionEnvironmentDetector({
1387
1384
  isAndroid: isAndroid(capabilities),
1388
1385
  isSauce: isSauce(requestedCapabilities),
1389
1386
  isSeleniumStandalone: isSeleniumStandalone(capabilities),
1390
- isBidi: isBidi(requestedCapabilities, capabilities),
1387
+ isBidi: isBidi(capabilities),
1391
1388
  isChromium: isChromium(capabilities)
1392
1389
  };
1393
1390
  }
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/node/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AA0GxD,wBAAsB,WAAW,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,sBAAsB,kCAe7H;AAED,wBAAgB,YAAY,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,sBAAsB,kCAYxH"}
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/node/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AA4GxD,wBAAsB,WAAW,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,sBAAsB,kCAqB7H;AAED,wBAAgB,YAAY,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,sBAAsB,kCAYxH"}
package/build/node.js CHANGED
@@ -388,6 +388,7 @@ If you like to run a local browser session make sure to pick from one of the fol
388
388
  import logger3 from "@wdio/logger";
389
389
  var log3 = logger3("@wdio/utils");
390
390
  var UNDEFINED_BROWSER_VERSION = null;
391
+ var firefoxChannels = ["stable", "latest"];
391
392
  function mapCapabilities(options, caps, task, taskItemLabel) {
392
393
  const capabilitiesToRequireSetup = (Array.isArray(caps) ? caps.map((cap) => {
393
394
  const w3cCaps = cap;
@@ -450,7 +451,7 @@ async function setupDriver(options, caps) {
450
451
  if (isEdge(cap.browserName)) {
451
452
  return setupEdgedriver(cacheDir, cap.browserVersion);
452
453
  } else if (isFirefox(cap.browserName)) {
453
- const version = cap.browserVersion === "latest" ? void 0 : cap.browserVersion;
454
+ const version = firefoxChannels.includes(cap.browserVersion ?? "") ? void 0 : cap.browserVersion;
454
455
  return setupGeckodriver(cacheDir, version);
455
456
  } else if (isChrome(cap.browserName)) {
456
457
  return setupChromedriver(cacheDir, cap.browserVersion);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/utils",
3
- "version": "9.2.8",
3
+ "version": "9.4.3",
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",
@@ -38,20 +38,20 @@
38
38
  "dependencies": {
39
39
  "@puppeteer/browsers": "^2.2.0",
40
40
  "@wdio/logger": "9.1.3",
41
- "@wdio/types": "9.2.2",
41
+ "@wdio/types": "9.4.3",
42
42
  "decamelize": "^6.0.0",
43
43
  "deepmerge-ts": "^7.0.3",
44
- "edgedriver": "^5.6.1",
45
- "geckodriver": "^4.3.3",
44
+ "edgedriver": "^6.1.1",
45
+ "geckodriver": "^5.0.0",
46
46
  "get-port": "^7.0.0",
47
47
  "import-meta-resolve": "^4.0.0",
48
48
  "locate-app": "^2.2.24",
49
- "safaridriver": "^0.1.2",
49
+ "safaridriver": "^1.0.0",
50
50
  "split2": "^4.2.0",
51
51
  "wait-port": "^1.1.0"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "f02604aee33fb785a1737db3c9092bacfc99a1f3"
56
+ "gitHead": "8ee63eaefd86cf06eea832bb8d4c1920e9cc4e55"
57
57
  }