artes 1.2.10 → 1.2.12
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 +2 -1
- package/src/helper/executers/helper.js +4 -1
- package/src/helper/executers/reportGenerator.js +40 -6
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "artes",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.12",
|
|
4
4
|
"description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"allure-cucumberjs": "3.0.5",
|
|
31
31
|
"allure-js-commons": "3.0.5",
|
|
32
32
|
"dayjs": "1.11.13",
|
|
33
|
+
"deasync": "^0.1.31",
|
|
33
34
|
"playwright": "1.52.0",
|
|
34
35
|
"rimraf": "6.0.1"
|
|
35
36
|
},
|
|
@@ -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,3 +1,6 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const archiver = require("archiver");
|
|
1
4
|
const { spawnSync } = require("child_process");
|
|
2
5
|
const { moduleConfig } = require("../imports/commons");
|
|
3
6
|
|
|
@@ -12,13 +15,44 @@ function generateReport() {
|
|
|
12
15
|
shell: true,
|
|
13
16
|
});
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
if (fs.existsSync(moduleConfig.reportPath) && process.env.ZIP) {
|
|
19
|
+
console.log(`🗜️ Zipping report folder`);
|
|
20
|
+
|
|
21
|
+
const zipPath = path.join(path.dirname(moduleConfig.reportPath), "report.zip");
|
|
22
|
+
|
|
23
|
+
let done = false;
|
|
24
|
+
let error = null;
|
|
25
|
+
|
|
26
|
+
const output = fs.createWriteStream(zipPath);
|
|
27
|
+
const archive = archiver("zip", { zlib: { level: 9 } });
|
|
28
|
+
|
|
29
|
+
output.on("close", () => {
|
|
30
|
+
console.log(`✅ Report folder zipped successfully: ${zipPath} (${archive.pointer()} total bytes)`);
|
|
31
|
+
done = true;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
archive.on("error", (err) => {
|
|
35
|
+
error = err;
|
|
36
|
+
done = true;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
archive.pipe(output);
|
|
40
|
+
archive.directory(moduleConfig.reportPath, false);
|
|
41
|
+
archive.finalize();
|
|
42
|
+
|
|
43
|
+
require("deasync").loopWhile(() => !done);
|
|
44
|
+
|
|
45
|
+
console.log(`🗜️ Zipped in ${moduleConfig.reportPath}/report.zip!`);
|
|
46
|
+
if (error) throw error;
|
|
47
|
+
} else {
|
|
48
|
+
console.warn(`⚠️ Report folder does not exist: ${moduleConfig.reportPath}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
console.log(`📋 Report generated successfully in ${moduleConfig.reportPath}!`);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.error("❌ Report generation failed:", err);
|
|
18
54
|
process.env.EXIT_CODE = 1;
|
|
19
55
|
}
|
|
20
56
|
}
|
|
21
57
|
|
|
22
|
-
module.exports = {
|
|
23
|
-
generateReport,
|
|
24
|
-
};
|
|
58
|
+
module.exports = { generateReport };
|