@wdio/cli 9.19.2 → 9.20.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/commands/run.d.ts.map +1 -1
- package/build/index.js +27 -3
- package/build/run.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAOtD,eAAO,MAAM,OAAO,qBAAqB,CAAA;AAEzC,eAAO,MAAM,IAAI,yEAAyE,CAAA;AAE1F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAmDI,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAkDN,MAAM;;;;;CAQpB,CAAA;AAEV,eAAO,MAAM,OAAO,GAAI,OAAO,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA5DX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAkDN,MAAM;;;;;GAoB7B,CAAA;AAED,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,QAezF;AAED,wBAAsB,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,iBAgBtF;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,mBAAmB,iBAiEtD"}
|
package/build/index.js
CHANGED
|
@@ -424,7 +424,7 @@ async function getCapabilities(arg) {
|
|
|
424
424
|
let requiredCaps = config3.getCapabilities();
|
|
425
425
|
requiredCaps = // multi capabilities
|
|
426
426
|
requiredCaps[parseInt(arg.capabilities, 10)] || // multiremote
|
|
427
|
-
requiredCaps[arg.capabilities];
|
|
427
|
+
requiredCaps[arg.capabilities]?.capabilities;
|
|
428
428
|
const requiredW3CCaps = pickBy(requiredCaps, (_, key) => CAPABILITY_KEYS.includes(key) || key.includes(":"));
|
|
429
429
|
if (!Object.keys(requiredW3CCaps).length) {
|
|
430
430
|
throw Error(`No capability found in given config file with the provided capability indexed/named property: ${arg.capabilities}. Please check the capability in your wdio config file.`);
|
|
@@ -1271,6 +1271,7 @@ __export(run_exports, {
|
|
|
1271
1271
|
});
|
|
1272
1272
|
import fs from "node:fs/promises";
|
|
1273
1273
|
import path2 from "node:path";
|
|
1274
|
+
import { pathToFileURL } from "node:url";
|
|
1274
1275
|
|
|
1275
1276
|
// src/watcher.ts
|
|
1276
1277
|
import url from "node:url";
|
|
@@ -1393,6 +1394,9 @@ var Watcher = class {
|
|
|
1393
1394
|
|
|
1394
1395
|
// src/commands/run.ts
|
|
1395
1396
|
import { config } from "create-wdio/config/cli";
|
|
1397
|
+
import { ConfigParser as ConfigParser3 } from "@wdio/config/node";
|
|
1398
|
+
import logger5 from "@wdio/logger";
|
|
1399
|
+
var log5 = logger5("@wdio/cli:run");
|
|
1396
1400
|
var command = "run <configPath>";
|
|
1397
1401
|
var desc = "Run your WDIO configuration file to initialize your tests. (default)";
|
|
1398
1402
|
var cmdArgs = {
|
|
@@ -1554,7 +1558,7 @@ async function handler(argv) {
|
|
|
1554
1558
|
const tsConfigPathFromEnvVar = process.env.TSCONFIG_PATH && path2.resolve(process.cwd(), process.env.TSCONFIG_PATH) || process.env.TSX_TSCONFIG_PATH && path2.resolve(process.cwd(), process.env.TSX_TSCONFIG_PATH);
|
|
1555
1559
|
const tsConfigPathFromParams = params.tsConfigPath && path2.resolve(process.cwd(), params.tsConfigPath);
|
|
1556
1560
|
const tsConfigPathRelativeToWdioConfig = path2.join(path2.dirname(confAccess), "tsconfig.json");
|
|
1557
|
-
const localTSConfigPath = tsConfigPathFromEnvVar || tsConfigPathFromParams || tsConfigPathRelativeToWdioConfig;
|
|
1561
|
+
const localTSConfigPath = tsConfigPathFromEnvVar || tsConfigPathFromParams || await tsConfigPathFromConfigFile(confAccess, params) || tsConfigPathRelativeToWdioConfig;
|
|
1558
1562
|
const hasLocalTSConfig = await fs.access(localTSConfigPath).then(() => true, () => false);
|
|
1559
1563
|
if (hasLocalTSConfig) {
|
|
1560
1564
|
process.env.TSX_TSCONFIG_PATH = localTSConfigPath;
|
|
@@ -1568,6 +1572,26 @@ async function handler(argv) {
|
|
|
1568
1572
|
}
|
|
1569
1573
|
launchWithStdin(confAccess, params);
|
|
1570
1574
|
}
|
|
1575
|
+
async function tsConfigPathFromConfigFile(wdioConfPath, params) {
|
|
1576
|
+
try {
|
|
1577
|
+
const configParser = new ConfigParser3(cacheBustFilePath(wdioConfPath), params);
|
|
1578
|
+
await configParser.initialize();
|
|
1579
|
+
const { tsConfigPath } = configParser.getConfig();
|
|
1580
|
+
if (tsConfigPath) {
|
|
1581
|
+
return tsConfigPath;
|
|
1582
|
+
}
|
|
1583
|
+
} catch {
|
|
1584
|
+
log5.debug(`Unable to parse config file. If tsConfigPath is set in ${wdioConfPath}, it will be ignored.`);
|
|
1585
|
+
return;
|
|
1586
|
+
}
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1589
|
+
function cacheBustFilePath(filePath) {
|
|
1590
|
+
const absolutePath = path2.resolve(filePath);
|
|
1591
|
+
const fileUrl = pathToFileURL(absolutePath);
|
|
1592
|
+
fileUrl.search = `v=${Date.now()}&log_errors=false`;
|
|
1593
|
+
return fileUrl.href;
|
|
1594
|
+
}
|
|
1571
1595
|
|
|
1572
1596
|
// src/commands/repl.ts
|
|
1573
1597
|
var IGNORED_ARGS = [
|
|
@@ -1630,7 +1654,7 @@ var DESCRIPTION = [
|
|
|
1630
1654
|
"For more information, visit: https://webdriver.io/docs/clioptions"
|
|
1631
1655
|
];
|
|
1632
1656
|
async function run() {
|
|
1633
|
-
const argv = yargs(hideBin(process.argv)).command(commands).example("wdio run wdio.conf.js --suite foobar", 'Run suite on testsuite "foobar"').example("wdio run wdio.conf.js --spec ./tests/e2e/a.js --spec ./tests/e2e/b.js", "Run suite on specific specs").example("wdio run wdio.conf.js --spec ./tests/e2e/a.feature:5", "Run scenario by line number").example("wdio run wdio.conf.js --spec ./tests/e2e/a.feature:5:10", "Run scenarios by line number").example("wdio run wdio.conf.js --spec ./tests/e2e/a.feature:5:10 --spec ./test/e2e/b.feature", "Run scenarios by line number in single feature and another complete feature").example("wdio install reporter spec", "Install @wdio/spec-reporter").example("wdio repl chrome -u <SAUCE_USERNAME> -k <SAUCE_ACCESS_KEY>", "Run repl in Sauce Labs cloud").updateStrings({ "Commands:": `${DESCRIPTION.join("\n")}
|
|
1657
|
+
const argv = yargs(hideBin(process.argv)).command(commands).example("wdio run wdio.conf.js --suite foobar", 'Run suite on testsuite "foobar"').example("wdio run wdio.conf.js --spec ./tests/e2e/a.js --spec ./tests/e2e/b.js", "Run suite on specific specs").example("wdio run wdio.conf.js --spec ./tests/e2e/a.feature:5", "Run scenario by line number").example("wdio run wdio.conf.js --spec ./tests/e2e/a.feature:5:10", "Run scenarios by line number").example("wdio run wdio.conf.js --spec ./tests/e2e/a.feature:5:10 --spec ./test/e2e/b.feature", "Run scenarios by line number in single feature and another complete feature").example("wdio run wdio.conf.js --tsConfigPath=./configs/bdd-tsconfig.json", "Run suite with tsx using custom tsconfig.json").example("wdio install reporter spec", "Install @wdio/spec-reporter").example("wdio repl chrome -u <SAUCE_USERNAME> -k <SAUCE_ACCESS_KEY>", "Run repl in Sauce Labs cloud").updateStrings({ "Commands:": `${DESCRIPTION.join("\n")}
|
|
1634
1658
|
|
|
1635
1659
|
Commands:` }).version(pkg.version).epilogue(CLI_EPILOGUE);
|
|
1636
1660
|
if (!process.argv.find((arg) => arg === "--help")) {
|
package/build/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAuBA,wBAA8B,GAAG,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAuBA,wBAA8B,GAAG,kBAgEhC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/cli",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.20.1",
|
|
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",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"typeScriptVersion": "3.8.3",
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@vitest/snapshot": "^2.1.1",
|
|
43
|
-
"@wdio/config": "9.
|
|
43
|
+
"@wdio/config": "9.20.1",
|
|
44
44
|
"@wdio/globals": "9.17.0",
|
|
45
45
|
"@wdio/logger": "9.18.0",
|
|
46
46
|
"@wdio/protocols": "9.16.2",
|
|
47
|
-
"@wdio/types": "9.
|
|
48
|
-
"@wdio/utils": "9.
|
|
47
|
+
"@wdio/types": "9.20.0",
|
|
48
|
+
"@wdio/utils": "9.20.1",
|
|
49
49
|
"async-exit-hook": "^2.0.1",
|
|
50
50
|
"chalk": "^5.4.1",
|
|
51
51
|
"chokidar": "^4.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"lodash.union": "^4.6.0",
|
|
58
58
|
"read-pkg-up": "^10.0.0",
|
|
59
59
|
"tsx": "^4.7.2",
|
|
60
|
-
"webdriverio": "9.
|
|
60
|
+
"webdriverio": "9.20.1",
|
|
61
61
|
"yargs": "^17.7.2"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "ac132d5e6c95ad0b9f4e92cb0090c9a60296da4c"
|
|
74
74
|
}
|