artes 1.7.2 → 1.7.4

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
@@ -139,61 +139,75 @@ npx artes [options]
139
139
  npx artes [options]
140
140
  ```
141
141
 
142
- ### Options
143
-
144
- | Option | Description | Usage Example |
145
- | ------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
146
- | 🆘 `-h, --help` | Show the usage options | `artes -h` or `artes --help` |
147
- | 🏷️ `-v, --version` | Show the current version of Artes | `artes -v` or `artes --version` |
148
- | 🏗️ `-c, --create` | Create an example project with Artes | `artes -c` or `artes --create` |
149
- | `-y, --yes` | Skip the confirmation prompt when creating an example project | `artes -c -y` or `artes --create --yes` |
150
- | 🚫 --noDeps | Skip installing dependencies when creating example project | `artes -c --noDeps` |
151
- | 📊 `-r, --report` | Run tests and generate Allure report | `artes -r` or `artes --report` |
152
- | `--reportSuccess` | Add screenshots and video records for also Success test cases | `artes --reportSuccess` |
153
- | `--trace` | Enable tracing | `artes --trace` |
154
- | `-rwt, --reportWithTrace` | Add trace to the report | `artes -rwt` or `artes --reportWithTrace` |
155
- | `--singleFileReport` | Generate single file allure report | `artes -r --singleFileReport` |
156
- | `--zip` | Zip the report folder after generation | `artes -r --zip` |
157
- | `--uploadReport` | Upload the generated report to Artes Reporting System | `artes -r --zip --uploadReport --reporterURL "https://example.com"` |
158
- | `--reporterURL` | URL of the Artes Reporting System to upload the report | `artes -r --zip --uploadReport --reporterURL "https://example.com"` |
159
- | `--projectName` | Name of the project in the Artes Reporting System (default: `"Artes Report"`) | `artes -r --zip --uploadReport --reporterURL "https://example.com" --projectName "My Project"` |
160
- | `--projectType` | Type of the project for reporting purposes (default: `"Artes"`) | `artes -r --zip --uploadReport --reporterURL "https://example.com" --projectType "API"` |
161
- | `--reportPath` | Path to the report zip file to upload (default: `./report.zip`) | `artes -r --zip --uploadReport --reporterURL "https://example.com" --reportPath "./my_report.zip"` |
162
- | 🖼️ `--logo` | Set a custom logo in the report sidebar. Accepts an absolute path, a relative path, or a direct image URL | `artes -r --logo /abs/path/logo.png`<br>`artes --logo logo.png`<br>`artes --logo 'https://example.com/logo.png'` |
163
- | 🏢 `--brandName` | Set the brand name displayed next to the logo in the report sidebar | `artes --brandName 'My Company'` |
164
- | 📄 `--reportName` | Report name displayed on the summary widget and in the Artes Reporting System | `artes --reportName 'Alma UI'`
165
- | 📁 `--features` | Specify one or more feature files' relative paths to run (comma-separated) | `artes --features "tests/features/Alma,tests/features/Banan.feature"` |
166
- | 📜 `--stepDef` | Specify one or more step definition files' relative paths to use (comma-separated) | `artes --stepDef "tests/steps/login.js,tests/steps/home.js"` |
167
- | 🔖 `--tags` | Run tests with specified Cucumber tags | `artes --tags "@smoke or @wip"` |
168
- | 🌐 `--env` | Set the environment for the test run | `artes --env "dev"` |
169
- | `--saveVar` | Set the variables from CLI | `artes --saveVar '{"armud":20,"banana":200}'` |
170
- | 🕶️ `--headless` | Run browser in headless mode | `artes --headless` |
171
- | ⚡ `--parallel` | Run tests in parallel mode | `artes --parallel 2` |
172
- | 🔁 `--retry` | Retry failed tests | `artes --retry 3` |
173
- | 🔁 `--rerun` | Rerun only the failed tests from previous run | `artes --rerun @rerun.txt` |
174
- | 🎭 `--dryRun` | Perform a dry run without executing tests | `artes --dryRun` |
175
- | 📈 `--percentage` | Set minimum success percentage to pass test run (default is 0) | `artes --percentage 85` |
176
- | 🌍 `--browser` | Specify browser to use (`chromium`, `firefox`, or `webkit`) | `artes --browser chromium` |
177
- | `--offline` | Run browser in offline mode | `artes --offline` |
178
- | 📱 `--device` | Emulate specific device (e.g., "iPhone 13") | `artes --device "iPhone 13"` |
179
- | 🔗 `--baseURL` | Set base URL for the tests | `artes --baseURL "https://example.com"` |
180
- | 🖥️ `--maxScreen` | Maximize browser window on launch | `artes --maxScreen` |
181
- | 📏 `--width` | Set browser width (default is 1280) | `artes --width 1920` |
182
- | 📐 `--height` | Set browser height (default is 720) | `artes --height 1080` |
183
- | ⏱️ `--timeout` | Set timeout for each test step in seconds (default is 30 seconds) | `artes --timeout 10` |
184
- | 🐢 `--slowMo` | Slow down text execution for clear view (default: 0 seconds) | `artes --slowMo 1` |
185
-
186
- ### AI Options
142
+
143
+ ### General ( artes -h or artes --help )
144
+
145
+ | Option | Description | Usage Example |
146
+ | --- | --- | --- |
147
+ | `-h, --help` | Show this help message | `artes -h` or `artes --help` |
148
+ | `-v, --version` | Show current version of artes | `artes -v` or `artes --version` |
149
+ | `-c, --create` | Create example artes project | `artes -c` or `artes --create` |
150
+
151
+ ### Reporting & Branding ( artes report --help )
152
+
153
+ | Option | Description | Usage Example |
154
+ | --- | --- | --- |
155
+ | `-r, --report` | Run tests and generate Allure report | `artes -r` or `artes --report` |
156
+ | `--reportSuccess` | Generate screenshot and video with successful tests too | `artes --reportSuccess` |
157
+ | `--trace` | Enable tracing for all tests | `artes --trace` |
158
+ | `-rwt, --reportWithTrace` | Include trace in the report | `artes -rwt` or `artes --reportWithTrace` |
159
+ | `--singleFileReport` | Generate single file Allure report | `artes -r --singleFileReport` |
160
+ | `--zip` | Zip the report folder after generation | `artes -r --zip` |
161
+ | `--logo` | Set a custom logo in the report sidebar | `artes --logo logo.png` |
162
+ | `--brandName` | Set the brand name displayed next to the logo | `artes --brandName 'My Company'` |
163
+ | `--reportName` | Report name on the summary widget | `artes --reportName 'Alma UI'` |
164
+ | `--uploadReport` | Upload the generated report to Artes Reporting System | `artes -r --zip --uploadReport --reporterURL "https://example.com"` |
165
+ | `--reporterURL` | URL of the Artes Reporting System | `artes --uploadReport --reporterURL "https://example.com"` |
166
+ | `--projectName` | Project name in the Artes Reporting System (default: `"Artes Report"`) | `artes --uploadReport --reporterURL "https://example.com" --projectName "My Project"` |
167
+ | `--projectType` | Project type for reporting, e.g., UI, API (default: `"Artes"`) | `artes --uploadReport --reporterURL "https://example.com" --projectType "API"` |
168
+ | `--reportPath` | Path to the report zip file to upload (default: `./report.zip`) | `artes --uploadReport --reporterURL "https://example.com" --reportPath "./my_report.zip"` |
169
+
170
+ ### Browser ( artes browser --help )
171
+
172
+ | Option | Description | Usage Example |
173
+ | --- | --- | --- |
174
+ | `--browser` | Specify browser to use (`chromium`, `firefox`, `webkit`) | `artes --browser chromium` |
175
+ | `--device` | Emulate a specific device (e.g., `"iPhone 13"`) | `artes --device "iPhone 13"` |
176
+ | `--maxScreen` | Maximize browser window on launch | `artes --maxScreen` |
177
+ | `--width` | Set browser width (default: `1280`) | `artes --width 1920` |
178
+ | `--height` | Set browser height (default: `720`) | `artes --height 1080` |
179
+
180
+ ### Execution ( artes execution --help )
181
+
182
+ | Option | Description | Usage Example |
183
+ | --- | --- | --- |
184
+ | `--headless` | Run browser in headless mode | `artes --headless` |
185
+ | `--baseURL` | Set base URL for the tests | `artes --baseURL "https://example.com"` |
186
+ | `--offline` | Run browser in offline mode | `artes --offline` |
187
+ | `--features` | Specify feature file paths to run (comma-separated) | `artes --features "tests/features/Alma,tests/features/Banan.feature"` |
188
+ | `--stepDef` | Specify step definition file paths to use (comma-separated) | `artes --stepDef "tests/steps/login.js,tests/steps/home.js"` |
189
+ | `--tags` | Run tests with specified Cucumber tags | `artes --tags "@smoke and not @wip"` |
190
+ | `--env` | Set the environment for the test run | `artes --env "dev"` |
191
+ | `--saveVar` | Set variables from CLI | `artes --saveVar '{"armud":20,"banana":200}'` |
192
+ | `--parallel` | Run tests in parallel mode | `artes --parallel 3` |
193
+ | `--retry` | Retry failed tests | `artes --retry 2` |
194
+ | `--rerun` | Rerun only failed tests from previous run | `artes --rerun @rerun.txt` |
195
+ | `--dryRun` | Perform a dry run without executing tests | `artes --dryRun` |
196
+ | `--percentage` | Set minimum success percentage to pass test run (default: `0`) | `artes --percentage 85` |
197
+ | `--timeout` | Set timeout for each test step in seconds (default: `30`) | `artes --timeout 10` |
198
+ | `--slowMo` | Slow down execution for clear view (default: `0`) | `artes --slowMo 1` |
199
+
200
+ ### AI Bug Reporter ( artes ai --help )
187
201
 
188
202
  | Option | Description | Usage Example |
189
203
  | --- | --- | --- |
190
- | 🤖 `--ai` | Enable AI-generated bug reports and test summaries | `artes --ai` |
191
- | 🧠 `--aiModel` | AI model to use for report generation | `artes --ai --aiModel "gemini 2.5 flash"` |
192
- | 🔑 `--aiKey` | API key for the selected AI provider | `artes --ai --aiKey "your-api-key"` |
193
- | 🔗 `--aiURL` | Local AI endpoint URL (e.g. Ollama, LM Studio). Overrides `--aiModel` and `--aiKey` when set | `artes --ai --aiURL "http://localhost:11434/api/chat"` |
194
- | 🌍 `--aiLanguage` | Language for AI-generated reports (default: `"English"`) | `artes --ai --aiLanguage "Azerbaijani"` |
195
- | 🔢 --maxTokens | Maximum tokens for AI response output (default: 4000) | artes --ai --maxTokens 8000 |
196
- | 📋 `--maxReports` | Maximum number of AI reports to generate per test run (default: `10`) | `artes --ai --maxReports 5` |
204
+ | `--ai` | Enable AI-generated bug reports and test summaries | `artes --ai` |
205
+ | `--aiModel` | AI model to use for report generation | `artes --ai --aiModel "gemini 2.5 flash"` |
206
+ | `--aiKey` | API key for the selected AI provider | `artes --ai --aiKey "your-api-key"` |
207
+ | `--aiURL` | Local AI endpoint URL (e.g., Ollama, LM Studio). Overrides `--aiModel` and `--aiKey` when set | `artes --ai --aiURL "http://localhost:11434/api/chat"` |
208
+ | `--aiLanguage` | Language for AI-generated reports (default: `"English"`) | `artes --ai --aiLanguage "Azerbaijani"` |
209
+ | `--maxTokens` | Maximum tokens for AI-generated reports (default: `4000`) | `artes --ai --maxTokens 8000` |
210
+ | `--maxReports` | Maximum number of AI reports to generate per test run (default: `10`) | `artes --ai --maxReports 5` |
197
211
 
198
212
 
199
213
  \*\* To just run the tests: <br>
package/executer.js CHANGED
@@ -3,24 +3,25 @@ const {
3
3
  showHelp,
4
4
  showAIHelp,
5
5
  showVersion,
6
+ showBrowserHelp,
7
+ showExecutionHelp,
8
+ showReportingHelp,
6
9
  createProject,
7
10
  runTests,
8
11
  generateReport,
9
12
  cleanUp,
10
13
  } = require("./src/helper/executers/exporter");
14
+
11
15
  const { logPomWarnings } = require("./src/helper/controller/pomCollector");
12
- const fs = require("fs");
13
- const path = require("path");
14
- const {
15
- testCoverageCalculator,
16
- } = require("./src/helper/controller/testCoverageCalculator");
16
+ const { testCoverageCalculator } = require("./src/helper/controller/testCoverageCalculator");
17
17
  const { getExecutor } = require("./src/helper/controller/getExecutor");
18
- const {
19
- findDuplicateTestNames,
20
- } = require("./src/helper/controller/findDuplicateTestNames");
18
+ const { findDuplicateTestNames } = require("./src/helper/controller/findDuplicateTestNames");
21
19
  const { getEnvInfo } = require("artes/src/helper/controller/getEnvInfo");
22
20
  const { uploadReport } = require("./src/helper/controller/reportUploader");
23
21
 
22
+ const fs = require("fs");
23
+ const path = require("path");
24
+
24
25
  const artesConfigPath = path.resolve(process.cwd(), "artes.config.js");
25
26
 
26
27
  let artesConfig = {};
@@ -31,256 +32,215 @@ if (fs.existsSync(artesConfigPath)) {
31
32
 
32
33
  const args = process.argv.slice(2);
33
34
 
35
+ const set = (key, value) => { if (value) process.env[key] = value; };
36
+
34
37
  const getArgValue = (flag) => {
35
38
  const index = args.indexOf(flag);
36
39
  return index >= 0 ? args[index + 1] : undefined;
37
40
  };
38
41
 
42
+
39
43
  const flags = {
40
- help: args.includes("-h") || args.includes("--help"),
44
+ // Main
45
+ help: args.includes("-h") || args.includes("--help"),
41
46
  version: args.includes("-v") || args.includes("--version"),
42
- create: args.includes("-c") || args.includes("--create"),
43
- createYes: args.includes("-y") || args.includes("--yes"),
44
- noDeps: args.includes("--noDeps"),
45
- report: args.includes("-r") || args.includes("--report"),
46
- reportSuccess: args.includes("--reportSuccess"),
47
- trace: args.includes("-t") || args.includes("--trace"),
48
- reportWithTrace: args.includes("-rwt") || args.includes("--reportWithTrace"),
47
+ create: args.includes("-c") || args.includes("--create"),
48
+
49
+ // Sub-command help pages
50
+ reportHelp: (args[0] === "report" && args.includes("--help")),
51
+ browserHelp: (args[0] === "browser" && args.includes("--help")),
52
+ executionHelp: (args[0] === "execution" && args.includes("--help")),
53
+ aiHelp: (args[0] === "ai" && args.includes("--help")),
54
+
55
+ // Reporting
56
+ report: args.includes("-r") || args.includes("--report"),
57
+ reportSuccess: args.includes("--reportSuccess"),
58
+ reportWithTrace: args.includes("-rwt") || args.includes("--reportWithTrace"),
59
+ trace: args.includes("--trace"),
49
60
  singleFileReport: args.includes("--singleFileReport"),
50
- customLogo: args.includes("--logo"),
51
- customBrandName: args.includes("--brandName"),
52
- customReportName: args.includes("--reportName"),
53
- zip: args.includes("--zip"),
54
- uploadReport: args.includes("--uploadReport"),
55
- reporterURL: args.includes("--reporterURL"),
56
- projectName: args.includes("--projectName"),
57
- projectType: args.includes("--projectType"),
58
- reportPath: args.includes("--reportPath"),
59
- aiHelp: args.includes("--aiHelp"),
60
- ai: args.includes("--ai"),
61
- aiURL: args.includes("--aiURL"),
62
- aiModel: args.includes("--aiModel"),
63
- aiKey: args.includes("--aiKey"),
64
- aiLanguage: args.includes("--aiLanguage"),
65
- maxTokens: args.includes("--maxTokens"),
66
- maxReports: args.includes("--maxReports"),
67
- features: args.includes("--features"),
68
- stepDef: args.includes("--stepDef"),
69
- tags: args.includes("--tags"),
70
- env: args.includes("--env"),
71
- saveVar: args.includes("--saveVar"),
72
- headless: args.includes("--headless"),
73
- parallel: args.includes("--parallel"),
74
- retry: args.includes("--retry"),
75
- rerun: args.includes("--rerun"),
76
- dryRun: args.includes("--dryRun"),
61
+ zip: args.includes("--zip"),
62
+ logo: args.includes("--logo"),
63
+ brandName: args.includes("--brandName"),
64
+ reportName: args.includes("--reportName"),
65
+ uploadReport: args.includes("--uploadReport"),
66
+ reporterURL: args.includes("--reporterURL"),
67
+ projectName: args.includes("--projectName"),
68
+ projectType: args.includes("--projectType"),
69
+ reportPath: args.includes("--reportPath"),
70
+
71
+ // Browser & Environment
72
+ browser: args.includes("--browser"),
73
+ device: args.includes("--device"),
74
+ maxScreen: args.includes("--maxScreen"),
75
+ width: args.includes("--width"),
76
+ height: args.includes("--height"),
77
+
78
+ // Execution
79
+ baseURL: args.includes("--baseURL"),
80
+ env: args.includes("--env"),
81
+ headless: args.includes("--headless"),
82
+ offline: args.includes("--offline"),
83
+ features: args.includes("--features"),
84
+ stepDef: args.includes("--stepDef"),
85
+ tags: args.includes("--tags"),
86
+ parallel: args.includes("--parallel"),
87
+ retry: args.includes("--retry"),
88
+ rerun: args.includes("--rerun"),
89
+ dryRun: args.includes("--dryRun"),
77
90
  percentage: args.includes("--percentage"),
78
- browser: args.includes("--browser"),
79
- offline: args.includes("--offline"),
80
- device: args.includes("--device"),
81
- baseURL: args.includes("--baseURL"),
82
- maximizeScreen: args.includes("--maxScreen"),
83
- width: args.includes("--width"),
84
- height: args.includes("--height"),
85
- timeout: args.includes("--timeout"),
86
- slowMo: args.includes("--slowMo"),
91
+ timeout: args.includes("--timeout"),
92
+ slowMo: args.includes("--slowMo"),
93
+ saveVar: args.includes("--saveVar"),
94
+
95
+ // AI
96
+ ai: args.includes("--ai"),
97
+ aiModel: args.includes("--aiModel"),
98
+ aiKey: args.includes("--aiKey"),
99
+ aiURL: args.includes("--aiURL"),
100
+ aiLanguage: args.includes("--aiLanguage"),
101
+ maxTokens: args.includes("--maxTokens"),
102
+ maxReports: args.includes("--maxReports"),
87
103
  };
88
104
 
89
- const env = getArgValue("--env");
90
- const vars = getArgValue("--saveVar");
91
- const reporterURL = getArgValue("--reporterURL");
92
- const projectType = getArgValue("--projectType");
93
- const projectName = getArgValue("--projectName");
94
- const reportPath = getArgValue("--reportPath");
95
- const logo = getArgValue("--logo");
96
- const brandName = getArgValue("--brandName");
97
- const reportName = getArgValue("--reportName");
98
- const ai = args.includes("--ai");
99
- const aiURL = getArgValue("--aiURL");
100
- const aiModel = getArgValue("--aiModel");
101
- const aiKey = getArgValue("--aiKey");
102
- const aiLanguage = getArgValue("--aiLanguage");
103
- const maxTokens = getArgValue("--maxTokens")
104
- const maxReports = getArgValue("--maxReports");
105
+ const shouldReport = flags.reportWithTrace || artesConfig.reportWithTrace || flags.report || artesConfig.report;
106
+
107
+ // Reporting & Branding
108
+ const logo = getArgValue("--logo");
109
+ const brandName = getArgValue("--brandName");
110
+ const reportName = getArgValue("--reportName");
111
+ const reporterURL = getArgValue("--reporterURL");
112
+ const projectName = getArgValue("--projectName");
113
+ const projectType = getArgValue("--projectType");
114
+ const reportPath = getArgValue("--reportPath");
115
+
116
+ // Browser & Environment
117
+ const browser = getArgValue("--browser");
118
+ const baseURL = getArgValue("--baseURL");
119
+ const device = getArgValue("--device");
120
+ const width = getArgValue("--width");
121
+ const height = getArgValue("--height");
122
+
123
+ // Execution
124
+ const env = getArgValue("--env");
105
125
  const featureFiles = getArgValue("--features");
106
126
  const features = flags.features && featureFiles;
107
- const stepDef = getArgValue("--stepDef");
108
- const tags = getArgValue("--tags");
109
- const parallel = getArgValue("--parallel");
110
- const retry = getArgValue("--retry");
111
- const rerun = getArgValue("--rerun");
112
- const percentage = getArgValue("--percentage");
113
- const browser = getArgValue("--browser");
114
- const device = getArgValue("--device");
115
- const baseURL = getArgValue("--baseURL");
116
- const width = getArgValue("--width");
117
- const height = getArgValue("--height");
118
- const timeout = getArgValue("--timeout");
119
- const slowMo = getArgValue("--slowMo");
120
-
121
- flags.env ? (process.env.ENV = env) : "";
122
-
123
- vars ? (process.env.VARS = vars) : "";
124
-
125
- flags.reportWithTrace ||
126
- artesConfig.reportWithTrace ||
127
- flags.report ||
128
- artesConfig.report
129
- ? (process.env.REPORT_FORMAT = JSON.stringify([
130
- "allure-cucumberjs/reporter:./allure-results",
131
- ]))
132
- : "";
133
-
134
- flags.customLogo ? (process.env.LOGO = logo) : "";
135
- flags.customBrandName ? (process.env.BRAND_NAME = brandName) : "";
136
- flags.customReportName ? (process.env.REPORT_NAME = reportName) : "";
137
-
138
- flags.reportSuccess ? (process.env.REPORT_SUCCESS = true) : "";
139
-
140
- flags.tags && console.log("Running tags:", tags);
141
- flags.tags ? (process.env.RUN_TAGS = JSON.stringify(tags)) : "";
142
-
143
- flags.features && console.log("Running features:", features);
144
- flags.features ? (process.env.FEATURES = features) : "";
145
-
146
- flags.stepDef && console.log("Running step definitions:", flags.stepDef);
147
- flags.stepDef ? (process.env.STEP_DEFINITIONS = stepDef) : "";
148
-
149
- flags.report ? (process.env.REPORT = true) : "";
150
-
151
- flags.trace ? (process.env.TRACE = true) : "";
152
-
153
- flags.reportWithTrace
154
- ? (process.env.REPORT_WITH_TRACE = true)
155
- : (process.env.REPORT_WITH_TRACE = false);
156
-
157
- flags.singleFileReport
158
- ? (process.env.SINGLE_FILE_REPORT = true)
159
- : (process.env.SINGLE_FILE_REPORT = false);
160
-
161
- flags.zip ? (process.env.ZIP = true) : (process.env.ZIP = false);
162
-
163
- flags.ai ? (process.env.AI = ai) : (process.env.AI = false);
164
- flags.aiURL ? (process.env.AI_URL = aiURL) : "";
165
- flags.aiModel ? (process.env.AI_MODEL = aiModel) : "";
166
- flags.aiKey ? (process.env.AI_KEY = aiKey) : "";
167
- flags.aiLanguage ? (process.env.AI_LANGUAGE = aiLanguage) : "";
168
- flags.maxTokens ? (process.env.MAX_TOKENS = maxTokens) : "";
169
- flags.maxReports ? (process.env.MAX_REPORTS = maxReports) : "";
170
-
171
- flags.headless &&
172
- console.log("Running mode:", flags.headless ? "headless" : "headed");
173
- flags.headless ? (process.env.MODE = JSON.stringify(true)) : false;
174
-
175
- flags.parallel ? (process.env.PARALLEL = parallel) : "";
176
-
177
- flags.retry ? (process.env.RETRY = retry) : "";
178
-
179
- flags.rerun ? (process.env.RERUN = rerun) : "";
180
-
181
- flags.dryRun ? (process.env.DRYRUN = flags.dryRun) : "";
182
-
183
- flags.percentage ? (process.env.PERCENTAGE = percentage) : "";
184
-
185
- flags.browser && console.log("Running browser:", browser);
186
- flags.browser ? (process.env.BROWSER = JSON.stringify(browser)) : "";
187
-
188
- flags.browser && console.log("Running mode:", flags.offline && "Offline");
189
- flags.offline ? (process.env.OFFLINE = true) : "";
190
-
191
- flags.device && console.log("Running device:", device);
192
- flags.device ? (process.env.DEVICE = JSON.stringify(device)) : "";
193
-
194
- flags.baseURL ? (process.env.BASE_URL = JSON.stringify(baseURL)) : "";
195
-
196
- flags.maximizeScreen
197
- ? (process.env.MAXIMIZE_SCREEN = flags.maximizeScreen)
198
- : "";
127
+ const stepDef = getArgValue("--stepDef");
128
+ const tags = getArgValue("--tags");
129
+ const parallel = getArgValue("--parallel");
130
+ const retry = getArgValue("--retry");
131
+ const rerun = getArgValue("--rerun");
132
+ const percentage = getArgValue("--percentage");
133
+ const timeout = getArgValue("--timeout");
134
+ const slowMo = getArgValue("--slowMo");
135
+ const vars = getArgValue("--saveVar");
136
+
137
+ // AI
138
+ const aiModel = getArgValue("--aiModel");
139
+ const aiKey = getArgValue("--aiKey");
140
+ const aiURL = getArgValue("--aiURL");
141
+ const aiLanguage = getArgValue("--aiLanguage");
142
+ const maxTokens = getArgValue("--maxTokens");
143
+ const maxReports = getArgValue("--maxReports");
199
144
 
200
- flags.width && console.log("Running width:", width);
201
- flags.width ? (process.env.WIDTH = width) : "";
202
145
 
203
- flags.height && console.log("Running height:", height);
204
- flags.height ? (process.env.HEIGHT = height) : "";
205
146
 
206
- flags.timeout ? (process.env.TIMEOUT = timeout) : "";
147
+ // Reporting & Branding
148
+ set("REPORT", flags.report);
149
+ set("REPORT_SUCCESS", flags.reportSuccess);
150
+ set("SINGLE_FILE_REPORT", flags.singleFileReport);
151
+ set("REPORT_WITH_TRACE", flags.reportWithTrace);
152
+ set("TRACE", flags.trace);
153
+ set("ZIP", flags.zip);
154
+ set("LOGO", logo);
155
+ set("BRAND_NAME", brandName);
156
+ set("REPORT_NAME", reportName);
157
+
158
+ if (shouldReport) { process.env.REPORT_FORMAT = JSON.stringify(["allure-cucumberjs/reporter:./allure-results"]) }
159
+
160
+ set("REPORTER_URL", reporterURL);
161
+ set("PROJECT_NAME", projectName);
162
+ set("PROJECT_TYPE", projectType);
163
+ set("REPORT_PATH", reportPath);
164
+
165
+ // Browser & Environment
166
+ set("BROWSER", browser);
167
+ set("BASE_URL", baseURL ? JSON.stringify(baseURL) : null);
168
+ set("DEVICE", device ? JSON.stringify(device) : null);
169
+ set("MODE", flags.headless ? JSON.stringify(true) : null);
170
+ set("OFFLINE", flags.offline);
171
+ set("MAXIMIZE_SCREEN", flags.maxScreen);
172
+ set("WIDTH", width);
173
+ set("HEIGHT", height);
174
+
175
+ // Execution
176
+ set("ENV", env);
177
+ set("VARS", vars);
178
+ set("FEATURES", features);
179
+ set("STEP_DEFINITIONS", stepDef);
180
+ set("RUN_TAGS", tags ? JSON.stringify(tags) : null);
181
+ set("PARALLEL", parallel);
182
+ set("RETRY", retry);
183
+ set("RERUN", rerun);
184
+ set("DRYRUN", flags.dryRun);
185
+ set("PERCENTAGE", percentage);
186
+ set("TIMEOUT", timeout);
187
+ set("SLOWMO", slowMo);
188
+
189
+ // AI
190
+ set("AI", flags.ai);
191
+ set("AI_URL", aiURL);
192
+ set("AI_MODEL", aiModel);
193
+ set("AI_KEY", aiKey);
194
+ set("AI_LANGUAGE", aiLanguage);
195
+ set("MAX_TOKENS", maxTokens);
196
+ set("MAX_REPORTS", maxReports);
207
197
 
208
- flags.slowMo ? (process.env.SLOWMO = slowMo) : "";
209
198
 
210
199
  async function main() {
200
+ if (flags.reportHelp) return showReportingHelp();
201
+ if (flags.browserHelp) return showBrowserHelp();
202
+ if (flags.executionHelp) return showExecutionHelp();
203
+ if (flags.aiHelp) return showAIHelp();
204
+
211
205
  if (flags.help) return showHelp();
212
- if (flags.aiHelp) return showAIHelp();
213
206
  if (flags.version) return showVersion();
214
207
  if (flags.create) return createProject(flags.createYes, flags.noDeps);
215
208
 
209
+
216
210
  runTests();
217
211
 
218
- const testCoverage = testCoverageCalculator();
212
+ const testPercentage = process.env.PERCENTAGE ? Number(process.env.PERCENTAGE) : artesConfig.testPercentage || 0;
213
+
214
+ const testCoverage = testCoverageCalculator({ percentage: testPercentage });
219
215
 
216
+ if (!testCoverage) {
217
+ cleanUp();
218
+ process.exit(1);
219
+ }
220
+
220
221
  if (testCoverage.totalTests === 0) {
221
- console.log("\x1b[33mNo tests were run (0 scenarios). Skipping report generation and upload.\x1b[0m");
222
222
  cleanUp();
223
223
  process.exit(process.env.EXIT_CODE);
224
224
  }
225
-
225
+
226
226
  logPomWarnings();
227
227
 
228
228
  findDuplicateTestNames();
229
229
 
230
- const testPercentage = process.env.PERCENTAGE
231
- ? Number(process.env.PERCENTAGE)
232
- : artesConfig.testPercentage || 0;
233
-
234
- if (testPercentage > 0) {
235
- const meetsThreshold = testCoverage.percentage >= testPercentage;
236
-
237
- if (meetsThreshold) {
238
- console.log(
239
- `\x1b[32mTests passed required ${testPercentage}% success rate with ${testCoverage.percentage.toFixed(2)}%!\x1b[0m`,
240
- );
241
- process.env.EXIT_CODE = parseInt(0, 10);
242
- } else {
243
- console.log(
244
- `\x1b[31mTests failed required ${testPercentage}% success rate with ${testCoverage.percentage.toFixed(2)}%!\x1b[0m`,
245
- );
246
- process.env.EXIT_CODE = parseInt(1, 10);
247
- }
248
- }
249
-
250
- const source = path.join(
251
- process.cwd(),
252
- "node_modules",
253
- "artes",
254
- "@rerun.txt",
255
- );
230
+ const source = path.join(process.cwd(), "node_modules", "artes", "@rerun.txt" );
256
231
  const destination = path.join(process.cwd(), "@rerun.txt");
232
+ if (fs.existsSync(source)) { fs.renameSync(source, destination)}
257
233
 
258
- if (fs.existsSync(source)) {
259
- fs.renameSync(source, destination);
260
- }
261
-
262
- if (
263
- flags.reportWithTrace ||
264
- artesConfig.reportWithTrace ||
265
- flags.report ||
266
- artesConfig.report
267
- ) {
234
+ if (shouldReport) {
268
235
  getExecutor();
269
236
  getEnvInfo();
270
237
  generateReport();
271
238
  }
272
239
 
273
-
274
- if (
275
- !(process.env.TRACE === "true"
276
- ? process.env.TRACE
277
- : artesConfig.trace || false)
278
- ) {
279
- fs.rmSync(path.join(process.cwd(), "traces"), {
280
- recursive: true,
281
- force: true,
282
- });
283
- }
240
+ const traceEnabled = process.env.TRACE === "true" || artesConfig.trace || false;
241
+ if (!traceEnabled) {
242
+ fs.rmSync(path.join(process.cwd(), "traces"), { recursive: true, force: true });
243
+ }
284
244
 
285
245
  try {
286
246
  if (flags.uploadReport || artesConfig.uploadReport) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
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,7 +1,7 @@
1
1
  const fs = require("fs");
2
2
  const path = require("path");
3
3
 
4
- function testCoverageCalculator({ silent = false } = {}) {
4
+ function testCoverageCalculator({ silent = false, percentage = 0 } = {}) {
5
5
  const testStatusFile = path.join(
6
6
  process.cwd(),
7
7
  "node_modules",
@@ -67,16 +67,7 @@ function testCoverageCalculator({ silent = false } = {}) {
67
67
  }
68
68
  });
69
69
 
70
- if (!silent && retriedTests.length > 0) {
71
- console.warn("\n\x1b[33mRetried test cases:");
72
- retriedTests.forEach((t) => {
73
- console.warn(`- "${t.scenario}" ran ${t.count} times`);
74
- });
75
- console.log("\x1b[0m");
76
- console.log("");
77
- }
78
-
79
- return {
70
+ const result = {
80
71
  percentage: ((total - notPassed) / total) * 100,
81
72
  totalTests: total,
82
73
  notPassed,
@@ -85,6 +76,36 @@ function testCoverageCalculator({ silent = false } = {}) {
85
76
  Object.entries(map).map(([id, data]) => [id, data.latest.status]),
86
77
  ),
87
78
  };
79
+
80
+ if (!silent && result.totalTests === 0) {
81
+ console.log("\x1b[33mNo tests were run (0 scenarios).\x1b[0m");
82
+ process.env.EXIT_CODE = 1;
83
+ return result;
84
+ }
85
+
86
+ if (!silent && retriedTests.length > 0) {
87
+ console.warn(`\n\x1b[33mRetried ${retriedTests.length} test cases:`);
88
+ retriedTests.forEach((t) => {
89
+ console.warn(`- "${t.scenario}" ran ${t.count} times`);
90
+ });
91
+ console.log("\x1b[0m");
92
+ console.log("");
93
+ }
94
+
95
+ if (!silent && percentage > 0) {
96
+ const meetsThreshold = result.percentage >= percentage;
97
+
98
+ if (meetsThreshold) {
99
+ console.log(`\x1b[32mTests passed required ${percentage}% success rate with ${result.percentage.toFixed(2)}%!\x1b[0m`);
100
+ process.env.EXIT_CODE = 0;
101
+ } else {
102
+ console.log(`\x1b[31mTests failed required ${percentage}% success rate with ${result.percentage.toFixed(2)}%!\x1b[0m`);
103
+ process.env.EXIT_CODE = 1;
104
+ }
105
+ }
106
+
107
+
108
+ return result
88
109
  }
89
110
 
90
111
  module.exports = { testCoverageCalculator };
@@ -1,4 +1,4 @@
1
- const { showHelp, showAIHelp } = require("./helper");
1
+ const { showHelp, showBrowserHelp, showExecutionHelp, showReportingHelp, showAIHelp } = require("./helper");
2
2
  const { createProject } = require("./projectCreator");
3
3
  const { generateReport } = require("./reportGenerator");
4
4
  const { runTests } = require("./testRunner");
@@ -10,6 +10,9 @@ module.exports = {
10
10
  generateReport,
11
11
  runTests,
12
12
  showHelp,
13
+ showBrowserHelp,
14
+ showExecutionHelp,
15
+ showReportingHelp,
13
16
  showAIHelp,
14
17
  showVersion,
15
18
  cleanUp,
@@ -1,168 +1,192 @@
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:
2
+ console.log(`
3
+ Artes CLI
4
+
5
+ Usage:
10
6
  npx artes [options]
11
-
7
+
12
8
  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
- 🚫 --noDeps Skip installing dependencies when creating example project
26
- Usage: artes -c --noDeps or artes --create --noDeps
27
-
28
- 📊 -r, --report Run tests and generate Allure report
29
- Usage: artes -r or artes --report
30
-
31
- ✅ --reportSuccess Generate screenshot and video record with also successful tests
32
- Usage: artes --reportSuccess
33
-
34
- ⚡ --trace Enable tracing for all tests
35
- Usage: artes --trace
36
-
37
- 🔍 -rwt, --reportWithTrace Include trace in the report
38
- Usage: artes --reportWithTrace
39
-
40
- 📄 --singleFileReport Generate single file Allure report
41
- Usage: artes -r --singleFileReport
42
-
43
- 🗜️ --zip Zip the report folder after generation
44
- Usage: artes -r --zip
45
-
46
- --uploadReport Upload the generated report to a Artes Reporting System
47
- Usage: artes --uploadReport --reporterURL "https://example.com/upload"
48
-
49
- --reporterURL URL of the Artes Reporting System to upload the report
50
- Usage: artes --uploadReport --reporterURL "https://example.com/upload"
51
-
52
- --projectName Name of the project in the Artes Reporting System (default: "Artes Report")
53
- Usage: artes --uploadReport --reporterURL "https://example.com/upload" --projectName "My Project"
54
-
55
- --projectType Type of the project (e.g., UI, API) for reporting purposes (default: "Artes")
56
- Usage: artes --uploadReport --reporterURL "https://example.com/upload" --projectType "API"
57
-
58
- --reportPath Path to the report zip or html file to be uploaded (default: ./report.zip)
59
- Usage: artes --uploadReport --reporterURL "https://example.com/upload" --reportPath "./my_report.zip"
60
-
61
- 🖼️ --logo Set a custom logo in the report sidebar
62
- Usage: artes --logo logo.png
63
-
64
- 🏢 --brandName Set the brand name displayed next to the logo in the report sidebar
65
- Usage: artes --brandName 'My Company'
66
-
67
- 📄 --reportName Report name displayed on the summary widget and in the Artes Reporting System
68
- Usage: artes --reportName 'Alma UI'
69
-
70
- 📁 --features Specify one or more feature files' relative paths to run (comma-separated)
71
- Usage: artes --features "tests/features/Alma, tests/features/Banan.feature"
72
-
73
- 📜 --stepDef Specify one or more step definition files' relative paths to use (comma-separated)
74
- Usage: artes --stepDef "tests/steps/login.js, tests/steps/home.js"
75
-
76
- 🔖 --tags Run tests with specified Cucumber tags
77
- Usage: artes --tags "@smoke and not @wip"
78
-
79
- 🌐 --env Set environment for the test run
80
- Usage: artes --env "dev"
81
-
82
- --saveVar Set variables from cli
83
- artes --saveVar '{"armud":20,"banana":200}'
84
-
85
- 🕶️ --headless Run browser in headless mode
86
- Usage: artes --headless
87
-
88
- ⚡ --parallel Run tests in parallel mode
89
- Usage: artes --parallel 3
90
-
91
- 🔁 --retry Retry failed tests
92
- Usage: artes --retry 2
93
-
94
- 🔄 --rerun Rerun only the failed tests from previous run
95
- Usage: artes --rerun @rerun.txt
96
-
97
- 🎭 --dryRun Perform a dry run without executing tests
98
- Usage: artes --dryRun
99
-
100
- 📈 --percentage Set minimum success percentage to pass test run
101
- Usage: artes --percentage 85
102
-
103
- 🌐 --browser Specify browser to use (chromium, firefox, webkit)
104
- Usage: artes --browser chromium
105
-
106
- --offline Run browser in offline mode
107
- Usage: artes --offline
108
-
109
- 📱 --device Emulate specific device (e.g., "iPhone 13")
110
- Usage: artes --device "iPhone 13"
111
-
112
- 🌐 --baseURL Set base URL for the tests
113
- Usage: artes --baseURL "https://example.com"
114
-
115
- 📏 --maxScreen Maximize browser window
116
- Usage: artes --maxScreen
117
-
118
- 📐 --width Set browser width (default: 1280)
119
- Usage: artes --width 1920
120
-
121
- 📏 --height Set browser height (default: 720)
122
- Usage: artes --height 1080
123
-
124
- ⏱️ --timeout Set timeout for each test step (default: 30 seconds)
125
- Usage: artes --timeout 10
126
-
127
- 🐢 --slowMo Slow down text execution for clear view (default: 0 seconds)
128
- Usage: artes --slowMo 1
129
- `);
130
- }
131
-
132
-
133
- function showAIHelp() {
134
- console.log(`
135
- 🚀 Artes AI Bug reporter
136
-
137
- Usage:
9
+ -h, --help Show this help message
10
+ -v, --version Show current version of artes
11
+ -c, --create Create example artes project
12
+
13
+ For more options, use:
14
+ artes report --help Reporting & branding options
15
+ artes browser --help Browser & environment options
16
+ artes execution --help Execution control options
17
+ artes ai --help AI bug reporter options
18
+ `);
19
+ }
20
+
21
+ function showReportingHelp() {
22
+ console.log(`
23
+ Artes CLI - Reporting & Branding
24
+
25
+ Usage:
138
26
  npx artes [options]
139
-
27
+
28
+ Options:
29
+ -r, --report Run tests and generate Allure report
30
+ Usage: artes -r or artes --report
31
+
32
+ --reportSuccess Generate screenshot and video with successful tests too
33
+ Usage: artes --reportSuccess
34
+
35
+ -rwt, --reportWithTrace Include trace in the report
36
+ Usage: artes --reportWithTrace
37
+
38
+ --trace Enable tracing for all tests
39
+ Usage: artes --trace
40
+
41
+ --singleFileReport Generate single file Allure report
42
+ Usage: artes -r --singleFileReport
43
+
44
+ --zip Zip the report folder after generation
45
+ Usage: artes -r --zip
46
+
47
+ --logo Set a custom logo in the report sidebar
48
+ Usage: artes --logo logo.png
49
+
50
+ --brandName Set the brand name displayed next to the logo
51
+ Usage: artes --brandName 'My Company'
52
+
53
+ --reportName Report name on the summary widget
54
+ Usage: artes --reportName 'Alma UI'
55
+
56
+ --uploadReport Upload the generated report to Artes Reporting System
57
+ Usage: artes --uploadReport --reporterURL "https://example.com/upload"
58
+
59
+ --reporterURL URL of the Artes Reporting System
60
+ Usage: artes --uploadReport --reporterURL "https://example.com/upload"
61
+
62
+ --projectName Project name in the Artes Reporting System (default: "Artes Report")
63
+ Usage: artes --uploadReport --reporterURL "https://example.com/upload" --projectName "My Project"
64
+
65
+ --projectType Project type for reporting, e.g., UI, API (default: "Artes")
66
+ Usage: artes --uploadReport --reporterURL "https://example.com/upload" --projectType "API"
67
+
68
+ --reportPath Path to the report zip or html file to upload (default: ./report.zip)
69
+ Usage: artes --uploadReport --reporterURL "https://example.com/upload" --reportPath "./my_report.zip"
70
+ `);
71
+ }
72
+
73
+ function showBrowserHelp() {
74
+ console.log(`
75
+ Artes CLI - Browser & Environment
76
+
77
+ Usage:
78
+ npx artes [options]
79
+
80
+ Options:
81
+ --browser Specify browser to use (chromium, firefox, webkit)
82
+ Usage: artes --browser chromium
83
+
84
+ --device Emulate a specific device (e.g., "iPhone 13")
85
+ Usage: artes --device "iPhone 13"
86
+
87
+ --maxScreen Maximize browser window
88
+ Usage: artes --maxScreen
89
+
90
+ --width Set browser width (default: 1280)
91
+ Usage: artes --width 1920
92
+
93
+ --height Set browser height (default: 720)
94
+ Usage: artes --height 1080
95
+ `);
96
+ }
97
+
98
+ function showExecutionHelp() {
99
+ console.log(`
100
+ Artes CLI - Execution
101
+
102
+ Usage:
103
+ npx artes [options]
104
+
140
105
  Options:
141
106
 
142
- 🤖 --ai Enable AI-generated bug reports and test summaries
143
- Usage: artes --ai
144
-
145
- 🧠 --aiModel AI model to use for report generation
146
- Supported: "gpt-4o", "gemini 2.5 flash", "claude sonnet", "mistral large"
147
- Usage: artes --ai --aiModel "gemini 2.5 flash"
148
-
149
- 🔑 --aiKey API key for the selected AI provider
150
- Usage: artes --ai --aiKey "your-api-key"
151
-
152
- 🔗 --aiURL Local AI endpoint URL (e.g., Ollama, LM Studio). Overrides --aiModel and --aiKey when set
153
- Usage: artes --ai --aiURL "http://localhost:11434/api/chat"
154
-
155
- 🌍 --aiLanguage Language for AI-generated reports (default: "English")
156
- Usage: artes --ai --aiLanguage "Azerbaijani"
157
-
158
- 🔢 --maxTokens Maximum tokens for AI-generated reports (default: 4000)
159
- Usage: artes --ai --maxTokens 8000
160
-
161
- 📋 --maxReports Maximum number of AI reports to generate per test run (default: 10)
162
- Usage: artes --ai --maxReports 5
163
- `);
164
- }
165
-
166
- module.exports = {
167
- showHelp, showAIHelp
168
- };
107
+ --headless Run browser in headless mode
108
+ Usage: artes --headless
109
+
110
+ --baseURL Set base URL for the tests
111
+ Usage: artes --baseURL "https://example.com"
112
+
113
+ --env Set environment for the test run
114
+ Usage: artes --env "dev"
115
+
116
+ --offline Run browser in offline mode
117
+ Usage: artes --offline
118
+
119
+ --features Specify feature file paths to run (comma-separated)
120
+ Usage: artes --features "tests/features/Alma, tests/features/Banan.feature"
121
+
122
+ --stepDef Specify step definition file paths to use (comma-separated)
123
+ Usage: artes --stepDef "tests/steps/login.js, tests/steps/home.js"
124
+
125
+ --tags Run tests with specified Cucumber tags
126
+ Usage: artes --tags "@smoke and not @wip"
127
+
128
+ --parallel Run tests in parallel mode
129
+ Usage: artes --parallel 3
130
+
131
+ --retry Retry failed tests
132
+ Usage: artes --retry 2
133
+
134
+ --rerun Rerun only failed tests from previous run
135
+ Usage: artes --rerun @rerun.txt
136
+
137
+ --dryRun Perform a dry run without executing tests
138
+ Usage: artes --dryRun
139
+
140
+ --percentage Set minimum success percentage to pass test run
141
+ Usage: artes --percentage 85
142
+
143
+ --timeout Set timeout for each test step (default: 30 seconds)
144
+ Usage: artes --timeout 10
145
+
146
+ --slowMo Slow down execution for clear view (default: 0)
147
+ Usage: artes --slowMo 1
148
+
149
+ --saveVar Set variables from CLI
150
+ Usage: artes --saveVar '{"armud":20,"banana":200}'
151
+ `);
152
+ }
153
+
154
+ function showAIHelp() {
155
+ console.log(`
156
+ Artes CLI - AI Bug Reporter
157
+
158
+ Usage:
159
+ npx artes [options]
160
+
161
+ Options:
162
+ --ai Enable AI-generated bug reports and test summaries
163
+ Usage: artes --ai
164
+
165
+ --aiModel AI model to use for report generation.
166
+ (For supported AI models: https://github.com/4gayev1/Artes/blob/main/docs/aiProviders.md)
167
+ Usage: artes --ai --aiModel "gemini 2.5 flash"
168
+
169
+ --aiKey API key for the selected AI provider
170
+ Usage: artes --ai --aiKey "your-api-key"
171
+
172
+ --aiURL Local AI endpoint URL (e.g., Ollama, LM Studio). Overrides --aiModel and --aiKey when set
173
+ Usage: artes --ai --aiURL "http://localhost:11434/api/chat"
174
+
175
+ --aiLanguage Language for AI-generated reports (default: "English")
176
+ Usage: artes --ai --aiLanguage "Azerbaijani"
177
+
178
+ --maxTokens Maximum tokens for AI-generated reports (default: 4000)
179
+ Usage: artes --ai --maxTokens 8000
180
+
181
+ --maxReports Maximum number of AI reports to generate per test run (default: 10)
182
+ Usage: artes --ai --maxReports 5
183
+ `);
184
+ }
185
+
186
+ module.exports = {
187
+ showHelp,
188
+ showReportingHelp,
189
+ showBrowserHelp,
190
+ showExecutionHelp,
191
+ showAIHelp
192
+ };
@@ -164,7 +164,7 @@ After(async function ({ result, pickle }) {
164
164
 
165
165
  await attachResponse(allure.attachment);
166
166
 
167
- if (shouldReport && cucumberConfig.ai.ai) {
167
+ if (shouldReport && cucumberConfig.ai.ai === "true") {
168
168
  await attachAiBugReport({
169
169
  result,
170
170
  pickle,