artes 1.0.80 → 1.0.82
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/README.md
CHANGED
|
@@ -284,6 +284,7 @@ You can configure Artes by editing the `artes.config.js` file. Below are the def
|
|
|
284
284
|
| `require` | `[moduleConfig.stepsPath, "src/stepDefinitions/*.js", "src/hooks/hooks.js"]` | Support code paths (CommonJS). |
|
|
285
285
|
| `pomPath` | `moduleConfig.pomPath` | Path to Page Object Models. |
|
|
286
286
|
| `import` | `[]` | Support code paths. |
|
|
287
|
+
| `testPercentage` | `0` | Define test coverage percentage |
|
|
287
288
|
| `format` | `["rerun:@rerun.txt", "allure-cucumberjs/reporter"]` | Formatter names/paths. |
|
|
288
289
|
| `formatOptions` | `{ "resultsDir": "allure-result" }` | Formatter options. |
|
|
289
290
|
| `parallel` | `1` | Number of parallel workers. |
|
package/executer.js
CHANGED
|
@@ -51,13 +51,15 @@ function main() {
|
|
|
51
51
|
// }
|
|
52
52
|
|
|
53
53
|
if (flags.report) {
|
|
54
|
-
runTests(args, flags)
|
|
54
|
+
const result = runTests(args, flags)
|
|
55
55
|
generateReport();
|
|
56
56
|
cleanUp();
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
process.exit(result.status);
|
|
58
|
+
} else {
|
|
59
|
+
const result = runTests(args, flags);
|
|
60
|
+
cleanUp();
|
|
61
|
+
process.exit(result.status);
|
|
62
|
+
}
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
main();
|
package/package.json
CHANGED
|
@@ -40,6 +40,7 @@ function createProject(createYes) {
|
|
|
40
40
|
|
|
41
41
|
// Configuration options:
|
|
42
42
|
// env: "", // string - Environment name for tests
|
|
43
|
+
//testPercentage: 0, // number - Minimum success rate percentage(Default: 0)
|
|
43
44
|
// baseURL: "", // string - Base URL for API tests
|
|
44
45
|
// paths: [], // string[] - Paths to feature files
|
|
45
46
|
// steps: "", // string - Step definitions files
|
|
@@ -55,8 +55,8 @@ function runTests(args, flags) {
|
|
|
55
55
|
CI: "false",
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
console.log("✅ Tests running completed successfully!");
|
|
59
|
+
return result;
|
|
60
60
|
} catch (error) {
|
|
61
61
|
console.error("❌ Test execution failed:", error);
|
|
62
62
|
process.exit(1);
|
package/src/hooks/hooks.js
CHANGED
|
@@ -129,17 +129,17 @@ After(async function ({ pickle, result }) {
|
|
|
129
129
|
AfterAll(async function () {
|
|
130
130
|
const successPercentage = 100 - (testsFailed / totalTests) * 100;
|
|
131
131
|
const successRate =
|
|
132
|
-
successPercentage.toFixed(2) >= cucumberConfig.testPercentage;
|
|
132
|
+
successPercentage.toFixed(2) >= cucumberConfig.default.testPercentage;
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
if (!isNaN(successPercentage)) {
|
|
135
135
|
if (successRate) {
|
|
136
136
|
console.log(
|
|
137
|
-
`Tests passed with ${successPercentage.toFixed(2)}%
|
|
137
|
+
`Tests passed required ${cucumberConfig.default.testPercentage}% success rate with ${successPercentage.toFixed(2)}% !`,
|
|
138
138
|
);
|
|
139
139
|
process.exit(0);
|
|
140
140
|
} else {
|
|
141
141
|
console.log(
|
|
142
|
-
`Tests failed with ${successPercentage.toFixed(2)}
|
|
142
|
+
`Tests failed at required ${cucumberConfig.default.testPercentage}% success rate with ${successPercentage.toFixed(2)}%!`,
|
|
143
143
|
);
|
|
144
144
|
process.exit(1);
|
|
145
145
|
}
|