@wdio/utils 8.8.0 → 8.8.6
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/initialiseServices.d.ts +1 -1
- package/build/initialiseServices.js +1 -1
- package/build/monad.d.ts +1 -1
- package/build/monad.js +2 -2
- package/build/test-framework/testInterfaceWrapper.d.ts +8 -8
- package/build/test-framework/testInterfaceWrapper.js +8 -8
- package/build/utils.d.ts +2 -2
- package/build/utils.js +2 -2
- package/package.json +3 -3
|
@@ -15,7 +15,7 @@ export declare function initialiseLauncherService(config: Omit<Options.Testrunne
|
|
|
15
15
|
* initialise services for worker instance
|
|
16
16
|
* @param {Object} config wdio config
|
|
17
17
|
* @param {Object} caps worker capabilities
|
|
18
|
-
* @param {
|
|
18
|
+
* @param {object} ignoredWorkerServices list of services that don't need to be required in a worker
|
|
19
19
|
* as they don't export a service for it
|
|
20
20
|
* @return {Object[]} list if worker initiated worker services
|
|
21
21
|
*/
|
|
@@ -123,7 +123,7 @@ export async function initialiseLauncherService(config, caps) {
|
|
|
123
123
|
* initialise services for worker instance
|
|
124
124
|
* @param {Object} config wdio config
|
|
125
125
|
* @param {Object} caps worker capabilities
|
|
126
|
-
* @param {
|
|
126
|
+
* @param {object} ignoredWorkerServices list of services that don't need to be required in a worker
|
|
127
127
|
* as they don't export a service for it
|
|
128
128
|
* @return {Object[]} list if worker initiated worker services
|
|
129
129
|
*/
|
package/build/monad.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export default function WebDriver(options: Record<string, any>, modifier?: Funct
|
|
|
8
8
|
}): any;
|
|
9
9
|
/**
|
|
10
10
|
* Enhance monad prototype with function
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {string} name name of function to attach to prototype
|
|
12
12
|
* @param {Function} func function to be added to prototype
|
|
13
13
|
* @param {Object} proto prototype to add function to (optional)
|
|
14
14
|
* @param {Function} origCommand original command to be passed to custom command as first argument
|
package/build/monad.js
CHANGED
|
@@ -88,7 +88,7 @@ export default function WebDriver(options, modifier, propertiesObject = {}) {
|
|
|
88
88
|
};
|
|
89
89
|
/**
|
|
90
90
|
* overwriteCommand
|
|
91
|
-
* @param {
|
|
91
|
+
* @param {string} name command name to be overwritten
|
|
92
92
|
* @param {Function} func function to replace original command with;
|
|
93
93
|
* takes original function as first argument.
|
|
94
94
|
* @param {boolean=} attachToElement overwrite browser command (false) or element command (true)
|
|
@@ -128,7 +128,7 @@ export default function WebDriver(options, modifier, propertiesObject = {}) {
|
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
130
|
* Enhance monad prototype with function
|
|
131
|
-
* @param {
|
|
131
|
+
* @param {string} name name of function to attach to prototype
|
|
132
132
|
* @param {Function} func function to be added to prototype
|
|
133
133
|
* @param {Object} proto prototype to add function to (optional)
|
|
134
134
|
* @param {Function} origCommand original command to be passed to custom command as first argument
|
|
@@ -15,8 +15,8 @@ import type { HookFnArgs, SpecArguments } from './types.js';
|
|
|
15
15
|
* @param {Function} beforeFnArgs function that returns args for `beforeFn`
|
|
16
16
|
* @param {Function} afterFn after hook
|
|
17
17
|
* @param {Function} afterArgsFn function that returns args for `afterFn`
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {
|
|
18
|
+
* @param {string} cid cid
|
|
19
|
+
* @param {number} repeatTest number of retries if hook fails
|
|
20
20
|
* @return {Function} wrapped framework hook function
|
|
21
21
|
*/
|
|
22
22
|
export declare const runHook: (this: unknown, hookFn: Function, origFn: Function, beforeFn: Function | Function[], beforeFnArgs: HookFnArgs<unknown>, afterFn: Function | Function[], afterFnArgs: HookFnArgs<unknown>, cid: string, repeatTest: number, timeout: number) => any;
|
|
@@ -30,8 +30,8 @@ export declare const runHook: (this: unknown, hookFn: Function, origFn: Function
|
|
|
30
30
|
* @param {Function} beforeFnArgs function that returns args for `beforeFn`
|
|
31
31
|
* @param {Function} afterFn after hook
|
|
32
32
|
* @param {Function} afterFnArgs function that returns args for `afterFn`
|
|
33
|
-
* @param {
|
|
34
|
-
* @param {
|
|
33
|
+
* @param {string} cid cid
|
|
34
|
+
* @param {number} repeatTest number of retries if test fails
|
|
35
35
|
* @return {Function} wrapped test function
|
|
36
36
|
*/
|
|
37
37
|
export declare const runSpec: (this: unknown, specTitle: string, specFn: Function, origFn: Function, beforeFn: Function | Function[], beforeFnArgs: HookFnArgs<unknown>, afterFn: Function | Function[], afterFnArgs: HookFnArgs<unknown>, cid: string, repeatTest: number, timeout: number) => any;
|
|
@@ -40,12 +40,12 @@ export declare const runSpec: (this: unknown, specTitle: string, specFn: Functio
|
|
|
40
40
|
*
|
|
41
41
|
* @param {Function} origFn original framework function
|
|
42
42
|
* @param {Boolean} isSpec whether or not origFn is a spec
|
|
43
|
-
* @param {
|
|
43
|
+
* @param {string[]} testInterfaceFnNames command that runs specs, e.g. `it`, `it.only` or `fit`
|
|
44
44
|
* @param {Function} beforeFn before hook
|
|
45
45
|
* @param {Function} beforeFnArgs function that returns args for `beforeFn`
|
|
46
46
|
* @param {Function} afterFn after hook
|
|
47
47
|
* @param {Function} afterArgsFn function that returns args for `afterFn`
|
|
48
|
-
* @param {
|
|
48
|
+
* @param {string} cid cid
|
|
49
49
|
* @return {Function} wrapped test/hook function
|
|
50
50
|
*/
|
|
51
51
|
export declare const wrapTestFunction: (this: unknown, origFn: Function, isSpec: boolean, beforeFn: Function | Function[], beforeArgsFn: HookFnArgs<unknown>, afterFn: Function | Function[], afterArgsFn: HookFnArgs<unknown>, cid: string) => (...specArguments: SpecArguments) => any;
|
|
@@ -59,8 +59,8 @@ export declare const wrapTestFunction: (this: unknown, origFn: Function, isSpec:
|
|
|
59
59
|
* @param {Function} beforeFnArgs function that returns args for `beforeFn`
|
|
60
60
|
* @param {Function} afterFn after hook
|
|
61
61
|
* @param {Function} afterArgsFn function that returns args for `afterFn`
|
|
62
|
-
* @param {
|
|
63
|
-
* @param {
|
|
62
|
+
* @param {string} fnName test interface command to wrap, e.g. `beforeEach`
|
|
63
|
+
* @param {string} cid cid
|
|
64
64
|
* @param {Object} scope the scope to run command from, defaults to global
|
|
65
65
|
*/
|
|
66
66
|
export declare const wrapGlobalTestMethod: (this: unknown, isSpec: boolean, beforeFn: Function | Function[], beforeArgsFn: HookFnArgs<unknown>, afterFn: Function | Function[], afterArgsFn: HookFnArgs<unknown>, fnName: string, cid: string, scope?: typeof globalThis) => void;
|
|
@@ -17,8 +17,8 @@ const MOCHA_COMMANDS = ['skip', 'only'];
|
|
|
17
17
|
* @param {Function} beforeFnArgs function that returns args for `beforeFn`
|
|
18
18
|
* @param {Function} afterFn after hook
|
|
19
19
|
* @param {Function} afterArgsFn function that returns args for `afterFn`
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {
|
|
20
|
+
* @param {string} cid cid
|
|
21
|
+
* @param {number} repeatTest number of retries if hook fails
|
|
22
22
|
* @return {Function} wrapped framework hook function
|
|
23
23
|
*/
|
|
24
24
|
export const runHook = function (hookFn, origFn, beforeFn, beforeFnArgs, afterFn, afterFnArgs, cid, repeatTest, timeout) {
|
|
@@ -45,8 +45,8 @@ export const runHook = function (hookFn, origFn, beforeFn, beforeFnArgs, afterFn
|
|
|
45
45
|
* @param {Function} beforeFnArgs function that returns args for `beforeFn`
|
|
46
46
|
* @param {Function} afterFn after hook
|
|
47
47
|
* @param {Function} afterFnArgs function that returns args for `afterFn`
|
|
48
|
-
* @param {
|
|
49
|
-
* @param {
|
|
48
|
+
* @param {string} cid cid
|
|
49
|
+
* @param {number} repeatTest number of retries if test fails
|
|
50
50
|
* @return {Function} wrapped test function
|
|
51
51
|
*/
|
|
52
52
|
export const runSpec = function (specTitle, specFn, origFn, beforeFn, beforeFnArgs, afterFn, afterFnArgs, cid, repeatTest, timeout) {
|
|
@@ -68,12 +68,12 @@ export const runSpec = function (specTitle, specFn, origFn, beforeFn, beforeFnAr
|
|
|
68
68
|
*
|
|
69
69
|
* @param {Function} origFn original framework function
|
|
70
70
|
* @param {Boolean} isSpec whether or not origFn is a spec
|
|
71
|
-
* @param {
|
|
71
|
+
* @param {string[]} testInterfaceFnNames command that runs specs, e.g. `it`, `it.only` or `fit`
|
|
72
72
|
* @param {Function} beforeFn before hook
|
|
73
73
|
* @param {Function} beforeFnArgs function that returns args for `beforeFn`
|
|
74
74
|
* @param {Function} afterFn after hook
|
|
75
75
|
* @param {Function} afterArgsFn function that returns args for `afterFn`
|
|
76
|
-
* @param {
|
|
76
|
+
* @param {string} cid cid
|
|
77
77
|
* @return {Function} wrapped test/hook function
|
|
78
78
|
*/
|
|
79
79
|
export const wrapTestFunction = function (origFn, isSpec, beforeFn, beforeArgsFn, afterFn, afterArgsFn, cid) {
|
|
@@ -129,8 +129,8 @@ export const wrapTestFunction = function (origFn, isSpec, beforeFn, beforeArgsFn
|
|
|
129
129
|
* @param {Function} beforeFnArgs function that returns args for `beforeFn`
|
|
130
130
|
* @param {Function} afterFn after hook
|
|
131
131
|
* @param {Function} afterArgsFn function that returns args for `afterFn`
|
|
132
|
-
* @param {
|
|
133
|
-
* @param {
|
|
132
|
+
* @param {string} fnName test interface command to wrap, e.g. `beforeEach`
|
|
133
|
+
* @param {string} cid cid
|
|
134
134
|
* @param {Object} scope the scope to run command from, defaults to global
|
|
135
135
|
*/
|
|
136
136
|
export const wrapGlobalTestMethod = function (isSpec, beforeFn, beforeArgsFn, afterFn, afterArgsFn, fnName, cid, scope = globalThis) {
|
package/build/utils.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare function commandCallStructure(commandName: string, args: any[]):
|
|
|
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
|
|
20
|
-
* @param {
|
|
20
|
+
* @param {object} result WebDriver response body
|
|
21
21
|
*/
|
|
22
22
|
export declare function transformCommandLogResult(result: {
|
|
23
23
|
file?: string;
|
|
@@ -64,7 +64,7 @@ export declare function filterSpecArgs(args: any[]): any[];
|
|
|
64
64
|
export declare function isBase64(str: string): boolean;
|
|
65
65
|
/**
|
|
66
66
|
* Helper utility to check file access
|
|
67
|
-
* @param {
|
|
67
|
+
* @param {string} file file to check access for
|
|
68
68
|
* @return true if file can be accessed
|
|
69
69
|
*/
|
|
70
70
|
export declare const canAccess: (file?: string) => boolean;
|
package/build/utils.js
CHANGED
|
@@ -84,7 +84,7 @@ export function commandCallStructure(commandName, args) {
|
|
|
84
84
|
/**
|
|
85
85
|
* transforms WebDriver result for log stream to avoid unnecessary long
|
|
86
86
|
* result strings e.g. if it contains a screenshot
|
|
87
|
-
* @param {
|
|
87
|
+
* @param {object} result WebDriver response body
|
|
88
88
|
*/
|
|
89
89
|
export function transformCommandLogResult(result) {
|
|
90
90
|
if (typeof result.file === 'string' && isBase64(result.file)) {
|
|
@@ -246,7 +246,7 @@ export function isBase64(str) {
|
|
|
246
246
|
}
|
|
247
247
|
/**
|
|
248
248
|
* Helper utility to check file access
|
|
249
|
-
* @param {
|
|
249
|
+
* @param {string} file file to check access for
|
|
250
250
|
* @return true if file can be accessed
|
|
251
251
|
*/
|
|
252
252
|
export const canAccess = (file) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "8.8.
|
|
3
|
+
"version": "8.8.6",
|
|
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",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@wdio/logger": "8.6.6",
|
|
34
|
-
"@wdio/types": "8.8.
|
|
34
|
+
"@wdio/types": "8.8.6",
|
|
35
35
|
"import-meta-resolve": "^2.2.0",
|
|
36
36
|
"p-iteration": "^1.1.8"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "0db3b2f595ef834e6e01f58873dbde776dc08240"
|
|
42
42
|
}
|