@wdio/utils 8.35.0 → 9.0.0-alpha.59
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/constants.d.ts +1 -1
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +1 -1
- package/build/envDetector.d.ts +1 -36
- package/build/envDetector.d.ts.map +1 -1
- package/build/envDetector.js +11 -43
- package/build/index.d.ts +4 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -4
- package/build/node/manager.d.ts.map +1 -1
- package/build/node/manager.js +3 -13
- package/build/node/startWebDriver.d.ts.map +1 -1
- package/build/node/startWebDriver.js +3 -7
- package/build/node/utils.d.ts.map +1 -1
- package/build/node/utils.js +0 -10
- package/build/pIteration.d.ts +15 -15
- package/build/pIteration.d.ts.map +1 -1
- package/build/shim.d.ts.map +1 -1
- package/build/shim.js +0 -3
- package/build/utils.d.ts +9 -2
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +19 -4
- package/package.json +11 -11
package/build/constants.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ export declare const SUPPORTED_BROWSERNAMES: {
|
|
|
85
85
|
edge: string[];
|
|
86
86
|
safari: string[];
|
|
87
87
|
};
|
|
88
|
-
export declare const DEFAULT_HOSTNAME = "
|
|
88
|
+
export declare const DEFAULT_HOSTNAME = "localhost";
|
|
89
89
|
export declare const DEFAULT_PROTOCOL = "http";
|
|
90
90
|
export declare const DEFAULT_PATH = "/";
|
|
91
91
|
export declare const HOOK_DEFINITION: {
|
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ErB,CAAA;AAEV,eAAO,MAAM,sBAAsB;;;;;CAKlC,CAAA;AAED,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ErB,CAAA;AAEV,eAAO,MAAM,sBAAsB;;;;;CAKlC,CAAA;AAED,eAAO,MAAM,gBAAgB,cAAc,CAAA;AAC3C,eAAO,MAAM,gBAAgB,SAAS,CAAA;AACtC,eAAO,MAAM,YAAY,MAAM,CAAA;AAE/B,eAAO,MAAM,eAAe;;sBAEN,GAAG;CAsBxB,CAAA"}
|
package/build/constants.js
CHANGED
|
@@ -85,7 +85,7 @@ export const SUPPORTED_BROWSERNAMES = {
|
|
|
85
85
|
edge: ['edge', 'microsoftedge', 'msedge'],
|
|
86
86
|
safari: ['safari', 'safari technology preview']
|
|
87
87
|
};
|
|
88
|
-
export const DEFAULT_HOSTNAME = '
|
|
88
|
+
export const DEFAULT_HOSTNAME = 'localhost';
|
|
89
89
|
export const DEFAULT_PROTOCOL = 'http';
|
|
90
90
|
export const DEFAULT_PATH = '/';
|
|
91
91
|
/* istanbul ignore next */
|
package/build/envDetector.d.ts
CHANGED
|
@@ -8,10 +8,9 @@ export declare function isW3C(capabilities?: Capabilities.DesiredCapabilities):
|
|
|
8
8
|
/**
|
|
9
9
|
* returns information about the environment before the session is created
|
|
10
10
|
* @param {Object} capabilities caps provided by user
|
|
11
|
-
* @param {string=} automationProtocol `devtools`
|
|
12
11
|
* @return {Object} object with environment flags
|
|
13
12
|
*/
|
|
14
|
-
export declare function capabilitiesEnvironmentDetector(capabilities: WebdriverIO.Capabilities
|
|
13
|
+
export declare function capabilitiesEnvironmentDetector(capabilities: WebdriverIO.Capabilities): {
|
|
15
14
|
isChrome: boolean;
|
|
16
15
|
isFirefox: boolean;
|
|
17
16
|
isMobile: boolean;
|
|
@@ -42,38 +41,4 @@ export declare function sessionEnvironmentDetector({ capabilities, requestedCapa
|
|
|
42
41
|
isBidi: boolean;
|
|
43
42
|
isChromium: boolean;
|
|
44
43
|
};
|
|
45
|
-
/**
|
|
46
|
-
* returns information about the environment when `devtools` protocol is used
|
|
47
|
-
* @param {Object} capabilities caps of session response
|
|
48
|
-
* @return {Object} object with environment flags
|
|
49
|
-
*/
|
|
50
|
-
export declare function devtoolsEnvironmentDetector(capabilities: WebdriverIO.Capabilities): {
|
|
51
|
-
isDevTools: boolean;
|
|
52
|
-
isW3C: boolean;
|
|
53
|
-
isMobile: boolean;
|
|
54
|
-
isIOS: boolean;
|
|
55
|
-
isAndroid: boolean;
|
|
56
|
-
isFirefox: boolean;
|
|
57
|
-
isChrome: boolean;
|
|
58
|
-
isSauce: boolean;
|
|
59
|
-
isSeleniumStandalone: boolean;
|
|
60
|
-
isBidi: boolean;
|
|
61
|
-
isChromium: boolean;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* returns information about the environment before the session is created
|
|
65
|
-
* `isW3C`, `isSeleniumStandalone` cannot be detected
|
|
66
|
-
* @param {Object} capabilities caps provided by user
|
|
67
|
-
* @return {Object} object with environment flags
|
|
68
|
-
*/
|
|
69
|
-
export declare function webdriverEnvironmentDetector(capabilities: WebdriverIO.Capabilities): {
|
|
70
|
-
isChrome: boolean;
|
|
71
|
-
isFirefox: boolean;
|
|
72
|
-
isMobile: boolean;
|
|
73
|
-
isIOS: boolean;
|
|
74
|
-
isAndroid: boolean;
|
|
75
|
-
isSauce: boolean;
|
|
76
|
-
isBidi: boolean;
|
|
77
|
-
isChromium: boolean;
|
|
78
|
-
};
|
|
79
44
|
//# 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,YAAY,CAAC,mBAAmB,WAwCpE;AAsMD
|
|
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;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,WAAW,CAAC,YAAY;;;;;;;;;EAWrF;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"}
|
package/build/envDetector.js
CHANGED
|
@@ -212,13 +212,19 @@ function isChromium(capabilities) {
|
|
|
212
212
|
/**
|
|
213
213
|
* returns information about the environment before the session is created
|
|
214
214
|
* @param {Object} capabilities caps provided by user
|
|
215
|
-
* @param {string=} automationProtocol `devtools`
|
|
216
215
|
* @return {Object} object with environment flags
|
|
217
216
|
*/
|
|
218
|
-
export function capabilitiesEnvironmentDetector(capabilities
|
|
219
|
-
return
|
|
220
|
-
|
|
221
|
-
:
|
|
217
|
+
export function capabilitiesEnvironmentDetector(capabilities) {
|
|
218
|
+
return {
|
|
219
|
+
isChrome: isChrome(capabilities),
|
|
220
|
+
isFirefox: isFirefox(capabilities),
|
|
221
|
+
isMobile: isMobile(capabilities),
|
|
222
|
+
isIOS: isIOS(capabilities),
|
|
223
|
+
isAndroid: isAndroid(capabilities),
|
|
224
|
+
isSauce: isSauce(capabilities),
|
|
225
|
+
isBidi: isBidi(capabilities),
|
|
226
|
+
isChromium: isChromium(capabilities)
|
|
227
|
+
};
|
|
222
228
|
}
|
|
223
229
|
/**
|
|
224
230
|
* returns information about the environment when the session is created
|
|
@@ -243,41 +249,3 @@ export function sessionEnvironmentDetector({ capabilities, requestedCapabilities
|
|
|
243
249
|
isChromium: isChromium(cap)
|
|
244
250
|
};
|
|
245
251
|
}
|
|
246
|
-
/**
|
|
247
|
-
* returns information about the environment when `devtools` protocol is used
|
|
248
|
-
* @param {Object} capabilities caps of session response
|
|
249
|
-
* @return {Object} object with environment flags
|
|
250
|
-
*/
|
|
251
|
-
export function devtoolsEnvironmentDetector(capabilities) {
|
|
252
|
-
return {
|
|
253
|
-
isDevTools: true,
|
|
254
|
-
isW3C: true,
|
|
255
|
-
isMobile: false,
|
|
256
|
-
isIOS: false,
|
|
257
|
-
isAndroid: false,
|
|
258
|
-
isFirefox: false,
|
|
259
|
-
isChrome: capabilities.browserName === 'chrome',
|
|
260
|
-
isSauce: false,
|
|
261
|
-
isSeleniumStandalone: false,
|
|
262
|
-
isBidi: false,
|
|
263
|
-
isChromium: capabilities.browserName === 'chrome' || isChromium(capabilities)
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* returns information about the environment before the session is created
|
|
268
|
-
* `isW3C`, `isSeleniumStandalone` cannot be detected
|
|
269
|
-
* @param {Object} capabilities caps provided by user
|
|
270
|
-
* @return {Object} object with environment flags
|
|
271
|
-
*/
|
|
272
|
-
export function webdriverEnvironmentDetector(capabilities) {
|
|
273
|
-
return {
|
|
274
|
-
isChrome: isChrome(capabilities),
|
|
275
|
-
isFirefox: isFirefox(capabilities),
|
|
276
|
-
isMobile: isMobile(capabilities),
|
|
277
|
-
isIOS: isIOS(capabilities),
|
|
278
|
-
isAndroid: isAndroid(capabilities),
|
|
279
|
-
isSauce: isSauce(capabilities),
|
|
280
|
-
isBidi: isBidi(capabilities),
|
|
281
|
-
isChromium: isChromium(capabilities)
|
|
282
|
-
};
|
|
283
|
-
}
|
package/build/index.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import webdriverMonad from './monad.js';
|
|
|
2
2
|
import initializePlugin from './initializePlugin.js';
|
|
3
3
|
import { startWebDriver } from './startWebDriver.js';
|
|
4
4
|
import { initializeWorkerService, initializeLauncherService } from './initializeServices.js';
|
|
5
|
-
import { commandCallStructure, isValidParameter, getArgumentType, safeImport, isFunctionAsync, transformCommandLogResult, sleep, isAppiumCapability, getBrowserObject } from './utils.js';
|
|
5
|
+
import { commandCallStructure, isValidParameter, getArgumentType, safeImport, isFunctionAsync, transformCommandLogResult, sleep, isAppiumCapability, userImport, getBrowserObject } from './utils.js';
|
|
6
6
|
import { wrapCommand, executeHooksWithArgs, executeAsync } from './shim.js';
|
|
7
7
|
import * as asyncIterators from './pIteration.js';
|
|
8
8
|
import { testFnWrapper, wrapGlobalTestMethod } from './test-framework/index.js';
|
|
9
|
-
import { isW3C, capabilitiesEnvironmentDetector, sessionEnvironmentDetector
|
|
9
|
+
import { isW3C, capabilitiesEnvironmentDetector, sessionEnvironmentDetector } from './envDetector.js';
|
|
10
10
|
import { UNICODE_CHARACTERS, HOOK_DEFINITION } from './constants.js';
|
|
11
|
-
export { startWebDriver, initializePlugin, initializeLauncherService, initializeWorkerService, isFunctionAsync, transformCommandLogResult, webdriverMonad, commandCallStructure, isValidParameter, getArgumentType, safeImport, sleep, isAppiumCapability, getBrowserObject, asyncIterators,
|
|
11
|
+
export { startWebDriver, initializePlugin, initializeLauncherService, initializeWorkerService, isFunctionAsync, transformCommandLogResult, webdriverMonad, commandCallStructure, isValidParameter, getArgumentType, safeImport, sleep, isAppiumCapability, userImport, getBrowserObject, asyncIterators,
|
|
12
12
|
/**
|
|
13
13
|
* runner shim
|
|
14
14
|
*/
|
|
@@ -16,7 +16,7 @@ wrapCommand, executeAsync, wrapGlobalTestMethod, testFnWrapper, executeHooksWith
|
|
|
16
16
|
/**
|
|
17
17
|
* environmentDetector
|
|
18
18
|
*/
|
|
19
|
-
isW3C, sessionEnvironmentDetector, capabilitiesEnvironmentDetector,
|
|
19
|
+
isW3C, sessionEnvironmentDetector, capabilitiesEnvironmentDetector,
|
|
20
20
|
/**
|
|
21
21
|
* constants
|
|
22
22
|
*/
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,MAAM,YAAY,CAAA;AACvC,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAC5F,OAAO,EACH,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EACnE,eAAe,EAAE,yBAAyB,EAAE,KAAK,EAAE,kBAAkB,EACrE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,MAAM,YAAY,CAAA;AACvC,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAC5F,OAAO,EACH,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EACnE,eAAe,EAAE,yBAAyB,EAAE,KAAK,EAAE,kBAAkB,EACrE,UAAU,EAAE,gBAAgB,EAC/B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC3E,OAAO,KAAK,cAAc,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,EAAE,KAAK,EAAE,+BAA+B,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAA;AACrG,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEpE,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,KAAK,EACL,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,cAAc;AAEd;;GAEG;AACH,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,oBAAoB;AAEpB;;GAEG;AACH,KAAK,EACL,0BAA0B,EAC1B,+BAA+B;AAE/B;;GAEG;AACH,kBAAkB,EAClB,eAAe,EAClB,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -3,13 +3,13 @@ import webdriverMonad from './monad.js';
|
|
|
3
3
|
import initializePlugin from './initializePlugin.js';
|
|
4
4
|
import { startWebDriver } from './startWebDriver.js';
|
|
5
5
|
import { initializeWorkerService, initializeLauncherService } from './initializeServices.js';
|
|
6
|
-
import { commandCallStructure, isValidParameter, getArgumentType, safeImport, isFunctionAsync, transformCommandLogResult, sleep, isAppiumCapability, getBrowserObject } from './utils.js';
|
|
6
|
+
import { commandCallStructure, isValidParameter, getArgumentType, safeImport, isFunctionAsync, transformCommandLogResult, sleep, isAppiumCapability, userImport, getBrowserObject } from './utils.js';
|
|
7
7
|
import { wrapCommand, executeHooksWithArgs, executeAsync } from './shim.js';
|
|
8
8
|
import * as asyncIterators from './pIteration.js';
|
|
9
9
|
import { testFnWrapper, wrapGlobalTestMethod } from './test-framework/index.js';
|
|
10
|
-
import { isW3C, capabilitiesEnvironmentDetector, sessionEnvironmentDetector
|
|
10
|
+
import { isW3C, capabilitiesEnvironmentDetector, sessionEnvironmentDetector } from './envDetector.js';
|
|
11
11
|
import { UNICODE_CHARACTERS, HOOK_DEFINITION } from './constants.js';
|
|
12
|
-
export { startWebDriver, initializePlugin, initializeLauncherService, initializeWorkerService, isFunctionAsync, transformCommandLogResult, webdriverMonad, commandCallStructure, isValidParameter, getArgumentType, safeImport, sleep, isAppiumCapability, getBrowserObject, asyncIterators,
|
|
12
|
+
export { startWebDriver, initializePlugin, initializeLauncherService, initializeWorkerService, isFunctionAsync, transformCommandLogResult, webdriverMonad, commandCallStructure, isValidParameter, getArgumentType, safeImport, sleep, isAppiumCapability, userImport, getBrowserObject, asyncIterators,
|
|
13
13
|
/**
|
|
14
14
|
* runner shim
|
|
15
15
|
*/
|
|
@@ -17,7 +17,7 @@ wrapCommand, executeAsync, wrapGlobalTestMethod, testFnWrapper, executeHooksWith
|
|
|
17
17
|
/**
|
|
18
18
|
* environmentDetector
|
|
19
19
|
*/
|
|
20
|
-
isW3C, sessionEnvironmentDetector, capabilitiesEnvironmentDetector,
|
|
20
|
+
isW3C, sessionEnvironmentDetector, capabilitiesEnvironmentDetector,
|
|
21
21
|
/**
|
|
22
22
|
* constants
|
|
23
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/node/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/node/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAkGxD,wBAAsB,WAAW,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,kBAAkB,kCAezH;AAED,wBAAgB,YAAY,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,kBAAkB,kCAYpH"}
|
package/build/node/manager.js
CHANGED
|
@@ -15,12 +15,7 @@ function mapCapabilities(options, caps, task, taskItemLabel) {
|
|
|
15
15
|
const multiremoteCaps = cap;
|
|
16
16
|
const isMultiremote = Boolean(multiremoteCaps[Object.keys(cap)[0]].capabilities);
|
|
17
17
|
if (isMultiremote) {
|
|
18
|
-
return Object.values(multiremoteCaps).map((c) =>
|
|
19
|
-
if (c.automationProtocol === 'devtools') {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
return c.capabilities;
|
|
23
|
-
});
|
|
18
|
+
return Object.values(multiremoteCaps).map((c) => c.capabilities);
|
|
24
19
|
}
|
|
25
20
|
else if (w3cCaps.alwaysMatch) {
|
|
26
21
|
return w3cCaps.alwaysMatch;
|
|
@@ -29,9 +24,6 @@ function mapCapabilities(options, caps, task, taskItemLabel) {
|
|
|
29
24
|
}).flat()
|
|
30
25
|
: Object.values(caps).map((mrOpts) => {
|
|
31
26
|
const w3cCaps = mrOpts.capabilities;
|
|
32
|
-
if (mrOpts.automationProtocol === 'devtools') {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
27
|
if (w3cCaps.alwaysMatch) {
|
|
36
28
|
return w3cCaps.alwaysMatch;
|
|
37
29
|
}
|
|
@@ -40,7 +32,7 @@ function mapCapabilities(options, caps, task, taskItemLabel) {
|
|
|
40
32
|
/**
|
|
41
33
|
* only set up driver if
|
|
42
34
|
*/
|
|
43
|
-
// - capabilities are defined and not empty
|
|
35
|
+
// - capabilities are defined and not empty
|
|
44
36
|
cap &&
|
|
45
37
|
// - browserName is defined so we know it is a browser session
|
|
46
38
|
cap.browserName &&
|
|
@@ -49,9 +41,7 @@ function mapCapabilities(options, caps, task, taskItemLabel) {
|
|
|
49
41
|
// - we are not running Safari (driver already installed on macOS)
|
|
50
42
|
!isSafari(cap.browserName) &&
|
|
51
43
|
// - driver options don't define a binary path
|
|
52
|
-
!getDriverOptions(cap).binary
|
|
53
|
-
// - user is not defining "devtools" as automation protocol
|
|
54
|
-
options.automationProtocol !== 'devtools'));
|
|
44
|
+
!getDriverOptions(cap).binary));
|
|
55
45
|
/**
|
|
56
46
|
* nothing to setup
|
|
57
47
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startWebDriver.d.ts","sourceRoot":"","sources":["../../src/node/startWebDriver.ts"],"names":[],"mappings":";AAGA,OAAO,EAAyB,MAAM,oBAAoB,CAAA;AAQ1D,OAAO,EAA8B,KAAK,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAC7G,OAAO,EAA6B,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACnF,OAAO,EAA0C,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAC9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,KAAK,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAA;AAMxD,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,mBAAmB,GAAG,sBAAsB,CAAC,CAAA;AAChJ,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,WAAW,CAAC;QAClB,UAAU,mBAAoB,SAAQ,sBAAsB;SAAG;QAC/D,UAAU,kBAAmB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC;SAAG;QAC3E,UAAU,iBAAkB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;SAAG;QACzE,UAAU,mBAAoB,SAAQ,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC;SAAG;KAChF;CACJ;AAKD,wBAAsB,cAAc,CAAE,OAAO,EAAE,OAAO,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"startWebDriver.d.ts","sourceRoot":"","sources":["../../src/node/startWebDriver.ts"],"names":[],"mappings":";AAGA,OAAO,EAAyB,MAAM,oBAAoB,CAAA;AAQ1D,OAAO,EAA8B,KAAK,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAC7G,OAAO,EAA6B,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACnF,OAAO,EAA0C,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAC9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,KAAK,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAA;AAMxD,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,mBAAmB,GAAG,sBAAsB,CAAC,CAAA;AAChJ,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,WAAW,CAAC;QAClB,UAAU,mBAAoB,SAAQ,sBAAsB;SAAG;QAC/D,UAAU,kBAAmB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC;SAAG;QAC3E,UAAU,iBAAkB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;SAAG;QACzE,UAAU,mBAAoB,SAAQ,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC;SAAG;KAChF;CACJ;AAKD,wBAAsB,cAAc,CAAE,OAAO,EAAE,OAAO,CAAC,SAAS,wCA6I/D"}
|
|
@@ -20,7 +20,7 @@ export async function startWebDriver(options) {
|
|
|
20
20
|
* in case we are running unit tests, just return
|
|
21
21
|
*/
|
|
22
22
|
if (process.env.WDIO_SKIP_DRIVER_SETUP) {
|
|
23
|
-
options.hostname = '
|
|
23
|
+
options.hostname = 'localhost';
|
|
24
24
|
options.port = 4321;
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -68,10 +68,6 @@ export async function startWebDriver(options) {
|
|
|
68
68
|
...safaridriverOptions,
|
|
69
69
|
port
|
|
70
70
|
});
|
|
71
|
-
/**
|
|
72
|
-
* set "Host" header as it is required by Safaridriver
|
|
73
|
-
*/
|
|
74
|
-
options.headers = deepmerge({ Host: 'localhost' }, (options.headers || {}));
|
|
75
71
|
}
|
|
76
72
|
else if (isFirefox(caps.browserName)) {
|
|
77
73
|
/**
|
|
@@ -89,7 +85,7 @@ export async function startWebDriver(options) {
|
|
|
89
85
|
geckodriverOptions.customGeckoDriverPath = binary;
|
|
90
86
|
}
|
|
91
87
|
driver = 'GeckoDriver';
|
|
92
|
-
driverProcess = await startGeckodriver({ ...geckodriverOptions, cacheDir, port, allowHosts: ['
|
|
88
|
+
driverProcess = await startGeckodriver({ ...geckodriverOptions, cacheDir, port, allowHosts: ['localhost'] });
|
|
93
89
|
}
|
|
94
90
|
else if (isEdge(caps.browserName)) {
|
|
95
91
|
/**
|
|
@@ -137,7 +133,7 @@ export async function startWebDriver(options) {
|
|
|
137
133
|
}
|
|
138
134
|
await waitPort({ port, output: 'silent', timeout: DRIVER_WAIT_TIMEOUT })
|
|
139
135
|
.catch((e) => { throw new Error(`Timed out to connect to ${driver}: ${e.message}`); });
|
|
140
|
-
options.hostname = '
|
|
136
|
+
options.hostname = 'localhost';
|
|
141
137
|
options.port = port;
|
|
142
138
|
log.info(`Started ${driver} in ${Date.now() - start}ms on port ${port}`);
|
|
143
139
|
return driverProcess;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAK1C;;;;GAIG;AACH,eAAO,MAAM,SAAS,UAAW,MAAM,YAWtC,CAAA;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,oBAAoB,YAYvD;AAED,wBAAgB,sBAAsB,CAAC,UAAU,CAAC,EAAE,MAAM,sBAqBzD;AAED,wBAAsB,uBAAuB,CAAC,WAAW,CAAC,EAAE,MAAM,+BAiBjE;AAGD,eAAO,MAAM,wBAAwB,aAAc,MAAM,mBAAmB,MAAM,cAAc,MAAM,SAOrG,CAAA;AA+BD,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,YAAY;;;;;;GA2G3F;AAED,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,WAAW,CAAC,YAAY,oGAS/D;AAED,wBAAgB,WAAW,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,YAAY,UAGxG;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAC,MAAM,UAM3D;AAED,wBAAsB,iBAAiB,CAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM;;GAgDhF;AAED,wBAAgB,gBAAgB,CAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,mBAEzE;AAED,wBAAgB,eAAe,CAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,mBAExE"}
|
package/build/node/utils.js
CHANGED
|
@@ -10,7 +10,6 @@ import { download as downloadGeckodriver } from 'geckodriver';
|
|
|
10
10
|
import { download as downloadEdgedriver } from 'edgedriver';
|
|
11
11
|
import { locateChrome, locateFirefox, locateApp } from 'locate-app';
|
|
12
12
|
const log = logger('webdriver');
|
|
13
|
-
const CHROMEDRIVER_BASE_URL = 'https://storage.googleapis.com/chrome-for-testing-public';
|
|
14
13
|
const EXCLUDED_PARAMS = ['version', 'help'];
|
|
15
14
|
/**
|
|
16
15
|
* Helper utility to check file access
|
|
@@ -189,14 +188,6 @@ export async function setupPuppeteerBrowser(cacheDir, caps) {
|
|
|
189
188
|
browser: browserName,
|
|
190
189
|
downloadProgressCallback: (downloadedBytes, totalBytes) => downloadProgressCallback(`${browserName} (${buildId})`, downloadedBytes, totalBytes)
|
|
191
190
|
};
|
|
192
|
-
/**
|
|
193
|
-
* For Chrome browser we need to set the baseUrl to the Chrome storage.
|
|
194
|
-
* Google has changed the baseUrl and changes were only applied to a major
|
|
195
|
-
* version released which v8 can't adopt due to support of Node.js v16.
|
|
196
|
-
*/
|
|
197
|
-
if (browserName === Browser.CHROME) {
|
|
198
|
-
installOptions.baseUrl = CHROMEDRIVER_BASE_URL;
|
|
199
|
-
}
|
|
200
191
|
const isCombinationAvailable = await canDownload(installOptions);
|
|
201
192
|
if (!isCombinationAvailable) {
|
|
202
193
|
throw new Error(`Couldn't find a matching ${browserName} browser for tag "${buildId}" on platform "${platform}"`);
|
|
@@ -251,7 +242,6 @@ export async function setupChromedriver(cacheDir, driverVersion) {
|
|
|
251
242
|
if (!hasChromedriverInstalled) {
|
|
252
243
|
log.info(`Downloading Chromedriver v${buildId}`);
|
|
253
244
|
const chromedriverInstallOpts = {
|
|
254
|
-
baseUrl: CHROMEDRIVER_BASE_URL,
|
|
255
245
|
cacheDir,
|
|
256
246
|
buildId,
|
|
257
247
|
platform,
|
package/build/pIteration.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
9
9
|
* @return {Promise} - Returns a Promise with undefined value.
|
|
10
10
|
*/
|
|
11
|
-
export declare const forEach: <T>(array: T[], callback: Function, thisArg?: T
|
|
11
|
+
export declare const forEach: <T>(array: T[], callback: Function, thisArg?: T) => Promise<void>;
|
|
12
12
|
/**
|
|
13
13
|
* Same functionality as [`forEach()`](global.html#forEach), but runs only one callback at a time.
|
|
14
14
|
* @param {Array} array - Array to iterate over.
|
|
@@ -16,7 +16,7 @@ export declare const forEach: <T>(array: T[], callback: Function, thisArg?: T |
|
|
|
16
16
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
17
17
|
* @return {Promise} - Returns a Promise with undefined value.
|
|
18
18
|
*/
|
|
19
|
-
export declare const forEachSeries: <T>(array: T[], callback: Function, thisArg?: T
|
|
19
|
+
export declare const forEachSeries: <T>(array: T[], callback: Function, thisArg?: T) => Promise<void>;
|
|
20
20
|
/**
|
|
21
21
|
* Implements ES5 [`Array#map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) method.<br><br>
|
|
22
22
|
* Creates a new array with the results of calling the provided callback once for each element.<br>
|
|
@@ -28,7 +28,7 @@ export declare const forEachSeries: <T>(array: T[], callback: Function, thisArg?
|
|
|
28
28
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
29
29
|
* @return {Promise} - Returns a Promise with the resultant *Array* as value.
|
|
30
30
|
*/
|
|
31
|
-
export declare const map: <T>(array: T[], callback: Function, thisArg?: T
|
|
31
|
+
export declare const map: <T>(array: T[], callback: Function, thisArg?: T) => Promise<any[]>;
|
|
32
32
|
/**
|
|
33
33
|
* Same functionality as [`map()`](global.html#map), but runs only one callback at a time.
|
|
34
34
|
* @param {Array} array - Array to iterate over.
|
|
@@ -36,7 +36,7 @@ export declare const map: <T>(array: T[], callback: Function, thisArg?: T | unde
|
|
|
36
36
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
37
37
|
* @return {Promise} - Returns a Promise with the resultant *Array* as value.
|
|
38
38
|
*/
|
|
39
|
-
export declare const mapSeries: <T>(array: T[], callback: Function, thisArg?: T
|
|
39
|
+
export declare const mapSeries: <T>(array: T[], callback: Function, thisArg?: T) => Promise<any[]>;
|
|
40
40
|
/**
|
|
41
41
|
* Implements ES5 [`Array#find()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) method.<br><br>
|
|
42
42
|
* Returns the value of the element that satisfies the provided `callback`. The value returned is the one found first.<br>
|
|
@@ -47,7 +47,7 @@ export declare const mapSeries: <T>(array: T[], callback: Function, thisArg?: T
|
|
|
47
47
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
48
48
|
* @return {Promise} - Returns a Promise with the element that passed the test as value, otherwise *undefined*.
|
|
49
49
|
*/
|
|
50
|
-
export declare const find: <T>(array: T[], callback: Function, thisArg?: T
|
|
50
|
+
export declare const find: <T>(array: T[], callback: Function, thisArg?: T) => Promise<T | undefined>;
|
|
51
51
|
/**
|
|
52
52
|
* Same functionality as [`find()`](global.html#find), but runs only one callback at a time.
|
|
53
53
|
* @param {Array} array - Array to iterate over.
|
|
@@ -55,7 +55,7 @@ export declare const find: <T>(array: T[], callback: Function, thisArg?: T | und
|
|
|
55
55
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
56
56
|
* @return {Promise} - Returns a Promise with the element that passed the test as value, otherwise *undefined*.
|
|
57
57
|
*/
|
|
58
|
-
export declare const findSeries: <T>(array: T[], callback: Function, thisArg?: T
|
|
58
|
+
export declare const findSeries: <T>(array: T[], callback: Function, thisArg?: T) => Promise<T | undefined>;
|
|
59
59
|
/**
|
|
60
60
|
* Implements ES5 [`Array#findIndex()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) method.<br><br>
|
|
61
61
|
* Returns the index of the element that satisfies the provided `callback`. The index returned is the one found first.<br>
|
|
@@ -66,7 +66,7 @@ export declare const findSeries: <T>(array: T[], callback: Function, thisArg?: T
|
|
|
66
66
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
67
67
|
* @return {Promise} - Returns a Promise with the index that passed the test as value, otherwise *-1*.
|
|
68
68
|
*/
|
|
69
|
-
export declare const findIndex: <T>(array: T[], callback: Function, thisArg?: T
|
|
69
|
+
export declare const findIndex: <T>(array: T[], callback: Function, thisArg?: T) => Promise<unknown>;
|
|
70
70
|
/**
|
|
71
71
|
* Same functionality as [`findIndex()`](global.html#findIndex), but runs only one callback at a time.
|
|
72
72
|
* @param {Array} array - Array to iterate over.
|
|
@@ -74,7 +74,7 @@ export declare const findIndex: <T>(array: T[], callback: Function, thisArg?: T
|
|
|
74
74
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
75
75
|
* @return {Promise} - Returns a Promise with the index that passed the test, otherwise *-1*.
|
|
76
76
|
*/
|
|
77
|
-
export declare const findIndexSeries: <T>(array: T[], callback: Function, thisArg?: T
|
|
77
|
+
export declare const findIndexSeries: <T>(array: T[], callback: Function, thisArg?: T) => Promise<number | undefined>;
|
|
78
78
|
/**
|
|
79
79
|
* Implements ES5 [`Array#some()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) method.<br><br>
|
|
80
80
|
* Test if some element in `array` passes the test implemented in `callback`.<br>
|
|
@@ -85,7 +85,7 @@ export declare const findIndexSeries: <T>(array: T[], callback: Function, thisAr
|
|
|
85
85
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
86
86
|
* @return {Promise} - Returns a Promise with *true* as value if some element passed the test, otherwise *false*.
|
|
87
87
|
*/
|
|
88
|
-
export declare const some: <T>(array: T[], callback: Function, thisArg?: T
|
|
88
|
+
export declare const some: <T>(array: T[], callback: Function, thisArg?: T) => Promise<unknown>;
|
|
89
89
|
/**
|
|
90
90
|
* Same functionality as [`some()`](global.html#some), but runs only one callback at a time.
|
|
91
91
|
* @param {Array} array - Array to iterate over.
|
|
@@ -93,7 +93,7 @@ export declare const some: <T>(array: T[], callback: Function, thisArg?: T | und
|
|
|
93
93
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
94
94
|
* @return {Promise} - Returns a Promise with *true* as value if some element passed the test, otherwise *false*.
|
|
95
95
|
*/
|
|
96
|
-
export declare const someSeries: <T>(array: T[], callback: Function, thisArg?: T
|
|
96
|
+
export declare const someSeries: <T>(array: T[], callback: Function, thisArg?: T) => Promise<boolean>;
|
|
97
97
|
/**
|
|
98
98
|
* Implements ES5 [`Array#every()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) method.<br><br>
|
|
99
99
|
* Test if all elements in `array` pass the test implemented in `callback`.<br>
|
|
@@ -104,7 +104,7 @@ export declare const someSeries: <T>(array: T[], callback: Function, thisArg?: T
|
|
|
104
104
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
105
105
|
* @return {Promise} - Returns a Promise with *true* as value if all elements passed the test, otherwise *false*.
|
|
106
106
|
*/
|
|
107
|
-
export declare const every: <T>(array: T[], callback: any, thisArg?: T
|
|
107
|
+
export declare const every: <T>(array: T[], callback: any, thisArg?: T) => Promise<boolean>;
|
|
108
108
|
/**
|
|
109
109
|
* Same functionality as [`every()`](global.html#every), but runs only one callback at a time.<br><br>
|
|
110
110
|
* @param {Array} array - Array to iterate over.
|
|
@@ -112,7 +112,7 @@ export declare const every: <T>(array: T[], callback: any, thisArg?: T | undefin
|
|
|
112
112
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
113
113
|
* @return {Promise} - Returns a Promise with *true* as value if all elements passed the test, otherwise *false*.
|
|
114
114
|
*/
|
|
115
|
-
export declare const everySeries: <T>(array: T[], callback: Function, thisArg?: T
|
|
115
|
+
export declare const everySeries: <T>(array: T[], callback: Function, thisArg?: T) => Promise<boolean>;
|
|
116
116
|
/**
|
|
117
117
|
* Implements ES5 [`Array#filter()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) method.<br><br>
|
|
118
118
|
* Creates a new array with the elements that passed the test implemented in `callback`.<br>
|
|
@@ -122,14 +122,14 @@ export declare const everySeries: <T>(array: T[], callback: Function, thisArg?:
|
|
|
122
122
|
* @param {Object} [thisArg] - Value to use as *this* when executing the `callback`.
|
|
123
123
|
* @return {Promise} - Returns a Promise with the resultant filtered *Array* as value.
|
|
124
124
|
*/
|
|
125
|
-
export declare const filter: <T>(array: T[], callback: Function, thisArg?: T
|
|
125
|
+
export declare const filter: <T>(array: T[], callback: Function, thisArg?: T) => Promise<unknown>;
|
|
126
126
|
/**
|
|
127
127
|
* Same functionality as [`filter()`](global.html#filter), but runs only one callback at a time.
|
|
128
128
|
* @param {Array} array - Array to iterate over.
|
|
129
129
|
* @param {Function} callback - Function to apply each item in `array`. Accepts three arguments: `currentValue`, `index` and `array`.
|
|
130
130
|
* @return {Promise} - Returns a Promise with the resultant filtered *Array* as value.
|
|
131
131
|
*/
|
|
132
|
-
export declare const filterSeries: <T>(array: T[], callback: Function, thisArg?: T
|
|
132
|
+
export declare const filterSeries: <T>(array: T[], callback: Function, thisArg?: T) => Promise<Awaited<T>[]>;
|
|
133
133
|
/**
|
|
134
134
|
* Implements ES5 [`Array#reduce()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) method.<br><br>
|
|
135
135
|
* Applies a `callback` against an accumulator and each element in `array`.
|
|
@@ -138,5 +138,5 @@ export declare const filterSeries: <T>(array: T[], callback: Function, thisArg?:
|
|
|
138
138
|
* @param {Object} [initialValue] - Used as first argument to the first call of `callback`.
|
|
139
139
|
* @return {Promise} - Returns a Promise with the resultant value from the reduction.
|
|
140
140
|
*/
|
|
141
|
-
export declare const reduce: <T>(array: T[], callback: Function, initialValue?: T
|
|
141
|
+
export declare const reduce: <T>(array: T[], callback: Function, initialValue?: T) => Promise<any>;
|
|
142
142
|
//# sourceMappingURL=pIteration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pIteration.d.ts","sourceRoot":"","sources":["../src/pIteration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"pIteration.d.ts","sourceRoot":"","sources":["../src/pIteration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,aAAoB,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,kBAW3E,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,aAAoB,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,kBAMjF,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,GAAG,aAAoB,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,mBAUvE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,aAAoB,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,mBAQ7E,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,aAAc,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,2BAqBlE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,aAAoB,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,2BAM9E,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,aAAc,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,qBAqBvE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,aAAoB,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,gCAMnF,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,aAAc,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,qBAyBlE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,aAAoB,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,qBAO9E,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,aAAc,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC,qBAyB9D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,aAAoB,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,qBAO/E,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,aAAc,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,qBAwBpE,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,aAAoB,CAAC,EAAE,YAAY,QAAQ,YAAY,CAAC,0BAQhF,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,aAAoB,CAAC,EAAE,YAAY,QAAQ,iBAAiB,CAAC,iBAmB/E,CAAA"}
|
package/build/shim.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shim.d.ts","sourceRoot":"","sources":["../src/shim.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAW,UAAU,EAAE,MAAM,aAAa,CAAA;AAsBtD,wBAAsB,oBAAoB,CAAC,CAAC,EAAG,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,QAAQ,GAAG,QAAQ,EAAO,EAAE,IAAI,GAAE,GAAG,EAAO,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CA4DvJ;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"shim.d.ts","sourceRoot":"","sources":["../src/shim.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAW,UAAU,EAAE,MAAM,aAAa,CAAA;AAsBtD,wBAAsB,oBAAoB,CAAC,CAAC,EAAG,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,QAAQ,GAAG,QAAQ,EAAO,EAAE,IAAI,GAAE,GAAG,EAAO,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CA4DvJ;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,CAkN9F;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,WAAW,EAAE,IAAI,GAAE,GAAG,EAAO,EAAE,OAAO,GAAE,MAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CA2CxJ"}
|
package/build/shim.js
CHANGED
|
@@ -136,9 +136,6 @@ export function wrapCommand(commandName, fn) {
|
|
|
136
136
|
return wrapElementFn(target,
|
|
137
137
|
/**
|
|
138
138
|
* `this` is an array of WebdriverIO elements
|
|
139
|
-
*
|
|
140
|
-
* Note(Christian): types for elements are defined in the
|
|
141
|
-
* webdriverio package and not accessible here (fixed in v9)
|
|
142
139
|
*/
|
|
143
140
|
function (index) {
|
|
144
141
|
/**
|
package/build/utils.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare function transformCommandLogResult(result: {
|
|
|
28
28
|
script?: string | undefined;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
* checks if command argument is valid according to
|
|
31
|
+
* checks if command argument is valid according to specification
|
|
32
32
|
*
|
|
33
33
|
* @param {*} arg command argument
|
|
34
34
|
* @param {Object} expectedType parameter type (e.g. `number`, `string[]` or `(number|string)`)
|
|
@@ -39,6 +39,13 @@ export declare function isValidParameter(arg: any, expectedType: string): boolea
|
|
|
39
39
|
* get type of command argument
|
|
40
40
|
*/
|
|
41
41
|
export declare function getArgumentType(arg: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "null";
|
|
42
|
+
/**
|
|
43
|
+
* Utility to import modules with user friendly error message
|
|
44
|
+
* @param moduleName The name of the module to import
|
|
45
|
+
* @param namedImport The name of the import to return
|
|
46
|
+
* @returns The imported module
|
|
47
|
+
*/
|
|
48
|
+
export declare function userImport<T>(moduleName: string, namedImport?: string): Promise<T>;
|
|
42
49
|
/**
|
|
43
50
|
* Allows to safely require a package, it only throws if the package was found
|
|
44
51
|
* but failed to load due to syntax errors
|
|
@@ -91,5 +98,5 @@ export declare function isEdge(browserName?: string): boolean;
|
|
|
91
98
|
/**
|
|
92
99
|
* traverse up the scope chain until browser element was reached
|
|
93
100
|
*/
|
|
94
|
-
export declare function getBrowserObject(elem: WebdriverIO.Element | WebdriverIO.Browser): WebdriverIO.Browser;
|
|
101
|
+
export declare function getBrowserObject(elem: WebdriverIO.Element | WebdriverIO.Browser | WebdriverIO.ElementArray): WebdriverIO.Browser;
|
|
95
102
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAW,MAAM,aAAa,CAAA;AAe7D,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,WAGnC;AAED;;;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,CAAC,CAAC,EAAG,UAAU,EAAE,MAAM,EAAE,WAAW,SAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAW5F;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC,CAgEtF;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;;;GAGG;AACH,eAAO,MAAM,KAAK,mCAAoD,CAAA;AAEtE;;;;;EAKE;AACF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,GAAG,OAAO,CAM1E;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"}
|
package/build/utils.js
CHANGED
|
@@ -110,7 +110,7 @@ export function transformCommandLogResult(result) {
|
|
|
110
110
|
return result;
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
|
-
* checks if command argument is valid according to
|
|
113
|
+
* checks if command argument is valid according to specification
|
|
114
114
|
*
|
|
115
115
|
* @param {*} arg command argument
|
|
116
116
|
* @param {Object} expectedType parameter type (e.g. `number`, `string[]` or `(number|string)`)
|
|
@@ -150,6 +150,24 @@ export function isValidParameter(arg, expectedType) {
|
|
|
150
150
|
export function getArgumentType(arg) {
|
|
151
151
|
return arg === null ? 'null' : typeof arg;
|
|
152
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Utility to import modules with user friendly error message
|
|
155
|
+
* @param moduleName The name of the module to import
|
|
156
|
+
* @param namedImport The name of the import to return
|
|
157
|
+
* @returns The imported module
|
|
158
|
+
*/
|
|
159
|
+
export async function userImport(moduleName, namedImport = 'default') {
|
|
160
|
+
try {
|
|
161
|
+
const mod = await import(moduleName);
|
|
162
|
+
if (namedImport in mod) {
|
|
163
|
+
return mod[namedImport];
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
catch (err) {
|
|
167
|
+
throw new Error(`Couldn't import "${moduleName}"! Do you have it installed? If not run "npm install ${moduleName}"!`);
|
|
168
|
+
}
|
|
169
|
+
throw new Error(`Couldn't find "${namedImport}" in module "${moduleName}"`);
|
|
170
|
+
}
|
|
153
171
|
/**
|
|
154
172
|
* Allows to safely require a package, it only throws if the package was found
|
|
155
173
|
* but failed to load due to syntax errors
|
|
@@ -303,10 +321,7 @@ export function isEdge(browserName) {
|
|
|
303
321
|
/**
|
|
304
322
|
* traverse up the scope chain until browser element was reached
|
|
305
323
|
*/
|
|
306
|
-
// @ts-ignore types are not loaded in time (fixed in v9)
|
|
307
324
|
export function getBrowserObject(elem) {
|
|
308
|
-
// @ts-ignore types are not loaded in time (fixed in v9)
|
|
309
325
|
const elemObject = elem;
|
|
310
|
-
// @ts-ignore types are not loaded in time (fixed in v9)
|
|
311
326
|
return elemObject.parent ? getBrowserObject(elemObject.parent) : elem;
|
|
312
327
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-alpha.59+259e4a29f",
|
|
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",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"types": "./build/index.d.ts",
|
|
21
21
|
"typeScriptVersion": "3.8.3",
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": "
|
|
23
|
+
"node": ">=18"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
"url": "https://github.com/webdriverio/webdriverio/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@puppeteer/browsers": "^
|
|
41
|
-
"@wdio/logger": "
|
|
42
|
-
"@wdio/types": "
|
|
40
|
+
"@puppeteer/browsers": "^2.2.0",
|
|
41
|
+
"@wdio/logger": "9.0.0-alpha.59+259e4a29f",
|
|
42
|
+
"@wdio/types": "9.0.0-alpha.59+259e4a29f",
|
|
43
43
|
"decamelize": "^6.0.0",
|
|
44
44
|
"deepmerge-ts": "^5.1.0",
|
|
45
|
-
"edgedriver": "^5.3.
|
|
46
|
-
"geckodriver": "^4.3.
|
|
45
|
+
"edgedriver": "^5.3.10",
|
|
46
|
+
"geckodriver": "^4.3.3",
|
|
47
47
|
"get-port": "^7.0.0",
|
|
48
48
|
"import-meta-resolve": "^4.0.0",
|
|
49
|
-
"locate-app": "^2.
|
|
50
|
-
"safaridriver": "^0.1.
|
|
49
|
+
"locate-app": "^2.2.24",
|
|
50
|
+
"safaridriver": "^0.1.2",
|
|
51
51
|
"split2": "^4.2.0",
|
|
52
|
-
"wait-port": "^1.0
|
|
52
|
+
"wait-port": "^1.1.0"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "259e4a29f28745e0af3ca6ca3140c8cf491e3771"
|
|
58
58
|
}
|