@wdio/utils 8.16.17 → 8.16.22
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/test-framework/testFnWrapper.d.ts +4 -2
- package/build/test-framework/testFnWrapper.d.ts.map +1 -1
- package/build/test-framework/testFnWrapper.js +9 -1
- package/build/test-framework/testInterfaceWrapper.d.ts.map +1 -1
- package/build/test-framework/testInterfaceWrapper.js +1 -1
- package/package.json +3 -3
|
@@ -9,8 +9,9 @@ import type { WrapperMethods, SpecFunction, BeforeHookParam, AfterHookParam } fr
|
|
|
9
9
|
* @param {string} cid cid
|
|
10
10
|
* @param {number} repeatTest number of retries if test fails
|
|
11
11
|
* @return {*} specFn result
|
|
12
|
+
* @param {string} hookName the hook name
|
|
12
13
|
*/
|
|
13
|
-
export declare const testFnWrapper: (this: unknown, args_0: string, args_1: SpecFunction, args_2: BeforeHookParam<unknown>, args_3: AfterHookParam<unknown>, args_4: string, args_5: number) => Promise<unknown>;
|
|
14
|
+
export declare const testFnWrapper: (this: unknown, args_0: string, args_1: SpecFunction, args_2: BeforeHookParam<unknown>, args_3: AfterHookParam<unknown>, args_4: string, args_5: number, args_6?: string | undefined) => Promise<unknown>;
|
|
14
15
|
/**
|
|
15
16
|
* wraps test framework spec/hook function with WebdriverIO before/after hooks
|
|
16
17
|
*
|
|
@@ -22,8 +23,9 @@ export declare const testFnWrapper: (this: unknown, args_0: string, args_1: Spec
|
|
|
22
23
|
* @param {string} cid cid
|
|
23
24
|
* @param {number} repeatTest number of retries if test fails
|
|
24
25
|
* @return {*} specFn result
|
|
26
|
+
* @param {string} hookName the hook name
|
|
25
27
|
*/
|
|
26
|
-
export declare const testFrameworkFnWrapper: (this: unknown, { executeHooksWithArgs, executeAsync }: WrapperMethods, type: string, { specFn, specFnArgs }: SpecFunction, { beforeFn, beforeFnArgs }: BeforeHookParam<unknown>, { afterFn, afterFnArgs }: AfterHookParam<unknown>, cid: string, repeatTest?: number) => Promise<unknown>;
|
|
28
|
+
export declare const testFrameworkFnWrapper: (this: unknown, { executeHooksWithArgs, executeAsync }: WrapperMethods, type: string, { specFn, specFnArgs }: SpecFunction, { beforeFn, beforeFnArgs }: BeforeHookParam<unknown>, { afterFn, afterFnArgs }: AfterHookParam<unknown>, cid: string, repeatTest?: number, hookName?: string) => Promise<unknown>;
|
|
27
29
|
/**
|
|
28
30
|
* Filter out internal stacktraces. exporting to allow testing of the function
|
|
29
31
|
* @param {string} stack Stacktrace
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testFnWrapper.d.ts","sourceRoot":"","sources":["../../src/test-framework/testFnWrapper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,cAAc,EACd,YAAY,EACZ,eAAe,EACf,cAAc,EACjB,MAAM,YAAY,CAAA;AASnB
|
|
1
|
+
{"version":3,"file":"testFnWrapper.d.ts","sourceRoot":"","sources":["../../src/test-framework/testFnWrapper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,cAAc,EACd,YAAY,EACZ,eAAe,EACf,cAAc,EACjB,MAAM,YAAY,CAAA;AASnB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,SAChB,OAAO,2LAYhB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,SACzB,OAAO,0CAC2B,cAAc,QAChD,MAAM,0BACY,YAAY,8BACR,gBAAgB,OAAO,CAAC,4BAC1B,eAAe,OAAO,CAAC,OAC5C,MAAM,kCAEA,MAAM,qBA0CpB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MAKhD,CAAA"}
|
|
@@ -16,6 +16,7 @@ const STACKTRACE_FILTER = [
|
|
|
16
16
|
* @param {string} cid cid
|
|
17
17
|
* @param {number} repeatTest number of retries if test fails
|
|
18
18
|
* @return {*} specFn result
|
|
19
|
+
* @param {string} hookName the hook name
|
|
19
20
|
*/
|
|
20
21
|
export const testFnWrapper = function (...args) {
|
|
21
22
|
return testFrameworkFnWrapper.call(this, { executeHooksWithArgs, executeAsync }, ...args);
|
|
@@ -31,10 +32,14 @@ export const testFnWrapper = function (...args) {
|
|
|
31
32
|
* @param {string} cid cid
|
|
32
33
|
* @param {number} repeatTest number of retries if test fails
|
|
33
34
|
* @return {*} specFn result
|
|
35
|
+
* @param {string} hookName the hook name
|
|
34
36
|
*/
|
|
35
|
-
export const testFrameworkFnWrapper = async function ({ executeHooksWithArgs, executeAsync }, type, { specFn, specFnArgs }, { beforeFn, beforeFnArgs }, { afterFn, afterFnArgs }, cid, repeatTest = 0) {
|
|
37
|
+
export const testFrameworkFnWrapper = async function ({ executeHooksWithArgs, executeAsync }, type, { specFn, specFnArgs }, { beforeFn, beforeFnArgs }, { afterFn, afterFnArgs }, cid, repeatTest = 0, hookName) {
|
|
36
38
|
const retries = { attempts: 0, limit: repeatTest };
|
|
37
39
|
const beforeArgs = beforeFnArgs(this);
|
|
40
|
+
if (type === 'Hook' && hookName) {
|
|
41
|
+
beforeArgs.push(hookName);
|
|
42
|
+
}
|
|
38
43
|
await logHookError(`Before${type}`, await executeHooksWithArgs(`before${type}`, beforeFn, beforeArgs), cid);
|
|
39
44
|
let result;
|
|
40
45
|
let error;
|
|
@@ -57,6 +62,9 @@ export const testFrameworkFnWrapper = async function ({ executeHooksWithArgs, ex
|
|
|
57
62
|
duration,
|
|
58
63
|
passed: !error
|
|
59
64
|
});
|
|
65
|
+
if (type === 'Hook' && hookName) {
|
|
66
|
+
afterArgs.push(hookName);
|
|
67
|
+
}
|
|
60
68
|
await logHookError(`After${type}`, await executeHooksWithArgs(`after${type}`, afterFn, [...afterArgs]), cid);
|
|
61
69
|
if (error && !error.matcherName) {
|
|
62
70
|
throw error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testInterfaceWrapper.d.ts","sourceRoot":"","sources":["../../src/test-framework/testInterfaceWrapper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACR,UAAU,EAIV,aAAa,EAChB,MAAM,YAAY,CAAA;AAInB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,SACV,OAAO,UACL,QAAQ,UACR,QAAQ,YACN,QAAQ,GAAG,QAAQ,EAAE,gBACjB,WAAW,OAAO,CAAC,WACxB,QAAQ,GAAG,QAAQ,EAAE,eACjB,WAAW,OAAO,CAAC,OAC3B,MAAM,cACC,MAAM,WACT,MAAM,
|
|
1
|
+
{"version":3,"file":"testInterfaceWrapper.d.ts","sourceRoot":"","sources":["../../src/test-framework/testInterfaceWrapper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACR,UAAU,EAIV,aAAa,EAChB,MAAM,YAAY,CAAA;AAInB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,SACV,OAAO,UACL,QAAQ,UACR,QAAQ,YACN,QAAQ,GAAG,QAAQ,EAAE,gBACjB,WAAW,OAAO,CAAC,WACxB,QAAQ,GAAG,QAAQ,EAAE,eACjB,WAAW,OAAO,CAAC,OAC3B,MAAM,cACC,MAAM,WACT,MAAM,QAuClB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,SACV,OAAO,aACF,MAAM,UACT,QAAQ,UACR,QAAQ,YACN,QAAQ,GAAG,QAAQ,EAAE,gBACjB,WAAW,OAAO,CAAC,WACxB,QAAQ,GAAG,QAAQ,EAAE,eACjB,WAAW,OAAO,CAAC,OAC3B,MAAM,cACC,MAAM,WACT,MAAM,QAqClB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,SACnB,OAAO,UACL,QAAQ,UACR,OAAO,YACL,QAAQ,GAAG,QAAQ,EAAE,gBACjB,WAAW,OAAO,CAAC,WACxB,QAAQ,GAAG,QAAQ,EAAE,eACjB,WAAW,OAAO,CAAC,OAC3B,MAAM,wBAEwB,aAAa,QAkEnD,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,SACvB,OAAO,UACL,OAAO,YACL,QAAQ,GAAG,QAAQ,EAAE,gBACjB,WAAW,OAAO,CAAC,WACxB,QAAQ,GAAG,QAAQ,EAAE,eACjB,WAAW,OAAO,CAAC,UACxB,MAAM,OACT,MAAM,oCAcd,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "8.16.
|
|
3
|
+
"version": "8.16.22",
|
|
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",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@puppeteer/browsers": "^1.6.0",
|
|
34
34
|
"@wdio/logger": "8.16.17",
|
|
35
|
-
"@wdio/types": "8.16.
|
|
35
|
+
"@wdio/types": "8.16.22",
|
|
36
36
|
"decamelize": "^6.0.0",
|
|
37
37
|
"deepmerge-ts": "^5.1.0",
|
|
38
38
|
"edgedriver": "^5.3.5",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "54b6b1723b012e6792941199a325aaea8ebe7356"
|
|
52
52
|
}
|