@wdio/utils 9.10.1 → 9.12.1
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/envDetector.d.ts +4 -0
- package/build/envDetector.d.ts.map +1 -1
- package/build/index.js +36 -4
- package/build/utils.d.ts.map +1 -1
- package/package.json +2 -2
package/build/envDetector.d.ts
CHANGED
|
@@ -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;
|
|
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
|
@@ -165,7 +165,16 @@ function overwriteElementCommands(propertiesObject) {
|
|
|
165
165
|
}
|
|
166
166
|
function commandCallStructure(commandName, args, unfurl = false) {
|
|
167
167
|
const callArgs = args.map((arg) => {
|
|
168
|
-
if (typeof arg === "string" &&
|
|
168
|
+
if (typeof arg === "string" && /**
|
|
169
|
+
* The regex pattern matches:
|
|
170
|
+
* - Regular functions: `function()` or `function foo()`
|
|
171
|
+
* - Async functions: `async function()` or `async function foo()`
|
|
172
|
+
* - IIFEs: `!function()`
|
|
173
|
+
* - Returned functions: `return function` or `return (function`
|
|
174
|
+
* - Returned async functions: `return async function` or `return (async function`
|
|
175
|
+
* - Arrow functions: `() =>` or `param =>` or `(param1, param2) =>`
|
|
176
|
+
*/
|
|
177
|
+
/^\s*(?:(?:async\s+)?function\s*[\w\s]*\(|!function\(|return\s+\(?(?:async\s+)?function|\(?\w*(?:\s*,\s*\w+)*\)?\s*=>)/.test(arg.trim())) {
|
|
169
178
|
arg = "<fn>";
|
|
170
179
|
} else if (typeof arg === "string" && /**
|
|
171
180
|
* the isBase64 method returns for xPath values like
|
|
@@ -1294,11 +1303,14 @@ function isFirefox(capabilities) {
|
|
|
1294
1303
|
}
|
|
1295
1304
|
return capabilities.browserName === "firefox" || Boolean(Object.keys(capabilities).find((cap) => cap.startsWith("moz:")));
|
|
1296
1305
|
}
|
|
1306
|
+
function getAutomationName(capabilities) {
|
|
1307
|
+
return capabilities["appium:options"]?.automationName || capabilities["appium:automationName"];
|
|
1308
|
+
}
|
|
1297
1309
|
function isMobile(capabilities) {
|
|
1298
1310
|
const browserName = (capabilities.browserName || "").toLowerCase();
|
|
1299
1311
|
const bsOptions = capabilities["bstack:options"] || {};
|
|
1300
1312
|
const browserstackBrowserName = (bsOptions.browserName || "").toLowerCase();
|
|
1301
|
-
const automationName = capabilities
|
|
1313
|
+
const automationName = getAutomationName(capabilities);
|
|
1302
1314
|
if (automationName && ["gecko", "safari", "chrome", "chromium"].includes(automationName.toLocaleLowerCase())) {
|
|
1303
1315
|
return false;
|
|
1304
1316
|
}
|
|
@@ -1336,6 +1348,22 @@ function isAndroid(capabilities) {
|
|
|
1336
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)
|
|
1337
1349
|
);
|
|
1338
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
|
+
}
|
|
1339
1367
|
function isSauce(capabilities) {
|
|
1340
1368
|
if (!capabilities) {
|
|
1341
1369
|
return false;
|
|
@@ -1381,7 +1409,9 @@ function capabilitiesEnvironmentDetector(capabilities) {
|
|
|
1381
1409
|
isAndroid: isAndroid(capabilities),
|
|
1382
1410
|
isSauce: isSauce(capabilities),
|
|
1383
1411
|
isBidi: isBidi(capabilities),
|
|
1384
|
-
isChromium: isChromium(capabilities)
|
|
1412
|
+
isChromium: isChromium(capabilities),
|
|
1413
|
+
isWindowsApp: isWindowsApp(capabilities),
|
|
1414
|
+
isMacApp: isMacApp(capabilities)
|
|
1385
1415
|
};
|
|
1386
1416
|
}
|
|
1387
1417
|
function sessionEnvironmentDetector({
|
|
@@ -1398,7 +1428,9 @@ function sessionEnvironmentDetector({
|
|
|
1398
1428
|
isSauce: isSauce(requestedCapabilities),
|
|
1399
1429
|
isSeleniumStandalone: isSeleniumStandalone(capabilities),
|
|
1400
1430
|
isBidi: isBidi(capabilities),
|
|
1401
|
-
isChromium: isChromium(capabilities)
|
|
1431
|
+
isChromium: isChromium(capabilities),
|
|
1432
|
+
isWindowsApp: isWindowsApp(capabilities),
|
|
1433
|
+
isMacApp: isMacApp(capabilities)
|
|
1402
1434
|
};
|
|
1403
1435
|
}
|
|
1404
1436
|
export {
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAepD,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,WAGnC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE;IAAE,sBAAsB,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,QA0CjJ;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,UAAQ,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.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AAkB,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,GAAG,OAAO,CAoB1E;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;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC,OAAO,CAGjI;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO1E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.12.1",
|
|
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",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "2887e7ba43c346edc5457309b874350a4cf628db"
|
|
58
58
|
}
|