@wdio/cli 9.10.1 → 9.12.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.
|
@@ -58,10 +58,11 @@ export declare function formatConfigFilePaths(config: string): Promise<{
|
|
|
58
58
|
}>;
|
|
59
59
|
/**
|
|
60
60
|
* Helper utility used in `run` and `install` command to check whether a config file currently exists
|
|
61
|
-
* @param
|
|
61
|
+
* @param configPathNoExtension the file path to the WDIO config file without extension
|
|
62
|
+
* @param configPath the file path to the WDIO config file that is checked first if set
|
|
62
63
|
* @returns {string} the path to the config file that exists, otherwise undefined
|
|
63
64
|
*/
|
|
64
|
-
export declare function canAccessConfigPath(
|
|
65
|
+
export declare function canAccessConfigPath(configPathNoExtension: string, configPath?: string): Promise<string | undefined>;
|
|
65
66
|
/**
|
|
66
67
|
* Helper utility used in `run` and `install` command to create config if none exist
|
|
67
68
|
* @param {string} command to be executed by user
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAWjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAUxE,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,eAAO,MAAM,IAAI,4EAA4E,CAAA;AAE7F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAkBV,CAAA;AAEV,eAAO,MAAM,OAAO,UAAW,IAAI;;;;;;;;;;;;;;;;;;GAKlC,CAAA;AAED,eAAO,MAAM,YAAY,QAAwB,OAAO,KAAG,OAAO,CAAC,aAAa,CAyF/E,CAAA;AAED,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAqBlF;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,sBAAsB,EAAE,YAAY,0BAAmB;;;;GAQ1F;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM;;;GAMzD;AAED
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAWjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAUxE,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,eAAO,MAAM,IAAI,4EAA4E,CAAA;AAE7F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAkBV,CAAA;AAEV,eAAO,MAAM,OAAO,UAAW,IAAI;;;;;;;;;;;;;;;;;;GAKlC,CAAA;AAED,eAAO,MAAM,YAAY,QAAwB,OAAO,KAAG,OAAO,CAAC,aAAa,CAyF/E,CAAA;AAED,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAqBlF;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,sBAAsB,EAAE,YAAY,0BAAmB;;;;GAQ1F;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM;;;GAMzD;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,qBAAqB,EAAC,MAAM,EAAE,UAAU,CAAC,EAAC,MAAM,+BAezF;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,0BAAmB,mBA+BpH"}
|
package/build/commands/run.d.ts
CHANGED
|
@@ -70,11 +70,11 @@ export declare const cmdArgs: {
|
|
|
70
70
|
readonly type: "array";
|
|
71
71
|
};
|
|
72
72
|
readonly spec: {
|
|
73
|
-
readonly desc: "run only a certain spec file - overrides specs piped from stdin";
|
|
73
|
+
readonly desc: "run only a certain spec file or wildcard - overrides specs piped from stdin";
|
|
74
74
|
readonly type: "array";
|
|
75
75
|
};
|
|
76
76
|
readonly exclude: {
|
|
77
|
-
readonly desc: "exclude certain spec file from the test run - overrides exclude piped from stdin";
|
|
77
|
+
readonly desc: "exclude certain spec file or wildcard from the test run - overrides exclude piped from stdin";
|
|
78
78
|
readonly type: "array";
|
|
79
79
|
};
|
|
80
80
|
readonly repeat: {
|
|
@@ -184,11 +184,11 @@ export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "fr
|
|
|
184
184
|
readonly type: "array";
|
|
185
185
|
};
|
|
186
186
|
readonly spec: {
|
|
187
|
-
readonly desc: "run only a certain spec file - overrides specs piped from stdin";
|
|
187
|
+
readonly desc: "run only a certain spec file or wildcard - overrides specs piped from stdin";
|
|
188
188
|
readonly type: "array";
|
|
189
189
|
};
|
|
190
190
|
readonly exclude: {
|
|
191
|
-
readonly desc: "exclude certain spec file from the test run - overrides exclude piped from stdin";
|
|
191
|
+
readonly desc: "exclude certain spec file or wildcard from the test run - overrides exclude piped from stdin";
|
|
192
192
|
readonly type: "array";
|
|
193
193
|
};
|
|
194
194
|
readonly repeat: {
|
package/build/index.js
CHANGED
|
@@ -2579,7 +2579,7 @@ var Launcher = class {
|
|
|
2579
2579
|
var launcher_default = Launcher;
|
|
2580
2580
|
|
|
2581
2581
|
// src/run.ts
|
|
2582
|
-
import
|
|
2582
|
+
import path7 from "node:path";
|
|
2583
2583
|
import yargs from "yargs";
|
|
2584
2584
|
import { hideBin } from "yargs/helpers";
|
|
2585
2585
|
|
|
@@ -2730,14 +2730,21 @@ async function formatConfigFilePaths(config) {
|
|
|
2730
2730
|
const fullPathNoExtension = fullPath.substring(0, fullPath.lastIndexOf(path3.extname(fullPath)));
|
|
2731
2731
|
return { fullPath, fullPathNoExtension };
|
|
2732
2732
|
}
|
|
2733
|
-
async function canAccessConfigPath(configPath) {
|
|
2734
|
-
return Promise
|
|
2735
|
-
|
|
2733
|
+
async function canAccessConfigPath(configPathNoExtension, configPath) {
|
|
2734
|
+
return new Promise((resolve3, reject) => {
|
|
2735
|
+
if (configPath) {
|
|
2736
|
+
const _configPath = configPath;
|
|
2737
|
+
fs3.access(_configPath).then(() => resolve3(_configPath), reject);
|
|
2738
|
+
} else {
|
|
2739
|
+
reject();
|
|
2740
|
+
}
|
|
2741
|
+
}).catch(() => Promise.all(SUPPORTED_CONFIG_FILE_EXTENSION.map(async (supportedExtension) => {
|
|
2742
|
+
const configPathWithExtension = `${configPathNoExtension}.${supportedExtension}`;
|
|
2736
2743
|
return fs3.access(configPathWithExtension).then(() => configPathWithExtension, () => void 0);
|
|
2737
2744
|
})).then(
|
|
2738
2745
|
(configFilePaths) => configFilePaths.find(Boolean),
|
|
2739
2746
|
() => void 0
|
|
2740
|
-
);
|
|
2747
|
+
));
|
|
2741
2748
|
}
|
|
2742
2749
|
async function missingConfigurationPrompt(command5, configPath, runConfigCmd = runConfigCommand) {
|
|
2743
2750
|
const message = `Could not execute "${command5}" due to missing configuration, file "${path3.parse(configPath).name}[.js/.ts]" not found! Would you like to create one?`;
|
|
@@ -2879,15 +2886,17 @@ __export(run_exports, {
|
|
|
2879
2886
|
launchWithStdin: () => launchWithStdin
|
|
2880
2887
|
});
|
|
2881
2888
|
import fs5 from "node:fs/promises";
|
|
2882
|
-
import
|
|
2889
|
+
import path6 from "node:path";
|
|
2883
2890
|
|
|
2884
2891
|
// src/watcher.ts
|
|
2885
2892
|
import url from "node:url";
|
|
2893
|
+
import path5 from "node:path";
|
|
2886
2894
|
import chokidar from "chokidar";
|
|
2887
|
-
import logger4 from "@wdio/logger";
|
|
2888
2895
|
import pickBy2 from "lodash.pickby";
|
|
2889
2896
|
import flattenDeep from "lodash.flattendeep";
|
|
2890
2897
|
import union from "lodash.union";
|
|
2898
|
+
import logger4 from "@wdio/logger";
|
|
2899
|
+
import { FileSystemPathService } from "@wdio/config/node";
|
|
2891
2900
|
var log4 = logger4("@wdio/cli:watch");
|
|
2892
2901
|
var Watcher = class {
|
|
2893
2902
|
constructor(_configFile, _args) {
|
|
@@ -2909,7 +2918,10 @@ var Watcher = class {
|
|
|
2909
2918
|
chokidar.watch(flattenedSpecs, { ignoreInitial: true }).on("add", this.getFileListener()).on("change", this.getFileListener());
|
|
2910
2919
|
const { filesToWatch } = this._launcher.configParser.getConfig();
|
|
2911
2920
|
if (filesToWatch.length) {
|
|
2912
|
-
|
|
2921
|
+
const pathService = new FileSystemPathService();
|
|
2922
|
+
const rootDir = path5.dirname(path5.resolve(process.cwd(), this._configFile));
|
|
2923
|
+
const globbedFilesToWatch = filesToWatch.map((file) => pathService.ensureAbsolutePath(file, rootDir));
|
|
2924
|
+
chokidar.watch(globbedFilesToWatch, { ignoreInitial: true }).on("add", this.getFileListener(false)).on("change", this.getFileListener(false));
|
|
2913
2925
|
}
|
|
2914
2926
|
await this._launcher.run();
|
|
2915
2927
|
const workers = this.getWorkers();
|
|
@@ -2984,8 +2996,8 @@ var Watcher = class {
|
|
|
2984
2996
|
this.cleanUp();
|
|
2985
2997
|
for (const [, worker] of Object.entries(workers)) {
|
|
2986
2998
|
const { cid, capabilities, specs, sessionId } = worker;
|
|
2987
|
-
const { hostname, path:
|
|
2988
|
-
const args = Object.assign({ sessionId, baseUrl: worker.config.baseUrl, hostname, path:
|
|
2999
|
+
const { hostname, path: path8, port, protocol, automationProtocol } = worker.config;
|
|
3000
|
+
const args = Object.assign({ sessionId, baseUrl: worker.config.baseUrl, hostname, path: path8, port, protocol, automationProtocol }, params);
|
|
2989
3001
|
worker.postMessage("run", args);
|
|
2990
3002
|
this._launcher.interface.emit("job:start", { cid, caps: capabilities, specs });
|
|
2991
3003
|
}
|
|
@@ -3071,11 +3083,11 @@ var cmdArgs3 = {
|
|
|
3071
3083
|
type: "array"
|
|
3072
3084
|
},
|
|
3073
3085
|
spec: {
|
|
3074
|
-
desc: "run only a certain spec file - overrides specs piped from stdin",
|
|
3086
|
+
desc: "run only a certain spec file or wildcard - overrides specs piped from stdin",
|
|
3075
3087
|
type: "array"
|
|
3076
3088
|
},
|
|
3077
3089
|
exclude: {
|
|
3078
|
-
desc: "exclude certain spec file from the test run - overrides exclude piped from stdin",
|
|
3090
|
+
desc: "exclude certain spec file or wildcard from the test run - overrides exclude piped from stdin",
|
|
3079
3091
|
type: "array"
|
|
3080
3092
|
},
|
|
3081
3093
|
"repeat": {
|
|
@@ -3142,7 +3154,7 @@ async function launch(wdioConfPath, params) {
|
|
|
3142
3154
|
async function handler3(argv) {
|
|
3143
3155
|
const { configPath = "wdio.conf.js", ...params } = argv;
|
|
3144
3156
|
const wdioConf = await formatConfigFilePaths(configPath);
|
|
3145
|
-
const confAccess = await canAccessConfigPath(wdioConf.fullPathNoExtension);
|
|
3157
|
+
const confAccess = await canAccessConfigPath(wdioConf.fullPathNoExtension, wdioConf.fullPath);
|
|
3146
3158
|
if (!confAccess) {
|
|
3147
3159
|
try {
|
|
3148
3160
|
await missingConfigurationPrompt("run", wdioConf.fullPathNoExtension);
|
|
@@ -3154,9 +3166,9 @@ async function handler3(argv) {
|
|
|
3154
3166
|
process.exit(1);
|
|
3155
3167
|
}
|
|
3156
3168
|
}
|
|
3157
|
-
const tsConfigPathFromEnvVar = process.env.TSCONFIG_PATH &&
|
|
3158
|
-
const tsConfigPathFromParams = params.tsConfigPath &&
|
|
3159
|
-
const tsConfigPathRelativeToWdioConfig =
|
|
3169
|
+
const tsConfigPathFromEnvVar = process.env.TSCONFIG_PATH && path6.resolve(process.cwd(), process.env.TSCONFIG_PATH) || process.env.TSX_TSCONFIG_PATH && path6.resolve(process.cwd(), process.env.TSX_TSCONFIG_PATH);
|
|
3170
|
+
const tsConfigPathFromParams = params.tsConfigPath && path6.resolve(process.cwd(), params.tsConfigPath);
|
|
3171
|
+
const tsConfigPathRelativeToWdioConfig = path6.join(path6.dirname(confAccess), "tsconfig.json");
|
|
3160
3172
|
const localTSConfigPath = tsConfigPathFromEnvVar || tsConfigPathFromParams || tsConfigPathRelativeToWdioConfig;
|
|
3161
3173
|
const hasLocalTSConfig = await fs5.access(localTSConfigPath).then(() => true, () => false);
|
|
3162
3174
|
if (hasLocalTSConfig) {
|
|
@@ -3245,7 +3257,7 @@ Commands:` }).version(pkg.version).epilogue(CLI_EPILOGUE);
|
|
|
3245
3257
|
}
|
|
3246
3258
|
const args = {
|
|
3247
3259
|
...params,
|
|
3248
|
-
configPath:
|
|
3260
|
+
configPath: path7.resolve(process.cwd(), params._[0] && params._[0].toString() || DEFAULT_CONFIG_FILENAME)
|
|
3249
3261
|
};
|
|
3250
3262
|
try {
|
|
3251
3263
|
const cp = await handler3(args);
|
package/build/watcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../src/watcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../src/watcher.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAA;AAGxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAKvE,MAAM,CAAC,OAAO,OAAO,OAAO;IAKpB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,KAAK;IALjB,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,MAAM,CAAa;gBAGf,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC;IAMpD,KAAK;IAsDX;;;;OAIG;IACH,eAAe,CAAE,UAAU,UAAO,UAChB,MAAM;IAgCxB;;;;;OAKG;IACH,UAAU,CAAE,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU;IAqB7H;;;OAGG;IACH,GAAG,CAAE,MAAM,GAAE,OAAO,CAAC,mBAAmB,CAAM;IAqC9C,OAAO;CAGV"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/cli",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.12.0",
|
|
4
4
|
"description": "WebdriverIO testrunner command line interface",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-cli",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@types/node": "^20.1.1",
|
|
43
43
|
"@vitest/snapshot": "^2.1.1",
|
|
44
|
-
"@wdio/config": "9.
|
|
45
|
-
"@wdio/globals": "9.
|
|
44
|
+
"@wdio/config": "9.11.0",
|
|
45
|
+
"@wdio/globals": "9.12.0",
|
|
46
46
|
"@wdio/logger": "9.4.4",
|
|
47
47
|
"@wdio/protocols": "9.7.0",
|
|
48
48
|
"@wdio/types": "9.10.1",
|
|
49
|
-
"@wdio/utils": "9.
|
|
49
|
+
"@wdio/utils": "9.11.0",
|
|
50
50
|
"async-exit-hook": "^2.0.1",
|
|
51
51
|
"chalk": "^5.2.0",
|
|
52
52
|
"chokidar": "^4.0.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"read-pkg-up": "^10.0.0",
|
|
62
62
|
"recursive-readdir": "^2.2.3",
|
|
63
63
|
"tsx": "^4.7.2",
|
|
64
|
-
"webdriverio": "9.
|
|
64
|
+
"webdriverio": "9.12.0",
|
|
65
65
|
"yargs": "^17.7.2"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "7571cb5af89ba6119d6524001124162bb27fa8fc"
|
|
81
81
|
}
|