artes 1.0.61 → 1.0.62

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.
Files changed (38) hide show
  1. package/README.md +356 -340
  2. package/cucumber.config.js +98 -98
  3. package/docs/functionDefinitions.md +2343 -2101
  4. package/docs/stepDefinitions.md +352 -269
  5. package/executer.js +59 -59
  6. package/index.js +44 -44
  7. package/package.json +50 -50
  8. package/src/helper/contextManager/browserManager.js +66 -66
  9. package/src/helper/contextManager/requestManager.js +30 -30
  10. package/src/helper/executers/cleaner.js +23 -23
  11. package/src/helper/executers/exporter.js +15 -15
  12. package/src/helper/executers/helper.js +44 -44
  13. package/src/helper/executers/projectCreator.js +162 -162
  14. package/src/helper/executers/reportGenerator.js +29 -29
  15. package/src/helper/executers/testRunner.js +59 -59
  16. package/src/helper/executers/versionChecker.js +13 -13
  17. package/src/helper/imports/commons.js +51 -51
  18. package/src/helper/pomController/elementController.js +146 -146
  19. package/src/helper/pomController/pomCollector.js +20 -20
  20. package/src/helper/stepFunctions/APIActions.js +271 -271
  21. package/src/helper/stepFunctions/assertions.js +523 -523
  22. package/src/helper/stepFunctions/browserActions.js +21 -19
  23. package/src/helper/stepFunctions/elementInteractions.js +38 -38
  24. package/src/helper/stepFunctions/exporter.js +19 -19
  25. package/src/helper/stepFunctions/frameActions.js +50 -50
  26. package/src/helper/stepFunctions/keyboardActions.js +41 -36
  27. package/src/helper/stepFunctions/mouseActions.js +145 -145
  28. package/src/helper/stepFunctions/pageActions.js +27 -27
  29. package/src/hooks/context.js +15 -15
  30. package/src/hooks/hooks.js +76 -76
  31. package/src/stepDefinitions/API.steps.js +248 -248
  32. package/src/stepDefinitions/assertions.steps.js +826 -826
  33. package/src/stepDefinitions/browser.steps.js +7 -7
  34. package/src/stepDefinitions/frameActions.steps.js +76 -76
  35. package/src/stepDefinitions/keyboardActions.steps.js +87 -87
  36. package/src/stepDefinitions/mouseActions.steps.js +256 -256
  37. package/src/stepDefinitions/page.steps.js +71 -71
  38. package/src/stepDefinitions/random.steps.js +25 -25
