@wdio/utils 8.36.0 → 8.36.1
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/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/utils.d.ts +5 -0
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +14 -0
- package/package.json +3 -3
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, getBrowserObject, enableFileLogging } 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
9
|
import { isW3C, capabilitiesEnvironmentDetector, sessionEnvironmentDetector, devtoolsEnvironmentDetector } 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, getBrowserObject, enableFileLogging, asyncIterators,
|
|
12
12
|
/**
|
|
13
13
|
* runner shim
|
|
14
14
|
*/
|
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,gBAAgB,EAAE,iBAAiB,EACtC,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,EACH,KAAK,EAAE,+BAA+B,EACtC,0BAA0B,EAAE,2BAA2B,EAC1D,MAAM,kBAAkB,CAAA;AACzB,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,gBAAgB,EAChB,iBAAiB,EACjB,cAAc;AAEd;;GAEG;AACH,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,oBAAoB;AAEpB;;GAEG;AACH,KAAK,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,2BAA2B;AAE3B;;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, getBrowserObject, enableFileLogging, } 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
10
|
import { isW3C, capabilitiesEnvironmentDetector, sessionEnvironmentDetector, devtoolsEnvironmentDetector } 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, getBrowserObject, enableFileLogging, asyncIterators,
|
|
13
13
|
/**
|
|
14
14
|
* runner shim
|
|
15
15
|
*/
|
package/build/utils.d.ts
CHANGED
|
@@ -92,4 +92,9 @@ export declare function isEdge(browserName?: string): boolean;
|
|
|
92
92
|
* traverse up the scope chain until browser element was reached
|
|
93
93
|
*/
|
|
94
94
|
export declare function getBrowserObject(elem: WebdriverIO.Element | WebdriverIO.Browser): WebdriverIO.Browser;
|
|
95
|
+
/**
|
|
96
|
+
* Enables logging to a file in a specified directory.
|
|
97
|
+
* @param {string} outputDir Directory containing the log file
|
|
98
|
+
*/
|
|
99
|
+
export declare function enableFileLogging(outputDir?: string): Promise<void>;
|
|
95
100
|
//# 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":"AAGA,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,E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WAE3C;AAED;;GAEG;AAEH,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,CAKtG;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO1E"}
|
package/build/utils.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/// <reference types="@wdio/globals/types" />
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
1
4
|
import { SUPPORTED_BROWSERNAMES, DEFAULT_PROTOCOL, DEFAULT_HOSTNAME, DEFAULT_PATH } from './constants.js';
|
|
2
5
|
const SCREENSHOT_REPLACEMENT = '"<Screenshot[base64]>"';
|
|
3
6
|
const SCRIPT_PLACEHOLDER = '"<Script[base64]>"';
|
|
@@ -310,3 +313,14 @@ export function getBrowserObject(elem) {
|
|
|
310
313
|
// @ts-ignore types are not loaded in time (fixed in v9)
|
|
311
314
|
return elemObject.parent ? getBrowserObject(elemObject.parent) : elem;
|
|
312
315
|
}
|
|
316
|
+
/**
|
|
317
|
+
* Enables logging to a file in a specified directory.
|
|
318
|
+
* @param {string} outputDir Directory containing the log file
|
|
319
|
+
*/
|
|
320
|
+
export async function enableFileLogging(outputDir) {
|
|
321
|
+
if (!outputDir) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
await fs.mkdir(path.join(outputDir), { recursive: true });
|
|
325
|
+
process.env.WDIO_LOG_PATH = path.join(outputDir, 'wdio.log');
|
|
326
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "8.36.
|
|
3
|
+
"version": "8.36.1",
|
|
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",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@puppeteer/browsers": "^1.6.0",
|
|
41
41
|
"@wdio/logger": "8.28.0",
|
|
42
|
-
"@wdio/types": "8.36.
|
|
42
|
+
"@wdio/types": "8.36.1",
|
|
43
43
|
"decamelize": "^6.0.0",
|
|
44
44
|
"deepmerge-ts": "^5.1.0",
|
|
45
45
|
"edgedriver": "^5.3.5",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "6c4a9745052c29d13b73ac622dfda387c884ffd8"
|
|
58
58
|
}
|