@wdio/utils 9.17.0 → 9.19.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 +1 -1
- package/build/node/startWebDriver.d.ts.map +1 -1
- package/build/node/utils.d.ts +7 -0
- package/build/node/utils.d.ts.map +1 -1
- package/build/node.js +24 -7
- package/package.json +5 -5
package/build/index.js
CHANGED
|
@@ -175,7 +175,7 @@ function commandCallStructure(commandName, args, unfurl = false) {
|
|
|
175
175
|
* - Returned async functions: `return async function` or `return (async function`
|
|
176
176
|
* - Arrow functions: `() =>` or `param =>` or `(param1, param2) =>`
|
|
177
177
|
*/
|
|
178
|
-
/^\s*(?:(?:async\s+)?function
|
|
178
|
+
/^\s*(?:(?:async\s+)?function(?:\s+\w+)?\s*\(|!function\(|return\s+\(?(?:async\s+)?function|\([^)]*\)\s*=>|\w+\s*=>)/.test(arg.trim())) {
|
|
179
179
|
arg = "<fn>";
|
|
180
180
|
} else if (typeof arg === "string" && /**
|
|
181
181
|
* the isBase64 method returns for xPath values like
|
|
@@ -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,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM/C,MAAM,MAAM,sBAAsB,GAAG,CACjC,OAAO,CAAC,cAAc,CAAC,GACvB,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,mBAAm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,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,wCA0JvE"}
|
package/build/node/utils.d.ts
CHANGED
|
@@ -25,4 +25,11 @@ export declare function setupChromedriver(cacheDir: string, driverVersion?: stri
|
|
|
25
25
|
}>;
|
|
26
26
|
export declare function setupGeckodriver(cacheDir: string, driverVersion?: string): Promise<string>;
|
|
27
27
|
export declare function setupEdgedriver(cacheDir: string, driverVersion?: string): Promise<string>;
|
|
28
|
+
export declare function generateDefaultPrefs(caps: WebdriverIO.Capabilities): {
|
|
29
|
+
prefs?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
prefs: {
|
|
32
|
+
'profile.password_manager_leak_detection': boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
28
35
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAK1C;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,YAWtC,CAAA;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,oBAAoB,YAYvD;AAED,wBAAgB,sBAAsB,CAAC,UAAU,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAK1C;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,YAWtC,CAAA;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,oBAAoB,YAYvD;AAED,wBAAgB,sBAAsB,CAAC,UAAU,CAAC,EAAE,MAAM,sBA6BzD;AAED,wBAAsB,uBAAuB,CAAC,WAAW,CAAC,EAAE,MAAM,+BAyBjE;AAGD,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,EAAE,iBAAiB,MAAM,EAAE,YAAY,MAAM,SAOrG,CAAA;AAgCD,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,YAAY;;;;;;GA2G3F;AAED,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,WAAW,CAAC,YAAY,oGAS/D;AAED,wBAAgB,WAAW,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,YAAY,UAGxG;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAC,MAAM,UAM3D;AAED,wBAAsB,iBAAiB,CAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM;;GAgDhF;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,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY;;;;;;EAIlE"}
|
package/build/node.js
CHANGED
|
@@ -64,10 +64,16 @@ function getBuildIdByChromePath(chromePath) {
|
|
|
64
64
|
const oldest = versions.sort((a, b) => a > b ? -1 : 1)[0];
|
|
65
65
|
return oldest;
|
|
66
66
|
}
|
|
67
|
-
const
|
|
68
|
-
|
|
67
|
+
const result = cp.spawnSync(chromePath, ["--version", "--no-sandbox"], {
|
|
68
|
+
encoding: "utf8",
|
|
69
|
+
env: process.env
|
|
70
|
+
});
|
|
71
|
+
if (result.error) {
|
|
72
|
+
throw result.error;
|
|
73
|
+
}
|
|
74
|
+
const versionSanitized = result.stdout.trim().split(" ").find((s) => s.split(".").length === 4);
|
|
69
75
|
if (!versionSanitized) {
|
|
70
|
-
throw new Error(`Couldn't find valid Chrome version from "${
|
|
76
|
+
throw new Error(`Couldn't find valid Chrome version from "${result.stdout}", please raise an issue in the WebdriverIO project (https://github.com/webdriverio/webdriverio/issues/new/choose)`);
|
|
71
77
|
}
|
|
72
78
|
return versionSanitized;
|
|
73
79
|
}
|
|
@@ -78,10 +84,16 @@ async function getBuildIdByFirefoxPath(firefoxPath) {
|
|
|
78
84
|
if (os.platform() === "win32") {
|
|
79
85
|
const appPath = path.dirname(firefoxPath);
|
|
80
86
|
const contents = (await fsp.readFile(path.join(appPath, "application.ini"))).toString("utf-8");
|
|
81
|
-
return contents.split("\n").filter((line) => line.startsWith("Version=")).map((line) => line.replace(
|
|
87
|
+
return contents.split("\n").filter((line) => line.startsWith("Version=")).map((line) => line.replace(/Version=/g, "").replace(/\r/g, "")).pop();
|
|
82
88
|
}
|
|
83
|
-
const
|
|
84
|
-
|
|
89
|
+
const result = cp.spawnSync(firefoxPath, ["--version"], {
|
|
90
|
+
encoding: "utf8",
|
|
91
|
+
env: process.env
|
|
92
|
+
});
|
|
93
|
+
if (result.error) {
|
|
94
|
+
throw result.error;
|
|
95
|
+
}
|
|
96
|
+
return result.stdout.trim().split(" ").pop()?.trim();
|
|
85
97
|
}
|
|
86
98
|
var lastTimeCalled = Date.now();
|
|
87
99
|
var downloadProgressCallback = (artifact, downloadedBytes, totalBytes) => {
|
|
@@ -237,6 +249,9 @@ function setupGeckodriver(cacheDir, driverVersion) {
|
|
|
237
249
|
function setupEdgedriver(cacheDir, driverVersion) {
|
|
238
250
|
return downloadEdgedriver(driverVersion, cacheDir);
|
|
239
251
|
}
|
|
252
|
+
function generateDefaultPrefs(caps) {
|
|
253
|
+
return caps["goog:chromeOptions"]?.debuggerAddress ? {} : { prefs: { "profile.password_manager_leak_detection": false } };
|
|
254
|
+
}
|
|
240
255
|
|
|
241
256
|
// src/utils.ts
|
|
242
257
|
import fs2 from "node:fs/promises";
|
|
@@ -311,8 +326,10 @@ If you like to run a local browser session make sure to pick from one of the fol
|
|
|
311
326
|
const chromedriverBinary = chromedriverOptions.binary || process.env.CHROMEDRIVER_PATH;
|
|
312
327
|
const { executablePath: chromeExecuteablePath, browserVersion } = await setupPuppeteerBrowser(cacheDir, caps);
|
|
313
328
|
const { executablePath: chromedriverExcecuteablePath } = chromedriverBinary ? { executablePath: chromedriverBinary } : await setupChromedriver(cacheDir, browserVersion);
|
|
329
|
+
const prefs = generateDefaultPrefs(caps);
|
|
314
330
|
caps["goog:chromeOptions"] = deepmerge(
|
|
315
|
-
{ binary: chromeExecuteablePath
|
|
331
|
+
{ binary: chromeExecuteablePath },
|
|
332
|
+
prefs,
|
|
316
333
|
caps["goog:chromeOptions"] || {}
|
|
317
334
|
);
|
|
318
335
|
chromedriverOptions.allowedOrigins = chromedriverOptions.allowedOrigins || ["*"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.19.0",
|
|
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,11 +38,11 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@puppeteer/browsers": "^2.2.0",
|
|
41
|
-
"@wdio/logger": "9.
|
|
42
|
-
"@wdio/types": "9.
|
|
41
|
+
"@wdio/logger": "9.18.0",
|
|
42
|
+
"@wdio/types": "9.19.0",
|
|
43
43
|
"decamelize": "^6.0.0",
|
|
44
44
|
"deepmerge-ts": "^7.0.3",
|
|
45
|
-
"edgedriver": "^6.1.
|
|
45
|
+
"edgedriver": "^6.1.2",
|
|
46
46
|
"geckodriver": "^5.0.0",
|
|
47
47
|
"get-port": "^7.0.0",
|
|
48
48
|
"import-meta-resolve": "^4.0.0",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "be9a42358a6646d48c3ce5a341761f55aa605b24"
|
|
59
59
|
}
|