artes 1.2.5 → 1.2.6
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 +1 -0
- package/cucumber.config.js +3 -0
- package/executer.js +4 -1
- package/package.json +1 -2
- package/src/helper/executers/cleaner.js +1 -1
- package/src/helper/executers/helper.js +5 -2
- package/src/helper/executers/projectCreator.js +1 -3
- package/src/helper/executers/reportGenerator.js +3 -4
- package/src/helper/imports/commons.js +1 -2
package/README.md
CHANGED
|
@@ -52,6 +52,7 @@ 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
56
|
| 📁 `--features` | Specify one or more feature files' relative paths to run (comma-separated) | `artes --features "tests/features/Alma,tests/features/Banan.feature"` |
|
|
56
57
|
| 📜 `--stepDef` | Specify one or more step definition files' relative paths to use (comma-separated) | `artes --stepDef "tests/steps/login.js,tests/steps/home.js"` |
|
|
57
58
|
| 🔖 `--tags` | Run tests with specified Cucumber tags | `artes --tags "@smoke or @wip"` |
|
package/cucumber.config.js
CHANGED
|
@@ -131,6 +131,9 @@ module.exports = {
|
|
|
131
131
|
// World parameters
|
|
132
132
|
worldParameters: artesConfig.worldParameters || {}, // Custom world parameters
|
|
133
133
|
},
|
|
134
|
+
report:{
|
|
135
|
+
singleFileReport: process.env.SINGLE_FILE_REPORT == "true" ? true : artesConfig.singleFileReport ? true : false
|
|
136
|
+
},
|
|
134
137
|
env: env,
|
|
135
138
|
baseURL: process.env.BASE_URL
|
|
136
139
|
? JSON.parse(process.env.BASE_URL)
|
package/executer.js
CHANGED
|
@@ -29,6 +29,7 @@ const flags = {
|
|
|
29
29
|
reportSuccess: args.includes("--reportSuccess"),
|
|
30
30
|
trace: args.includes("-t") || args.includes("--trace"),
|
|
31
31
|
reportWithTrace: args.includes("-rwt") || args.includes("--reportWithTrace"),
|
|
32
|
+
singleFileReport: args.includes("--singleFileReport"),
|
|
32
33
|
features: args.includes("--features"),
|
|
33
34
|
stepDef: args.includes("--stepDef"),
|
|
34
35
|
tags: args.includes("--tags"),
|
|
@@ -89,7 +90,9 @@ flags.report ? (process.env.REPORT = true) : "";
|
|
|
89
90
|
|
|
90
91
|
flags.trace ? (process.env.TRACE = true) : "";
|
|
91
92
|
|
|
92
|
-
flags.reportWithTrace ? (process.env.REPORT_WITH_TRACE = true) :
|
|
93
|
+
flags.reportWithTrace ? (process.env.REPORT_WITH_TRACE = true) : (process.env.REPORT_WITH_TRACE=false);
|
|
94
|
+
|
|
95
|
+
flags.singleFileReport ? (process.env.SINGLE_FILE_REPORT = true) : (process.env.SINGLE_FILE_REPORT=false);
|
|
93
96
|
|
|
94
97
|
flags.headless &&
|
|
95
98
|
console.log("Running mode:", flags.headless ? "headless" : "headed");
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "artes",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "cucumber-js --config=cucumber.config.js",
|
|
8
|
-
"testWithReport": "allure generate --clean --single-file allure-result --output",
|
|
9
8
|
"createProject": "node ./src/helper/executers/projectCreator.js",
|
|
10
9
|
"clean": "rimraf",
|
|
11
10
|
"publishOnly": "prettier -w . && npm version patch && npm publish"
|
|
@@ -28,11 +28,14 @@ function showHelp() {
|
|
|
28
28
|
✅ --reportSuccess Generate screenshot and video record with also successful tests
|
|
29
29
|
Usage: artes --reportSuccess
|
|
30
30
|
|
|
31
|
-
--trace Enable tracing for all tests
|
|
31
|
+
⚡ --trace Enable tracing for all tests
|
|
32
32
|
Usage: artes --trace
|
|
33
33
|
|
|
34
|
-
-rwt, --reportWithTrace Include trace in the report
|
|
34
|
+
🔍 -rwt, --reportWithTrace Include trace in the report
|
|
35
35
|
Usage: artes --reportWithTrace
|
|
36
|
+
|
|
37
|
+
📄 --singleFileReport Generate single file Allure report
|
|
38
|
+
Usage: artes --singleFileReport
|
|
36
39
|
|
|
37
40
|
📁 --features Specify one or more feature files' relative paths to run (comma-separated)
|
|
38
41
|
Usage: artes --features "tests/features/Alma, tests/features/Banan.feature"
|
|
@@ -16,8 +16,6 @@ function createProject(createYes) {
|
|
|
16
16
|
path.join(projectDir, ".vscode"),
|
|
17
17
|
].forEach((dir) => fs.mkdirSync(dir, { recursive: true }));
|
|
18
18
|
|
|
19
|
-
process.chdir(projectDir);
|
|
20
|
-
|
|
21
19
|
console.log("🚀 Initializing project...");
|
|
22
20
|
execSync(`npm init ${createYes ? "-y" : ""}`, { stdio: "inherit" });
|
|
23
21
|
execSync("npm i artes", { stdio: "inherit" });
|
|
@@ -48,7 +46,7 @@ function createProject(createYes) {
|
|
|
48
46
|
// timeout : 0, // number - Test timeout in seconds
|
|
49
47
|
// slowMo: 0, // number - Slow down test execution (Default: 0 seconds)
|
|
50
48
|
// parallel: 0, // number - Number of parallel workers
|
|
51
|
-
//report: true / boolean - Generate report
|
|
49
|
+
// report: true / boolean - Generate report
|
|
52
50
|
// reportSuccess: false, // boolean - Add screenshots and video records to report also for success test cases
|
|
53
51
|
// trace: false, // boolean - Enable tracing
|
|
54
52
|
// reportWithTrace: false, // boolean - Include trace in report
|
|
@@ -2,18 +2,17 @@ const { spawnSync } = require("child_process");
|
|
|
2
2
|
const { moduleConfig } = require("../imports/commons");
|
|
3
3
|
|
|
4
4
|
function generateReport() {
|
|
5
|
+
|
|
5
6
|
try {
|
|
6
7
|
console.log("📊 Generating report...");
|
|
7
8
|
|
|
8
|
-
spawnSync("
|
|
9
|
+
spawnSync("allure", [ "generate", "--clean", `${process.env.SINGLE_FILE_REPORT ? "--single-file allure-result" : "" }`, "--output", moduleConfig.reportPath], {
|
|
9
10
|
cwd: moduleConfig.modulePath,
|
|
10
11
|
stdio: "ignore",
|
|
11
12
|
shell: true,
|
|
12
13
|
});
|
|
13
14
|
|
|
14
|
-
console.log(
|
|
15
|
-
`📋 Report generated successfully in ${moduleConfig.reportPath}!`,
|
|
16
|
-
);
|
|
15
|
+
console.log(`📋 Report generated successfully in ${moduleConfig.reportPath}!`,);
|
|
17
16
|
} catch (error) {
|
|
18
17
|
console.error("❌ Report generation failed:", error);
|
|
19
18
|
process.env.EXIT_CODE = 1;
|
|
@@ -34,8 +34,7 @@ const moduleConfig = {
|
|
|
34
34
|
featuresPath: path.join(projectPath, "/tests/features/"),
|
|
35
35
|
stepsPath: path.join(projectPath, "/tests/steps/*.js"),
|
|
36
36
|
pomPath: path.join(projectPath, "/tests/POMs"),
|
|
37
|
-
cleanUpPaths:
|
|
38
|
-
"allure-result allure-results test-results @rerun.txt testsStatus EXIT_CODE.txt",
|
|
37
|
+
cleanUpPaths: "allure-result allure-results test-results @rerun.txt testsStatus EXIT_CODE.txt",
|
|
39
38
|
};
|
|
40
39
|
|
|
41
40
|
module.exports = {
|