k6-cucumber-steps 1.2.6 → 1.2.8
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 +5 -24
- package/package.json +1 -1
- package/scripts/linkReports.js +2 -2
package/bin/k6-cucumber-steps.js
CHANGED
|
@@ -119,52 +119,34 @@ program
|
|
|
119
119
|
|
|
120
120
|
// Collect options to pass as env vars
|
|
121
121
|
const extraEnv = {
|
|
122
|
-
// Priority: cucumberConfig > CLI
|
|
122
|
+
// Priority: cucumberConfig > CLI
|
|
123
123
|
SAVE_K6_SCRIPT:
|
|
124
124
|
cucumberConfig.saveK6Script === true ||
|
|
125
|
-
argv.saveK6Script === true
|
|
126
|
-
process.env.SAVE_K6_SCRIPT === "true"
|
|
125
|
+
argv.saveK6Script === true
|
|
127
126
|
? "true"
|
|
128
127
|
: "false",
|
|
129
128
|
K6_CUCUMBER_OVERWRITE:
|
|
130
129
|
cucumberConfig.overwrite === true ||
|
|
131
|
-
argv.overwrite === true
|
|
132
|
-
process.env.K6_CUCUMBER_OVERWRITE === "true"
|
|
130
|
+
argv.overwrite === true
|
|
133
131
|
? "true"
|
|
134
132
|
: "false",
|
|
135
133
|
CLEAN_REPORTS:
|
|
136
134
|
cucumberConfig.cleanReports === true ||
|
|
137
135
|
argv.cleanReports === true ||
|
|
138
|
-
argv.clean === true
|
|
139
|
-
process.env.CLEAN_REPORTS === "true"
|
|
136
|
+
argv.clean === true
|
|
140
137
|
? "true"
|
|
141
138
|
: "false",
|
|
142
139
|
K6_CUCUMBER_REPORTER:
|
|
143
140
|
cucumberConfig.reporter === true ||
|
|
144
|
-
argv.reporter === true
|
|
145
|
-
process.env.K6_CUCUMBER_REPORTER === "true"
|
|
141
|
+
argv.reporter === true
|
|
146
142
|
? "true"
|
|
147
143
|
: "false",
|
|
148
144
|
};
|
|
149
145
|
|
|
150
|
-
// Now print environment variables (after extraEnv is defined)
|
|
151
|
-
console.log("▶️ Environment variables passed to cucumber-js:");
|
|
152
|
-
Object.entries(extraEnv).forEach(([key, value]) => {
|
|
153
|
-
console.log(` ${key}=${value}`);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
console.log("▶️ CLI flags passed:");
|
|
157
|
-
Object.entries(argv).forEach(([key, value]) => {
|
|
158
|
-
if (typeof value !== "function" && typeof value !== "undefined") {
|
|
159
|
-
console.log(` --${key}=${value}`);
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
|
|
163
146
|
// Clean reports directory if requested
|
|
164
147
|
const shouldCleanReports =
|
|
165
148
|
argv.cleanReports ||
|
|
166
149
|
argv.clean ||
|
|
167
|
-
process.env.CLEAN_REPORTS === "true" ||
|
|
168
150
|
cucumberConfig.cleanReports;
|
|
169
151
|
|
|
170
152
|
if (shouldCleanReports) {
|
|
@@ -172,7 +154,6 @@ program
|
|
|
172
154
|
if (fs.existsSync(reportsDir)) {
|
|
173
155
|
fs.rmSync(reportsDir, { recursive: true, force: true });
|
|
174
156
|
fs.mkdirSync(reportsDir, { recursive: true });
|
|
175
|
-
console.log("🧹 Cleaned reports directory.");
|
|
176
157
|
}
|
|
177
158
|
}
|
|
178
159
|
|
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),
|