@wdio/utils 9.15.0 → 9.16.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.
- package/build/envDetector.d.ts.map +1 -1
- package/build/index.js +21 -3
- package/build/initializePlugin.d.ts.map +1 -1
- package/build/utils.d.ts +2 -0
- package/build/utils.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -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;AA4ND;;;;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
|
@@ -121,6 +121,7 @@ var SCREENSHOT_REPLACEMENT = '"<Screenshot[base64]>"';
|
|
|
121
121
|
var SCRIPT_PLACEHOLDER = '"<Script[base64]>"';
|
|
122
122
|
var REGEX_SCRIPT_NAME = /return \((async )?function (\w+)/;
|
|
123
123
|
var SLASH = "/";
|
|
124
|
+
var REG_EXP_WINDOWS_ABS_PATH = /^[A-Za-z]:\\/;
|
|
124
125
|
function assertPath(path2) {
|
|
125
126
|
if (typeof path2 !== "string") {
|
|
126
127
|
throw new TypeError("Path must be a string. Received " + JSON.stringify(path2));
|
|
@@ -128,7 +129,7 @@ function assertPath(path2) {
|
|
|
128
129
|
}
|
|
129
130
|
function isAbsolute(p) {
|
|
130
131
|
assertPath(p);
|
|
131
|
-
return p.length > 0 && p.charCodeAt(0) === SLASH.codePointAt(0);
|
|
132
|
+
return p.length > 0 && (p.charCodeAt(0) === SLASH.codePointAt(0) || REG_EXP_WINDOWS_ABS_PATH.test(p));
|
|
132
133
|
}
|
|
133
134
|
function overwriteElementCommands(propertiesObject) {
|
|
134
135
|
const elementOverrides = propertiesObject.__elementOverrides__ ? propertiesObject.__elementOverrides__.value : {};
|
|
@@ -472,9 +473,11 @@ function WebDriver(options, modifier, propertiesObject = {}) {
|
|
|
472
473
|
}
|
|
473
474
|
|
|
474
475
|
// src/initializePlugin.ts
|
|
476
|
+
var FILE_PROTOCOL = "file://";
|
|
475
477
|
async function initializePlugin(name, type) {
|
|
476
478
|
if (name[0] === "@" || isAbsolute(name)) {
|
|
477
|
-
const
|
|
479
|
+
const fileUrl = name[0] === "@" ? name : ensureFileURL(name);
|
|
480
|
+
const service = await safeImport(fileUrl);
|
|
478
481
|
if (service) {
|
|
479
482
|
return service;
|
|
480
483
|
}
|
|
@@ -494,6 +497,18 @@ async function initializePlugin(name, type) {
|
|
|
494
497
|
`Couldn't find plugin "${name}" ${type}, neither as wdio scoped package "@wdio/${name.toLowerCase()}-${type}" nor as community package "wdio-${name.toLowerCase()}-${type}". Please make sure you have it installed!`
|
|
495
498
|
);
|
|
496
499
|
}
|
|
500
|
+
function ensureFileURL(path2) {
|
|
501
|
+
if (path2.startsWith(FILE_PROTOCOL)) {
|
|
502
|
+
return path2;
|
|
503
|
+
}
|
|
504
|
+
if (REG_EXP_WINDOWS_ABS_PATH.test(path2)) {
|
|
505
|
+
return `${FILE_PROTOCOL}/${path2.replace(/\\/g, "/")}`;
|
|
506
|
+
}
|
|
507
|
+
if (path2.startsWith(SLASH)) {
|
|
508
|
+
return `${FILE_PROTOCOL}${path2}`;
|
|
509
|
+
}
|
|
510
|
+
return path2;
|
|
511
|
+
}
|
|
497
512
|
|
|
498
513
|
// src/startWebDriver.ts
|
|
499
514
|
import logger2 from "@wdio/logger";
|
|
@@ -1355,9 +1370,12 @@ function isAndroid(capabilities) {
|
|
|
1355
1370
|
if (!capabilities) {
|
|
1356
1371
|
return false;
|
|
1357
1372
|
}
|
|
1358
|
-
|
|
1373
|
+
const hasAndroidPlatform = Boolean(
|
|
1359
1374
|
capabilities.platformName && capabilities.platformName.match(/Android/i) || /Android/i.test(bsOptions.platformName || "") || /Android/i.test(bsOptions.browserName || "") || capabilities.browserName && capabilities.browserName.match(/Android/i)
|
|
1360
1375
|
);
|
|
1376
|
+
const deviceName = bsOptions.deviceName || "";
|
|
1377
|
+
const hasAndroidDeviceName = /android|galaxy|pixel|nexus|oneplus|lg|htc|motorola|sony|huawei|vivo|oppo|xiaomi|redmi|realme|samsung/i.test(deviceName);
|
|
1378
|
+
return Boolean(hasAndroidPlatform || hasAndroidDeviceName);
|
|
1361
1379
|
}
|
|
1362
1380
|
function matchesAppAutomationName(automationNameValue, capabilities) {
|
|
1363
1381
|
if (!capabilities) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializePlugin.d.ts","sourceRoot":"","sources":["../src/initializePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"initializePlugin.d.ts","sourceRoot":"","sources":["../src/initializePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAM3C;;;;;GAKG;AACH,wBAA8B,gBAAgB,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,aAAa,GAAG,QAAQ,CAAC,YAAY,CAAC,CAsCpI"}
|
package/build/utils.d.ts
CHANGED
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;
|
|
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;AAOpD,eAAO,MAAM,KAAK,MAAM,CAAA;AACxB,eAAO,MAAM,wBAAwB,QAAiB,CAAA;AAQtD,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,UAiDzF;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAE,MAAM,EAAE,OAAO,aAiBzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAgCnE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAE,GAAG,EAAE,OAAO,wGAE5C;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,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GED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.16.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",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@puppeteer/browsers": "^2.2.0",
|
|
41
|
-
"@wdio/logger": "9.
|
|
42
|
-
"@wdio/types": "9.
|
|
41
|
+
"@wdio/logger": "9.16.2",
|
|
42
|
+
"@wdio/types": "9.16.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": "
|
|
57
|
+
"gitHead": "ff2154c00e7ba6d6e2a58e0b8e1258a20229752d"
|
|
58
58
|
}
|