artes 1.2.16 โ 1.2.17
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 +104 -8
- package/docs/stepDefinitions.md +44 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,9 +10,61 @@ Artes is a test runner for Playwright that executes [predefined Cucumber tests](
|
|
|
10
10
|
|
|
11
11
|

|
|
12
12
|
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ๐ Artes Benefits
|
|
16
|
+
|
|
17
|
+
### ๐ Fast Setup & Smooth Onboarding
|
|
18
|
+
- Install in minutes and create a test project effortlessly
|
|
19
|
+
- Well-structured, easy-to-follow documentation for a smooth learning curve
|
|
20
|
+
- Designed for long-term maintainability and scalability
|
|
21
|
+
|
|
22
|
+
### ๐งฉ Powerful & Developer-Friendly Architecture
|
|
23
|
+
- Intuitive API for writing custom step definitions
|
|
24
|
+
- Rich set of ready-to-use step definitions to speed up test creation
|
|
25
|
+
- Fully extensible โ add your own step definitions anytime
|
|
26
|
+
|
|
27
|
+
### ๐ Advanced API Testing
|
|
28
|
+
- Schema validation to ensure API response correctness
|
|
29
|
+
- Rich assertion library for precise validations
|
|
30
|
+
- Support for all HTTP methods
|
|
31
|
+
- Environment-based API configuration for flexible testing
|
|
32
|
+
|
|
33
|
+
### ๐ Smart Variable & Data Handling
|
|
34
|
+
- Page Object Model (POM) support for structured data management
|
|
35
|
+
- Save, reuse, and share variables across steps
|
|
36
|
+
- Built-in data randomization for dynamic and realistic test data
|
|
37
|
+
- Environment-specific variables for clean environment separation
|
|
38
|
+
|
|
39
|
+
### ๐ฅ๏ธ Modern UI Automation
|
|
40
|
+
- Wide locator strategy support (CSS, XPath, text-based, and more)
|
|
41
|
+
- Built-in browser actions
|
|
42
|
+
- Cookie management
|
|
43
|
+
- Local & session storage handling
|
|
44
|
+
|
|
45
|
+
### โ๏ธ Flexible Configuration & Hooks
|
|
46
|
+
- Environment-based configuration system
|
|
47
|
+
- Powerful and customizable configuration files
|
|
48
|
+
- Full hook support:
|
|
49
|
+
- Before / After
|
|
50
|
+
- Step-level and scenario-level hooks
|
|
51
|
+
|
|
52
|
+
### ๐งช CLI, CI/CD & Containerization
|
|
53
|
+
- Powerful CLI for full control from the command line
|
|
54
|
+
- Official [Artes Docker image](https://hub.docker.com/r/vahidaghayev/artes) for seamless containerized execution
|
|
55
|
+
- CI/CD-ready โ integrate easily with any pipeline
|
|
56
|
+
|
|
57
|
+
### ๐ Artes Reporting System
|
|
58
|
+
- Easy installation with docker compose (For detailed info: [Artes Reporting System](https://github.com/4gayev1/artes-reporting-system))
|
|
59
|
+
- Multiple reporting formats supported
|
|
60
|
+
- Native Allure reporting integration
|
|
61
|
+
- Customizable Artes Reporting System
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
13
65
|
## ๐งโ๐ป Installation
|
|
14
66
|
|
|
15
|
-
You can install **Artes** via npm. To install it globally**(RECOMMENDED)**, run the following command:
|
|
67
|
+
You can install **Artes** via npm. To install it globally **(RECOMMENDED)**, run the following command:
|
|
16
68
|
|
|
17
69
|
```bash
|
|
18
70
|
npm install -g artes
|
|
@@ -50,10 +102,10 @@ npx artes [options]
|
|
|
50
102
|
| โ
`-y, --yes` | Skip the confirmation prompt when creating an example project | `artes -c -y` or `artes --create --yes` |
|
|
51
103
|
| ๐ `-r, --report` | Run tests and generate Allure report | `artes -r` or `artes --report` |
|
|
52
104
|
| `--reportSuccess` | Add screenshots and video records for also Success test cases | `artes --reportSuccess` |
|
|
53
|
-
| `--trace` | Enable tracing | `artes --trace
|
|
105
|
+
| `--trace` | Enable tracing | `artes --trace` |
|
|
54
106
|
| `-rwt, --reportWithTrace` | Add trace to the report | `artes -rwt` or `artes --reportWithTrace` |
|
|
55
|
-
| `--singleFileReport` | Generate single file allure report | `
|
|
56
|
-
| `--zip`
|
|
107
|
+
| `--singleFileReport` | Generate single file allure report | `artes -r --singleFileReport` |
|
|
108
|
+
| `--zip` | Zip the report folder after generation | `artes -r --zip` |
|
|
57
109
|
| ๐ `--features` | Specify one or more feature files' relative paths to run (comma-separated) | `artes --features "tests/features/Alma,tests/features/Banan.feature"` |
|
|
58
110
|
| ๐ `--stepDef` | Specify one or more step definition files' relative paths to use (comma-separated) | `artes --stepDef "tests/steps/login.js,tests/steps/home.js"` |
|
|
59
111
|
| ๐ `--tags` | Run tests with specified Cucumber tags | `artes --tags "@smoke or @wip"` |
|
|
@@ -172,11 +224,55 @@ Feature: Searching on Google ๐
|
|
|
172
224
|
When User types "alma" in "#APjFqb"
|
|
173
225
|
```
|
|
174
226
|
- ๐ It is good to use snake_case for element names
|
|
175
|
-
- โณ "waitTime" is to define custom wait for elements, but the feature currently under development
|
|
227
|
+
- โณ "waitTime" is to define custom wait for elements, but the feature currently under development.
|
|
176
228
|
"selector" must be used if "waitTime" is used, but when using only selector is not needed mention in "selector"
|
|
177
229
|
|
|
178
230
|
---
|
|
179
231
|
|
|
232
|
+
## ๐ Variable Management
|
|
233
|
+
|
|
234
|
+
Artes provides powerful variable management capabilities that allow you to save, reuse, and share variables across test steps.
|
|
235
|
+
|
|
236
|
+
### Saving Variables from API Responses
|
|
237
|
+
|
|
238
|
+
You can save variables directly from API responses, even using dot notation to extract nested values:
|
|
239
|
+
|
|
240
|
+
```gherkin
|
|
241
|
+
When User sends GET request to "https://www.test.com" and saves "id" variables
|
|
242
|
+
And User sends GET request to "https://www.test.com/items/{{id}}"
|
|
243
|
+
Then User expects that response should have 200 status code
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Manual Variable Assignment
|
|
247
|
+
|
|
248
|
+
Save variables manually using the dedicated step:
|
|
249
|
+
|
|
250
|
+
```gherkin
|
|
251
|
+
And User saves "15" variable as "id"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Variable Randomization
|
|
255
|
+
|
|
256
|
+
Artes includes built-in randomization for generating dynamic test data:
|
|
257
|
+
|
|
258
|
+
```gherkin
|
|
259
|
+
And User sets random email as "email"
|
|
260
|
+
And User sets random 5 words as "description"
|
|
261
|
+
And User sets random fullname as "fullName"
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Using Variables in Tests
|
|
265
|
+
|
|
266
|
+
Reference saved variables anywhere in your tests using double curly braces:
|
|
267
|
+
|
|
268
|
+
```gherkin
|
|
269
|
+
When User types "{{email}}" in "email_input"
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
๐ **For detailed information and complete step definitions**, visit the [Variable Management Documentation](https://github.com/4gayev1/Artes/blob/main/docs/stepDefinitions.md#variable-management).
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
180
276
|
## ๐ ๏ธ Customization
|
|
181
277
|
|
|
182
278
|
## โ๏ธ Writing Custom Step Definitions
|
|
@@ -290,7 +386,7 @@ Then("User should see the login form", async () => {
|
|
|
290
386
|
|
|
291
387
|
Artes supports **hooks** that allow you to execute custom logic **before and after tests, scenarios, and steps**.
|
|
292
388
|
|
|
293
|
-
Hooks are **user-defined**.
|
|
389
|
+
Hooks are **user-defined**.
|
|
294
390
|
|
|
295
391
|
---
|
|
296
392
|
|
|
@@ -307,6 +403,7 @@ tests/steps/hooks.js
|
|
|
307
403
|
|
|
308
404
|
You can define **only the hooks you need** in hooks.js under the steps folder.
|
|
309
405
|
Undefined hooks are automatically skipped.
|
|
406
|
+
|
|
310
407
|
```js
|
|
311
408
|
// tests/steps/hooks.js
|
|
312
409
|
|
|
@@ -410,8 +507,7 @@ You can configure Artes by editing the `artes.config.js` file. Below are the def
|
|
|
410
507
|
| `env` | `""` | Environment configuration. Should match the name with the baseURL object, like "dev" |
|
|
411
508
|
| `baseURL` | `""` | Base URL for API requests. Can be object {"dev":"dev-api.com", "pre":"pre-api.com"}, or string "dev-api.com" |
|
|
412
509
|
|
|
413
|
-
|
|
414
|
-
### Environment Variables Configuration
|
|
510
|
+
### Environment Variables Configuration
|
|
415
511
|
|
|
416
512
|
Artes supports environment-specific configurations through environment variables. This feature allows to manage different settings for environments.
|
|
417
513
|
|
package/docs/stepDefinitions.md
CHANGED
|
@@ -207,9 +207,53 @@
|
|
|
207
207
|
|
|
208
208
|
# Variable Management
|
|
209
209
|
|
|
210
|
+
## Manual Variable Assignment
|
|
210
211
|
- User saves `{string}` variable from response as `{string}`
|
|
211
212
|
- User saves `{string}` variable as `{string}`
|
|
212
213
|
|
|
214
|
+
## Random Variable Management
|
|
215
|
+
|
|
216
|
+
### Random Words
|
|
217
|
+
- User sets random word as `{string}`
|
|
218
|
+
- User sets random word that has `{int}` character as `{string}`
|
|
219
|
+
- User sets random word that has character between `{int}` and `{int}` as `{string}`
|
|
220
|
+
- User sets random words as `{string}`
|
|
221
|
+
- User sets random `{int}` words as `{string}`
|
|
222
|
+
- User sets random words that range between `{int}` and `{int}` as `{string}`
|
|
223
|
+
|
|
224
|
+
### Random Numbers
|
|
225
|
+
- User sets random number as `{string}`
|
|
226
|
+
- User sets random number from `{int}` to `{int}` as `{string}`
|
|
227
|
+
|
|
228
|
+
### Random Text Content
|
|
229
|
+
- User sets random paragraph as `{string}`
|
|
230
|
+
- User sets random paragraph that range between `{int}` and `{int}` as `{string}`
|
|
231
|
+
- User sets random sentences that has `{int}` paragraph as `{string}`
|
|
232
|
+
|
|
233
|
+
### Random Characters & Alphanumeric
|
|
234
|
+
- User sets random characters from `{string}` as `{string}`
|
|
235
|
+
- User sets random alphanumeric in range from `{int}` to `{int}` as `{string}`
|
|
236
|
+
|
|
237
|
+
### Random Personal Information
|
|
238
|
+
- User sets random email as `{string}`
|
|
239
|
+
- User sets random fullname as `{string}`
|
|
240
|
+
- User sets random first name as `{string}`
|
|
241
|
+
- User sets random last name as `{string}`
|
|
242
|
+
- User sets random middle name as `{string}`
|
|
243
|
+
|
|
244
|
+
### Random Internet Data
|
|
245
|
+
- User sets random url as `{string}`
|
|
246
|
+
|
|
247
|
+
### Random Dates
|
|
248
|
+
- User sets random date between `{int}` and `{int}` as `{string}`
|
|
249
|
+
- User sets date `{int}` days after today as `{string}`
|
|
250
|
+
- User sets date `{int}` days before today as `{string}`
|
|
251
|
+
|
|
252
|
+
### Random from API Response
|
|
253
|
+
- User sends GET request to `{string}` and save `{string}` variable from `{string}` array as `{string}` randomly
|
|
254
|
+
|
|
255
|
+
### Random from Array
|
|
256
|
+
- User sets random value from given `{string}` array as `{string}`
|
|
213
257
|
---
|
|
214
258
|
|
|
215
259
|
# Debugging / Console Output
|
|
@@ -220,11 +264,6 @@
|
|
|
220
264
|
|
|
221
265
|
---
|
|
222
266
|
|
|
223
|
-
# Generic HTTP Request
|
|
224
|
-
|
|
225
|
-
- User sends `{string}` request to `{string}`
|
|
226
|
-
|
|
227
|
-
---
|
|
228
267
|
|
|
229
268
|
# Random Data Generation
|
|
230
269
|
|