artes 1.0.68 โ†’ 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 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) (comma-separated) | `artes --features "tests/features/Alma, tests/features/Banan.feature"` |
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>
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
4
4
  "description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,43 +1,52 @@
1
1
  function showHelp() {
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
- }
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";
@@ -4,7 +4,7 @@ class Context {
4
4
  this.page = undefined;
5
5
  this.request = undefined;
6
6
  this.response = undefined;
7
- this.vars = {};
7
+ this.vars = undefined;
8
8
  }
9
9
  }
10
10
 
@@ -24,6 +24,7 @@ BeforeAll(async function () {
24
24
  });
25
25
 
26
26
  Before(async function () {
27
+ context.vars = {};
27
28
  browser = await invokeBrowser();
28
29
  request = await invokeRequest();
29
30