artes 1.7.4 → 1.7.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 +781 -779
- package/assets/styles.css +4 -4
- package/cucumber.config.js +253 -253
- package/docs/ciExecutors.md +198 -198
- package/docs/emulationDevicesList.md +152 -152
- package/docs/functionDefinitions.md +2401 -2401
- package/docs/stepDefinitions.md +435 -433
- package/executer.js +266 -264
- package/index.js +50 -50
- package/package.json +56 -56
- package/src/helper/contextManager/browserManager.js +74 -74
- package/src/helper/contextManager/requestManager.js +23 -23
- package/src/helper/controller/elementController.js +210 -210
- package/src/helper/controller/findDuplicateTestNames.js +69 -69
- package/src/helper/controller/getEnvInfo.js +94 -94
- package/src/helper/controller/getExecutor.js +109 -109
- package/src/helper/controller/pomCollector.js +83 -83
- package/src/helper/controller/reportCustomizer.js +485 -485
- package/src/helper/controller/screenComparer.js +97 -108
- package/src/helper/controller/status-formatter.js +137 -137
- package/src/helper/controller/testCoverageCalculator.js +111 -111
- package/src/helper/executers/cleaner.js +23 -23
- package/src/helper/executers/exporter.js +19 -19
- package/src/helper/executers/helper.js +193 -191
- package/src/helper/executers/projectCreator.js +226 -222
- package/src/helper/executers/reportGenerator.js +91 -91
- package/src/helper/executers/testRunner.js +28 -28
- package/src/helper/executers/versionChecker.js +31 -31
- package/src/helper/imports/commons.js +65 -65
- package/src/helper/stepFunctions/APIActions.js +495 -495
- package/src/helper/stepFunctions/assertions.js +986 -986
- package/src/helper/stepFunctions/browserActions.js +87 -87
- package/src/helper/stepFunctions/elementInteractions.js +60 -60
- package/src/helper/stepFunctions/exporter.js +19 -19
- package/src/helper/stepFunctions/frameActions.js +72 -72
- package/src/helper/stepFunctions/keyboardActions.js +66 -66
- package/src/helper/stepFunctions/mouseActions.js +84 -84
- package/src/helper/stepFunctions/pageActions.js +43 -43
- package/src/hooks/context.js +15 -15
- package/src/hooks/hooks.js +287 -279
- package/src/stepDefinitions/API.steps.js +310 -310
- package/src/stepDefinitions/assertions.steps.js +1303 -1280
- package/src/stepDefinitions/browser.steps.js +74 -74
- package/src/stepDefinitions/frameActions.steps.js +76 -76
- package/src/stepDefinitions/keyboardActions.steps.js +264 -264
- package/src/stepDefinitions/mouseActions.steps.js +378 -378
- package/src/stepDefinitions/page.steps.js +71 -71
- package/src/stepDefinitions/random.steps.js +191 -191
package/README.md
CHANGED
|
@@ -1,779 +1,781 @@
|
|
|
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
|
-
<p >
|
|
8
|
-
<a href="https://www.npmjs.com/package/artes">
|
|
9
|
-
<img src="https://img.shields.io/npm/dm/artes?label=npm&logo=npm&color=blue" alt="npm version">
|
|
10
|
-
</a>
|
|
11
|
-
|
|
12
|
-
<a href="https://github.com/4gayev1/Artes">
|
|
13
|
-
<img src="https://img.shields.io/badge/GitHub-Artes-181717?logo=github&logoColor=white" alt="GitHub Artes">
|
|
14
|
-
</a>
|
|
15
|
-
|
|
16
|
-
<a href="https://hub.docker.com/r/vahidaghayev/artes">
|
|
17
|
-
<img src="https://img.shields.io/badge/Docker-Artes-blue?logo=docker&logoColor=white" alt="Docker Artes">
|
|
18
|
-
</a>
|
|
19
|
-
|
|
20
|
-
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
|
|
21
|
-
<img src="https://img.shields.io/badge/JavaScript-F7DF1E?logo=javascript&logoColor=black" alt="JavaScript">
|
|
22
|
-
</a>
|
|
23
|
-
|
|
24
|
-
<a href="https://playwright.dev/">
|
|
25
|
-
<img src="https://img.shields.io/badge/Playwright-2EAD33?logo=playwright&logoColor=white" alt="Playwright">
|
|
26
|
-
</a>
|
|
27
|
-
|
|
28
|
-
<a href="https://cucumber.io/">
|
|
29
|
-
<img src="https://img.shields.io/badge/Cucumber-23D96C?logo=cucumber&logoColor=white" alt="Cucumber">
|
|
30
|
-
</a>
|
|
31
|
-
|
|
32
|
-
<a href="https://www.apache.org/licenses/LICENSE-2.0">
|
|
33
|
-
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="Apache 2.0 License">
|
|
34
|
-
</a>
|
|
35
|
-
|
|
36
|
-
</p>
|
|
37
|
-
|
|
38
|
-
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.
|
|
39
|
-
|
|
40
|
-

