artes 1.0.67 โ 1.0.69
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 +6 -2
- package/cucumber.config.js +3 -3
- package/executer.js +3 -0
- package/package.json +1 -1
- package/src/helper/executers/helper.js +48 -39
- package/src/helper/executers/testRunner.js +6 -0
- package/src/hooks/context.js +1 -1
- package/src/hooks/hooks.js +1 -0
- package/src/stepDefinitions/API.steps.js +1 -1
package/README.md
CHANGED
|
@@ -43,16 +43,20 @@ npx artes [options]
|
|
|
43
43
|
### Options
|
|
44
44
|
|
|
45
45
|
| Option | Description | Usage Example |
|
|
46
|
-
|
|
|
46
|
+
| ------------------- | ------------------------------------------------------------- | ------------------------------------------------- |
|
|
47
47
|
| ๐ `-h, --help` | Show the usage options | `artes -h` or `artes --help` |
|
|
48
48
|
| ๐ท๏ธ `-v, --version` | Show the current version of Artes | `artes -v` or `artes --version` |
|
|
49
49
|
| ๐๏ธ `-c, --create` | Create an example project with Artes | `artes -c` or `artes --create` |
|
|
50
50
|
| โ
`-y, --yes` | Skip the confirmation prompt when creating an example project | `artes -c -y` or `artes --create --yes` |
|
|
51
51
|
| ๐ `-r, --report` | Run tests and generate Allure report | `artes -r` or `artes --report` |
|
|
52
|
-
| ๐ `--features` | Specify one or more feature files' relative paths to run (comma-separated)
|
|
52
|
+
| ๐ `--features` | Specify one or more feature files' relative paths to run (comma-separated) | `artes --features "tests/features/Alma, tests/features/Banan.feature"` |
|
|
53
53
|
| ๐ `--tags` | Run tests with specified Cucumber tags | `artes --tags "@smoke or @wip"` |
|
|
54
54
|
| ๐ `--env` | Set the environment for the test run | `artes --env "dev"` |
|
|
55
55
|
| ๐ถ๏ธ `--headless` | Run browser in headless mode | `artes --headless` |
|
|
56
|
+
| โก `--parallel` | Run tests in parallel mode | `artes --parallel 2` |
|
|
57
|
+
| ๐ `--retry` | Retry failed tests | `artes --retry 3` |
|
|
58
|
+
| ๐ญ `--dryrun` | Perform a dry run without executing tests | `artes --dryrun` |
|
|
59
|
+
|
|
56
60
|
|
|
57
61
|
\*\* To just run the tests: <br>
|
|
58
62
|
Globally: artes <br>
|
package/cucumber.config.js
CHANGED
|
@@ -47,8 +47,8 @@ module.exports = {
|
|
|
47
47
|
}, // Formatter options
|
|
48
48
|
|
|
49
49
|
// Execution options
|
|
50
|
-
parallel: artesConfig.parallel || 1, // Number of parallel workers
|
|
51
|
-
dryRun: artesConfig.dryRun || false, // Prepare test run without execution
|
|
50
|
+
parallel: process.env.REPORT_FORMAT ? JSON.parse(process.env.REPORT_FORMAT) : artesConfig.parallel || 1, // Number of parallel workers
|
|
51
|
+
dryRun: process.env.DRYRUN ? JSON.parse(process.env.DRYRUN) : artesConfig.dryRun || false, // Prepare test run without execution
|
|
52
52
|
failFast: artesConfig.failFast || false, // Stop on first test failure
|
|
53
53
|
forceExit: artesConfig.forceExit || false, // Force process.exit() after tests
|
|
54
54
|
strict: artesConfig.strict || true, // Fail on pending steps
|
|
@@ -67,7 +67,7 @@ module.exports = {
|
|
|
67
67
|
requireModule: artesConfig.requireModule || [], // Transpilation module names
|
|
68
68
|
|
|
69
69
|
// Retry logic
|
|
70
|
-
retry: artesConfig.retry || 0, // Retry attempts for failing tests
|
|
70
|
+
retry: process.env.RETRY ? JSON.parse(process.env.RETRY) : artesConfig.retry || 0, // Retry attempts for failing tests
|
|
71
71
|
retryTagFilter: artesConfig.retryTagFilter || "", // Tag expression for retries
|
|
72
72
|
|
|
73
73
|
// Publishing
|
package/executer.js
CHANGED
|
@@ -22,6 +22,9 @@ const flags = {
|
|
|
22
22
|
tags: args.includes("--tags"),
|
|
23
23
|
env: args.includes("--env"),
|
|
24
24
|
headless: args.includes("--headless"),
|
|
25
|
+
parallel: args.includes("--parallel"),
|
|
26
|
+
retry: args.includes("--retry"),
|
|
27
|
+
dryrun: args.includes("--dryrun")
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
function main() {
|
package/package.json
CHANGED
|
@@ -1,43 +1,52 @@
|
|
|
1
1
|
function showHelp() {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
2
|
+
console.log(`
|
|
3
|
+
๐ Artes - Playwright Test Runner
|
|
4
|
+
|
|
5
|
+
Description:
|
|
6
|
+
Artes is a test runner for Playwright that executes Cucumber tests
|
|
7
|
+
and can generate Allure reports.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
npx artes [options]
|
|
11
|
+
|
|
12
|
+
Options:
|
|
13
|
+
๐ -h, --help Show this help message
|
|
14
|
+
Usage: artes -h or artes --help
|
|
15
|
+
|
|
16
|
+
๐ท๏ธ -v, --version Show current version of artes
|
|
17
|
+
Usage: artes -v or artes --version
|
|
18
|
+
|
|
19
|
+
๐๏ธ -c, --create Create example project with artes
|
|
20
|
+
Usage: artes -c or artes --create
|
|
21
|
+
|
|
22
|
+
โ
-y, --yes Skip confirmation prompt for creating example project
|
|
23
|
+
Usage: artes -c -y or artes --create --yes
|
|
24
|
+
|
|
25
|
+
๐ -r, --report Run tests and generate Allure report
|
|
26
|
+
Usage: artes -r or artes --report
|
|
27
|
+
|
|
28
|
+
๐ --features Specify one or more feature files' relative paths to run (comma-separated)
|
|
29
|
+
Usage: artes --features "tests/features/Alma, tests/features/Banan.feature"
|
|
30
|
+
|
|
31
|
+
๐ --tags Run tests with specified Cucumber tags
|
|
32
|
+
Usage: artes --tags "@smoke and not @wip"
|
|
33
|
+
|
|
34
|
+
๐ --env Set environment for the test run
|
|
35
|
+
Usage: artes --env "dev"
|
|
36
|
+
|
|
37
|
+
๐ถ๏ธ --headless Run browser in headless mode
|
|
38
|
+
Usage: artes --headless
|
|
39
|
+
|
|
40
|
+
โก --parallel Run tests in parallel mode
|
|
41
|
+
Usage: artes --parallel 3
|
|
42
|
+
|
|
43
|
+
๐ --retry Retry failed tests
|
|
44
|
+
Usage: artes --retry 2
|
|
45
|
+
|
|
46
|
+
๐ญ --dryrun Perform a dry run without executing tests
|
|
47
|
+
Usage: artes --dryrun
|
|
48
|
+
`);
|
|
49
|
+
|
|
41
50
|
|
|
42
51
|
module.exports = {
|
|
43
52
|
showHelp,
|
|
@@ -9,6 +9,8 @@ function runTests(args, flags) {
|
|
|
9
9
|
const features = flags.features && featureFiles;
|
|
10
10
|
|
|
11
11
|
const tags = args[args.indexOf("--tags") + 1];
|
|
12
|
+
const parallel = args[args.indexOf("--parallel") + 1];
|
|
13
|
+
const retry = args[args.indexOf("--retry") + 1];
|
|
12
14
|
|
|
13
15
|
flags.env && console.log("Running env:", env);
|
|
14
16
|
flags.env ? (process.env.ENV = JSON.stringify(env)) : "";
|
|
@@ -30,6 +32,10 @@ function runTests(args, flags) {
|
|
|
30
32
|
console.log("Running mode:", flags.headless ? "headless" : "headed");
|
|
31
33
|
flags.headless ? (process.env.MODE = JSON.stringify(true)) : false;
|
|
32
34
|
|
|
35
|
+
flags.parallel ? (process.env.PARALLEL = JSON.stringify(parallel)) : "";
|
|
36
|
+
flags.retry ? (process.env.RETRY = JSON.stringify(retry)) : "";
|
|
37
|
+
flags.dryrun ? (process.env.DRYRUN = JSON.stringify(true)) : "";
|
|
38
|
+
|
|
33
39
|
try {
|
|
34
40
|
console.log("๐งช Running tests...");
|
|
35
41
|
process.env.FORCE_COLOR = "1";
|
package/src/hooks/context.js
CHANGED
package/src/hooks/hooks.js
CHANGED
|
@@ -63,7 +63,7 @@ When(
|
|
|
63
63
|
);
|
|
64
64
|
|
|
65
65
|
When(
|
|
66
|
-
"User sends multipart POST request to {string} with payload and {string} variables",
|
|
66
|
+
"User sends multipart POST request to {string} with payload and saves {string} variables",
|
|
67
67
|
async (url, vars, payload) => {
|
|
68
68
|
await api.post(url, payload, "multipart");
|
|
69
69
|
extractVarsFromResponse(vars);
|