@wdio/utils 8.10.7 → 8.11.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/envDetector.d.ts +4 -0
- package/build/envDetector.d.ts.map +1 -1
- package/build/envDetector.js +19 -3
- package/build/utils.d.ts +1 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +2 -2
- package/package.json +3 -3
package/build/envDetector.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare function capabilitiesEnvironmentDetector(capabilities: Capabiliti
|
|
|
18
18
|
isIOS: boolean;
|
|
19
19
|
isAndroid: boolean;
|
|
20
20
|
isSauce: boolean;
|
|
21
|
+
isBidi: boolean;
|
|
21
22
|
};
|
|
22
23
|
/**
|
|
23
24
|
* returns information about the environment when the session is created
|
|
@@ -37,6 +38,7 @@ export declare function sessionEnvironmentDetector({ capabilities, requestedCapa
|
|
|
37
38
|
isAndroid: boolean;
|
|
38
39
|
isSauce: boolean;
|
|
39
40
|
isSeleniumStandalone: boolean;
|
|
41
|
+
isBidi: boolean;
|
|
40
42
|
};
|
|
41
43
|
/**
|
|
42
44
|
* returns information about the environment when `devtools` protocol is used
|
|
@@ -53,6 +55,7 @@ export declare function devtoolsEnvironmentDetector({ browserName }: Capabilitie
|
|
|
53
55
|
isChrome: boolean;
|
|
54
56
|
isSauce: boolean;
|
|
55
57
|
isSeleniumStandalone: boolean;
|
|
58
|
+
isBidi: boolean;
|
|
56
59
|
};
|
|
57
60
|
/**
|
|
58
61
|
* returns information about the environment before the session is created
|
|
@@ -67,5 +70,6 @@ export declare function webdriverEnvironmentDetector(capabilities: Capabilities.
|
|
|
67
70
|
isIOS: boolean;
|
|
68
71
|
isAndroid: boolean;
|
|
69
72
|
isSauce: boolean;
|
|
73
|
+
isBidi: boolean;
|
|
70
74
|
};
|
|
71
75
|
//# 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;AAQ/C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC,mBAAmB,WAwCpE;
|
|
1
|
+
{"version":3,"file":"envDetector.d.ts","sourceRoot":"","sources":["../src/envDetector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAQ/C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC,mBAAmB,WAwCpE;AA4JD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY,EAAE,kBAAkB,EAAE,MAAM;;;;;;;;EAIlH;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,YAAY,EAAE,qBAAqB,EAAE,EAC9E;IAAE,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAAC;IAAC,qBAAqB,EAAE,YAAY,CAAC,gBAAgB,CAAA;CAAE;;;;;;;;;;EAexG;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,WAAW,EAAE,EAAE,YAAY,CAAC,YAAY;;;;;;;;;;;EAarF;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY;;;;;;;;EAUnF"}
|
package/build/envDetector.js
CHANGED
|
@@ -125,7 +125,6 @@ function isAndroid(capabilities) {
|
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
127
|
* detects if session is run on Sauce with extended debugging enabled
|
|
128
|
-
* @param {string} hostname hostname of session request
|
|
129
128
|
* @param {object} capabilities session capabilities
|
|
130
129
|
* @return {Boolean} true if session is running on Sauce with extended debugging enabled
|
|
131
130
|
*/
|
|
@@ -140,6 +139,20 @@ function isSauce(capabilities) {
|
|
|
140
139
|
(caps['sauce:options'] &&
|
|
141
140
|
caps['sauce:options'].extendedDebugging));
|
|
142
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* detects if session has support for WebDriver Bidi
|
|
144
|
+
* @param {object} capabilities session capabilities
|
|
145
|
+
* @return {Boolean} true if session has WebDriver Bidi support
|
|
146
|
+
*/
|
|
147
|
+
function isBidi(capabilities) {
|
|
148
|
+
if (!capabilities) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
const caps = capabilities.alwaysMatch
|
|
152
|
+
? capabilities.alwaysMatch
|
|
153
|
+
: capabilities;
|
|
154
|
+
return Boolean(caps.webSocketUrl);
|
|
155
|
+
}
|
|
143
156
|
/**
|
|
144
157
|
* detects if session is run using Selenium Standalone server
|
|
145
158
|
* @param {object} capabilities session capabilities
|
|
@@ -188,7 +201,8 @@ export function sessionEnvironmentDetector({ capabilities, requestedCapabilities
|
|
|
188
201
|
isIOS: isIOS(cap),
|
|
189
202
|
isAndroid: isAndroid(cap),
|
|
190
203
|
isSauce: isSauce(requestedCapabilities),
|
|
191
|
-
isSeleniumStandalone: isSeleniumStandalone(cap)
|
|
204
|
+
isSeleniumStandalone: isSeleniumStandalone(cap),
|
|
205
|
+
isBidi: isBidi(capabilities)
|
|
192
206
|
};
|
|
193
207
|
}
|
|
194
208
|
/**
|
|
@@ -207,6 +221,7 @@ export function devtoolsEnvironmentDetector({ browserName }) {
|
|
|
207
221
|
isChrome: browserName === 'chrome',
|
|
208
222
|
isSauce: false,
|
|
209
223
|
isSeleniumStandalone: false,
|
|
224
|
+
isBidi: false
|
|
210
225
|
};
|
|
211
226
|
}
|
|
212
227
|
/**
|
|
@@ -222,6 +237,7 @@ export function webdriverEnvironmentDetector(capabilities) {
|
|
|
222
237
|
isMobile: isMobile(capabilities),
|
|
223
238
|
isIOS: isIOS(capabilities),
|
|
224
239
|
isAndroid: isAndroid(capabilities),
|
|
225
|
-
isSauce: isSauce(capabilities)
|
|
240
|
+
isSauce: isSauce(capabilities),
|
|
241
|
+
isBidi: isBidi(capabilities)
|
|
226
242
|
};
|
|
227
243
|
}
|
package/build/utils.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare function overwriteElementCommands(propertiesObject: {
|
|
|
13
13
|
* get command call structure
|
|
14
14
|
* (for logging purposes)
|
|
15
15
|
*/
|
|
16
|
-
export declare function commandCallStructure(commandName: string, args: any[]): string;
|
|
16
|
+
export declare function commandCallStructure(commandName: string, args: any[], unfurl?: boolean): string;
|
|
17
17
|
/**
|
|
18
18
|
* transforms WebDriver result for log stream to avoid unnecessary long
|
|
19
19
|
* result strings e.g. if it contains a screenshot
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAW,MAAM,aAAa,CAAA;AAMpD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE;IAAE,sBAAsB,CAAC,EAAE;QAAE,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,QAwCzH;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,UA+
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAW,MAAM,aAAa,CAAA;AAMpD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE;IAAE,sBAAsB,CAAC,EAAE;QAAE,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,QAwCzH;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,UAAQ,UA+BrF;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAE,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;;;EAapF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WA8B/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAE,GAAG,EAAE,GAAG,wGAExC;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC,CA4DtF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAE,EAAE,EAAE,QAAQ,WAE5C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAE,IAAI,EAAE,GAAG,EAAE,SAE1C;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,WAenC;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,UAAW,MAAM,YAWtC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,mCAAoD,CAAA"}
|
package/build/utils.js
CHANGED
|
@@ -47,7 +47,7 @@ export function overwriteElementCommands(propertiesObject) {
|
|
|
47
47
|
* get command call structure
|
|
48
48
|
* (for logging purposes)
|
|
49
49
|
*/
|
|
50
|
-
export function commandCallStructure(commandName, args) {
|
|
50
|
+
export function commandCallStructure(commandName, args, unfurl = false) {
|
|
51
51
|
const callArgs = args.map((arg) => {
|
|
52
52
|
if (typeof arg === 'string' && (arg.startsWith('!function(') || arg.startsWith('return (function'))) {
|
|
53
53
|
arg = '<fn>';
|
|
@@ -72,7 +72,7 @@ export function commandCallStructure(commandName, args) {
|
|
|
72
72
|
arg = 'null';
|
|
73
73
|
}
|
|
74
74
|
else if (typeof arg === 'object') {
|
|
75
|
-
arg = '<object>';
|
|
75
|
+
arg = unfurl ? JSON.stringify(arg) : '<object>';
|
|
76
76
|
}
|
|
77
77
|
else if (typeof arg === 'undefined') {
|
|
78
78
|
arg = typeof arg;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.11.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",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"url": "https://github.com/webdriverio/webdriverio/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@wdio/logger": "8.
|
|
33
|
+
"@wdio/logger": "8.11.0",
|
|
34
34
|
"@wdio/types": "8.10.4",
|
|
35
35
|
"import-meta-resolve": "^3.0.0",
|
|
36
36
|
"p-iteration": "^1.1.8"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "6fa7ae486537cbd3f6dd9e3bcc1812eb0acc6262"
|
|
42
42
|
}
|