@wdio/utils 8.10.6 → 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 +23 -5
- 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
|
@@ -81,9 +81,11 @@ function isMobile(capabilities) {
|
|
|
81
81
|
*/
|
|
82
82
|
return Boolean(
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* If the device is ios, tvos or android, the device might be mobile.
|
|
85
85
|
*/
|
|
86
|
-
|
|
86
|
+
capabilities.platformName && capabilities.platformName.match(/ios/i) ||
|
|
87
|
+
capabilities.platformName && capabilities.platformName.match(/tvos/i) ||
|
|
88
|
+
capabilities.platformName && capabilities.platformName.match(/android/i) ||
|
|
87
89
|
/**
|
|
88
90
|
* capabilities contain mobile only specific capabilities
|
|
89
91
|
*/
|
|
@@ -123,7 +125,6 @@ function isAndroid(capabilities) {
|
|
|
123
125
|
}
|
|
124
126
|
/**
|
|
125
127
|
* detects if session is run on Sauce with extended debugging enabled
|
|
126
|
-
* @param {string} hostname hostname of session request
|
|
127
128
|
* @param {object} capabilities session capabilities
|
|
128
129
|
* @return {Boolean} true if session is running on Sauce with extended debugging enabled
|
|
129
130
|
*/
|
|
@@ -138,6 +139,20 @@ function isSauce(capabilities) {
|
|
|
138
139
|
(caps['sauce:options'] &&
|
|
139
140
|
caps['sauce:options'].extendedDebugging));
|
|
140
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
|
+
}
|
|
141
156
|
/**
|
|
142
157
|
* detects if session is run using Selenium Standalone server
|
|
143
158
|
* @param {object} capabilities session capabilities
|
|
@@ -186,7 +201,8 @@ export function sessionEnvironmentDetector({ capabilities, requestedCapabilities
|
|
|
186
201
|
isIOS: isIOS(cap),
|
|
187
202
|
isAndroid: isAndroid(cap),
|
|
188
203
|
isSauce: isSauce(requestedCapabilities),
|
|
189
|
-
isSeleniumStandalone: isSeleniumStandalone(cap)
|
|
204
|
+
isSeleniumStandalone: isSeleniumStandalone(cap),
|
|
205
|
+
isBidi: isBidi(capabilities)
|
|
190
206
|
};
|
|
191
207
|
}
|
|
192
208
|
/**
|
|
@@ -205,6 +221,7 @@ export function devtoolsEnvironmentDetector({ browserName }) {
|
|
|
205
221
|
isChrome: browserName === 'chrome',
|
|
206
222
|
isSauce: false,
|
|
207
223
|
isSeleniumStandalone: false,
|
|
224
|
+
isBidi: false
|
|
208
225
|
};
|
|
209
226
|
}
|
|
210
227
|
/**
|
|
@@ -220,6 +237,7 @@ export function webdriverEnvironmentDetector(capabilities) {
|
|
|
220
237
|
isMobile: isMobile(capabilities),
|
|
221
238
|
isIOS: isIOS(capabilities),
|
|
222
239
|
isAndroid: isAndroid(capabilities),
|
|
223
|
-
isSauce: isSauce(capabilities)
|
|
240
|
+
isSauce: isSauce(capabilities),
|
|
241
|
+
isBidi: isBidi(capabilities)
|
|
224
242
|
};
|
|
225
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
|
}
|