@wdio/utils 8.16.17 → 8.17.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/driver/utils.d.ts +4 -4
- package/build/driver/utils.d.ts.map +1 -1
- package/build/envDetector.d.ts +3 -3
- package/build/envDetector.d.ts.map +1 -1
- package/build/monad.js +4 -3
- 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
package/build/driver/utils.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { EdgedriverParameters } from 'edgedriver';
|
|
2
|
-
import type { Options
|
|
2
|
+
import type { Options } from '@wdio/types';
|
|
3
3
|
export declare function parseParams(params: EdgedriverParameters): string[];
|
|
4
4
|
export declare function getBuildIdByChromePath(chromePath?: string): string | undefined;
|
|
5
5
|
export declare function getBuildIdByFirefoxPath(firefoxPath?: string): Promise<string | undefined>;
|
|
6
6
|
export declare const downloadProgressCallback: (artifact: string, downloadedBytes: number, totalBytes: number) => void;
|
|
7
|
-
export declare function setupPuppeteerBrowser(cacheDir: string, caps:
|
|
7
|
+
export declare function setupPuppeteerBrowser(cacheDir: string, caps: WebdriverIO.Capabilities): Promise<{
|
|
8
8
|
executablePath: string;
|
|
9
9
|
browserVersion: string | undefined;
|
|
10
10
|
} | {
|
|
11
11
|
executablePath: string | undefined;
|
|
12
12
|
browserVersion: string;
|
|
13
13
|
}>;
|
|
14
|
-
export declare function getDriverOptions(caps:
|
|
15
|
-
export declare function getCacheDir(options: Pick<Options.WebDriver, 'cacheDir'>, caps:
|
|
14
|
+
export declare function getDriverOptions(caps: WebdriverIO.Capabilities): WebdriverIO.ChromedriverOptions | WebdriverIO.GeckodriverOptions | WebdriverIO.EdgedriverOptions;
|
|
15
|
+
export declare function getCacheDir(options: Pick<Options.WebDriver, 'cacheDir'>, caps: WebdriverIO.Capabilities): string;
|
|
16
16
|
export declare function setupChromedriver(cacheDir: string, driverVersion?: string): Promise<{
|
|
17
17
|
executablePath: string;
|
|
18
18
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/driver/utils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/driver/utils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAO1C,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;AAoBD,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,YAAY;;;;;;GA6E3F;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,wBAAsB,iBAAiB,CAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM;;GAgEhF;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;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"}
|
package/build/envDetector.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function isW3C(capabilities?: Capabilities.DesiredCapabilities):
|
|
|
11
11
|
* @param {string=} automationProtocol `devtools`
|
|
12
12
|
* @return {Object} object with environment flags
|
|
13
13
|
*/
|
|
14
|
-
export declare function capabilitiesEnvironmentDetector(capabilities:
|
|
14
|
+
export declare function capabilitiesEnvironmentDetector(capabilities: WebdriverIO.Capabilities, automationProtocol: string): {
|
|
15
15
|
isChrome: boolean;
|
|
16
16
|
isFirefox: boolean;
|
|
17
17
|
isMobile: boolean;
|
|
@@ -45,7 +45,7 @@ export declare function sessionEnvironmentDetector({ capabilities, requestedCapa
|
|
|
45
45
|
* @param {Object} capabilities caps of session response
|
|
46
46
|
* @return {Object} object with environment flags
|
|
47
47
|
*/
|
|
48
|
-
export declare function devtoolsEnvironmentDetector({ browserName }:
|
|
48
|
+
export declare function devtoolsEnvironmentDetector({ browserName }: WebdriverIO.Capabilities): {
|
|
49
49
|
isDevTools: boolean;
|
|
50
50
|
isW3C: boolean;
|
|
51
51
|
isMobile: boolean;
|
|
@@ -63,7 +63,7 @@ export declare function devtoolsEnvironmentDetector({ browserName }: Capabilitie
|
|
|
63
63
|
* @param {Object} capabilities caps provided by user
|
|
64
64
|
* @return {Object} object with environment flags
|
|
65
65
|
*/
|
|
66
|
-
export declare function webdriverEnvironmentDetector(capabilities:
|
|
66
|
+
export declare function webdriverEnvironmentDetector(capabilities: WebdriverIO.Capabilities): {
|
|
67
67
|
isChrome: boolean;
|
|
68
68
|
isFirefox: boolean;
|
|
69
69
|
isMobile: boolean;
|
|
@@ -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;AA4JD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,
|
|
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,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;;;;;;;;;;EAexG;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,WAAW,EAAE,EAAE,WAAW,CAAC,YAAY;;;;;;;;;;;EAapF;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,WAAW,CAAC,YAAY;;;;;;;;EAUlF"}
|
package/build/monad.js
CHANGED
|
@@ -166,10 +166,11 @@ export default function WebDriver(options, modifier, propertiesObject = {}) {
|
|
|
166
166
|
*/
|
|
167
167
|
for (const eventCommand in EVENTHANDLER_FUNCTIONS) {
|
|
168
168
|
prototype[eventCommand] = function (...args) {
|
|
169
|
-
|
|
169
|
+
const method = eventCommand;
|
|
170
|
+
eventHandler[method]?.(...args);
|
|
170
171
|
if (prototype.eventMiddleware) {
|
|
171
|
-
if (typeof prototype.eventMiddleware[
|
|
172
|
-
prototype.eventMiddleware.socket[
|
|
172
|
+
if (typeof prototype.eventMiddleware[method] === 'function') {
|
|
173
|
+
prototype.eventMiddleware.socket[method](...args);
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
176
|
return this;
|
|
@@ -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.
|
|
3
|
+
"version": "8.17.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",
|
|
@@ -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.
|
|
35
|
+
"@wdio/types": "8.17.0",
|
|
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": "f7fe9474c580fc2003f6abca130e44ed025b1bd5"
|
|
52
52
|
}
|