@wdio/utils 8.32.4 → 8.33.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 +30 -3
- package/package.json +2 -2
package/build/envDetector.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare function capabilitiesEnvironmentDetector(capabilities: WebdriverI
|
|
|
19
19
|
isAndroid: boolean;
|
|
20
20
|
isSauce: boolean;
|
|
21
21
|
isBidi: boolean;
|
|
22
|
+
isChromium: boolean;
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
24
25
|
* returns information about the environment when the session is created
|
|
@@ -39,6 +40,7 @@ export declare function sessionEnvironmentDetector({ capabilities, requestedCapa
|
|
|
39
40
|
isSauce: boolean;
|
|
40
41
|
isSeleniumStandalone: boolean;
|
|
41
42
|
isBidi: boolean;
|
|
43
|
+
isChromium: boolean;
|
|
42
44
|
};
|
|
43
45
|
/**
|
|
44
46
|
* returns information about the environment when `devtools` protocol is used
|
|
@@ -56,6 +58,7 @@ export declare function devtoolsEnvironmentDetector({ browserName }: WebdriverIO
|
|
|
56
58
|
isSauce: boolean;
|
|
57
59
|
isSeleniumStandalone: boolean;
|
|
58
60
|
isBidi: boolean;
|
|
61
|
+
isChromium: boolean;
|
|
59
62
|
};
|
|
60
63
|
/**
|
|
61
64
|
* returns information about the environment before the session is created
|
|
@@ -71,5 +74,6 @@ export declare function webdriverEnvironmentDetector(capabilities: WebdriverIO.C
|
|
|
71
74
|
isAndroid: boolean;
|
|
72
75
|
isSauce: boolean;
|
|
73
76
|
isBidi: boolean;
|
|
77
|
+
isChromium: boolean;
|
|
74
78
|
};
|
|
75
79
|
//# 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;
|
|
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,YAAY,CAAC,mBAAmB,WAwCpE;AAsMD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,WAAW,CAAC,YAAY,EAAE,kBAAkB,EAAE,MAAM;;;;;;;;;EAIjH;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;;;;;;;;;;;EAgBxG;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,WAAW,EAAE,EAAE,WAAW,CAAC,YAAY;;;;;;;;;;;;EAcpF;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,WAAW,CAAC,YAAY;;;;;;;;;EAWlF"}
|
package/build/envDetector.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SUPPORTED_BROWSERNAMES } from './constants.js';
|
|
1
2
|
const MOBILE_BROWSER_NAMES = ['ipad', 'iphone', 'android'];
|
|
2
3
|
const MOBILE_CAPABILITIES = [
|
|
3
4
|
'appium-version', 'appiumVersion', 'device-type', 'deviceType', 'app', 'appArguments',
|
|
@@ -55,6 +56,18 @@ function isChrome(capabilities) {
|
|
|
55
56
|
}
|
|
56
57
|
return Boolean(capabilities.chrome || capabilities['goog:chromeOptions']);
|
|
57
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* check if session is run by Edgedriver
|
|
61
|
+
* @param {Object} capabilities caps of session response
|
|
62
|
+
* @return {Boolean} true if run by Edgedriver
|
|
63
|
+
*/
|
|
64
|
+
function isEdge(capabilities) {
|
|
65
|
+
if (!capabilities) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return (Boolean(capabilities.browserName && SUPPORTED_BROWSERNAMES.edge.includes(capabilities.browserName.toLowerCase()) ||
|
|
69
|
+
capabilities['ms:edgeOptions']));
|
|
70
|
+
}
|
|
58
71
|
/**
|
|
59
72
|
* check if session is run by Geckodriver
|
|
60
73
|
* @param {Object} capabilities caps of session response
|
|
@@ -185,6 +198,17 @@ function isSeleniumStandalone(capabilities) {
|
|
|
185
198
|
*/
|
|
186
199
|
Boolean(capabilities['se:cdp']));
|
|
187
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* detects if session is run using Chromium protocol
|
|
203
|
+
* @param {object} capabilities session capabilities
|
|
204
|
+
* @return {Boolean} true if session is run with Chromium protocol
|
|
205
|
+
*/
|
|
206
|
+
function isChromium(capabilities) {
|
|
207
|
+
if (!capabilities) {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
return (isChrome(capabilities) || isEdge(capabilities));
|
|
211
|
+
}
|
|
188
212
|
/**
|
|
189
213
|
* returns information about the environment before the session is created
|
|
190
214
|
* @param {Object} capabilities caps provided by user
|
|
@@ -215,7 +239,8 @@ export function sessionEnvironmentDetector({ capabilities, requestedCapabilities
|
|
|
215
239
|
isAndroid: isAndroid(cap),
|
|
216
240
|
isSauce: isSauce(requestedCapabilities),
|
|
217
241
|
isSeleniumStandalone: isSeleniumStandalone(cap),
|
|
218
|
-
isBidi: isBidi(capabilities)
|
|
242
|
+
isBidi: isBidi(capabilities),
|
|
243
|
+
isChromium: isChromium(cap)
|
|
219
244
|
};
|
|
220
245
|
}
|
|
221
246
|
/**
|
|
@@ -234,7 +259,8 @@ export function devtoolsEnvironmentDetector({ browserName }) {
|
|
|
234
259
|
isChrome: browserName === 'chrome',
|
|
235
260
|
isSauce: false,
|
|
236
261
|
isSeleniumStandalone: false,
|
|
237
|
-
isBidi: false
|
|
262
|
+
isBidi: false,
|
|
263
|
+
isChromium: browserName === 'chrome'
|
|
238
264
|
};
|
|
239
265
|
}
|
|
240
266
|
/**
|
|
@@ -251,6 +277,7 @@ export function webdriverEnvironmentDetector(capabilities) {
|
|
|
251
277
|
isIOS: isIOS(capabilities),
|
|
252
278
|
isAndroid: isAndroid(capabilities),
|
|
253
279
|
isSauce: isSauce(capabilities),
|
|
254
|
-
isBidi: isBidi(capabilities)
|
|
280
|
+
isBidi: isBidi(capabilities),
|
|
281
|
+
isChromium: isChromium(capabilities)
|
|
255
282
|
};
|
|
256
283
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.33.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",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "b00f5062e9ca87d6b2d01b1e9fa66ab15d8636b4"
|
|
58
58
|
}
|