@wdio/utils 8.15.0 → 8.15.6

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":"index.d.ts","sourceRoot":"","sources":["../../src/driver/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAyB,MAAM,oBAAoB,CAAA;AAO1D,OAAO,EAA8B,KAAK,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAC7G,OAAO,EAA6B,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACnF,OAAO,EAA4B,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,KAAK,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAA;AAQxD,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,mBAAmB,GAAG,sBAAsB,CAAC,CAAA;AACvI,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;AAID,wBAAsB,cAAc,CAAE,OAAO,EAAE,OAAO,CAAC,SAAS,wCAoH/D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/driver/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAAyB,MAAM,oBAAoB,CAAA;AAO1D,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,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,KAAK,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAA;AAQxD,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,mBAAmB,GAAG,sBAAsB,CAAC,CAAA;AACvI,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;AAID,wBAAsB,cAAc,CAAE,OAAO,EAAE,OAAO,CAAC,SAAS,wCA4H/D"}
@@ -1,4 +1,5 @@
1
1
  import fs from 'node:fs';
2
+ import os from 'node:os';
2
3
  import path from 'node:path';
3
4
  import cp from 'node:child_process';
4
5
  import getPort from 'get-port';
@@ -7,7 +8,7 @@ import logger from '@wdio/logger';
7
8
  import { deepmerge } from 'deepmerge-ts';
8
9
  import { start as startSafaridriver } from 'safaridriver';
9
10
  import { start as startGeckodriver } from 'geckodriver';
10
- import { start as startEdgedriver } from 'edgedriver';
11
+ import { start as startEdgedriver, findEdgePath } from 'edgedriver';
11
12
  import { parseParams, setupChrome, definesRemoteDriver, setupChromedriver, isChrome, isFirefox, isEdge, isSafari, getCacheDir } from './utils.js';
12
13
  import { SUPPORTED_BROWSERNAMES } from '../constants.js';
13
14
  const log = logger('@wdio/utils');
@@ -94,6 +95,13 @@ export async function startWebDriver(options) {
94
95
  * Microsoft Edge is very particular when it comes to browser names
95
96
  */
96
97
  caps.browserName = 'MicrosoftEdge';
98
+ /**
99
+ * on Linux set the path to the Edge binary if not already set
100
+ */
101
+ if (!caps['ms:edgeOptions']?.binary && os.platform() !== 'darwin' && os.platform() !== 'win32') {
102
+ caps['ms:edgeOptions'] = caps['ms:edgeOptions'] || {};
103
+ caps['ms:edgeOptions'].binary = findEdgePath();
104
+ }
97
105
  }
98
106
  else {
99
107
  throw new Error(`Unknown browser name "${caps.browserName}". Make sure to pick from one of the following ` +
@@ -24,11 +24,14 @@ export declare function setupChromedriver(cacheDir: string, driverVersion?: stri
24
24
  export declare function setupGeckodriver(cacheDir: string, driverVersion?: string): Promise<string>;
25
25
  export declare function setupEdgedriver(cacheDir: string, driverVersion?: string): Promise<string>;
26
26
  /**
27
- * helper method to determine if we need to start a browser driver
28
- * which is: whenever the user has set connection options that differ from
29
- * the default, or a port is set
27
+ * helper method to determine if we need to setup a browser driver
28
+ * which is:
29
+ * - whenever the user has set connection options that differ
30
+ * from the default, or a port is set
31
+ * - whenever the user defines `user` and `key` which later will
32
+ * update the connection options
30
33
  */
31
- export declare function definesRemoteDriver(options: Pick<Options.WebDriver, 'protocol' | 'hostname' | 'port' | 'path'>): boolean;
34
+ export declare function definesRemoteDriver(options: Pick<Options.WebDriver, 'user' | 'key' | 'protocol' | 'hostname' | 'port' | 'path'>): boolean;
32
35
  export declare function isChrome(browserName?: string): boolean;
33
36
  export declare function isSafari(browserName?: string): boolean;
34
37
  export declare function isFirefox(browserName?: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/driver/utils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAOxD,wBAAgB,WAAW,CAAC,MAAM,EAAE,oBA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AA;AAOxD,wBAAgB,WAAW,CAAC,MAAM,EAAE,oBAAoB,YAYvD;AAED,wBAAgB,kBAAkB,uBAOjC;AAED,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,MAAM,sBAenD;AAGD,eAAO,MAAM,wBAAwB,aAAc,MAAM,mBAAmB,MAAM,cAAc,MAAM,SAOrG,CAAA;AAED,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,YAAY;;;;;;;;;;;;GAmDlF;AAED,wBAAgB,WAAW,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,YAAY,UASzG;AAED,wBAAsB,iBAAiB,CAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM;;GA8DhF;AAED,wBAAgB,gBAAgB,CAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,mBAEzE;AAED,wBAAgB,eAAe,CAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,mBAExE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC,WAQ/H;AAED,wBAAgB,QAAQ,CAAE,WAAW,CAAC,EAAE,MAAM,WAE7C;AACD,wBAAgB,QAAQ,CAAE,WAAW,CAAC,EAAE,MAAM,WAE7C;AACD,wBAAgB,SAAS,CAAE,WAAW,CAAC,EAAE,MAAM,WAE9C;AACD,wBAAgB,MAAM,CAAE,WAAW,CAAC,EAAE,MAAM,WAE3C"}
@@ -183,15 +183,19 @@ export function setupEdgedriver(cacheDir, driverVersion) {
183
183
  return downloadEdgedriver(driverVersion, cacheDir);
184
184
  }
185
185
  /**
186
- * helper method to determine if we need to start a browser driver
187
- * which is: whenever the user has set connection options that differ from
188
- * the default, or a port is set
186
+ * helper method to determine if we need to setup a browser driver
187
+ * which is:
188
+ * - whenever the user has set connection options that differ
189
+ * from the default, or a port is set
190
+ * - whenever the user defines `user` and `key` which later will
191
+ * update the connection options
189
192
  */
190
193
  export function definesRemoteDriver(options) {
191
194
  return Boolean((options.protocol && options.protocol !== DEFAULT_PROTOCOL) ||
192
195
  (options.hostname && options.hostname !== DEFAULT_HOSTNAME) ||
193
196
  Boolean(options.port) ||
194
- (options.path && options.path !== DEFAULT_PATH));
197
+ (options.path && options.path !== DEFAULT_PATH) ||
198
+ Boolean(options.user && options.key));
195
199
  }
196
200
  export function isChrome(browserName) {
197
201
  return Boolean(browserName && SUPPORTED_BROWSERNAMES.chrome.includes(browserName.toLowerCase()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/utils",
3
- "version": "8.15.0",
3
+ "version": "8.15.6",
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",
@@ -36,7 +36,7 @@
36
36
  "chrome-launcher": "^1.0.0",
37
37
  "decamelize": "^6.0.0",
38
38
  "deepmerge-ts": "^5.1.0",
39
- "edgedriver": "^5.3.3",
39
+ "edgedriver": "^5.3.5",
40
40
  "geckodriver": "^4.2.0",
41
41
  "get-port": "^7.0.0",
42
42
  "got": "^13.0.0",
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "78e199c5ffd74bdf3a5576952c3834c29afa989f"
50
+ "gitHead": "c205398c7773823b1eb365a5abeadbcc2fb6b8a3"
51
51
  }