artes 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -265,26 +265,26 @@ Then("User should see the login form", async () => {
265
265
 
266
266
  You can configure Artes by editing the `artes.config.js` file. Below are the default configuration options with explanations:
267
267
 
268
- | **Option** | **Default Value** | **Description** |
269
- | ---------------- | ---------------------------------------------------- | --------------------------------------- |
270
- | `headless` | `true` | Run in headless browser mode. |
271
- | `paths` | `["tests/features/"]` | Array of paths to feature files. |
272
- | `pomPath` | `"tests/POMs/*.json"` | Path to Page Object Models. |
273
- | `require` | `"tests/steps/*.js"` | Array of support code paths (CommonJS). |
274
- | `parallel` | `1` | Number of parallel workers. |
275
- | `tags` | `""` | Tag expression to filter scenarios. |
276
- | `language` | `"en"` | Default language for feature files. |
277
- | `order` | `"defined"` | Run order (defined or random). |
278
- | `dryRun` | `false` | Prepare test run without execution. |
279
- | `failFast` | `false` | Stop on first failure. |
280
- | `forceExit` | `false` | Force `process.exit()` after tests. |
281
- | `retry` | `0` | Retry attempts for failing tests. |
282
- | `retryTagFilter` | `""` | Tag expression for retries. |
283
- | `strict` | `true` | Fail on pending steps. |
284
- | `backtrace` | `false` | Show full backtrace for errors. |
285
- | `format` | `["rerun:@rerun.txt", "allure-cucumberjs/reporter"]` | Array of formatter names/paths. |
286
- | `formatOptions` | `{ "resultsDir": "allure-result" }` | Formatter options. |
287
- | `publish` | `false` | Publish results to `cucumber.io`. |
268
+ | **Option** | **Default Value** | **Description** |
269
+ | ---------------- | ---------------------------------------------------- | ----------------------------------- |
270
+ | `headless` | `true` | Run in headless browser mode. |
271
+ | `paths` | `["tests/features/"]` | Array of paths to feature files. |
272
+ | `pomPath` | `"tests/POMs/*.json"` | Path to Page Object Models. |
273
+ | `steps` | `"tests/steps/*.js"` | string - Step definitions files. |
274
+ | `format` | `["rerun:@rerun.txt", "allure-cucumberjs/reporter"]` | Array of formatter names/paths. |
275
+ | `formatOptions` | `{ "resultsDir": "allure-result" }` | Formatter options. |
276
+ | `parallel` | `1` | Number of parallel workers. |
277
+ | `tags` | `""` | Tag expression to filter scenarios. |
278
+ | `language` | `"en"` | Default language for feature files. |
279
+ | `order` | `"defined"` | Run order (defined or random). |
280
+ | `dryRun` | `false` | Prepare test run without execution. |
281
+ | `failFast` | `false` | Stop on first failure. |
282
+ | `forceExit` | `false` | Force `process.exit()` after tests. |
283
+ | `retry` | `0` | Retry attempts for failing tests. |
284
+ | `retryTagFilter` | `""` | Tag expression for retries. |
285
+ | `strict` | `true` | Fail on pending steps. |
286
+ | `backtrace` | `false` | Show full backtrace for errors. |
287
+ | `publish` | `false` | Publish results to `cucumber.io`. |
288
288
 
289
289
  ---
290
290
 
@@ -17,7 +17,7 @@ try {
17
17
  module.exports = {
18
18
  default: {
19
19
  // File paths and patterns
20
- cucumberTimeout: artesConfig.cucumberTimeout || 30, // Default timeout in milliseconds
20
+ cucumberTimeout: artesConfig.timeout || 30, // Default timeout in milliseconds
21
21
  paths: artesConfig.features
22
22
  ? path.join(moduleConfig.projectPath, artesConfig.features)
23
23
  : [moduleConfig.featuresPath], // Paths to feature files
@@ -43,7 +43,7 @@ module.exports = {
43
43
  }, // Formatter options
44
44
 
45
45
  // Execution options
46
- parallel: artesConfig.parallel || 0, // Number of parallel workers
46
+ parallel: artesConfig.parallel || 1, // Number of parallel workers
47
47
  dryRun: artesConfig.dryRun || false, // Prepare test run without execution
48
48
  failFast: artesConfig.failFast || false, // Stop on first test failure
49
49
  forceExit: artesConfig.forceExit || false, // Force process.exit() after tests
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "The package provide step definitions and user writes feature files, and the package handles automation, with optional POM files and custom step definitions.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -19,9 +19,6 @@ let request;
19
19
  setDefaultTimeout(cucumberConfig.default.cucumberTimeout * 1000);
20
20
 
21
21
  BeforeAll(async function () {
22
- browser = await invokeBrowser();
23
- request = await invokeRequest();
24
-
25
22
  pomCollector();
26
23
 
27
24
  // browser.tracing.start({
@@ -32,6 +29,8 @@ BeforeAll(async function () {
32
29
  });
33
30
 
34
31
  Before(async function () {
32
+ browser = await invokeBrowser();
33
+ request = await invokeRequest();
35
34
  context.page = await browser.newPage();
36
35
  context.request = await request;
37
36
  });
@@ -48,6 +47,8 @@ After(async function ({ pickle, result }) {
48
47
  }
49
48
 
50
49
  await context.page.close();
50
+ await browser.close();
51
+
51
52
  // await browser.tracing.stop({ path: 'trace.zip' });
52
53
  if (result?.status != Status.PASSED) {
53
54
  const videoPath = await context.page.video().path();
@@ -56,6 +57,4 @@ After(async function ({ pickle, result }) {
56
57
  }
57
58
  });
58
59
 
59
- AfterAll(function () {
60
- browser.close();
61
- });
60
+ AfterAll(function () {});
@@ -2,768 +2,792 @@ const { Then } = require("../../helper/imports/commons");
2
2
  const { assert } = require("../../helper/stepFunctions/exporter");
3
3
 
4
4
  // Check if a selector should be attached
5
- Then("User expects {string} should be attached", function (selector) {
6
- assert.shouldBeAttached(selector);
5
+ Then("User expects {string} should be attached", async function (selector) {
6
+ await assert.shouldBeAttached(selector);
7
7
  });
8
8
 
9
9
  // Check if a selector should be checked
10
- Then("User expects {string} should be checked", function (selector) {
11
- assert.shouldBeChecked(selector);
10
+ Then("User expects {string} should be checked", async function (selector) {
11
+ await assert.shouldBeChecked(selector);
12
12
  });
13
13
 
14
14
  // Check if a selector should be disabled
15
- Then("User expects {string} should be disabled", function (selector) {
16
- assert.shouldBeDisabled(selector);
15
+ Then("User expects {string} should be disabled", async function (selector) {
16
+ await assert.shouldBeDisabled(selector);
17
17
  });
18
18
 
19
19
  // Check if a selector should be editable
20
- Then("User expects {string} should be editable", function (selector) {
21
- assert.shouldBeEditable(selector);
20
+ Then("User expects {string} should be editable", async function (selector) {
21
+ await assert.shouldBeEditable(selector);
22
22
  });
23
23
 
24
24
  // Check if a selector should be empty
25
- Then("User expects {string} should be empty", function (selector) {
26
- assert.shouldBeEmpty(selector);
25
+ Then("User expects {string} should be empty", async function (selector) {
26
+ await assert.shouldBeEmpty(selector);
27
27
  });
28
28
 
29
29
  // Check if a selector should be enabled
30
- Then("User expects {string} should be enabled", function (selector) {
31
- assert.shouldBeEnabled(selector);
30
+ Then("User expects {string} should be enabled", async function (selector) {
31
+ await assert.shouldBeEnabled(selector);
32
32
  });
33
33
 
34
34
  // Check if a selector should be focused
35
- Then("User expects {string} should be focused", function (selector) {
36
- assert.shouldBeFocused(selector);
35
+ Then("User expects {string} should be focused", async function (selector) {
36
+ await assert.shouldBeFocused(selector);
37
37
  });
38
38
 
39
39
  // Check if a selector should be hidden
40
- Then("User expects {string} should be hidden", function (selector) {
41
- assert.shouldBeHidden(selector);
40
+ Then("User expects {string} should be hidden", async function (selector) {
41
+ await assert.shouldBeHidden(selector);
42
42
  });
43
43
 
44
44
  // Check if a selector should be in the viewport
45
- Then("User expects {string} should be on the screen", function (selector) {
46
- assert.shouldBeInViewport(selector);
47
- });
45
+ Then(
46
+ "User expects {string} should be on the screen",
47
+ async function (selector) {
48
+ await assert.shouldBeInViewport(selector);
49
+ },
50
+ );
48
51
 
49
52
  // Check if a selector should be visible
50
- Then("User expects {string} should be visible", function (selector) {
51
- assert.shouldBeVisible(selector);
53
+ Then("User expects {string} should be visible", async function (selector) {
54
+ await assert.shouldBeVisible(selector);
52
55
  });
53
56
 
54
57
  // Check if a selector should contain specific text
55
58
  Then(
56
59
  "User expects {string} should have {string} text",
57
- function (selector, text) {
58
- assert.shouldContainText(selector, text);
60
+ async function (selector, text) {
61
+ await assert.shouldContainText(selector, text);
59
62
  },
60
63
  );
61
64
 
62
65
  // Check if a selector should have an accessible description
63
66
  Then(
64
67
  "User expects {string} should have {string} description",
65
- function (selector, description) {
66
- assert.shouldHaveAccessibleDescription(selector, description);
68
+ async function (selector, description) {
69
+ await assert.shouldHaveAccessibleDescription(selector, description);
67
70
  },
68
71
  );
69
72
 
70
73
  // Check if a selector should have an accessible name
71
74
  Then(
72
75
  "User expects {string} should have {string} name",
73
- function (selector, name) {
74
- assert.shouldHaveAccessibleName(selector, name);
76
+ async function (selector, name) {
77
+ await assert.shouldHaveAccessibleName(selector, name);
75
78
  },
76
79
  );
77
80
 
78
81
  // Check if a selector should have a specific attribute with a given value
79
82
  Then(
80
83
  "User expects {string} should have {string} attribute with {string} value",
81
- function (selector, attribute, value) {
82
- assert.shouldHaveAttribute(selector, attribute, value);
84
+ async function (selector, attribute, value) {
85
+ await assert.shouldHaveAttribute(selector, attribute, value);
83
86
  },
84
87
  );
85
88
 
86
89
  // Check if a selector should have a specific class
87
90
  Then(
88
91
  "User expects {string} should have {string} class",
89
- function (selector, className) {
90
- assert.shouldHaveClass(selector, className);
92
+ async function (selector, className) {
93
+ await assert.shouldHaveClass(selector, className);
91
94
  },
92
95
  );
93
96
 
94
97
  // Check if a selector should have a specific count
95
98
  Then(
96
99
  "User expects count of {string} should be {int}",
97
- function (selector, count) {
98
- assert.shouldHaveCount(selector, count);
100
+ async function (selector, count) {
101
+ await assert.shouldHaveCount(selector, count);
99
102
  },
100
103
  );
101
104
 
102
105
  // Check if a selector should have a specific CSS property with a given value
103
106
  Then(
104
107
  "User expects {string} should have {string} CSS property with {string} value",
105
- function (selector, property, value) {
106
- assert.shouldHaveCSS(selector, property, value);
108
+ async function (selector, property, value) {
109
+ await assert.shouldHaveCSS(selector, property, value);
107
110
  },
108
111
  );
109
112
 
110
113
  // Check if a selector should have a specific id
111
- Then("User expects {string} should have {string} id", function (selector, id) {
112
- assert.shouldHaveId(selector, id);
113
- });
114
+ Then(
115
+ "User expects {string} should have {string} id",
116
+ async function (selector, id) {
117
+ await assert.shouldHaveId(selector, id);
118
+ },
119
+ );
114
120
 
115
121
  // Check if a selector should have a specific JavaScript property with a given value
116
122
  Then(
117
123
  "User expects {string} should have {string} JavaScript property with {string} value",
118
- function (selector, property, value) {
119
- assert.shouldHaveJSProperty(selector, property, value);
124
+ async function (selector, property, value) {
125
+ await assert.shouldHaveJSProperty(selector, property, value);
120
126
  },
121
127
  );
122
128
 
123
129
  // Check if a selector should have a specific role
124
130
  Then(
125
131
  "User expects {string} should have {string} role",
126
- function (selector, role) {
127
- assert.shouldHaveRole(selector, role);
132
+ async function (selector, role) {
133
+ await assert.shouldHaveRole(selector, role);
128
134
  },
129
135
  );
130
136
 
131
137
  // Check if a selector should have a screenshot
132
- Then("User expects {string} should have a screenshot", function (selector) {
133
- assert.shouldHaveScreenshot(selector);
134
- });
138
+ Then(
139
+ "User expects {string} should have a screenshot",
140
+ async function (selector) {
141
+ await assert.shouldHaveScreenshot(selector);
142
+ },
143
+ );
135
144
 
136
145
  // Check if a selector should have specific text
137
146
  Then(
138
147
  "User expects {string} should match {string} text",
139
- function (selector, text) {
140
- assert.shouldHaveText(selector, text);
148
+ async function (selector, text) {
149
+ await assert.shouldHaveText(selector, text);
141
150
  },
142
151
  );
143
152
 
144
153
  // Check if a selector should have a specific value
145
154
  Then(
146
155
  "User expects {string} should have {string} value",
147
- function (selector, value) {
148
- assert.shouldHaveValue(selector, value);
156
+ async function (selector, value) {
157
+ await assert.shouldHaveValue(selector, value);
149
158
  },
150
159
  );
151
160
 
152
161
  // Check if a selector should have specific values
153
162
  Then(
154
163
  "User expects {string} should have {string} values",
155
- function (selector, values) {
156
- assert.shouldHaveValues(selector, values.split(","));
164
+ async function (selector, values) {
165
+ await assert.shouldHaveValues(selector, values.split(","));
157
166
  },
158
167
  );
159
168
 
160
169
  // Check if the page should have a screenshot
161
- Then("User expects the page should have a screenshot", function () {
162
- assert.shouldPageHaveScreenshot();
170
+ Then("User expects the page should have a screenshot", async function () {
171
+ await assert.shouldPageHaveScreenshot();
163
172
  });
164
173
 
165
174
  // Check if the page should have a specific title
166
- Then("User expects the page should have {string} title", function (title) {
167
- assert.shouldPageHaveTitle(title);
168
- });
175
+ Then(
176
+ "User expects the page should have {string} title",
177
+ async function (title) {
178
+ await assert.shouldPageHaveTitle(title);
179
+ },
180
+ );
169
181
 
170
182
  // Check if the page should have a specific URL
171
- Then("User expects the page url should be {string}", function (url) {
172
- assert.shouldPageHaveURL(url);
183
+ Then("User expects the page url should be {string}", async function (url) {
184
+ await assert.shouldPageHaveURL(url);
173
185
  });
174
186
 
175
- Then("User is on {string} page", function (url) {
176
- assert.shouldPageHaveURL(url);
187
+ Then("User is on {string} page", async function (url) {
188
+ await assert.shouldPageHaveURL(url);
177
189
  });
178
190
 
179
191
  // Check if the response should be OK
180
- Then("The response should be OK", function (response) {
181
- assert.shouldResponseBeOK(response);
192
+ Then("The response should be OK", async function (response) {
193
+ await assert.shouldResponseBeOK(response);
182
194
  });
183
195
 
184
196
  // Check if a selector should not be attached
185
- Then("User expects {string} should not be attached", function (selector) {
186
- assert.shouldNotBeAttached(selector);
197
+ Then("User expects {string} should not be attached", async function (selector) {
198
+ await assert.shouldNotBeAttached(selector);
187
199
  });
188
200
 
189
201
  // Check if a selector should not be checked
190
- Then("User expects {string} should not be checked", function (selector) {
191
- assert.shouldNotBeChecked(selector);
202
+ Then("User expects {string} should not be checked", async function (selector) {
203
+ await assert.shouldNotBeChecked(selector);
192
204
  });
193
205
 
194
206
  // Check if a selector should not be disabled
195
- Then("User expects {string} should not be disabled", function (selector) {
196
- assert.shouldNotBeDisabled(selector);
207
+ Then("User expects {string} should not be disabled", async function (selector) {
208
+ await assert.shouldNotBeDisabled(selector);
197
209
  });
198
210
 
199
211
  // Check if a selector should not be editable
200
- Then("User expects {string} should not be editable", function (selector) {
201
- assert.shouldNotBeEditable(selector);
212
+ Then("User expects {string} should not be editable", async function (selector) {
213
+ await assert.shouldNotBeEditable(selector);
202
214
  });
203
215
 
204
216
  // Check if a selector should not be empty
205
- Then("User expects {string} should not be empty", function (selector) {
206
- assert.shouldNotBeEmpty(selector);
217
+ Then("User expects {string} should not be empty", async function (selector) {
218
+ await assert.shouldNotBeEmpty(selector);
207
219
  });
208
220
 
209
221
  // Check if a selector should not be enabled
210
- Then("User expects {string} should not be enabled", function (selector) {
211
- assert.shouldNotBeEnabled(selector);
222
+ Then("User expects {string} should not be enabled", async function (selector) {
223
+ await assert.shouldNotBeEnabled(selector);
212
224
  });
213
225
 
214
226
  // Check if a selector should not be focused
215
- Then("User expects {string} should not be focused", function (selector) {
216
- assert.shouldNotBeFocused(selector);
227
+ Then("User expects {string} should not be focused", async function (selector) {
228
+ await assert.shouldNotBeFocused(selector);
217
229
  });
218
230
 
219
231
  // Check if a selector should not be hidden
220
- Then("User expects {string} should not be hidden", function (selector) {
221
- assert.shouldNotBeHidden(selector);
232
+ Then("User expects {string} should not be hidden", async function (selector) {
233
+ await assert.shouldNotBeHidden(selector);
222
234
  });
223
235
 
224
236
  // Check if a selector should not be in the viewport
225
- Then("User expects {string} should not be on screen", function (selector) {
226
- assert.shouldNotBeInViewport(selector);
227
- });
237
+ Then(
238
+ "User expects {string} should not be on screen",
239
+ async function (selector) {
240
+ await assert.shouldNotBeInViewport(selector);
241
+ },
242
+ );
228
243
 
229
244
  // Check if a selector should not be visible
230
- Then("User expects {string} should not be visible", function (selector) {
231
- assert.shouldNotBeVisible(selector);
245
+ Then("User expects {string} should not be visible", async function (selector) {
246
+ await assert.shouldNotBeVisible(selector);
232
247
  });
233
248
 
234
249
  // Check if a selector should not contain specific text
235
250
  Then(
236
251
  "User expects {string} should not have {string} text",
237
- function (selector, text) {
238
- assert.shouldNotContainText(selector, text);
252
+ async function (selector, text) {
253
+ await assert.shouldNotContainText(selector, text);
239
254
  },
240
255
  );
241
256
 
242
257
  // Check if a selector should not have an accessible description
243
258
  Then(
244
259
  "User expects {string} should not have {string} description",
245
- function (selector, description) {
246
- assert.shouldNotHaveAccessibleDescription(selector, description);
260
+ async function (selector, description) {
261
+ await assert.shouldNotHaveAccessibleDescription(selector, description);
247
262
  },
248
263
  );
249
264
 
250
265
  // Check if a selector should not have an accessible name
251
266
  Then(
252
267
  "User expects {string} should not have {string} name",
253
- function (selector, name) {
254
- assert.shouldNotHaveAccessibleName(selector, name);
268
+ async function (selector, name) {
269
+ await assert.shouldNotHaveAccessibleName(selector, name);
255
270
  },
256
271
  );
257
272
 
258
273
  // Check if a selector should not have a specific attribute with a given value
259
274
  Then(
260
275
  "User expects {string} should not have {string} attribute with {string} value",
261
- function (selector, attribute, value) {
262
- assert.shouldNotHaveAttribute(selector, attribute, value);
276
+ async function (selector, attribute, value) {
277
+ await assert.shouldNotHaveAttribute(selector, attribute, value);
263
278
  },
264
279
  );
265
280
 
266
281
  // Check if a selector should not have a specific class
267
282
  Then(
268
283
  "User expects {string} should not have {string} class",
269
- function (selector, className) {
270
- assert.shouldNotHaveClass(selector, className);
284
+ async function (selector, className) {
285
+ await assert.shouldNotHaveClass(selector, className);
271
286
  },
272
287
  );
273
288
 
274
289
  // Check if a selector should not have a specific count
275
290
  Then(
276
291
  "User expects count of {string} should not be {int}",
277
- function (selector, count) {
278
- assert.shouldNotHaveCount(selector, count);
292
+ async function (selector, count) {
293
+ await assert.shouldNotHaveCount(selector, count);
279
294
  },
280
295
  );
281
296
 
282
297
  // Check if a selector should not have a specific CSS property with a given value
283
298
  Then(
284
299
  "User expects {string} should not have {string} CSS property with {string} value",
285
- function (selector, property, value) {
286
- assert.shouldNotHaveCSS(selector, property, value);
300
+ async function (selector, property, value) {
301
+ await assert.shouldNotHaveCSS(selector, property, value);
287
302
  },
288
303
  );
289
304
 
290
305
  // Check if a selector should not have a specific ID
291
306
  Then(
292
307
  "User expects {string} should not have {string} id",
293
- function (selector, id) {
294
- assert.shouldNotHaveId(selector, id);
308
+ async function (selector, id) {
309
+ await assert.shouldNotHaveId(selector, id);
295
310
  },
296
311
  );
297
312
 
298
313
  // Check if a selector should not have a specific JavaScript property with a given value
299
314
  Then(
300
315
  "User expects {string} should not have {string} JavaScript property with {string} value",
301
- function (selector, property, value) {
302
- assert.shouldNotHaveJSProperty(selector, property, value);
316
+ async function (selector, property, value) {
317
+ await assert.shouldNotHaveJSProperty(selector, property, value);
303
318
  },
304
319
  );
305
320
 
306
321
  // Check if a selector should not have a specific role
307
322
  Then(
308
323
  "User expects {string} should not have {string} role",
309
- function (selector, role) {
310
- assert.shouldNotHaveRole(selector, role);
324
+ async function (selector, role) {
325
+ await assert.shouldNotHaveRole(selector, role);
311
326
  },
312
327
  );
313
328
 
314
329
  // Check if a selector should not have specific text
315
330
  Then(
316
331
  "User expects {string} should not match {string} text",
317
- function (selector, text) {
318
- assert.shouldNotHaveText(selector, text);
332
+ async function (selector, text) {
333
+ await assert.shouldNotHaveText(selector, text);
319
334
  },
320
335
  );
321
336
 
322
337
  // Check if a selector should not have a specific value
323
338
  Then(
324
339
  "User expects {string} should not have {string} value",
325
- function (selector, value) {
326
- assert.shouldNotHaveValue(selector, value);
340
+ async function (selector, value) {
341
+ await assert.shouldNotHaveValue(selector, value);
327
342
  },
328
343
  );
329
344
 
330
345
  // Check if a selector should not have specific values
331
346
  Then(
332
347
  "User expects {string} should not have {string} values",
333
- function (selector, values) {
334
- assert.shouldNotHaveValues(selector, values.split(","));
348
+ async function (selector, values) {
349
+ await assert.shouldNotHaveValues(selector, values.split(","));
335
350
  },
336
351
  );
337
352
 
338
353
  // Check if the page should not have a screenshot
339
- Then("User expects the page should not have a screenshot", function () {
340
- assert.shouldNotPageHaveScreenshot();
354
+ Then("User expects the page should not have a screenshot", async function () {
355
+ await assert.shouldNotPageHaveScreenshot();
341
356
  });
342
357
 
343
358
  // Check if the page should not have a specific title
344
- Then("User expects the page should not have {string} title", function (title) {
345
- assert.shouldNotPageHaveTitle(title);
346
- });
359
+ Then(
360
+ "User expects the page should not have {string} title",
361
+ async function (title) {
362
+ await assert.shouldNotPageHaveTitle(title);
363
+ },
364
+ );
347
365
 
348
366
  // Check if the page should not have a specific URL
349
- Then("User expects the page url should not be {string}", function (url) {
350
- assert.shouldNotPageHaveURL(url);
367
+ Then("User expects the page url should not be {string}", async function (url) {
368
+ await assert.shouldNotPageHaveURL(url);
351
369
  });
352
370
 
353
- Then("User is not on {string} page", function (url) {
354
- assert.shouldNotPageHaveURL(url);
371
+ Then("User is not on {string} page", async function (url) {
372
+ await assert.shouldNotPageHaveURL(url);
355
373
  });
356
374
 
357
375
  // Check if a response should not be OK
358
- Then("The response should not be OK", function (response) {
359
- assert.shouldNotResponseBeOK(response);
376
+ Then("The response should not be OK", async function (response) {
377
+ await assert.shouldNotResponseBeOK(response);
360
378
  });
361
379
 
362
380
  // Check if a selector's value should be equal to the expected value
363
381
  Then(
364
382
  "User expects {string} should be {string} text",
365
- function (selector, expected) {
366
- assert.shouldBe(selector, expected);
383
+ async function (selector, expected) {
384
+ await assert.shouldBe(selector, expected);
367
385
  },
368
386
  );
369
387
 
370
388
  // Check if a selector's value should be close to the expected value within a precision
371
389
  Then(
372
390
  "User expects {string} should be close to {float} with precision {int}",
373
- function (selector, expected, precision) {
374
- assert.shouldBeCloseTo(selector, expected, precision);
391
+ async function (selector, expected, precision) {
392
+ await assert.shouldBeCloseTo(selector, expected, precision);
375
393
  },
376
394
  );
377
395
 
378
396
  // Check if a selector's value should be defined
379
- Then("User expects {string} should be defined", function (selector) {
380
- assert.shouldBeDefined(selector);
397
+ Then("User expects {string} should be defined", async function (selector) {
398
+ await assert.shouldBeDefined(selector);
381
399
  });
382
400
 
383
401
  // Check if a selector's text content should be falsy
384
- Then("User expects {string} should be falsy", function (selector) {
385
- assert.shouldBeFalsy(selector);
402
+ Then("User expects {string} should be falsy", async function (selector) {
403
+ await assert.shouldBeFalsy(selector);
386
404
  });
387
405
 
388
406
  // Check if a selector's value should be greater than the expected value
389
407
  Then(
390
408
  "User expects {string} should be greater than {float}",
391
- function (selector, expected) {
392
- assert.shouldBeGreaterThan(selector, expected);
409
+ async function (selector, expected) {
410
+ await assert.shouldBeGreaterThan(selector, expected);
393
411
  },
394
412
  );
395
413
 
396
414
  // Check if a selector's value should be greater than or equal to the expected value
397
415
  Then(
398
416
  "User expects {string} should be greater than or equal to {float}",
399
- function (selector, expected) {
400
- assert.shouldBeGreaterThanOrEqual(selector, expected);
417
+ async function (selector, expected) {
418
+ await assert.shouldBeGreaterThanOrEqual(selector, expected);
401
419
  },
402
420
  );
403
421
 
404
422
  // Check if a selector's value should be an instance of a specific constructor
405
423
  Then(
406
424
  "User expects {string} should be an instance of {string}",
407
- function (selector, constructor) {
408
- assert.shouldBeInstanceOf(selector, constructor);
425
+ async function (selector, constructor) {
426
+ await assert.shouldBeInstanceOf(selector, constructor);
409
427
  },
410
428
  );
411
429
 
412
430
  // Check if a selector's value should be less than the expected value
413
431
  Then(
414
432
  "User expects {string} should be less than {float}",
415
- function (selector, expected) {
416
- assert.shouldBeLessThan(selector, expected);
433
+ async function (selector, expected) {
434
+ await assert.shouldBeLessThan(selector, expected);
417
435
  },
418
436
  );
419
437
 
420
438
  // Check if a selector's value should be less than or equal to the expected value
421
439
  Then(
422
440
  "User expects {string} should be less than or equal to {float}",
423
- function (selector, expected) {
424
- assert.shouldBeLessThanOrEqual(selector, expected);
441
+ async function (selector, expected) {
442
+ await assert.shouldBeLessThanOrEqual(selector, expected);
425
443
  },
426
444
  );
427
445
 
428
446
  // Check if a selector's value should be NaN
429
- Then("User expects {string} should be NaN", function (selector) {
430
- assert.shouldBeNaN(selector);
447
+ Then("User expects {string} should be NaN", async function (selector) {
448
+ await assert.shouldBeNaN(selector);
431
449
  });
432
450
 
433
451
  // Check if a selector's value should be null
434
- Then("User expects {string} should be null", function (selector) {
435
- assert.shouldBeNull(selector);
452
+ Then("User expects {string} should be null", async function (selector) {
453
+ await assert.shouldBeNull(selector);
436
454
  });
437
455
 
438
456
  // Check if a selector's value should be truthy
439
- Then("User expects {string} should be truthy", function (selector) {
440
- assert.shouldBeTruthy(selector);
457
+ Then("User expects {string} should be truthy", async function (selector) {
458
+ await assert.shouldBeTruthy(selector);
441
459
  });
442
460
 
443
461
  // Check if a selector's value should be undefined
444
- Then("User expects {string} should be undefined", function (selector) {
445
- assert.shouldBeUndefined(selector);
462
+ Then("User expects {string} should be undefined", async function (selector) {
463
+ await assert.shouldBeUndefined(selector);
446
464
  });
447
465
 
448
466
  // Check if a selector's value should contain a specific substring
449
467
  Then(
450
468
  "User expects {string} should have {string} substring",
451
- function (selector, substring) {
452
- assert.shouldContain(selector, substring);
469
+ async function (selector, substring) {
470
+ await assert.shouldContain(selector, substring);
453
471
  },
454
472
  );
455
473
 
456
474
  // Check if a selector's value should contain an equal value
457
475
  Then(
458
476
  "User expects {string} should contain equal {string}",
459
- function (selector, expected) {
460
- assert.shouldContainEqual(selector, expected);
477
+ async function (selector, expected) {
478
+ await assert.shouldContainEqual(selector, expected);
461
479
  },
462
480
  );
463
481
 
464
482
  // Check if a selector's value should equal the expected value
465
- Then("User expects {string} should equal {int}", function (selector, expected) {
466
- assert.shouldEqual(selector, expected);
467
- });
483
+ Then(
484
+ "User expects {string} should equal {int}",
485
+ async function (selector, expected) {
486
+ await assert.shouldEqual(selector, expected);
487
+ },
488
+ );
468
489
 
469
490
  // Check if a selector's text content should have a specific length
470
491
  Then(
471
492
  "User expects length of {string} should be {int}",
472
- function (selector, length) {
473
- assert.shouldHaveLength(selector, length);
493
+ async function (selector, length) {
494
+ await assert.shouldHaveLength(selector, length);
474
495
  },
475
496
  );
476
497
 
477
498
  // Check if a selector's text content should have a specific property
478
499
  Then(
479
500
  "User expects {string} should have {string} property",
480
- function (selector, property) {
481
- assert.shouldHaveProperty(selector, property);
501
+ async function (selector, property) {
502
+ await assert.shouldHaveProperty(selector, property);
482
503
  },
483
504
  );
484
505
 
485
506
  // Check if a selector's text content should match a specific regex
486
507
  Then(
487
508
  "User expects {string} should match {string} regex",
488
- function (selector, regex) {
489
- assert.shouldMatch(selector, new RegExp(regex));
509
+ async function (selector, regex) {
510
+ await assert.shouldMatch(selector, new RegExp(regex));
490
511
  },
491
512
  );
492
513
 
493
514
  // Check if a selector's text content should match a specific object
494
515
  Then(
495
516
  "User expects {string} should match {string} object",
496
- function (selector, object) {
497
- assert.shouldMatchObject(selector, JSON.parse(object));
517
+ async function (selector, object) {
518
+ await assert.shouldMatchObject(selector, JSON.parse(object));
498
519
  },
499
520
  );
500
521
 
501
522
  // Check if a selector's text content should strictly equal the expected value
502
523
  Then(
503
524
  "User expects {string} should strictly equal {string}",
504
- function (selector, expected) {
505
- assert.shouldStrictEqual(selector, expected);
525
+ async function (selector, expected) {
526
+ await assert.shouldStrictEqual(selector, expected);
506
527
  },
507
528
  );
508
529
 
509
- // Check if a function should throw an error
510
- Then("The function should throw", function (fn) {
511
- assert.shouldThrow(fn);
530
+ // Check if a async function should throw an error
531
+ Then("The async function should throw", async function (fn) {
532
+ await assert.shouldThrow(fn);
512
533
  });
513
534
 
514
535
  // Check if the text content of a selector should be an instance of a specific constructor
515
536
  Then(
516
537
  "User expects {string} should be any instance of {string}",
517
- function (selector, constructor) {
518
- assert.shouldAny(selector, constructor);
538
+ async function (selector, constructor) {
539
+ await assert.shouldAny(selector, constructor);
519
540
  },
520
541
  );
521
542
 
522
543
  // Check if the text content of a selector may be anything (truthy)
523
- Then("User expects {string} may be anything", function (selector) {
524
- assert.shouldAnything(selector);
544
+ Then("User expects {string} may be anything", async function (selector) {
545
+ await assert.shouldAnything(selector);
525
546
  });
526
547
 
527
548
  // Check if the text content of a selector should contain any of the specified elements in an array
528
549
  Then(
529
550
  "User expects {string} should contain {string} array elements",
530
- function (selector, elements) {
551
+ async function (selector, elements) {
531
552
  const parsedElements = elements.split(",");
532
- assert.shouldArrayContaining(selector, parsedElements);
553
+ await assert.shouldArrayContaining(selector, parsedElements);
533
554
  },
534
555
  );
535
556
 
536
557
  // Check if the text content of a selector should be close to the expected value within a precision
537
558
  Then(
538
559
  "User expects {string} should be close to {float} with precision {int}",
539
- function (selector, expected, precision) {
540
- assert.shouldCloseTo(selector, expected, precision);
560
+ async function (selector, expected, precision) {
561
+ await assert.shouldCloseTo(selector, expected, precision);
541
562
  },
542
563
  );
543
564
 
544
565
  // Check if the text content of a selector should contain the specified properties in an object
545
566
  Then(
546
567
  "User expects {string} should contain {string} object properties",
547
- function (selector, properties) {
568
+ async function (selector, properties) {
548
569
  const parsedProperties = properties.split(",");
549
- assert.shouldObjectContaining(selector, parsedProperties);
570
+ await assert.shouldObjectContaining(selector, parsedProperties);
550
571
  },
551
572
  );
552
573
 
553
574
  // Check if the text content of a selector should contain a specific substring
554
575
  Then(
555
576
  "User expects {string} should have {string} substring",
556
- function (selector, substring) {
557
- assert.shouldStringContaining(selector, substring);
577
+ async function (selector, substring) {
578
+ await assert.shouldStringContaining(selector, substring);
558
579
  },
559
580
  );
560
581
 
561
582
  // Check if the text content of a selector should match a specific regex
562
583
  Then(
563
584
  "User expects {string} should match {string} regex",
564
- function (selector, regex) {
565
- assert.shouldStringMatching(selector, new RegExp(regex));
585
+ async function (selector, regex) {
586
+ await assert.shouldStringMatching(selector, new RegExp(regex));
566
587
  },
567
588
  );
568
589
 
569
590
  // Check if a selector's text content should not be equal to the expected value
570
591
  Then(
571
- "User expects {string} should not have {string} text",
572
- function (selector, expected) {
573
- assert.shouldNotBe(selector, expected);
592
+ "User expects {string} should not be {string} text",
593
+ async function (selector, expected) {
594
+ await assert.shouldNotBe(selector, expected);
574
595
  },
575
596
  );
576
597
 
577
598
  // Check if a selector's text content should not be close to the expected value within a precision
578
599
  Then(
579
600
  "User expects {string} should not be close to {float} with precision {int}",
580
- function (selector, expected, precision) {
581
- assert.shouldNotBeCloseTo(selector, expected, precision);
601
+ async function (selector, expected, precision) {
602
+ await assert.shouldNotBeCloseTo(selector, expected, precision);
582
603
  },
583
604
  );
584
605
 
585
606
  // Check if a selector's text content should not be defined
586
- Then("User expects {string} should not be defined", function (selector) {
587
- assert.shouldNotBeDefined(selector);
607
+ Then("User expects {string} should not be defined", async function (selector) {
608
+ await assert.shouldNotBeDefined(selector);
588
609
  });
589
610
 
590
611
  // Check if a selector's text content should not be falsy
591
- Then("User expects {string} should not be falsy", function (selector) {
592
- assert.shouldNotBeFalsy(selector);
612
+ Then("User expects {string} should not be falsy", async function (selector) {
613
+ await assert.shouldNotBeFalsy(selector);
593
614
  });
594
615
 
595
616
  // Check if a selector's text content should not be greater than the expected value
596
617
  Then(
597
618
  "User expects {string} should not be greater than {float}",
598
- function (selector, expected) {
599
- assert.shouldNotBeGreaterThan(selector, expected);
619
+ async function (selector, expected) {
620
+ await assert.shouldNotBeGreaterThan(selector, expected);
600
621
  },
601
622
  );
602
623
 
603
624
  // Check if a selector's text content should not be greater than or equal to the expected value
604
625
  Then(
605
626
  "User expects {string} should not be greater than or equal to {float}",
606
- function (selector, expected) {
607
- assert.shouldNotBeGreaterThanOrEqual(selector, expected);
627
+ async function (selector, expected) {
628
+ await assert.shouldNotBeGreaterThanOrEqual(selector, expected);
608
629
  },
609
630
  );
610
631
 
611
632
  // Check if a selector's text content should not be an instance of a specific constructor
612
633
  Then(
613
634
  "User expects {string} should not be an instance of {string}",
614
- function (selector, constructor) {
615
- assert.shouldNotBeInstanceOf(selector, constructor);
635
+ async function (selector, constructor) {
636
+ await assert.shouldNotBeInstanceOf(selector, constructor);
616
637
  },
617
638
  );
618
639
 
619
640
  // Check if a selector's text content should not be less than the expected value
620
641
  Then(
621
642
  "User expects {string} should not be less than {float}",
622
- function (selector, expected) {
623
- assert.shouldNotBeLessThan(selector, expected);
643
+ async function (selector, expected) {
644
+ await assert.shouldNotBeLessThan(selector, expected);
624
645
  },
625
646
  );
626
647
 
627
648
  // Check if a selector's text content should not be less than or equal to the expected value
628
649
  Then(
629
650
  "User expects {string} should not be less than or equal to {float}",
630
- function (selector, expected) {
631
- assert.shouldNotBeLessThanOrEqual(selector, expected);
651
+ async function (selector, expected) {
652
+ await assert.shouldNotBeLessThanOrEqual(selector, expected);
632
653
  },
633
654
  );
634
655
 
635
656
  // Check if a selector's text content should not be NaN
636
- Then("User expects {string} should not be NaN", function (selector) {
637
- assert.shouldNotBeNaN(selector);
657
+ Then("User expects {string} should not be NaN", async function (selector) {
658
+ await assert.shouldNotBeNaN(selector);
638
659
  });
639
660
 
640
661
  // Check if a selector's text content should not be null
641
- Then("User expects {string} should not be null", function (selector) {
642
- assert.shouldNotBeNull(selector);
662
+ Then("User expects {string} should not be null", async function (selector) {
663
+ await assert.shouldNotBeNull(selector);
643
664
  });
644
665
 
645
666
  // Check if a selector's text content should not be truthy
646
- Then("User expects {string} should not be truthy", function (selector) {
647
- assert.shouldNotBeTruthy(selector);
667
+ Then("User expects {string} should not be truthy", async function (selector) {
668
+ await assert.shouldNotBeTruthy(selector);
648
669
  });
649
670
 
650
671
  // Check if a selector's text content should not be undefined
651
- Then("User expects {string} should not be undefined", function (selector) {
652
- assert.shouldNotBeUndefined(selector);
653
- });
672
+ Then(
673
+ "User expects {string} should not be undefined",
674
+ async function (selector) {
675
+ await assert.shouldNotBeUndefined(selector);
676
+ },
677
+ );
654
678
 
655
679
  // Check if a selector's text content should not contain a specific substring
656
680
  Then(
657
681
  "User expects {string} should not have {string} substring",
658
- function (selector, substring) {
659
- assert.shouldNotContain(selector, substring);
682
+ async function (selector, substring) {
683
+ await assert.shouldNotContain(selector, substring);
660
684
  },
661
685
  );
662
686
 
663
687
  // Check if a selector's text content should not contain an equal value
664
688
  Then(
665
689
  "User expects {string} should not contain equal {string}",
666
- function (selector, expected) {
667
- assert.shouldNotContainEqual(selector, expected);
690
+ async function (selector, expected) {
691
+ await assert.shouldNotContainEqual(selector, expected);
668
692
  },
669
693
  );
670
694
 
671
695
  // Check if a selector's text content should not equal the expected value
672
696
  Then(
673
697
  "User expects {string} should not equal {string}",
674
- function (selector, expected) {
675
- assert.shouldNotEqual(selector, expected);
698
+ async function (selector, expected) {
699
+ await assert.shouldNotEqual(selector, expected);
676
700
  },
677
701
  );
678
702
 
679
703
  // Check if a selector's text content should not have a specific length
680
704
  Then(
681
705
  "User expects length of {string} should not be {int} ",
682
- function (selector, length) {
683
- assert.shouldNotHaveLength(selector, length);
706
+ async function (selector, length) {
707
+ await assert.shouldNotHaveLength(selector, length);
684
708
  },
685
709
  );
686
710
 
687
711
  // Check if a selector's text content should not have a specific property
688
712
  Then(
689
713
  "User expects {string} should not have {string} property",
690
- function (selector, property) {
691
- assert.shouldNotHaveProperty(selector, property);
714
+ async function (selector, property) {
715
+ await assert.shouldNotHaveProperty(selector, property);
692
716
  },
693
717
  );
694
718
 
695
719
  // Check if a selector's text content should not match a specific regex
696
720
  Then(
697
721
  "User expects {string} should not match {string} regex",
698
- function (selector, regex) {
699
- assert.shouldNotMatch(selector, new RegExp(regex));
722
+ async function (selector, regex) {
723
+ await assert.shouldNotMatch(selector, new RegExp(regex));
700
724
  },
701
725
  );
702
726
 
703
727
  // Check if a selector's text content should not match a specific object
704
728
  Then(
705
729
  "User expects {string} should not match {string} object",
706
- function (selector, object) {
707
- assert.shouldNotMatchObject(selector, JSON.parse(object));
730
+ async function (selector, object) {
731
+ await assert.shouldNotMatchObject(selector, JSON.parse(object));
708
732
  },
709
733
  );
710
734
 
711
- // Check if a function should not throw an error
712
- Then("The function should not throw", function (fn) {
713
- assert.shouldNotThrow(fn);
735
+ // Check if a async function should not throw an error
736
+ Then("The async function should not throw", async function (fn) {
737
+ await assert.shouldNotThrow(fn);
714
738
  });
715
739
 
716
740
  // Check if a selector's text content should not be any instance of a specific constructor
717
741
  Then(
718
742
  "User expects {string} should not be any instance of {string}",
719
- function (selector, constructor) {
720
- assert.shouldNotAny(selector, constructor);
743
+ async function (selector, constructor) {
744
+ await assert.shouldNotAny(selector, constructor);
721
745
  },
722
746
  );
723
747
 
724
748
  // Check if a selector's text content may not be anything (falsy)
725
- Then("User expects {string} may not be anything", function (selector) {
726
- assert.shouldNotAnything(selector);
749
+ Then("User expects {string} may not be anything", async function (selector) {
750
+ await assert.shouldNotAnything(selector);
727
751
  });
728
752
 
729
753
  // Check if a selector's text content should not contain any of the specified elements in an array
730
754
  Then(
731
755
  "User expects {string} should not contain {string} array elements",
732
- function (selector, elements) {
756
+ async function (selector, elements) {
733
757
  const parsedElements = elements.split(",");
734
- assert.shouldNotArrayContaining(selector, parsedElements);
758
+ await assert.shouldNotArrayContaining(selector, parsedElements);
735
759
  },
736
760
  );
737
761
 
738
762
  // Check if a selector's text content should not be close to the expected value within a precision
739
763
  Then(
740
764
  "User expects {string} should not be close to {float} with precision {int}",
741
- function (selector, expected, precision) {
742
- assert.shouldNotCloseTo(selector, expected, precision);
765
+ async function (selector, expected, precision) {
766
+ await assert.shouldNotCloseTo(selector, expected, precision);
743
767
  },
744
768
  );
745
769
 
746
770
  // Check if a selector's text content should not contain the specified properties in an object
747
771
  Then(
748
772
  "User expects {string} should not contain {string} object properties",
749
- function (selector, properties) {
773
+ async function (selector, properties) {
750
774
  const parsedProperties = JSON.parse(properties);
751
- assert.shouldNotObjectContaining(selector, parsedProperties);
775
+ await assert.shouldNotObjectContaining(selector, parsedProperties);
752
776
  },
753
777
  );
754
778
 
755
779
  // Check if a selector's text content should not contain a specific substring
756
780
  Then(
757
781
  "User expects {string} should not contain {string} substring",
758
- function (selector, substring) {
759
- assert.shouldNotStringContaining(selector, substring);
782
+ async function (selector, substring) {
783
+ await assert.shouldNotStringContaining(selector, substring);
760
784
  },
761
785
  );
762
786
 
763
787
  // Check if a selector's text content should not match a specific regex
764
788
  Then(
765
789
  "User expects {string} should not match {string} regex",
766
- function (selector, regex) {
767
- assert.shouldNotStringMatching(selector, new RegExp(regex));
790
+ async function (selector, regex) {
791
+ await assert.shouldNotStringMatching(selector, new RegExp(regex));
768
792
  },
769
793
  );
@@ -1,3 +0,0 @@
1
- {
2
- "cSpell.words": ["artes"]
3
- }