k6-cucumber-steps 1.2.2 → 1.2.3
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 +20 -6
- package/package.json +1 -1
package/bin/k6-cucumber-steps.js
CHANGED
|
@@ -20,9 +20,10 @@ program
|
|
|
20
20
|
.option("-f, --feature <path>", "Feature file path")
|
|
21
21
|
.option("-t, --tags <string>", "Cucumber tags")
|
|
22
22
|
.option("-c, --config <file>", "Custom config file")
|
|
23
|
-
.option("
|
|
24
|
-
.option("
|
|
25
|
-
.option("--cleanReports", "Clean the reports folder before running")
|
|
23
|
+
.option("--saveK6Script", "Keep generated k6 script files", false)
|
|
24
|
+
.option("--overwrite", "Overwrite report files", false)
|
|
25
|
+
.option("--cleanReports", "Clean the reports folder before running", false)
|
|
26
|
+
.option("--reporter", "Enable report generation", false)
|
|
26
27
|
.option("--clean", "Alias for --cleanReports")
|
|
27
28
|
.option("-p, --payloadPath <dir>", "Directory for payload files")
|
|
28
29
|
.action(async (argv) => {
|
|
@@ -112,10 +113,23 @@ program
|
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
// Collect options to pass as env vars
|
|
117
|
+
const extraEnv = {
|
|
118
|
+
SAVE_K6_SCRIPT: argv.saveK6Script === true || process.env.SAVE_K6_SCRIPT === "true" || cucumberConfig.saveK6Script === true ? "true" : "false",
|
|
119
|
+
K6_CUCUMBER_OVERWRITE: argv.overwrite === true || process.env.K6_CUCUMBER_OVERWRITE === "true" || cucumberConfig.overwrite === true ? "true" : "false",
|
|
120
|
+
CLEAN_REPORTS: argv.cleanReports === true || argv.clean === true || process.env.CLEAN_REPORTS === "true" || cucumberConfig.cleanReports === true ? "true" : "false",
|
|
121
|
+
K6_CUCUMBER_REPORTER: argv.reporter === true || process.env.K6_CUCUMBER_REPORTER === "true" || cucumberConfig.reporter === true ? "true" : "false",
|
|
122
|
+
};
|
|
123
|
+
|
|
115
124
|
// Now spawn the process
|
|
116
|
-
const cucumberProcess = spawn(
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
const cucumberProcess = spawn(
|
|
126
|
+
"npx",
|
|
127
|
+
["cucumber-js", ...cliParts],
|
|
128
|
+
{
|
|
129
|
+
stdio: "inherit",
|
|
130
|
+
env: { ...process.env, ...extraEnv },
|
|
131
|
+
}
|
|
132
|
+
);
|
|
119
133
|
|
|
120
134
|
cucumberProcess.on("close", async (code) => {
|
|
121
135
|
if (code === 0) {
|