artes 1.2.10 → 1.2.11
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 +2 -1
- package/cucumber.config.js +2 -1
- package/executer.js +3 -0
- package/package.json +1 -1
- package/src/helper/executers/helper.js +4 -1
- package/src/helper/executers/reportGenerator.js +29 -1
package/README.md
CHANGED
|
@@ -52,7 +52,8 @@ npx artes [options]
|
|
|
52
52
|
| `--reportSuccess` | Add screenshots and video records for also Success test cases | `artes --reportSuccess` |
|
|
53
53
|
| `--trace` | Enable tracing | `artes --trace ` |
|
|
54
54
|
| `-rwt, --reportWithTrace` | Add trace to the report | `artes -rwt` or `artes --reportWithTrace` |
|
|
55
|
-
| `--singleFileReport` | Generate single file allure report | ` artes --singleFileReport` |
|
|
55
|
+
| `--singleFileReport` | Generate single file allure report | ` artes -r --singleFileReport` |
|
|
56
|
+
| `--zip` | Zip the report folder after generation | ` artes -r --zip` |
|
|
56
57
|
| 📁 `--features` | Specify one or more feature files' relative paths to run (comma-separated) | `artes --features "tests/features/Alma,tests/features/Banan.feature"` |
|
|
57
58
|
| 📜 `--stepDef` | Specify one or more step definition files' relative paths to use (comma-separated) | `artes --stepDef "tests/steps/login.js,tests/steps/home.js"` |
|
|
58
59
|
| 🔖 `--tags` | Run tests with specified Cucumber tags | `artes --tags "@smoke or @wip"` |
|
package/cucumber.config.js
CHANGED
|
@@ -132,7 +132,8 @@ module.exports = {
|
|
|
132
132
|
worldParameters: artesConfig.worldParameters || {}, // Custom world parameters
|
|
133
133
|
},
|
|
134
134
|
report:{
|
|
135
|
-
singleFileReport: process.env.SINGLE_FILE_REPORT == "true" ? true : artesConfig.singleFileReport ? true : false
|
|
135
|
+
singleFileReport: process.env.SINGLE_FILE_REPORT == "true" ? true : artesConfig.singleFileReport ? true : false,
|
|
136
|
+
zip: process.env.ZIP == "true" ? true : artesConfig.zip ? true : false
|
|
136
137
|
},
|
|
137
138
|
env: env,
|
|
138
139
|
baseURL: process.env.BASE_URL
|
package/executer.js
CHANGED
|
@@ -30,6 +30,7 @@ const flags = {
|
|
|
30
30
|
trace: args.includes("-t") || args.includes("--trace"),
|
|
31
31
|
reportWithTrace: args.includes("-rwt") || args.includes("--reportWithTrace"),
|
|
32
32
|
singleFileReport: args.includes("--singleFileReport"),
|
|
33
|
+
zip: args.includes("--zip"),
|
|
33
34
|
features: args.includes("--features"),
|
|
34
35
|
stepDef: args.includes("--stepDef"),
|
|
35
36
|
tags: args.includes("--tags"),
|
|
@@ -94,6 +95,8 @@ flags.reportWithTrace ? (process.env.REPORT_WITH_TRACE = true) : (process.env.RE
|
|
|
94
95
|
|
|
95
96
|
flags.singleFileReport ? (process.env.SINGLE_FILE_REPORT = true) : (process.env.SINGLE_FILE_REPORT=false);
|
|
96
97
|
|
|
98
|
+
flags.zip ? (process.env.ZIP = true) : (process.env.ZIP=false);
|
|
99
|
+
|
|
97
100
|
flags.headless &&
|
|
98
101
|
console.log("Running mode:", flags.headless ? "headless" : "headed");
|
|
99
102
|
flags.headless ? (process.env.MODE = JSON.stringify(true)) : false;
|
package/package.json
CHANGED
|
@@ -35,7 +35,10 @@ function showHelp() {
|
|
|
35
35
|
Usage: artes --reportWithTrace
|
|
36
36
|
|
|
37
37
|
📄 --singleFileReport Generate single file Allure report
|
|
38
|
-
Usage: artes --singleFileReport
|
|
38
|
+
Usage: artes -r --singleFileReport
|
|
39
|
+
|
|
40
|
+
🗜️ --zip Zip the report folder after generation
|
|
41
|
+
Usage: artes -r --zip
|
|
39
42
|
|
|
40
43
|
📁 --features Specify one or more feature files' relative paths to run (comma-separated)
|
|
41
44
|
Usage: artes --features "tests/features/Alma, tests/features/Banan.feature"
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const { spawnSync } = require("child_process");
|
|
2
2
|
const { moduleConfig } = require("../imports/commons");
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
3
5
|
|
|
4
6
|
function generateReport() {
|
|
5
7
|
|
|
@@ -12,7 +14,33 @@ function generateReport() {
|
|
|
12
14
|
shell: true,
|
|
13
15
|
});
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
if (fs.existsSync(moduleConfig.reportPath)) {
|
|
18
|
+
|
|
19
|
+
console.log(`🗜️ Zipping report folder to report.zip...`);
|
|
20
|
+
|
|
21
|
+
const zipResult = spawnSync("zip", ["-r", "report.zip", path.basename(moduleConfig.reportPath)], {
|
|
22
|
+
cwd: path.dirname(moduleConfig.reportPath),
|
|
23
|
+
stdio: "ignore"
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
if (zipResult.status === 0) {
|
|
27
|
+
const trueZipPath = path.join(path.dirname(moduleConfig.reportPath), 'true.zip');
|
|
28
|
+
const reportZipPath = path.join(path.dirname(moduleConfig.reportPath), 'report.zip');
|
|
29
|
+
|
|
30
|
+
if (fs.existsSync(trueZipPath)) {
|
|
31
|
+
fs.renameSync(trueZipPath, reportZipPath);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
console.log(`✅ Report folder zipped successfully in ${moduleConfig.reportPath}/report.zip!`);
|
|
35
|
+
} else {
|
|
36
|
+
console.error("❌ Failed to zip report folder");
|
|
37
|
+
process.env.EXIT_CODE = 1;
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
console.warn(`⚠️ Report folder does not exist: ${moduleConfig.reportPath}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
console.log(`📋 Report generated successfully in ${moduleConfig.reportPath}!`);
|
|
16
44
|
} catch (error) {
|
|
17
45
|
console.error("❌ Report generation failed:", error);
|
|
18
46
|
process.env.EXIT_CODE = 1;
|