package/README.md CHANGED
@@ -1,340 +1,356 @@
1
- <p align="center">
2
- <img alt="artesLogo" src="https://github.com/user-attachments/assets/e0641011-0e96-4330-8ad5-935b395b0838" width="280">
3
- </p>
4
-
5
- <h1 align="center">Artes</h1>
6
-
7
- ## 🚀 Summary
8
-
9
- Artes is a test runner for Playwright that executes [predefined Cucumber tests](./docs/stepDefinitions.md) and can generate Allure reports for test results. It simplifies setting up Playwright with Cucumber in your automation workflow. With Artes, you can easily run tests without writing step definitions, generate reports, and customize your testing environment.
10
-
11
- ![artes demonstration](https://github.com/user-attachments/assets/c46172f7-103d-45d1-a37d-8d4267df0967)
12
-
13
- ## 🧑‍💻 Installation
14
-
15
- You can install **Artes** via npm. To install it globally**(RECOMMENDED)**, run the following command:
16
-
17
- ```bash
18
- npm install -g artes
19
- ```
20
-
21
- To install it locally in your project, run:
22
-
23
- ```bash
24
- npm install artes
25
- ```
26
-
27
- Once installed, you can run **Artes** using:
28
-
29
- ```bash
30
- npx artes [options]
31
- ```
32
-
33
- ---
34
-
35
- ## 💡 Usage
36
-
37
- **Artes** has following CLI options:
38
-
39
- ```bash
40
- npx artes [options]
41
- ```
42
-
43
- ### Options
44
-
45
- | Option | Description | Usage Example |
46
- | -------------------| ------------------------------------------------------------- | -------------------------------------------------- |
47
- | 🆘 `-h, --help` | Show the usage options | `artes -h` or `artes --help` |
48
- | 🏷️ `-v, --version` | Show the current version of Artes | `artes -v` or `artes --version` |
49
- | 🏗️ `-c, --create` | Create an example project with Artes | `artes -c` or `artes --create` |
50
- | ✅ `-y, --yes` | Skip the confirmation prompt when creating an example project | `artes -c -y` or `artes --create --yes` |
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"` |
53
- | 🔖 `--tags` | Run tests with specified Cucumber tags | `artes --tags "@smoke or @wip"` |
54
- | 🌐 `--env` | Set the environment for the test run | `artes --env "dev"` |
55
- | 🕶️ `--headless` | Run browser in headless mode | `artes --headless` |
56
-
57
- \*\* To just run the tests: <br>
58
- Globally: artes <br>
59
- Locally: npx artes
60
-
61
- ---
62
-
63
- ## 🎯 Best Practices
64
-
65
- - **Global Installation:**
66
- For ease of use, it's recommended that Artes be installed globally. You can do this by running the following command:
67
-
68
- ```bash
69
- npm install -g artes
70
- ```
71
-
72
- - **Project Creation (Recommended):**
73
- To create a new project with Artes, use the `-c` flag. This will automatically set up the folder structure and configuration for you. Run the command:
74
-
75
- ```bash
76
- artes -c
77
- ```
78
-
79
- 🗂️ Example Project Structure: <br/>
80
- After running the `-c` flag to create a new project, the structure will look like this:
81
-
82
- ```
83
- /artes (Project Name)
84
- /tests
85
- /features
86
- (Your feature files here)
87
- /POMs // Optional
88
- (POM JSON file here)
89
- /steps // For custom steps
90
- (Your step definition JS files here)
91
- artes.config.js
92
- /report
93
- (Generated Allure report HTML here)
94
- ```
95
-
96
- **If you choose not to use the `-c` flag**, you can still download Artes to your testing project and use the prepared steps by running:
97
-
98
- ```bash
99
- npx artes
100
- ```
101
-
102
- You must customize the paths of features, steps, and other configurations by editing the `artes.config.js` file located inside your project folder (or create it).
103
-
104
- For example:
105
-
106
- ```javascript
107
- module.exports = {
108
- paths: ["tests/features/"], // Custom path for feature files
109
- require: ["tests/steps/*.js"], // Custom path for step definitions files
110
- pomPath: "tests/POMS/*.js", // Custom path for POM files
111
- };
112
- ```
113
-
114
- ---
115
-
116
- ## 📝 Writing Feature Files and POM Files
117
-
118
- Artes simplifies your test writing with structured feature files and organized Page Object Models (POM). Here’s how you can create them:
119
-
120
- ### 1. 📄 Feature File Structure
121
-
122
- ```gherkin
123
- Feature: Searching on Google 🔍
124
- Scenario Outline: Search for a term on Google
125
- Given User is on "https://www.google.com/" page
126
- When User types "alma" in "google_search_input"
127
- And User clicks "google_search_button"
128
- And User waits 10 seconds
129
- Then "google_text" should have "Alma" text
130
- ```
131
-
132
- - **Feature**: Describes the main feature being tested (e.g., Google search).
133
- - **Scenario Outline**: Defines a test case with steps.
134
- - **Steps**: Use `Given`, `When`, `And`, `Then` keywords to describe actions and expectations.
135
- - **Selectors**: The element names (e.g., `google_search_input`, `google_search_button`) map to the POM file or can be defined directly.
136
-
137
- ### 2. 📂 POM File Example
138
-
139
- ```json
140
- {
141
- "google_search_input": { "selector": "#APjFqb" },
142
- "google_search_button": {
143
- "selector": "input.gNO89b"
144
- },
145
- "google_text": {
146
- "selector": "#rso div h3",
147
- "waitTime": 5 //seconds
148
- }
149
- }
150
- ```
151
-
152
- - 📑 Using POM File is optional but it is **RECOMMENDED**
153
- - 🔗 Using Selector in Feature File is possible
154
- ```gherkin
155
- When User types "alma" in "#APjFqb"
156
- ```
157
- - 🐍 It is good to use snake_case for element names
158
- - ⏳ "waitTime" is to define custom wait for elements, but the feature currently under development
159
- "selector" must be used if "waitTime" is used, but when using only selector is not needed mention in "selector"
160
-
161
- ---
162
-
163
- ## 🛠️ Customization
164
-
165
- ## ✍️ Writing Custom Step Definitions
166
-
167
- Artes allows you to extend its functionality by writing custom step definitions. Here's how you can do it:
168
-
169
- ### Import Required APIs
170
-
171
- ```javascript
172
- const {
173
- expect,
174
- Given,
175
- When,
176
- Then,
177
- element,
178
- context,
179
- keyboard,
180
- mouse,
181
- frame,
182
- assert,
183
- elementInteractions,
184
- } = require("artes"); // Common JS
185
- import { expect, Given, When, Then, element, context } from "artes"; // ES Modules (Do not RECOMMENDED)
186
- ```
187
-
188
- - **`Given`, `When`, `Then`**: These define your steps in Cucumber syntax. Example:
189
-
190
- ```javascript
191
- Given("User is on the login page", async () => {
192
- await context.page.navigateTo("https://example.com/login");
193
- });
194
- ```
195
-
196
- - **`page`**: Provides higher-level page actions such as navigation and waiting(Same as PlayWright). Examples:
197
- - Navigate to a URL:
198
- ```javascript
199
- await context.page.navigate("https://example.com");
200
- ```
201
- - Wait for a selector:
202
- ```javascript
203
- await context.page.waitForSelector("#loadingSpinner");
204
- ```
205
- - **`request`**: Use for sending HTTP requests. _(Note: This feature is currently under development.)_
206
-
207
- - **`element`**: Use for interacting with elements on the web page. Examples:
208
- - Clicking a button:
209
- ```javascript
210
- await element("#submitButton").click();
211
- ```
212
- - Filling an input:
213
- ```javascript
214
- await element("#username").fill("testUser");
215
- ```
216
- - **`expect`**: Use for assertions in your steps. For example:
217
- ```javascript
218
- expect(actualValue).toBe(expectedValue);
219
- expect(element("Page_Title")).toHaveText(expectedValue);
220
- ```
221
-
222
- ## 📋 Simplified Functions
223
-
224
- If you don't want to deal with Playwright methods directly, you can simply use the following predefined actions methods by import them:
225
-
226
- ```javascript
227
- const { mouse, keyboard, frame, elementInteractions, page } = require("artes");
228
- ```
229
-
230
- - **Mouse Actions:**
231
- `mouse.click(element)`
232
-
233
- - **Keyboard Actions:**
234
- `keyboard.press(key)`
235
-
236
- - **Element Interactions:**
237
- `elementInteractions.isChecked()`
238
-
239
- - **Assertions:**
240
- `assert.shouldBeTruthy(element)`
241
-
242
- - **Frame Actions:**
243
- `frame.first()`
244
-
245
- ---
246
-
247
- For a detailed explanation of each function, please refer to the [functionDefinitions.md](./docs/functionDefinitions.md).
248
-
249
- ---
250
-
251
- ### Example of a Custom Step Definition
252
-
253
- ```javascript
254
- const { Given, When, Then, expect, element, page } = require("artes");
255
-
256
- Given("User is on the home page", async () => {
257
- await page.navigate("https://example.com");
258
- });
259
-
260
- When("User clicks the login button", async () => {
261
- await element("#loginButton").click();
262
- });
263
-
264
- Then("User should see the login form", async () => {
265
- expect(element("#loginForm")).toBeVisible(true);
266
- });
267
- ```
268
-
269
- ## ⚙️ Configuration
270
-
271
- You can configure Artes by editing the `artes.config.js` file. Below are the default configuration options with explanations:
272
-
273
- | **Option** | **Default Value** | **Description** |
274
- | ---------------- | ---------------------------------------------------- | ----------------------------------- |
275
- | `headless` | `true` | Run in headless browser mode. |
276
- | `paths` | `["tests/features/"]` | Array of paths to feature files. |
277
- | `pomPath` | `"tests/POMs/*.json"` | Path to Page Object Models. |
278
- | `steps` | `"tests/steps/*.js"` | string - Step definitions files. |
279
- | `format` | `["rerun:@rerun.txt", "allure-cucumberjs/reporter"]` | Array of formatter names/paths. |
280
- | `formatOptions` | `{ "resultsDir": "allure-result" }` | Formatter options. |
281
- | `parallel` | `1` | Number of parallel workers. |
282
- | `tags` | `""` | Tag expression to filter scenarios. |
283
- | `language` | `"en"` | Default language for feature files. |
284
- | `order` | `"defined"` | Run order (defined or random). |
285
- | `dryRun` | `false` | Prepare test run without execution. |
286
- | `failFast` | `false` | Stop on first failure. |
287
- | `forceExit` | `false` | Force `process.exit()` after tests. |
288
- | `retry` | `0` | Retry attempts for failing tests. |
289
- | `retryTagFilter` | `""` | Tag expression for retries. |
290
- | `strict` | `true` | Fail on pending steps. |
291
- | `backtrace` | `false` | Show full backtrace for errors. |
292
- | `publish` | `false` | Publish results to `cucumber.io`. |
293
-
294
- ---
295
-
296
- ### Browser Configuration
297
-
298
- | Option | Default Value | Description |
299
- | ------------- | ------------------------------ | ------------------------------------------------------ |
300
- | `browserType` | `"chrome"` | Browser type (`"chrome"`, `"firefox"`, or `"webkit"`). |
301
- | `viewport` | `{ width: 1280, height: 720 }` | Browser viewport size. |
302
- | `headless` | `true` | Run browser in headless mode (`true` or `false`). |
303
-
304
- ## 📊 Report Generation
305
-
306
- Artes can generate Allure reports. After running tests with the `-r` flag, the reports will be stored in the `report` folder in HTML format. You can view them in your browser after the tests complete.
307
-
308
- ---
309
-
310
- ## 👍 Good To Use
311
-
312
- If you don't use the -c or --create option that the package offers, save the file below under the `.vscode` folder:
313
-
314
- - Those configurations will help autocomplete both predefined and custom step definitions in your features file
315
-
316
- **extensions.json**
317
-
318
- ```json
319
- {
320
- "recommendations": ["CucumberOpen.cucumber-official"]
321
- }
322
- ```
323
-
324
- **settings.json**
325
-
326
- ```json
327
- {
328
- "cucumber.glue": [
329
- "tests/steps/*.{ts,js}",
330
- "node_modules/artes/src/tests/stepDefinitions/*.{ts,js}"
331
- ],
332
- "cucumber.features": ["tests/features/*.features"],
333
- "cucumberautocomplete.syncfeatures": true,
334
- "cucumberautocomplete.strictGherkinCompletion": true
335
- }
336
- ```
337
-
338
- ---
339
-
340
- ## 🧑‍💻 Have a Good Testing
1
+ <p align="center">
2
+ <img alt="artesLogo" src="https://github.com/user-attachments/assets/e0641011-0e96-4330-8ad5-935b395b0838" width="280">
3
+ </p>
4
+
5
+ <h1 align="center">Artes</h1>
6
+
7
+ ## 🚀 Summary
8
+
9
+ Artes is a test runner for Playwright that executes [predefined Cucumber tests](./docs/stepDefinitions.md) and can generate Allure reports for test results. It simplifies setting up Playwright with Cucumber in your automation workflow. With Artes, you can easily run tests without writing step definitions, generate reports, and customize your testing environment.
10
+
11
+ ![artes demonstration](https://github.com/user-attachments/assets/c46172f7-103d-45d1-a37d-8d4267df0967)
12
+
13
+ ## 🧑‍💻 Installation
14
+
15
+ You can install **Artes** via npm. To install it globally**(RECOMMENDED)**, run the following command:
16
+
17
+ ```bash
18
+ npm install -g artes
19
+ ```
20
+
21
+ To install it locally in your project, run:
22
+
23
+ ```bash
24
+ npm install artes
25
+ ```
26
+
27
+ Once installed, you can run **Artes** using:
28
+
29
+ ```bash
30
+ npx artes [options]
31
+ ```
32
+
33
+ ---
34
+
35
+ ## 💡 Usage
36
+
37
+ **Artes** has following CLI options:
38
+
39
+ ```bash
40
+ npx artes [options]
41
+ ```
42
+
43
+ ### Options
44
+
45
+ | Option | Description | Usage Example |
46
+ | -------------------| ------------------------------------------------------------- | -------------------------------------------------- |
47
+ | 🆘 `-h, --help` | Show the usage options | `artes -h` or `artes --help` |
48
+ | 🏷️ `-v, --version` | Show the current version of Artes | `artes -v` or `artes --version` |
49
+ | 🏗️ `-c, --create` | Create an example project with Artes | `artes -c` or `artes --create` |
50
+ | ✅ `-y, --yes` | Skip the confirmation prompt when creating an example project | `artes -c -y` or `artes --create --yes` |
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"` |
53
+ | 🔖 `--tags` | Run tests with specified Cucumber tags | `artes --tags "@smoke or @wip"` |
54
+ | 🌐 `--env` | Set the environment for the test run | `artes --env "dev"` |
55
+ | 🕶️ `--headless` | Run browser in headless mode | `artes --headless` |
56
+
57
+ \*\* To just run the tests: <br>
58
+ Globally: artes <br>
59
+ Locally: npx artes
60
+
61
+ ---
62
+
63
+ ## 🎯 Best Practices
64
+
65
+ - **Global Installation:**
66
+ For ease of use, it's recommended that Artes be installed globally. You can do this by running the following command:
67
+
68
+ ```bash
69
+ npm install -g artes
70
+ ```
71
+
72
+ - **Project Creation (Recommended):**
73
+ To create a new project with Artes, use the `-c` flag. This will automatically set up the folder structure and configuration for you. Run the command:
74
+
75
+ ```bash
76
+ artes -c
77
+ ```
78
+
79
+ 🗂️ Example Project Structure: <br/>
80
+ After running the `-c` flag to create a new project, the structure will look like this:
81
+
82
+ ```
83
+ /artes (Project Name)
84
+ /tests
85
+ /features
86
+ (Your feature files here)
87
+ /POMs // Optional
88
+ (POM JSON file here)
89
+ /steps // For custom steps
90
+ (Your step definition JS files here)
91
+ artes.config.js
92
+ /report
93
+ (Generated Allure report HTML here)
94
+ ```
95
+
96
+ **If you choose not to use the `-c` flag**, you can still download Artes to your testing project and use the prepared steps by running:
97
+
98
+ ```bash
99
+ npx artes
100
+ ```
101
+
102
+ You must customize the paths of features, steps, and other configurations by editing the `artes.config.js` file located inside your project folder (or create it).
103
+
104
+ For example:
105
+
106
+ ```javascript
107
+ module.exports = {
108
+ paths: ["tests/features/"], // Custom path for feature files
109
+ require: ["tests/steps/*.js"], // Custom path for step definitions files
110
+ pomPath: "tests/POMS/*.js", // Custom path for POM files
111
+ };
112
+ ```
113
+
114
+ ---
115
+
116
+ ## 📝 Writing Feature Files and POM Files
117
+
118
+ Artes simplifies your test writing with structured feature files and organized Page Object Models (POM). Here’s how you can create them:
119
+
120
+ ### 1. 📄 Feature File Structure
121
+
122
+ ```gherkin
123
+ Feature: Searching on Google 🔍
124
+ Scenario Outline: Search for a term on Google
125
+ Given User is on "https://www.google.com/" page
126
+ When User types "alma" in "google_search_input"
127
+ And User clicks "google_search_button"
128
+ And User waits 10 seconds
129
+ Then "google_text" should have "Alma" text
130
+ ```
131
+
132
+ - **Feature**: Describes the main feature being tested (e.g., Google search).
133
+ - **Scenario Outline**: Defines a test case with steps.
134
+ - **Steps**: Use `Given`, `When`, `And`, `Then` keywords to describe actions and expectations.
135
+ - **Selectors**: The element names (e.g., `google_search_input`, `google_search_button`) map to the POM file or can be defined directly.
136
+
137
+ ### 2. 📂 POM File Example
138
+
139
+ ```json
140
+ {
141
+ "google_search_input": { "selector": "#APjFqb" },
142
+ "google_search_button": {
143
+ "selector": "input.gNO89b"
144
+ },
145
+ "google_text": {
146
+ "selector": "#rso div h3",
147
+ "waitTime": 5 //seconds
148
+ }
149
+ }
150
+ ```
151
+
152
+ - 📑 Using POM File is optional but it is **RECOMMENDED**
153
+ - 🔗 Using Selector in Feature File is possible
154
+ ```gherkin
155
+ When User types "alma" in "#APjFqb"
156
+ ```
157
+ - 🐍 It is good to use snake_case for element names
158
+ - ⏳ "waitTime" is to define custom wait for elements, but the feature currently under development
159
+ "selector" must be used if "waitTime" is used, but when using only selector is not needed mention in "selector"
160
+
161
+ ---
162
+
163
+ ## 🛠️ Customization
164
+
165
+ ## ✍️ Writing Custom Step Definitions
166
+
167
+ Artes allows you to extend its functionality by writing custom step definitions. Here's how you can do it:
168
+
169
+ ### Import Required APIs
170
+
171
+ ```javascript
172
+ const {
173
+ expect,
174
+ Given,
175
+ When,
176
+ Then,
177
+ element,
178
+ context,
179
+ keyboard,
180
+ mouse,
181
+ frame,
182
+ assert,
183
+ elementInteractions,
184
+ } = require("artes"); // Common JS
185
+ import { expect, Given, When, Then, element, context } from "artes"; // ES Modules (Do not RECOMMENDED)
186
+ ```
187
+
188
+ - **`Given`, `When`, `Then`**: These define your steps in Cucumber syntax. Example:
189
+
190
+ ```javascript
191
+ Given("User is on the login page", async () => {
192
+ await context.page.navigateTo("https://example.com/login");
193
+ });
194
+ ```
195
+
196
+ - **`page`**: Provides higher-level page actions such as navigation and waiting(Same as PlayWright). Examples:
197
+ - Navigate to a URL:
198
+ ```javascript
199
+ await context.page.navigate("https://example.com");
200
+ ```
201
+ - Wait for a selector:
202
+ ```javascript
203
+ await context.page.waitForSelector("#loadingSpinner");
204
+ ```
205
+ - **`request`**: Use for sending HTTP requests. _(Note: This feature is currently under development.)_
206
+
207
+ - **`element`**: Use for interacting with elements on the web page. Examples:
208
+ - Clicking a button:
209
+ ```javascript
210
+ await element("#submitButton").click();
211
+ ```
212
+ - Filling an input:
213
+ ```javascript
214
+ await element("#username").fill("testUser");
215
+ ```
216
+ - **`expect`**: Use for assertions in your steps. For example:
217
+ ```javascript
218
+ expect(actualValue).toBe(expectedValue);
219
+ expect(element("Page_Title")).toHaveText(expectedValue);
220
+ ```
221
+
222
+ ## 📋 Simplified Functions
223
+
224
+ If you don't want to deal with Playwright methods directly, you can simply use the following predefined actions methods by import them:
225
+
226
+ ```javascript
227
+ const { mouse, keyboard, frame, elementInteractions, page } = require("artes");
228
+ ```
229
+
230
+ - **Mouse Actions:**
231
+ `mouse.click(element)`
232
+
233
+ - **Keyboard Actions:**
234
+ `keyboard.press(key)`
235
+
236
+ - **Element Interactions:**
237
+ `elementInteractions.isChecked()`
238
+
239
+ - **Assertions:**
240
+ `assert.shouldBeTruthy(element)`
241
+
242
+ - **Frame Actions:**
243
+ `frame.first()`
244
+
245
+ - **API Actions:**
246
+ `api.post(url, payload, requestDataType)`
247
+
248
+ ---
249
+
250
+ For a detailed explanation of each function, please refer to the [function definitions](./docs/functionDefinitions.md).
251
+
252
+ ---
253
+
254
+ ### Example of a Custom Step Definition
255
+
256
+ ```javascript
257
+ const { Given, When, Then, expect, element, page } = require("artes");
258
+
259
+ Given("User is on the home page", async () => {
260
+ await page.navigate("https://example.com");
261
+ });
262
+
263
+ When("User clicks the login button", async () => {
264
+ await element("#loginButton").click();
265
+ });
266
+
267
+ Then("User should see the login form", async () => {
268
+ expect(element("#loginForm")).toBeVisible(true);
269
+ });
270
+ ```
271
+
272
+ ## ⚙️ Configuration
273
+
274
+ You can configure Artes by editing the `artes.config.js` file. Below are the default configuration options with explanations:
275
+
276
+
277
+ | **Option** | **Default Value** | **Description** |
278
+ | ----------------- | ---------------------------------------------------- | ----------------------------------------------------- |
279
+ | `timeout` | `30` | Default timeout in milliseconds. |
280
+ | `paths` | `[moduleConfig.featuresPath]` | Paths to feature files. |
281
+ | `require` | `[moduleConfig.stepsPath, "src/stepDefinitions/*.js", "src/hooks/hooks.js"]` | Support code paths (CommonJS). |
282
+ | `pomPath` | `moduleConfig.pomPath` | Path to Page Object Models. |
283
+ | `import` | `[]` | Support code paths. |
284
+ | `format` | `["rerun:@rerun.txt", "allure-cucumberjs/reporter"]` | Formatter names/paths. |
285
+ | `formatOptions` | `{ "resultsDir": "allure-result" }` | Formatter options. |
286
+ | `parallel` | `1` | Number of parallel workers. |
287
+ | `dryRun` | `false` | Prepare test run without execution. |
288
+ | `failFast` | `false` | Stop on first test failure. |
289
+ | `forceExit` | `false` | Force `process.exit()` after tests. |
290
+ | `strict` | `true` | Fail on pending steps. |
291
+ | `backtrace` | `false` | Show full backtrace for errors. |
292
+ | `tags` | `""` | Tag expression to filter scenarios. |
293
+ | `name` | `[]` | Run scenarios matching regex. |
294
+ | `order` | `"defined"` | Run order (defined/random). |
295
+ | `language` | `"en"` | Default feature file language. |
296
+ | `loader` | `[]` | Module loader specifications. |
297
+ | `requireModule` | `[]` | Transpilation module names. |
298
+ | `retry` | `0` | Retry attempts for failing tests. |
299
+ | `retryTagFilter` | `""` | Tag expression for retries. |
300
+ | `publish` | `false` | Publish to cucumber.io. |
301
+ | `worldParameters` | `{}` | Custom world parameters. |
302
+
303
+ ### Environment Configuration
304
+
305
+ | **Option** | **Default Value** | **Description** |
306
+ | ----------- | ----------------- | ---------------------------------- |
307
+ | `env` | `""` | Environment configuration. Should match the name with the baseURL object, like "dev" |
308
+ | `baseURL` | `""` | Base URL for API requests. Can be object {"dev":"dev-api.com", "pre":"pre-api.com"}, or string "dev-api.com" |
309
+
310
+ ---
311
+
312
+ ### Browser Configuration
313
+
314
+ | Option | Default Value | Description |
315
+ | ------------- | ------------------------------ | ------------------------------------------------------ |
316
+ | `browserType` | `"chrome"` | Browser type (`"chrome"`, `"firefox"`, or `"webkit"`). |
317
+ | `viewport` | `{ width: 1280, height: 720 }` | Browser viewport size. |
318
+ | `headless` | `true` | Run browser in headless mode (`true` or `false`). |
319
+
320
+ ## 📊 Report Generation
321
+
322
+ Artes can generate Allure reports. After running tests with the `-r` flag, the reports will be stored in the `report` folder in HTML format. You can view them in your browser after the tests complete.
323
+
324
+ ---
325
+
326
+ ## 👍 Good To Use
327
+
328
+ If you don't use the -c or --create option that the package offers, save the file below under the `.vscode` folder:
329
+
330
+ - Those configurations will help autocomplete both predefined and custom step definitions in your features file
331
+
332
+ **extensions.json**
333
+
334
+ ```json
335
+ {
336
+ "recommendations": ["CucumberOpen.cucumber-official"]
337
+ }
338
+ ```
339
+
340
+ **settings.json**
341
+
342
+ ```json
343
+ {
344
+ "cucumber.glue": [
345
+ "tests/steps/*.{ts,js}",
346
+ "node_modules/artes/src/tests/stepDefinitions/*.{ts,js}"
347
+ ],
348
+ "cucumber.features": ["tests/features/*.features"],
349
+ "cucumberautocomplete.syncfeatures": true,
350
+ "cucumberautocomplete.strictGherkinCompletion": true
351
+ }
352
+ ```
353
+
354
+ ---
355
+
356
+ ## 🧑‍💻 Have a Good Testing