artes 1.2.11 → 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/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
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
const { spawnSync } = require("child_process");
|
|
2
|
-
const { moduleConfig } = require("../imports/commons");
|
|
3
1
|
const fs = require("fs");
|
|
4
2
|
const path = require("path");
|
|
3
|
+
const archiver = require("archiver");
|
|
4
|
+
const { spawnSync } = require("child_process");
|
|
5
|
+
const { moduleConfig } = require("../imports/commons");
|
|
5
6
|
|
|
6
7
|
function generateReport() {
|
|
7
8
|
|
|
@@ -14,39 +15,44 @@ function generateReport() {
|
|
|
14
15
|
shell: true,
|
|
15
16
|
});
|
|
16
17
|
|
|
17
|
-
if (fs.existsSync(moduleConfig.reportPath)) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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;
|
|
39
47
|
} else {
|
|
40
48
|
console.warn(`⚠️ Report folder does not exist: ${moduleConfig.reportPath}`);
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
console.log(`📋 Report generated successfully in ${moduleConfig.reportPath}!`);
|
|
44
|
-
} catch (
|
|
45
|
-
console.error("❌ Report generation failed:",
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.error("❌ Report generation failed:", err);
|
|
46
54
|
process.env.EXIT_CODE = 1;
|
|
47
55
|
}
|
|
48
56
|
}
|
|
49
57
|
|
|
50
|
-
module.exports = {
|
|
51
|
-
generateReport,
|
|
52
|
-
};
|
|
58
|
+
module.exports = { generateReport };
|