k6-cucumber-steps 1.2.5 → 1.2.7
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/bin/k6-cucumber-steps.js +16 -1
- package/package.json +1 -1
- package/scripts/linkReports.js +2 -2
package/bin/k6-cucumber-steps.js
CHANGED
|
@@ -26,6 +26,9 @@ program
|
|
|
26
26
|
.option("--reporter", "Enable report generation", false)
|
|
27
27
|
.option("--clean", "Alias for --cleanReports")
|
|
28
28
|
.option("-p, --payloadPath <dir>", "Directory for payload files")
|
|
29
|
+
// Add CLI options for all config options
|
|
30
|
+
.option("--script <file>", "k6 script file to run")
|
|
31
|
+
.option("--k6Config <file>", "k6 config file to use")
|
|
29
32
|
.action(async (argv) => {
|
|
30
33
|
// Load config file
|
|
31
34
|
const configFileInput =
|
|
@@ -52,6 +55,9 @@ program
|
|
|
52
55
|
if (cucumberConfig.paths && Array.isArray(cucumberConfig.paths)) {
|
|
53
56
|
cliParts.push(...cucumberConfig.paths);
|
|
54
57
|
}
|
|
58
|
+
if (argv.feature) {
|
|
59
|
+
cliParts.push(argv.feature);
|
|
60
|
+
}
|
|
55
61
|
|
|
56
62
|
// Add require
|
|
57
63
|
if (cucumberConfig.require && Array.isArray(cucumberConfig.require)) {
|
|
@@ -71,6 +77,9 @@ program
|
|
|
71
77
|
if (cucumberConfig.tags) {
|
|
72
78
|
cliParts.push("--tags", cucumberConfig.tags);
|
|
73
79
|
}
|
|
80
|
+
if (argv.tags) {
|
|
81
|
+
cliParts.push("--tags", argv.tags);
|
|
82
|
+
}
|
|
74
83
|
|
|
75
84
|
// Determine project root (where your main package.json is)
|
|
76
85
|
const projectRoot = path.resolve(__dirname, "..");
|
|
@@ -92,7 +101,13 @@ program
|
|
|
92
101
|
};
|
|
93
102
|
cliParts.push("--world-parameters", JSON.stringify(worldParams));
|
|
94
103
|
|
|
95
|
-
// Add
|
|
104
|
+
// Add CLI options for k6 script and config
|
|
105
|
+
if (argv.script) {
|
|
106
|
+
cliParts.push("--script", argv.script);
|
|
107
|
+
}
|
|
108
|
+
if (argv.k6Config) {
|
|
109
|
+
cliParts.push("--k6Config", argv.k6Config);
|
|
110
|
+
}
|
|
96
111
|
|
|
97
112
|
const finalCommand = [
|
|
98
113
|
"npx",
|
package/package.json
CHANGED
package/scripts/linkReports.js
CHANGED
|
@@ -10,10 +10,10 @@ async function linkReports() {
|
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
// Get all HTML files in the reports directory
|
|
13
|
+
// Get all HTML files in the reports directory, excluding any with "combined-" in the name
|
|
14
14
|
const htmlFiles = fs
|
|
15
15
|
.readdirSync(reportsDir)
|
|
16
|
-
.filter((f) => f.endsWith(".html"))
|
|
16
|
+
.filter((f) => f.endsWith(".html") && !f.includes("combined-"))
|
|
17
17
|
.map((f) => ({
|
|
18
18
|
name: f,
|
|
19
19
|
path: path.join(reportsDir, f),
|