|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## 🌟 Artes Benefits
|
|
45
|
-
|
|
46
|
-
### 🚀 Fast Setup & Smooth Onboarding
|
|
47
|
-
|
|
48
|
-
- Install in minutes and create a test project effortlessly
|
|
49
|
-
- Well-structured, easy-to-follow documentation for a smooth learning curve
|
|
50
|
-
- Designed for long-term maintainability and scalability
|
|
51
|
-
|
|
52
|
-
### 🧩 Powerful & QA-Friendly Architecture
|
|
53
|
-
|
|
54
|
-
- Intuitive API for writing custom step definitions
|
|
55
|
-
- Rich set of ready-to-use step definitions to speed up test creation
|
|
56
|
-
- Fully extensible — add your own step definitions anytime
|
|
57
|
-
|
|
58
|
-
### 🌐 Advanced API Testing
|
|
59
|
-
|
|
60
|
-
- Schema validation to ensure API response correctness
|
|
61
|
-
- Rich assertion library for precise validations
|
|
62
|
-
- Support for all HTTP methods
|
|
63
|
-
- Environment-based API configuration for flexible testing
|
|
64
|
-
|
|
65
|
-
### 🔁 Smart Variable & Data Handling
|
|
66
|
-
|
|
67
|
-
- Page Object Model (POM) support for structured data management
|
|
68
|
-
- Save, reuse, and share variables across steps
|
|
69
|
-
- Built-in data randomization for dynamic and realistic test data
|
|
70
|
-
- Environment-specific variables for clean environment separation
|
|
71
|
-
|
|
72
|
-
### 🖥️ Modern UI Automation
|
|
73
|
-
|
|
74
|
-
- Wide locator strategy support (CSS, XPath, text-based, and more)
|
|
75
|
-
- Built-in browser actions
|
|
76
|
-
- Cookie management
|
|
77
|
-
- Local & session storage handling
|
|
78
|
-
|
|
79
|
-
### ⚙️ Flexible Configuration & Hooks
|
|
80
|
-
|
|
81
|
-
- Environment-based configuration system
|
|
82
|
-
- Powerful and customizable configuration files
|
|
83
|
-
- Full hook support:
|
|
84
|
-
- Before / After
|
|
85
|
-
- Step-level and scenario-level hooks
|
|
86
|
-
|
|
87
|
-
### 🧪 CLI, CI/CD & Containerization
|
|
88
|
-
|
|
89
|
-
- Powerful CLI for full control from the command line
|
|
90
|
-
- Quality gate support — set a minimum success rate threshold to automatically fail the pipeline when test results drop below the required percentage
|
|
91
|
-
- Official [Artes Docker image](https://hub.docker.com/r/vahidaghayev/artes) for seamless containerized execution
|
|
92
|
-
- CI/CD-ready — integrate easily with any pipeline
|
|
93
|
-
|
|
94
|
-
### 🤖 AI-Powered Bug Reports & Test Summaries
|
|
95
|
-
|
|
96
|
-
- Automatically generates professional bug reports for failed test cases
|
|
97
|
-
- Generates concise test summaries for passed scenarios
|
|
98
|
-
- Supports multiple AI providers — OpenAI, Google Gemini, Anthropic Claude, Mistral, Groq, Cohere, DeepSeek (see [Supported AI Providers](docs/aiProviders.md) for full model list and setup)
|
|
99
|
-
- Works with local AI models (Ollama, LM Studio) — no API key required
|
|
100
|
-
- Multi-language report generation — produce reports in any language
|
|
101
|
-
- Configurable report cap to control API usage and costs
|
|
102
|
-
|
|
103
|
-
### 📊 Artes Reporting System
|
|
104
|
-
|
|
105
|
-
- Easy installation with docker compose (For detailed info: [Artes Reporting System](https://github.com/4gayev1/artes-reporting-system))
|
|
106
|
-
- Multiple reporting formats supported
|
|
107
|
-
- Native Allure reporting integration
|
|
108
|
-
- Customizable Artes Reporting System
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## 🧑💻 Installation
|
|
113
|
-
|
|
114
|
-
You can install **Artes** via npm. To install it globally **(RECOMMENDED)**, run the following command:
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
npm install -g artes
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
To install it locally in your project, run:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
npm install artes
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Once installed, you can run **Artes** using:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
npx artes [options]
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## 💡 Usage
|
|
135
|
-
|
|
136
|
-
**Artes** has following CLI options:
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
npx artes [options]
|
|
140
|
-
```
|
|
141
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
| `--
|
|
160
|
-
|
|
|
161
|
-
| `--
|
|
162
|
-
| `--
|
|
163
|
-
| `--
|
|
164
|
-
| `--
|
|
165
|
-
| `--
|
|
166
|
-
| `--
|
|
167
|
-
| `--
|
|
168
|
-
| `--
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
| `--
|
|
177
|
-
| `--
|
|
178
|
-
| `--
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
| `--
|
|
187
|
-
| `--
|
|
188
|
-
| `--
|
|
189
|
-
| `--
|
|
190
|
-
| `--
|
|
191
|
-
| `--
|
|
192
|
-
| `--
|
|
193
|
-
| `--
|
|
194
|
-
| `--
|
|
195
|
-
| `--
|
|
196
|
-
| `--
|
|
197
|
-
| `--
|
|
198
|
-
| `--
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
|
205
|
-
|
|
|
206
|
-
| `--
|
|
207
|
-
| `--
|
|
208
|
-
| `--
|
|
209
|
-
| `--
|
|
210
|
-
| `--
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
/
|
|
244
|
-
(
|
|
245
|
-
/
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
- **
|
|
291
|
-
- **
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
And User sets random
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
##
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
```
|
|
401
|
-
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
- **`
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
Given
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
|
530
|
-
|
|
|
531
|
-
| `
|
|
532
|
-
| `
|
|
533
|
-
| `
|
|
534
|
-
| `
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
|
561
|
-
|
|
|
562
|
-
| `
|
|
563
|
-
| `
|
|
564
|
-
| `
|
|
565
|
-
| `
|
|
566
|
-
| `
|
|
567
|
-
| `
|
|
568
|
-
| `
|
|
569
|
-
| `
|
|
570
|
-
| `
|
|
571
|
-
| `
|
|
572
|
-
| `
|
|
573
|
-
| `
|
|
574
|
-
| `
|
|
575
|
-
| `
|
|
576
|
-
| `
|
|
577
|
-
| `
|
|
578
|
-
| `
|
|
579
|
-
| `
|
|
580
|
-
| `
|
|
581
|
-
| `
|
|
582
|
-
| `
|
|
583
|
-
| `
|
|
584
|
-
| `
|
|
585
|
-
| `
|
|
586
|
-
| `
|
|
587
|
-
| `
|
|
588
|
-
| `
|
|
589
|
-
| `
|
|
590
|
-
| `
|
|
591
|
-
| `
|
|
592
|
-
| `
|
|
593
|
-
| `
|
|
594
|
-
| `
|
|
595
|
-
| `
|
|
596
|
-
| `
|
|
597
|
-
| `
|
|
598
|
-
| `
|
|
599
|
-
| `
|
|
600
|
-
| `
|
|
601
|
-
| `
|
|
602
|
-
| `
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
|
611
|
-
|
|
|
612
|
-
| `ai.
|
|
613
|
-
| `ai.
|
|
614
|
-
| `ai.
|
|
615
|
-
| ai.
|
|
616
|
-
| `ai.
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
|
625
|
-
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
"
|
|
664
|
-
"
|
|
665
|
-
"
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
-
|
|
684
|
-
-
|
|
685
|
-
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
|
694
|
-
|
|
|
695
|
-
| `
|
|
696
|
-
| `
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
|
717
|
-
|
|
|
718
|
-
| `
|
|
719
|
-
| `
|
|
720
|
-
| `
|
|
721
|
-
| `
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
```
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
"
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
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
|
+
<p >
|
|
8
|
+
<a href="https://www.npmjs.com/package/artes">
|
|
9
|
+
<img src="https://img.shields.io/npm/dm/artes?label=npm&logo=npm&color=blue" alt="npm version">
|
|
10
|
+
</a>
|
|
11
|
+
|
|
12
|
+
<a href="https://github.com/4gayev1/Artes">
|
|
13
|
+
<img src="https://img.shields.io/badge/GitHub-Artes-181717?logo=github&logoColor=white" alt="GitHub Artes">
|
|
14
|
+
</a>
|
|
15
|
+
|
|
16
|
+
<a href="https://hub.docker.com/r/vahidaghayev/artes">
|
|
17
|
+
<img src="https://img.shields.io/badge/Docker-Artes-blue?logo=docker&logoColor=white" alt="Docker Artes">
|
|
18
|
+
</a>
|
|
19
|
+
|
|
20
|
+
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
|
|
21
|
+
<img src="https://img.shields.io/badge/JavaScript-F7DF1E?logo=javascript&logoColor=black" alt="JavaScript">
|
|
22
|
+
</a>
|
|
23
|
+
|
|
24
|
+
<a href="https://playwright.dev/">
|
|
25
|
+
<img src="https://img.shields.io/badge/Playwright-2EAD33?logo=playwright&logoColor=white" alt="Playwright">
|
|
26
|
+
</a>
|
|
27
|
+
|
|
28
|
+
<a href="https://cucumber.io/">
|
|
29
|
+
<img src="https://img.shields.io/badge/Cucumber-23D96C?logo=cucumber&logoColor=white" alt="Cucumber">
|
|
30
|
+
</a>
|
|
31
|
+
|
|
32
|
+
<a href="https://www.apache.org/licenses/LICENSE-2.0">
|
|
33
|
+
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="Apache 2.0 License">
|
|
34
|
+
</a>
|
|
35
|
+
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 🌟 Artes Benefits
|
|
45
|
+
|
|
46
|
+
### 🚀 Fast Setup & Smooth Onboarding
|
|
47
|
+
|
|
48
|
+
- Install in minutes and create a test project effortlessly
|
|
49
|
+
- Well-structured, easy-to-follow documentation for a smooth learning curve
|
|
50
|
+
- Designed for long-term maintainability and scalability
|
|
51
|
+
|
|
52
|
+
### 🧩 Powerful & QA-Friendly Architecture
|
|
53
|
+
|
|
54
|
+
- Intuitive API for writing custom step definitions
|
|
55
|
+
- Rich set of ready-to-use step definitions to speed up test creation
|
|
56
|
+
- Fully extensible — add your own step definitions anytime
|
|
57
|
+
|
|
58
|
+
### 🌐 Advanced API Testing
|
|
59
|
+
|
|
60
|
+
- Schema validation to ensure API response correctness
|
|
61
|
+
- Rich assertion library for precise validations
|
|
62
|
+
- Support for all HTTP methods
|
|
63
|
+
- Environment-based API configuration for flexible testing
|
|
64
|
+
|
|
65
|
+
### 🔁 Smart Variable & Data Handling
|
|
66
|
+
|
|
67
|
+
- Page Object Model (POM) support for structured data management
|
|
68
|
+
- Save, reuse, and share variables across steps
|
|
69
|
+
- Built-in data randomization for dynamic and realistic test data
|
|
70
|
+
- Environment-specific variables for clean environment separation
|
|
71
|
+
|
|
72
|
+
### 🖥️ Modern UI Automation
|
|
73
|
+
|
|
74
|
+
- Wide locator strategy support (CSS, XPath, text-based, and more)
|
|
75
|
+
- Built-in browser actions
|
|
76
|
+
- Cookie management
|
|
77
|
+
- Local & session storage handling
|
|
78
|
+
|
|
79
|
+
### ⚙️ Flexible Configuration & Hooks
|
|
80
|
+
|
|
81
|
+
- Environment-based configuration system
|
|
82
|
+
- Powerful and customizable configuration files
|
|
83
|
+
- Full hook support:
|
|
84
|
+
- Before / After
|
|
85
|
+
- Step-level and scenario-level hooks
|
|
86
|
+
|
|
87
|
+
### 🧪 CLI, CI/CD & Containerization
|
|
88
|
+
|
|
89
|
+
- Powerful CLI for full control from the command line
|
|
90
|
+
- Quality gate support — set a minimum success rate threshold to automatically fail the pipeline when test results drop below the required percentage
|
|
91
|
+
- Official [Artes Docker image](https://hub.docker.com/r/vahidaghayev/artes) for seamless containerized execution
|
|
92
|
+
- CI/CD-ready — integrate easily with any pipeline
|
|
93
|
+
|
|
94
|
+
### 🤖 AI-Powered Bug Reports & Test Summaries
|
|
95
|
+
|
|
96
|
+
- Automatically generates professional bug reports for failed test cases
|
|
97
|
+
- Generates concise test summaries for passed scenarios
|
|
98
|
+
- Supports multiple AI providers — OpenAI, Google Gemini, Anthropic Claude, Mistral, Groq, Cohere, DeepSeek (see [Supported AI Providers](docs/aiProviders.md) for full model list and setup)
|
|
99
|
+
- Works with local AI models (Ollama, LM Studio) — no API key required
|
|
100
|
+
- Multi-language report generation — produce reports in any language
|
|
101
|
+
- Configurable report cap to control API usage and costs
|
|
102
|
+
|
|
103
|
+
### 📊 Artes Reporting System
|
|
104
|
+
|
|
105
|
+
- Easy installation with docker compose (For detailed info: [Artes Reporting System](https://github.com/4gayev1/artes-reporting-system))
|
|
106
|
+
- Multiple reporting formats supported
|
|
107
|
+
- Native Allure reporting integration
|
|
108
|
+
- Customizable Artes Reporting System
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 🧑💻 Installation
|
|
113
|
+
|
|
114
|
+
You can install **Artes** via npm. To install it globally **(RECOMMENDED)**, run the following command:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm install -g artes
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
To install it locally in your project, run:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npm install artes
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Once installed, you can run **Artes** using:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npx artes [options]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 💡 Usage
|
|
135
|
+
|
|
136
|
+
**Artes** has following CLI options:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npx artes [options]
|
|
140
|
+
```
|
|
141
|
+
|
|
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
|
+
| `-y, --yes` | Skip confirmation prompt when creating a project | `artes -c -y` or `artes -c --yes` |
|
|
151
|
+
| `--noDeps` | Create project without installing dependencies | `artes -c --noDeps` |
|
|
152
|
+
|
|
153
|
+
### Reporting & Branding ( artes report --help )
|
|
154
|
+
|
|
155
|
+
| Option | Description | Usage Example |
|
|
156
|
+
| --- | --- | --- |
|
|
157
|
+
| `-r, --report` | Run tests and generate Allure report | `artes -r` or `artes --report` |
|
|
158
|
+
| `--reportSuccess` | Generate screenshot and video with successful tests too | `artes --reportSuccess` |
|
|
159
|
+
| `--trace` | Enable tracing for all tests | `artes --trace` |
|
|
160
|
+
| `-rwt, --reportWithTrace` | Include trace in the report | `artes -rwt` or `artes --reportWithTrace` |
|
|
161
|
+
| `--singleFileReport` | Generate single file Allure report | `artes -r --singleFileReport` |
|
|
162
|
+
| `--zip` | Zip the report folder after generation | `artes -r --zip` |
|
|
163
|
+
| `--logo` | Set a custom logo in the report sidebar | `artes --logo logo.png` |
|
|
164
|
+
| `--brandName` | Set the brand name displayed next to the logo | `artes --brandName 'My Company'` |
|
|
165
|
+
| `--reportName` | Report name on the summary widget | `artes --reportName 'Alma UI'` |
|
|
166
|
+
| `--uploadReport` | Upload the generated report to Artes Reporting System | `artes -r --zip --uploadReport --reporterURL "https://example.com"` |
|
|
167
|
+
| `--reporterURL` | URL of the Artes Reporting System | `artes --uploadReport --reporterURL "https://example.com"` |
|
|
168
|
+
| `--projectName` | Project name in the Artes Reporting System (default: `"Artes Report"`) | `artes --uploadReport --reporterURL "https://example.com" --projectName "My Project"` |
|
|
169
|
+
| `--projectType` | Project type for reporting, e.g., UI, API (default: `"Artes"`) | `artes --uploadReport --reporterURL "https://example.com" --projectType "API"` |
|
|
170
|
+
| `--reportPath` | Path to the report zip file to upload (default: `./report.zip`) | `artes --uploadReport --reporterURL "https://example.com" --reportPath "./my_report.zip"` |
|
|
171
|
+
|
|
172
|
+
### Browser ( artes browser --help )
|
|
173
|
+
|
|
174
|
+
| Option | Description | Usage Example |
|
|
175
|
+
| --- | --- | --- |
|
|
176
|
+
| `--browser` | Specify browser to use (`chromium`, `firefox`, `webkit`) | `artes --browser chromium` |
|
|
177
|
+
| `--device` | Emulate a specific device (e.g., `"iPhone 13"`) | `artes --device "iPhone 13"` |
|
|
178
|
+
| `--maxScreen` | Maximize browser window on launch | `artes --maxScreen` |
|
|
179
|
+
| `--width` | Set browser width (default: `1280`) | `artes --width 1920` |
|
|
180
|
+
| `--height` | Set browser height (default: `720`) | `artes --height 1080` |
|
|
181
|
+
|
|
182
|
+
### Execution ( artes execution --help )
|
|
183
|
+
|
|
184
|
+
| Option | Description | Usage Example |
|
|
185
|
+
| --- | --- | --- |
|
|
186
|
+
| `--headless` | Run browser in headless mode | `artes --headless` |
|
|
187
|
+
| `--baseURL` | Set base URL for the tests | `artes --baseURL "https://example.com"` |
|
|
188
|
+
| `--offline` | Run browser in offline mode | `artes --offline` |
|
|
189
|
+
| `--features` | Specify feature file paths to run (comma-separated) | `artes --features "tests/features/Alma,tests/features/Banan.feature"` |
|
|
190
|
+
| `--stepDef` | Specify step definition file paths to use (comma-separated) | `artes --stepDef "tests/steps/login.js,tests/steps/home.js"` |
|
|
191
|
+
| `--tags` | Run tests with specified Cucumber tags | `artes --tags "@smoke and not @wip"` |
|
|
192
|
+
| `--env` | Set the environment for the test run | `artes --env "dev"` |
|
|
193
|
+
| `--saveVar` | Set variables from CLI | `artes --saveVar '{"armud":20,"banana":200}'` |
|
|
194
|
+
| `--parallel` | Run tests in parallel mode | `artes --parallel 3` |
|
|
195
|
+
| `--retry` | Retry failed tests | `artes --retry 2` |
|
|
196
|
+
| `--rerun` | Rerun only failed tests from previous run | `artes --rerun @rerun.txt` |
|
|
197
|
+
| `--dryRun` | Perform a dry run without executing tests | `artes --dryRun` |
|
|
198
|
+
| `--percentage` | Set minimum success percentage to pass test run (default: `0`) | `artes --percentage 85` |
|
|
199
|
+
| `--timeout` | Set timeout for each test step in seconds (default: `30`) | `artes --timeout 10` |
|
|
200
|
+
| `--slowMo` | Slow down execution for clear view (default: `0`) | `artes --slowMo 1` |
|
|
201
|
+
|
|
202
|
+
### AI Bug Reporter ( artes ai --help )
|
|
203
|
+
|
|
204
|
+
| Option | Description | Usage Example |
|
|
205
|
+
| --- | --- | --- |
|
|
206
|
+
| `--ai` | Enable AI-generated bug reports and test summaries | `artes --ai` |
|
|
207
|
+
| `--aiModel` | AI model to use for report generation | `artes --ai --aiModel "gemini 2.5 flash"` |
|
|
208
|
+
| `--aiKey` | API key for the selected AI provider | `artes --ai --aiKey "your-api-key"` |
|
|
209
|
+
| `--aiURL` | Local AI endpoint URL (e.g., Ollama, LM Studio). Overrides `--aiModel` and `--aiKey` when set | `artes --ai --aiURL "http://localhost:11434/api/chat"` |
|
|
210
|
+
| `--aiLanguage` | Language for AI-generated reports (default: `"English"`) | `artes --ai --aiLanguage "Azerbaijani"` |
|
|
211
|
+
| `--maxTokens` | Maximum tokens for AI-generated reports (default: `4000`) | `artes --ai --maxTokens 8000` |
|
|
212
|
+
| `--maxReports` | Maximum number of AI reports to generate per test run (default: `10`) | `artes --ai --maxReports 5` |
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
\*\* To just run the tests: <br>
|
|
216
|
+
Globally: artes <br>
|
|
217
|
+
Locally: npx artes
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 🎯 Best Practices
|
|
222
|
+
|
|
223
|
+
- **Global Installation:**
|
|
224
|
+
For ease of use, it's recommended that Artes be installed globally. You can do this by running the following command:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npm install -g artes
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
- **Project Creation (Recommended):**
|
|
231
|
+
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:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
artes -c
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
🗂️ Example Project Structure: <br/>
|
|
238
|
+
After running the `-c` flag to create a new project, the structure will look like this:
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
/artes (Project Name)
|
|
242
|
+
/tests
|
|
243
|
+
/features
|
|
244
|
+
(Your feature files here)
|
|
245
|
+
/POMs // Optional
|
|
246
|
+
(POM JSON file here)
|
|
247
|
+
/steps // For custom steps and hooks
|
|
248
|
+
(Your step definition and hooks JS files here)
|
|
249
|
+
artes.config.js
|
|
250
|
+
/report
|
|
251
|
+
(Generated Allure report HTML here)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**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:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
npx artes
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
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).
|
|
261
|
+
|
|
262
|
+
For example:
|
|
263
|
+
|
|
264
|
+
```javascript
|
|
265
|
+
module.exports = {
|
|
266
|
+
paths: ["tests/features/"], // Custom path for feature files
|
|
267
|
+
require: ["tests/steps/*.js"], // Custom path for step definitions files
|
|
268
|
+
pomPath: "tests/POMS/*.js", // Custom path for POM files
|
|
269
|
+
};
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 📝 Writing Feature Files and POM Files
|
|
275
|
+
|
|
276
|
+
Artes simplifies your test writing with structured feature files and organized Page Object Models (POM). Here’s how you can create them:
|
|
277
|
+
|
|
278
|
+
### 1. 📄 Feature File Structure
|
|
279
|
+
|
|
280
|
+
```gherkin
|
|
281
|
+
Feature: Searching on Google 🔍
|
|
282
|
+
Scenario Outline: Search for a term on Google
|
|
283
|
+
Given User is on "https://www.google.com/" page
|
|
284
|
+
When User types "alma" in "google_search_input"
|
|
285
|
+
And User clicks "google_search_button"
|
|
286
|
+
And User waits 10 seconds
|
|
287
|
+
Then "google_text" should have "Alma" text
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
- **Feature**: Describes the main feature being tested (e.g., Google search).
|
|
291
|
+
- **Scenario Outline**: Defines a test case with steps.
|
|
292
|
+
- **Steps**: Use `Given`, `When`, `And`, `Then` keywords to describe actions and expectations.
|
|
293
|
+
- **Selectors**: The element names (e.g., `google_search_input`, `google_search_button`) map to the POM file or can be defined directly.
|
|
294
|
+
|
|
295
|
+
### 2. 📂 POM File Example
|
|
296
|
+
|
|
297
|
+
```json
|
|
298
|
+
{
|
|
299
|
+
"google_search_input": { "selector": "#APjFqb" },
|
|
300
|
+
"google_search_button": {
|
|
301
|
+
"selector": "input.gNO89b"
|
|
302
|
+
},
|
|
303
|
+
"google_text": {
|
|
304
|
+
"selector": "#rso div h3",
|
|
305
|
+
"waitTime": 5 //seconds
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
- 📑 Using POM File is optional but it is **RECOMMENDED**
|
|
311
|
+
- 🔗 Using Selector in Feature File is possible
|
|
312
|
+
```gherkin
|
|
313
|
+
When User types "alma" in "#APjFqb"
|
|
314
|
+
```
|
|
315
|
+
- 🐍 It is good to use snake_case for element names
|
|
316
|
+
- ⏳ "waitTime" is to define custom wait for elements, but the feature currently under development.
|
|
317
|
+
"selector" must be used if "waitTime" is used, but when using only selector is not needed mention in "selector"
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## 🔄 Variable Management
|
|
322
|
+
|
|
323
|
+
Artes provides powerful variable management capabilities that allow you to save, reuse, and share variables across test steps.
|
|
324
|
+
|
|
325
|
+
### Saving Variables from API Responses
|
|
326
|
+
|
|
327
|
+
You can save variables directly from API responses, even using dot notation to extract nested values:
|
|
328
|
+
|
|
329
|
+
```gherkin
|
|
330
|
+
When User sends GET request to "https://www.test.com" and saves "id" variables
|
|
331
|
+
And User sends GET request to "https://www.test.com/items/{{id}}"
|
|
332
|
+
Then User expects that response should have 200 status code
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Manual Variable Assignment
|
|
336
|
+
|
|
337
|
+
Save variables manually using the dedicated step:
|
|
338
|
+
|
|
339
|
+
```gherkin
|
|
340
|
+
And User saves "15" variable as "id"
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Variable Randomization
|
|
344
|
+
|
|
345
|
+
Artes includes built-in randomization for generating dynamic test data:
|
|
346
|
+
|
|
347
|
+
```gherkin
|
|
348
|
+
And User sets random email as "email"
|
|
349
|
+
And User sets random 5 words as "description"
|
|
350
|
+
And User sets random fullname as "fullName"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Using Variables in Tests
|
|
354
|
+
|
|
355
|
+
Reference saved variables anywhere in your tests using double curly braces:
|
|
356
|
+
|
|
357
|
+
```gherkin
|
|
358
|
+
When User types "{{email}}" in "email_input"
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
📚 **For detailed information and complete step definitions**, visit the [Variable Management Documentation](https://github.com/4gayev1/Artes/blob/main/docs/stepDefinitions.md#variable-management).
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## 🛠️ Customization
|
|
366
|
+
|
|
367
|
+
## ✍️ Writing Custom Step Definitions
|
|
368
|
+
|
|
369
|
+
Artes allows you to extend its functionality by writing custom step definitions. Here's how you can do it:
|
|
370
|
+
|
|
371
|
+
### Import Required APIs
|
|
372
|
+
|
|
373
|
+
```javascript
|
|
374
|
+
const {
|
|
375
|
+
expect,
|
|
376
|
+
Given,
|
|
377
|
+
When,
|
|
378
|
+
Then,
|
|
379
|
+
element,
|
|
380
|
+
context,
|
|
381
|
+
keyboard,
|
|
382
|
+
mouse,
|
|
383
|
+
frame,
|
|
384
|
+
assert,
|
|
385
|
+
elementInteractions,
|
|
386
|
+
} = require("artes"); // Common JS
|
|
387
|
+
import { expect, Given, When, Then, element, context } from "artes"; // ES Modules (Do not RECOMMENDED)
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
- **`Given`, `When`, `Then`**: These define your steps in Cucumber syntax. Example:
|
|
391
|
+
|
|
392
|
+
```javascript
|
|
393
|
+
Given("User is on the login page", async () => {
|
|
394
|
+
await context.page.navigateTo("https://example.com/login");
|
|
395
|
+
});
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
- **`page`**: Provides higher-level page actions such as navigation and waiting(Same as PlayWright). Examples:
|
|
399
|
+
- Navigate to a URL:
|
|
400
|
+
```javascript
|
|
401
|
+
await context.page.navigate("https://example.com");
|
|
402
|
+
```
|
|
403
|
+
- Wait for a selector:
|
|
404
|
+
```javascript
|
|
405
|
+
await context.page.waitForSelector("#loadingSpinner");
|
|
406
|
+
```
|
|
407
|
+
- **`request`**: Use for sending HTTP requests. _(Note: This feature is currently under development.)_
|
|
408
|
+
|
|
409
|
+
- **`element`**: Use for interacting with elements on the web page. Examples:
|
|
410
|
+
- Clicking a button:
|
|
411
|
+
```javascript
|
|
412
|
+
await element("#submitButton").click();
|
|
413
|
+
```
|
|
414
|
+
- Filling an input:
|
|
415
|
+
```javascript
|
|
416
|
+
await element("#username").fill("testUser");
|
|
417
|
+
```
|
|
418
|
+
- **`expect`**: Use for assertions in your steps. For example:
|
|
419
|
+
```javascript
|
|
420
|
+
expect(actualValue).toBe(expectedValue);
|
|
421
|
+
expect(element("Page_Title")).toHaveText(expectedValue);
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
## 📋 Simplified Functions
|
|
425
|
+
|
|
426
|
+
If you don't want to deal with Playwright methods directly, you can simply use the following predefined actions methods by import them:
|
|
427
|
+
|
|
428
|
+
```javascript
|
|
429
|
+
const { mouse, keyboard, frame, elementInteractions, page } = require("artes");
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
- **Mouse Actions:**
|
|
433
|
+
`mouse.click(element)`
|
|
434
|
+
|
|
435
|
+
- **Keyboard Actions:**
|
|
436
|
+
`keyboard.press(key)`
|
|
437
|
+
|
|
438
|
+
- **Element Interactions:**
|
|
439
|
+
`elementInteractions.isChecked()`
|
|
440
|
+
|
|
441
|
+
- **Assertions:**
|
|
442
|
+
`assert.shouldBeTruthy(element)`
|
|
443
|
+
|
|
444
|
+
- **Frame Actions:**
|
|
445
|
+
`frame.first()`
|
|
446
|
+
|
|
447
|
+
- **API Actions:**
|
|
448
|
+
`api.post(url, payload, requestDataType)`
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
For a detailed explanation of each function, please refer to the [function definitions](./docs/functionDefinitions.md).
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
### Example of Custom Step Definition
|
|
457
|
+
|
|
458
|
+
```javascript
|
|
459
|
+
const { Given, When, Then, expect, element, page } = require("artes");
|
|
460
|
+
|
|
461
|
+
Given("User is on the home page", async () => {
|
|
462
|
+
await page.navigate("https://example.com");
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
When("User clicks the login button", async () => {
|
|
466
|
+
await element("#loginButton").click();
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
Then("User should see the login form", async () => {
|
|
470
|
+
expect(element("#loginForm")).toBeVisible(true);
|
|
471
|
+
});
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
## 🪝 Hooks (Lifecycle Hooks)
|
|
475
|
+
|
|
476
|
+
Artes supports **hooks** that allow you to execute custom logic **before and after tests, scenarios, and steps**.
|
|
477
|
+
|
|
478
|
+
Hooks are **user-defined**.
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
### 📁 Hooks File Location
|
|
483
|
+
|
|
484
|
+
Create the following file **inside your project** (optional):
|
|
485
|
+
|
|
486
|
+
```
|
|
487
|
+
tests/steps/hooks.js
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
### ✍️ Writing Hooks
|
|
493
|
+
|
|
494
|
+
You can define **only the hooks you need** in hooks.js under the steps folder.
|
|
495
|
+
Undefined hooks are automatically skipped.
|
|
496
|
+
|
|
497
|
+
```js
|
|
498
|
+
// tests/steps/hooks.js
|
|
499
|
+
|
|
500
|
+
export function BeforeStep() {
|
|
501
|
+
// hook for before each step
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export function Before() {
|
|
505
|
+
// hook for before each test
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export function BeforeAll() {
|
|
509
|
+
// hook for before all tests
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export function AfterStep() {
|
|
513
|
+
// hook for after each step
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export function After() {
|
|
517
|
+
// hook for after each test
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export function AfterAll() {
|
|
521
|
+
// hook for after all tests
|
|
522
|
+
}
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
### 🔁 Supported Hook Types
|
|
528
|
+
|
|
529
|
+
| Hook Name | Execution Time |
|
|
530
|
+
| ------------ | ----------------------------- |
|
|
531
|
+
| `BeforeAll` | Once before **all scenarios** |
|
|
532
|
+
| `Before` | Before **each scenario** |
|
|
533
|
+
| `BeforeStep` | Before **each step** |
|
|
534
|
+
| `AfterStep` | After **each step** |
|
|
535
|
+
| `After` | After **each scenario** |
|
|
536
|
+
| `AfterAll` | Once after **all scenarios** |
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
|
|
540
|
+
### ▶️ Execution Order Example
|
|
541
|
+
|
|
542
|
+
For a scenario with steps:
|
|
543
|
+
|
|
544
|
+
```
|
|
545
|
+
BeforeAll
|
|
546
|
+
Before
|
|
547
|
+
BeforeStep
|
|
548
|
+
(step executes)
|
|
549
|
+
AfterStep
|
|
550
|
+
After
|
|
551
|
+
AfterAll
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
---
|
|
555
|
+
|
|
556
|
+
## ⚙️ Configuration
|
|
557
|
+
|
|
558
|
+
You can configure Artes by editing the `artes.config.js` file. Below are the default configuration options with explanations:
|
|
559
|
+
|
|
560
|
+
| **Option** | **Default Value** | **Description** |
|
|
561
|
+
| ----------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
562
|
+
| `headless` | `false` | Run browser in headless mode. |
|
|
563
|
+
| `env` | `""` | Environment name for tests. |
|
|
564
|
+
| `variables` | `{}` | Variables for tests. |
|
|
565
|
+
| `baseURL` | `""` | Base URL for API or web tests. |
|
|
566
|
+
| `timeout` | `30` | Default timeout in seconds. |
|
|
567
|
+
| `slowMo` | `0` | Default slow motion in seconds. |
|
|
568
|
+
| `paths` | `[moduleConfig.featuresPath]` | Paths to feature files. |
|
|
569
|
+
| `require` | `[moduleConfig.stepsPath, "src/stepDefinitions/*.js", "src/hooks/hooks.js"]` | Support code paths (CommonJS). |
|
|
570
|
+
| `pomPath` | `moduleConfig.pomPath` | Path to Page Object Models. |
|
|
571
|
+
| `import` | `[]` | Support code paths. |
|
|
572
|
+
| `testPercentage` | `0` | Define test coverage percentage |
|
|
573
|
+
| `report` | `false` | Generate report |
|
|
574
|
+
| `zip` | `false` | Generate zip of report |
|
|
575
|
+
| `reportSuccess` | `false` | Add screenshots and video records also for success test cases |
|
|
576
|
+
| `trace` | `false` | Enable tracing |
|
|
577
|
+
| `reportWithTrace` | `false` | Include trace in report |
|
|
578
|
+
| `logo` | `""` (uses default Artes logo) | Custom logo for the report sidebar. Accepts an absolute path, a relative path, or a direct image URL |
|
|
579
|
+
| `brandName`| `""` | Brand name displayed next to the logo in the report sidebar |
|
|
580
|
+
| `reportName`| `""` | Report name displayed on the summary widget |
|
|
581
|
+
| `format` | `["rerun:@rerun.txt", "allure-cucumberjs/reporter"]` | Formatter names/paths. |
|
|
582
|
+
| `formatOptions` | `{ "resultsDir": "allure-result" }` | Formatter options. |
|
|
583
|
+
| `parallel` | `1` | Number of parallel workers. |
|
|
584
|
+
| `browser` | `"chrome"` | Browser to use: "chrome", "firefox", "webkit". |
|
|
585
|
+
| `offline` | `false` | Run browser in offline mode. |
|
|
586
|
+
| `device` | `""` | Emulate specific device (e.g., "iPhone 13"). |
|
|
587
|
+
| `width` | `1280` | Browser width in pixels. |
|
|
588
|
+
| `height` | `720` | Browser height in pixels. |
|
|
589
|
+
| `maximizeScreen` | `true` | Maximize browser window on start. |
|
|
590
|
+
| `dryRun` | `false` | Prepare test run without execution. |
|
|
591
|
+
| `failFast` | `false` | Stop on first test failure. |
|
|
592
|
+
| `forceExit` | `false` | Force `process.exit()` after tests |
|
|
593
|
+
| `strict` | `true` | Fail on pending steps. |
|
|
594
|
+
| `backtrace` | `false` | Show full backtrace for errors. |
|
|
595
|
+
| `tags` | `""` | Tag expression to filter scenarios. |
|
|
596
|
+
| `name` | `[]` | Run scenarios matching regex. |
|
|
597
|
+
| `order` | `"defined"` | Run order (defined/random). |
|
|
598
|
+
| `language` | `"en"` | Default feature file language. |
|
|
599
|
+
| `loader` | `[]` | Module loader specifications. |
|
|
600
|
+
| `requireModule` | `[]` | Transpilation module names. |
|
|
601
|
+
| `retry` | `0` | Retry attempts for failing tests. |
|
|
602
|
+
| `retryTagFilter` | `""` | Tag expression for retries. |
|
|
603
|
+
| `publish` | `false` | Publish to cucumber.io. |
|
|
604
|
+
| `worldParameters` | `{}` | Custom world parameters. |
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
## 🤖 AI Configuration
|
|
609
|
+
|
|
610
|
+
| **Option** | **Default Value** | **Description** |
|
|
611
|
+
| -------------------- | ----------------- | ---------------------------------------------------------------------------------------------------- |
|
|
612
|
+
| `ai.ai` | `false` | Enable AI-generated bug reports and test summaries. |
|
|
613
|
+
| `ai.model` | `"gpt-4o"` | AI model to use for report generation (e.g. `"gemini 2.5 flash"`, `"claude sonnet"`) |
|
|
614
|
+
| `ai.key` | `""` | API key for the selected AI provider. |
|
|
615
|
+
| `ai.url` | `""` | Local AI endpoint URL (e.g. Ollama, LM Studio). Overrides `model` and `key` when set. |
|
|
616
|
+
| `ai.language` | `"English"` | Language for AI-generated reports (e.g. `"Azerbaijani"`, `"German"`). |
|
|
617
|
+
| ai.maxTokens | 4000 | Maximum tokens for AI response output |
|
|
618
|
+
| `ai.maxReports` | `10` | Maximum number of AI reports to generate per test run. |
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
## 🌍 Environment Configuration
|
|
623
|
+
|
|
624
|
+
| **Option** | **Default Value** | **Description** |
|
|
625
|
+
| ---------- | ----------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
626
|
+
| `env` | `""` | Environment configuration. Should match the name with the baseURL object, like "dev" |
|
|
627
|
+
| `baseURL` | `""` | Base URL for API requests. Can be object {"dev":"dev-api.com", "pre":"pre-api.com"}, or string "dev-api.com" |
|
|
628
|
+
|
|
629
|
+
### Environment Variables Configuration
|
|
630
|
+
|
|
631
|
+
Artes supports environment-specific configurations through environment variables. This feature allows to manage different settings for environments.
|
|
632
|
+
|
|
633
|
+
### Setting Up Environment Variables
|
|
634
|
+
|
|
635
|
+
1. **Configure Environment in artes.config.js:**
|
|
636
|
+
|
|
637
|
+
```javascript
|
|
638
|
+
module.exports = {
|
|
639
|
+
baseURL: {
|
|
640
|
+
dev: "https://dev.alma.az",
|
|
641
|
+
pre: "https://pre.alma.az",
|
|
642
|
+
prod: "https://api.alma.az",
|
|
643
|
+
},
|
|
644
|
+
env: "dev", // Specify which environment to use
|
|
645
|
+
};
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
**Alternative single URL configuration:**
|
|
649
|
+
|
|
650
|
+
```javascript
|
|
651
|
+
module.exports = {
|
|
652
|
+
baseURL: "https://api.alma.az", // Direct string URL
|
|
653
|
+
};
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
2. **Create Environment Variable Files:**
|
|
657
|
+
Create JSON files under `src/tests/environment_variables/` folder with names matching your environment:
|
|
658
|
+
|
|
659
|
+
**dev.env.json:**
|
|
660
|
+
|
|
661
|
+
```json
|
|
662
|
+
{
|
|
663
|
+
"api_key": "dev-api-key-12345",
|
|
664
|
+
"auth_token": "dev-auth-token",
|
|
665
|
+
"database_url": "dev-db.example.com",
|
|
666
|
+
"timeout": 5000,
|
|
667
|
+
"headers": {
|
|
668
|
+
"Authorization": "Bearer dev-token",
|
|
669
|
+
"Content-Type": "application/json"
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
### How It Works
|
|
675
|
+
|
|
676
|
+
1. **Environment Detection:** When Artes runs, it reads the `env` value from `artes.config.js`
|
|
677
|
+
2. **Base URL Resolution:** If `baseURL` is an object, it uses the environment key to find the corresponding URL. If `baseURL` is a string, it uses it directly
|
|
678
|
+
3. **Variable Loading:** Artes looks for a JSON file matching the environment name in `src/tests/environment_variables/`
|
|
679
|
+
4. **Runtime Access:** All variables from the environment file become available during test execution
|
|
680
|
+
|
|
681
|
+
### Important Notes
|
|
682
|
+
|
|
683
|
+
- ⚠️ **Base URLs must be defined in `artes.config.js`** - they cannot be set in the environment variable JSON files
|
|
684
|
+
- 📁 Environment variable files should be placed in `src/tests/environment_variables/`
|
|
685
|
+
- 🏷️ File names must follow the format `{env}.env.json` (e.g., `dev.env.json` for `env: "dev"`)
|
|
686
|
+
- 🔄 Variables are loaded into variable storage and can be accessed during test runs
|
|
687
|
+
- 🌐 Use environment variables for headers, API keys, timeouts, and other environment-specific configurations
|
|
688
|
+
|
|
689
|
+
---
|
|
690
|
+
|
|
691
|
+
### Browser Configuration
|
|
692
|
+
|
|
693
|
+
| Option | Default Value | Description |
|
|
694
|
+
| ------------- | ------------------------------ | ------------------------------------------------------ |
|
|
695
|
+
| `browserType` | `"chrome"` | Browser type (`"chrome"`, `"firefox"`, or `"webkit"`). |
|
|
696
|
+
| `viewport` | `{ width: 1280, height: 720 }` | Browser viewport size. |
|
|
697
|
+
| `headless` | `true` | Run browser in headless mode (`true` or `false`). |
|
|
698
|
+
| `offline` | `false` | Run browser in offline mode (`true` or `false`). |
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
### Device Configuration
|
|
702
|
+
|
|
703
|
+
| Option | Default Value | Description |
|
|
704
|
+
| ------------- | ------------------------------ | ------------------------------------------------------ |
|
|
705
|
+
| `device` | `""` | [Device List](./docs/emulationDevicesList.md) |
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
## 📊 Reporting
|
|
709
|
+
|
|
710
|
+
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.
|
|
711
|
+
|
|
712
|
+
### Integration with Artes Reporting System
|
|
713
|
+
|
|
714
|
+
Artes has a built-in integration with the Artes Reporting System. By configuring the options below, you can automatically upload your test reports and keep your pipeline stages clean and organized.
|
|
715
|
+
|
|
716
|
+
| **Option** | **Default Value** | **Description** |
|
|
717
|
+
| ---------------- | ----------------------------- | ---------------------------------------------------------------------- |
|
|
718
|
+
| `uploadReport` | `false` | Automatically upload the report to Artes Reporting System after tests. |
|
|
719
|
+
| `reporterURL` | `""` | URL of the Artes Reporting System instance to upload the report to. |
|
|
720
|
+
| `projectName` | `"Artes Report"` | Name of the project in the Artes Reporting System. |
|
|
721
|
+
| `projectType` | `"Artes"` | Type/category of the project (e.g., UI, API). |
|
|
722
|
+
| `reportName` | `"Artes Report"` | Display name of the report in the Artes Reporting System. |
|
|
723
|
+
| `reportPath` | `"./report.zip"` | Path to the report zip file to be uploaded. |
|
|
724
|
+
|
|
725
|
+
---
|
|
726
|
+
|
|
727
|
+
## 🐳 Docker Image for CI/CD
|
|
728
|
+
|
|
729
|
+
A Docker image `vahidaghayev/artes` is available for running Artes in CI/CD pipelines. This image includes:
|
|
730
|
+
|
|
731
|
+
- **Playwright Browsers**: Pre-installed to support UI testing.
|
|
732
|
+
- **Xvfb**: Enables running UI tests with video recording in a virtual display.
|
|
733
|
+
|
|
734
|
+
### Recommended Settings for Best Quality
|
|
735
|
+
|
|
736
|
+
To achieve the best video recording quality, use the following command:
|
|
737
|
+
```bash
|
|
738
|
+
xvfb-run -a --server-args="-screen 0 3840x1180x24" --auto-servernum npx artes --width 1600 --height 900
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
### CI/CD Executor on Report
|
|
742
|
+
|
|
743
|
+
Artes automatically detects your CI/CD environment and displays executor information — pipeline name, build number, and a direct link to the build — on the generated report.
|
|
744
|
+
|
|
745
|
+
**No configuration needed.** Artes reads the standard environment variables that each CI platform sets automatically. Supported platforms include GitHub Actions, Jenkins, GitLab CI, Bitbucket Pipelines, CircleCI, Azure Pipelines, TeamCity, Travis CI, and Bamboo. When running locally, the executor is shown as "Local Run".
|
|
746
|
+
|
|
747
|
+
For full details, platform-specific examples, and the list of detected environment variables, see the [CI/CD Executor Integration guide](./docs/ciExecutors.md).
|
|
748
|
+
|
|
749
|
+
---
|
|
750
|
+
|
|
751
|
+
## 👍 Good To Use
|
|
752
|
+
|
|
753
|
+
If you don't use the -c or --create option that the package offers, save the file below under the `.vscode` folder:
|
|
754
|
+
|
|
755
|
+
- Those configurations will help autocomplete both predefined and custom step definitions in your features file
|
|
756
|
+
|
|
757
|
+
**extensions.json**
|
|
758
|
+
|
|
759
|
+
```json
|
|
760
|
+
{
|
|
761
|
+
"recommendations": ["CucumberOpen.cucumber-official"]
|
|
762
|
+
}
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
**settings.json**
|
|
766
|
+
|
|
767
|
+
```json
|
|
768
|
+
{
|
|
769
|
+
"cucumber.glue": [
|
|
770
|
+
"tests/steps/*.{ts,js}",
|
|
771
|
+
"node_modules/artes/src/tests/stepDefinitions/*.{ts,js}"
|
|
772
|
+
],
|
|
773
|
+
"cucumber.features": ["tests/features/*.features"],
|
|
774
|
+
"cucumberautocomplete.syncfeatures": true,
|
|
775
|
+
"cucumberautocomplete.strictGherkinCompletion": true
|
|
776
|
+
}
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
---
|
|
780
|
+
|
|
781
|
+
## 🧑💻 Have a Good Testing
|