artes 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +330 -0
  2. package/cucumber.config.js +98 -0
  3. package/executer.js +45 -0
  4. package/functionDefinitions.md +2065 -0
  5. package/index.js +33 -0
  6. package/package.json +35 -0
  7. package/src/helper/contextManager/browserManager.js +44 -0
  8. package/src/helper/contextManager/requestManager.js +10 -0
  9. package/src/helper/executers/cleaner.js +27 -0
  10. package/src/helper/executers/helper.js +32 -0
  11. package/src/helper/executers/projectCreator.js +152 -0
  12. package/src/helper/executers/reportGenerator.js +36 -0
  13. package/src/helper/executers/testRunner.js +35 -0
  14. package/src/helper/executers/versionChecker.js +13 -0
  15. package/src/helper/imports/commons.js +36 -0
  16. package/src/helper/pomController/elementController.js +24 -0
  17. package/src/helper/pomController/pomCollector.js +18 -0
  18. package/src/helper/stepFunctions/actionCommons.js +15 -0
  19. package/src/helper/stepFunctions/assertions.js +421 -0
  20. package/src/helper/stepFunctions/elementInteractions.js +38 -0
  21. package/src/helper/stepFunctions/frameActions.js +50 -0
  22. package/src/helper/stepFunctions/keyboardActions.js +29 -0
  23. package/src/helper/stepFunctions/mouseActions.js +97 -0
  24. package/src/helper/stepFunctions/pageActions.js +14 -0
  25. package/src/hooks/context.js +12 -0
  26. package/src/hooks/hooks.js +53 -0
  27. package/src/tests/stepDefinitions/assertions.steps.js +769 -0
  28. package/src/tests/stepDefinitions/frameActions.steps.js +76 -0
  29. package/src/tests/stepDefinitions/keyboardActions.steps.js +72 -0
  30. package/src/tests/stepDefinitions/mouseActions.steps.js +224 -0
  31. package/src/tests/stepDefinitions/page.steps.js +30 -0
  32. package/stepDefinitions.md +267 -0
@@ -0,0 +1,2065 @@
1
+ ## đŸ“‹ Simplified Functions
2
+
3
+ If you don't want to deal with Playwright methods directly, you can simply use the following predefined actions methods by import them:
4
+
5
+ ```javascript
6
+ const { mouse, keyboard, frame, elementInteractions, page } = require("artes");
7
+ ```
8
+
9
+ - **Mouse Actions:**
10
+ `mouse.click(element)`
11
+
12
+ - **Keyboard Actions:**
13
+ `keyboard.press(key)`
14
+
15
+ - **Element Interactions:**
16
+ `elementInteractions.isChecked()`
17
+
18
+ - **Assertions:**
19
+ `assert.shouldBeTruthy(element)`
20
+
21
+ - **Frame Actions:**
22
+ `frame.first()`
23
+
24
+ ---
25
+
26
+ ## Table of Contents
27
+
28
+ - [Mouse Functions](#mouse-functions)
29
+ - [Keyboard Functions](#keyboard-functions)
30
+ - [Assertions Functions](#assertions-functions)
31
+ - [Page Functions](#page-functions)
32
+ - [Frame Functions](#frame-functions)
33
+
34
+ ### **Mouse Functions**
35
+
36
+ #### `click(selector)`
37
+
38
+ Clicks on the specified element.
39
+
40
+ ```javascript
41
+ await click("button#submit");
42
+ ```
43
+
44
+ ---
45
+
46
+ #### `forceClick(selector)`
47
+
48
+ Clicks on the specified element, forcing the action even if not visible.
49
+
50
+ ```javascript
51
+ await forceClick("button#hiddenSubmit");
52
+ ```
53
+
54
+ ---
55
+
56
+ #### `clickPosition(selector, position)`
57
+
58
+ Clicks on a specific position within the element, specified as `x,y`.
59
+
60
+ ```javascript
61
+ await clickPosition("div#map", "50,100");
62
+ ```
63
+
64
+ ---
65
+
66
+ #### `forceClickPosition(selector, position)`
67
+
68
+ Forces a click at a specific position within the element.
69
+
70
+ ```javascript
71
+ await forceClickPosition("div#map", "50,100");
72
+ ```
73
+
74
+ ---
75
+
76
+ #### `rightClick(selector)`
77
+
78
+ Performs a right-click on the element.
79
+
80
+ ```javascript
81
+ await rightClick("div#contextMenu");
82
+ ```
83
+
84
+ ---
85
+
86
+ #### `forceRightClick(selector)`
87
+
88
+ Forces a right-click on the element.
89
+
90
+ ```javascript
91
+ await forceRightClick("div#hiddenContextMenu");
92
+ ```
93
+
94
+ ---
95
+
96
+ #### `leftClick(selector)`
97
+
98
+ Performs a left-click on the element (default click).
99
+
100
+ ```javascript
101
+ await leftClick("button#start");
102
+ ```
103
+
104
+ ---
105
+
106
+ #### `forceLeftClick(selector)`
107
+
108
+ Forces a left-click on the element.
109
+
110
+ ```javascript
111
+ await forceLeftClick("button#hiddenStart");
112
+ ```
113
+
114
+ ---
115
+
116
+ #### `doubleClick(selector)`
117
+
118
+ Performs a double-click on the element.
119
+
120
+ ```javascript
121
+ await doubleClick("input#textBox");
122
+ ```
123
+
124
+ ---
125
+
126
+ #### `forceDoubleClick(selector)`
127
+
128
+ Forces a double-click on the element.
129
+
130
+ ```javascript
131
+ await forceDoubleClick("input#hiddenTextBox");
132
+ ```
133
+
134
+ ---
135
+
136
+ #### `forceDoubleClickPosition(selector, position)`
137
+
138
+ Forces a double-click at a specific position within the element.
139
+
140
+ ```javascript
141
+ await forceDoubleClickPosition("div#image", "100,150");
142
+ ```
143
+
144
+ ---
145
+
146
+ ### **Hover Functions**
147
+
148
+ #### `hover(selector)`
149
+
150
+ Moves the mouse pointer over the element.
151
+
152
+ ```javascript
153
+ await hover("button#hoverMe");
154
+ ```
155
+
156
+ ---
157
+
158
+ #### `forceHover(selector)`
159
+
160
+ Forces a hover action over the element.
161
+
162
+ ```javascript
163
+ await forceHover("button#hiddenHoverMe");
164
+ ```
165
+
166
+ ---
167
+
168
+ #### `hoverPosition(selector, position)`
169
+
170
+ Hovers at a specific position within the element.
171
+
172
+ ```javascript
173
+ await hoverPosition("div#image", "75,50");
174
+ ```
175
+
176
+ ---
177
+
178
+ #### `forceHoverPosition(selector, position)`
179
+
180
+ Forces a hover at a specific position within the element.
181
+
182
+ ```javascript
183
+ await forceHoverPosition("div#hiddenImage", "75,50");
184
+ ```
185
+
186
+ ---
187
+
188
+ ### **Focus Functions**
189
+
190
+ #### `focus(selector)`
191
+
192
+ Focuses on the specified element.
193
+
194
+ ```javascript
195
+ await focus("input#username");
196
+ ```
197
+
198
+ ---
199
+
200
+ #### `forceFocus(selector)`
201
+
202
+ Forces focus on the specified element.
203
+
204
+ ```javascript
205
+ await forceFocus("input#hiddenUsername");
206
+ ```
207
+
208
+ ---
209
+
210
+ #### `focusPosition(selector, position)`
211
+
212
+ Focuses on a specific position within the element.
213
+
214
+ ```javascript
215
+ await focusPosition("div#editor", "200,300");
216
+ ```
217
+
218
+ ---
219
+
220
+ #### `forceFocusPosition(selector, position)`
221
+
222
+ Forces focus at a specific position within the element.
223
+
224
+ ```javascript
225
+ await forceFocusPosition("div#hiddenEditor", "200,300");
226
+ ```
227
+
228
+ ---
229
+
230
+ ### **Drag-and-Drop Functions**
231
+
232
+ #### `dragAndDrop(sourceSelector, targetSelector)`
233
+
234
+ Drags an element from the source and drops it at the target.
235
+
236
+ ```javascript
237
+ await dragAndDrop("div#source", "div#target");
238
+ ```
239
+
240
+ ---
241
+
242
+ #### `dragAndDropPosition(sourceSelector, position)`
243
+
244
+ Drags an element and drops it at a specified position.
245
+
246
+ ```javascript
247
+ await dragAndDropPosition("div#source", "300,400");
248
+ ```
249
+
250
+ ---
251
+
252
+ ### **Select Functions**
253
+
254
+ #### `selectByValue(selector, value)`
255
+
256
+ Selects an option in a dropdown by value.
257
+
258
+ ```javascript
259
+ await selectByValue("select#dropdown", "value1,value2");
260
+ ```
261
+
262
+ ---
263
+
264
+ #### `selectByText(selector, value)`
265
+
266
+ Selects an option in a dropdown by visible text.
267
+
268
+ ```javascript
269
+ await selectByText("select#dropdown", "Option 1");
270
+ ```
271
+
272
+ ---
273
+
274
+ ### **Checkbox Functions**
275
+
276
+ #### `check(selector)`
277
+
278
+ Checks the specified checkbox.
279
+
280
+ ```javascript
281
+ await check("input#termsCheckbox");
282
+ ```
283
+
284
+ ---
285
+
286
+ #### `uncheck(selector)`
287
+
288
+ Unchecks the specified checkbox.
289
+
290
+ ```javascript
291
+ await uncheck("input#termsCheckbox");
292
+ ```
293
+
294
+ ---
295
+
296
+ ### **Scroll Functions**
297
+
298
+ #### `scrollIntoViewIfNeeded(selector)`
299
+
300
+ Scrolls the element into view if it is not already visible.
301
+
302
+ ```javascript
303
+ await scrollIntoViewIfNeeded("div#content");
304
+ ```
305
+
306
+ ---
307
+
308
+ ### **Keyboard Functions**
309
+
310
+ #### `press(selector, key)`
311
+
312
+ Simulates a key press on the specified element.
313
+
314
+ ```javascript
315
+ await press("input#searchBox", "Enter");
316
+ ```
317
+
318
+ ---
319
+
320
+ #### `pressSequentially(selector, keys)`
321
+
322
+ Presses a sequence of keys on the specified element.
323
+
324
+ ```javascript
325
+ await pressSequentially("input#textField", ["Shift", "A", "B", "C"]);
326
+ ```
327
+
328
+ ---
329
+
330
+ #### `pressSequentiallyDelay(selector, keys, delay)`
331
+
332
+ Presses a sequence of keys on the specified element with a delay between each key press.
333
+
334
+ ```javascript
335
+ await pressSequentiallyDelay("input#textField", ["H", "E", "L", "L", "O"], 200);
336
+ ```
337
+
338
+ ---
339
+
340
+ #### `fill(selector, value)`
341
+
342
+ Fills the specified element (like an input field) with the provided value.
343
+
344
+ ```javascript
345
+ await fill("input#email", "example@example.com");
346
+ ```
347
+
348
+ ---
349
+
350
+ #### `clear(selector)`
351
+
352
+ Clears the value of the specified input field.
353
+
354
+ ```javascript
355
+ await clear("input#email");
356
+ ```
357
+
358
+ ---
359
+
360
+ #### `selectText(selector)`
361
+
362
+ Selects the text within the specified element.
363
+
364
+ ```javascript
365
+ await selectText("input#email");
366
+ ```
367
+
368
+ ---
369
+
370
+ #### `setInputFiles(selector, files)`
371
+
372
+ Sets the specified file(s) to an input field.
373
+
374
+ ```javascript
375
+ await setInputFiles("input#fileUpload", [
376
+ "path/to/file1.png",
377
+ "path/to/file2.jpg",
378
+ ]);
379
+ ```
380
+
381
+ ### **Page Functions**
382
+
383
+ #### `navigateTo(url)`
384
+
385
+ Navigates to the specified URL in the current page context.
386
+
387
+ ```javascript
388
+ await navigateTo("https://example.com");
389
+ ```
390
+
391
+ - **Parameters**:
392
+ - `url` _(string)_: The URL to navigate to.
393
+
394
+ ---
395
+
396
+ #### `getURL()`
397
+
398
+ Retrieves the current URL of the page.
399
+
400
+ ```javascript
401
+ const currentURL = await getURL();
402
+ ```
403
+
404
+ - **Returns**:
405
+ - _(string)_: The current page URL.
406
+
407
+ ### **Assertion Functions**
408
+
409
+ #### `shouldBeAttached(selector)`
410
+
411
+ Asserts that the element is attached to the DOM.
412
+
413
+ ```javascript
414
+ await shouldBeAttached("#element-id");
415
+ ```
416
+
417
+ ---
418
+
419
+ #### `shouldBeChecked(selector)`
420
+
421
+ Asserts that the element is checked (e.g., a checkbox).
422
+
423
+ ```javascript
424
+ await shouldBeChecked("#checkbox-id");
425
+ ```
426
+
427
+ ---
428
+
429
+ #### `shouldBeDisabled(selector)`
430
+
431
+ Asserts that the element is disabled.
432
+
433
+ ```javascript
434
+ await shouldBeDisabled("#button-id");
435
+ ```
436
+
437
+ ---
438
+
439
+ #### `shouldBeEditable(selector)`
440
+
441
+ Asserts that the element is editable (e.g., an input field).
442
+
443
+ ```javascript
444
+ await shouldBeEditable("#input-id");
445
+ ```
446
+
447
+ ---
448
+
449
+ #### `shouldBeEmpty(selector)`
450
+
451
+ Asserts that the element has no content.
452
+
453
+ ```javascript
454
+ await shouldBeEmpty("#container-id");
455
+ ```
456
+
457
+ ---
458
+
459
+ #### `shouldBeEnabled(selector)`
460
+
461
+ Asserts that the element is enabled.
462
+
463
+ ```javascript
464
+ await shouldBeEnabled("#button-id");
465
+ ```
466
+
467
+ ---
468
+
469
+ #### `shouldBeFocused(selector)`
470
+
471
+ Asserts that the element is currently focused.
472
+
473
+ ```javascript
474
+ await shouldBeFocused("#input-id");
475
+ ```
476
+
477
+ ---
478
+
479
+ #### `shouldBeHidden(selector)`
480
+
481
+ Asserts that the element is hidden.
482
+
483
+ ```javascript
484
+ await shouldBeHidden("#hidden-element-id");
485
+ ```
486
+
487
+ ---
488
+
489
+ #### `shouldBeInViewport(selector)`
490
+
491
+ Asserts that the element is visible within the viewport.
492
+
493
+ ```javascript
494
+ await shouldBeInViewport("#element-id");
495
+ ```
496
+
497
+ ---
498
+
499
+ #### `shouldBeVisible(selector)`
500
+
501
+ Asserts that the element is visible.
502
+
503
+ ```javascript
504
+ await shouldBeVisible("#visible-element-id");
505
+ ```
506
+
507
+ ---
508
+
509
+ #### `shouldContainText(selector, text)`
510
+
511
+ Asserts that the element contains the specified text.
512
+
513
+ ```javascript
514
+ await shouldContainText("#element-id", "Expected Text");
515
+ ```
516
+
517
+ - **Parameters**:
518
+ - `text` _(string)_: The text to check for.
519
+
520
+ ---
521
+
522
+ #### `shouldHaveAccessibleDescription(selector, description)`
523
+
524
+ Asserts that the element has the specified accessible description.
525
+
526
+ ```javascript
527
+ await shouldHaveAccessibleDescription("#element-id", "Description");
528
+ ```
529
+
530
+ - **Parameters**:
531
+ - `description` _(string)_: The expected accessible description.
532
+
533
+ ---
534
+
535
+ #### `shouldHaveAccessibleName(selector, name)`
536
+
537
+ Asserts that the element has the specified accessible name.
538
+
539
+ ```javascript
540
+ await shouldHaveAccessibleName("#element-id", "Name");
541
+ ```
542
+
543
+ - **Parameters**:
544
+ - `name` _(string)_: The expected accessible name.
545
+
546
+ ---
547
+
548
+ #### `shouldHaveAttribute(selector, attribute, value)`
549
+
550
+ Asserts that the element has the specified attribute with the given value.
551
+
552
+ ```javascript
553
+ await shouldHaveAttribute("#element-id", "data-type", "example");
554
+ ```
555
+
556
+ - **Parameters**:
557
+ - `attribute` _(string)_: The attribute to check.
558
+ - `value` _(string)_: The expected value of the attribute.
559
+
560
+ ---
561
+
562
+ #### `shouldHaveClass(selector, className)`
563
+
564
+ Asserts that the element has the specified class.
565
+
566
+ ```javascript
567
+ await shouldHaveClass("#element-id", "active-class");
568
+ ```
569
+
570
+ - **Parameters**:
571
+ - `className` _(string)_: The expected class name.
572
+
573
+ ---
574
+
575
+ #### `shouldHaveCount(selector, count)`
576
+
577
+ Asserts that the number of matching elements equals the specified count.
578
+
579
+ ```javascript
580
+ await shouldHaveCount(".list-item", 5);
581
+ ```
582
+
583
+ - **Parameters**:
584
+ - `count` _(number)_: The expected number of elements.
585
+
586
+ ---
587
+
588
+ #### `shouldHaveCSS(selector, property, value)`
589
+
590
+ Asserts that the element has the specified CSS property with the given value.
591
+
592
+ ```javascript
593
+ await shouldHaveCSS("#element-id", "color", "red");
594
+ ```
595
+
596
+ - **Parameters**:
597
+ - `property` _(string)_: The CSS property to check.
598
+ - `value` _(string)_: The expected value of the property.
599
+
600
+ ---
601
+
602
+ #### `shouldHaveId(selector, id)`
603
+
604
+ Asserts that the element has the specified ID.
605
+
606
+ ```javascript
607
+ await shouldHaveId("#element-id", "unique-id");
608
+ ```
609
+
610
+ - **Parameters**:
611
+
612
+ - `id` _(string)_: The expected ID.
613
+
614
+ Got it! Here’s the refined format for the assertion methods:
615
+
616
+ ---
617
+
618
+ #### `shouldHaveJSProperty(selector, property, value)`
619
+
620
+ Asserts that the element has the specified JavaScript property with the expected value.
621
+
622
+ ```javascript
623
+ await shouldHaveJSProperty("#element", "disabled", true);
624
+ ```
625
+
626
+ - **Parameters**:
627
+ - `selector` _(string)_: The target element’s selector.
628
+ - `property` _(string)_: The JavaScript property to check.
629
+ - `value` _(any)_: The expected value of the property.
630
+
631
+ ---
632
+
633
+ #### `shouldHaveRole(selector, role)`
634
+
635
+ Asserts that the element has the specified role.
636
+
637
+ ```javascript
638
+ await shouldHaveRole("#element", "button");
639
+ ```
640
+
641
+ - **Parameters**:
642
+ - `selector` _(string)_: The target element’s selector.
643
+ - `role` _(string)_: The expected role of the element.
644
+
645
+ ---
646
+
647
+ #### `shouldHaveScreenshot(selector)`
648
+
649
+ Asserts that the element has a screenshot.
650
+
651
+ ```javascript
652
+ await shouldHaveScreenshot("#element");
653
+ ```
654
+
655
+ - **Parameters**:
656
+ - `selector` _(string)_: The target element’s selector.
657
+
658
+ ---
659
+
660
+ #### `shouldHaveText(selector, text)`
661
+
662
+ Asserts that the element contains the specified text.
663
+
664
+ ```javascript
665
+ await shouldHaveText("#element", "Hello World");
666
+ ```
667
+
668
+ - **Parameters**:
669
+ - `selector` _(string)_: The target element’s selector.
670
+ - `text` _(string)_: The expected text in the element.
671
+
672
+ ---
673
+
674
+ #### `shouldHaveValue(selector, value)`
675
+
676
+ Asserts that the element has the specified value.
677
+
678
+ ```javascript
679
+ await shouldHaveValue("#input-field", "test value");
680
+ ```
681
+
682
+ - **Parameters**:
683
+ - `selector` _(string)_: The target element’s selector.
684
+ - `value` _(string)_: The expected value of the element.
685
+
686
+ ---
687
+
688
+ #### `shouldHaveValues(selector, values)`
689
+
690
+ Asserts that the element has the specified values.
691
+
692
+ ```javascript
693
+ await shouldHaveValues("#multi-select", ["Option 1", "Option 2"]);
694
+ ```
695
+
696
+ - **Parameters**:
697
+ - `selector` _(string)_: The target element’s selector.
698
+ - `values` _(array)_: The expected values in the element.
699
+
700
+ ---
701
+
702
+ #### `shouldPageHaveScreenshot()`
703
+
704
+ Asserts that the current page has a screenshot.
705
+
706
+ ```javascript
707
+ await shouldPageHaveScreenshot();
708
+ ```
709
+
710
+ - **Parameters**:
711
+ None
712
+
713
+ ---
714
+
715
+ #### `shouldPageHaveTitle(title)`
716
+
717
+ Asserts that the page has the specified title.
718
+
719
+ ```javascript
720
+ await shouldPageHaveTitle("Page Title");
721
+ ```
722
+
723
+ - **Parameters**:
724
+ - `title` _(string)_: The expected title of the page.
725
+
726
+ ---
727
+
728
+ #### `shouldPageHaveURL(url)`
729
+
730
+ Asserts that the page has the specified URL.
731
+
732
+ ```javascript
733
+ await shouldPageHaveURL("https://www.example.com");
734
+ ```
735
+
736
+ - **Parameters**:
737
+ - `url` _(string)_: The expected URL of the page.
738
+
739
+ ---
740
+
741
+ #### `shouldResponseBeOK(response)`
742
+
743
+ Asserts that the response status is OK (200).
744
+
745
+ ```javascript
746
+ await shouldResponseBeOK(response);
747
+ ```
748
+
749
+ - **Parameters**:
750
+ - `response` _(object)_: The response object to check.
751
+
752
+ #### `shouldNotBeAttached(selector)`
753
+
754
+ Asserts that the element is not attached to the DOM.
755
+
756
+ ```javascript
757
+ await shouldNotBeAttached("#element");
758
+ ```
759
+
760
+ - **Parameters**:
761
+ - `selector` _(string)_: The target element’s selector.
762
+
763
+ ---
764
+
765
+ #### `shouldNotBeChecked(selector)`
766
+
767
+ Asserts that the element is not checked.
768
+
769
+ ```javascript
770
+ await shouldNotBeChecked("#checkbox");
771
+ ```
772
+
773
+ - **Parameters**:
774
+ - `selector` _(string)_: The target element’s selector.
775
+
776
+ ---
777
+
778
+ #### `shouldNotBeDisabled(selector)`
779
+
780
+ Asserts that the element is not disabled.
781
+
782
+ ```javascript
783
+ await shouldNotBeDisabled("#button");
784
+ ```
785
+
786
+ - **Parameters**:
787
+ - `selector` _(string)_: The target element’s selector.
788
+
789
+ ---
790
+
791
+ #### `shouldNotBeEditable(selector)`
792
+
793
+ Asserts that the element is not editable.
794
+
795
+ ```javascript
796
+ await shouldNotBeEditable("#input");
797
+ ```
798
+
799
+ - **Parameters**:
800
+ - `selector` _(string)_: The target element’s selector.
801
+
802
+ ---
803
+
804
+ #### `shouldNotBeEmpty(selector)`
805
+
806
+ Asserts that the element is not empty.
807
+
808
+ ```javascript
809
+ await shouldNotBeEmpty("#input-field");
810
+ ```
811
+
812
+ - **Parameters**:
813
+ - `selector` _(string)_: The target element’s selector.
814
+
815
+ ---
816
+
817
+ #### `shouldNotBeEnabled(selector)`
818
+
819
+ Asserts that the element is not enabled.
820
+
821
+ ```javascript
822
+ await shouldNotBeEnabled("#button");
823
+ ```
824
+
825
+ - **Parameters**:
826
+ - `selector` _(string)_: The target element’s selector.
827
+
828
+ ---
829
+
830
+ #### `shouldNotBeFocused(selector)`
831
+
832
+ Asserts that the element is not focused.
833
+
834
+ ```javascript
835
+ await shouldNotBeFocused("#element");
836
+ ```
837
+
838
+ - **Parameters**:
839
+ - `selector` _(string)_: The target element’s selector.
840
+
841
+ ---
842
+
843
+ #### `shouldNotBeHidden(selector)`
844
+
845
+ Asserts that the element is not hidden.
846
+
847
+ ```javascript
848
+ await shouldNotBeHidden("#element");
849
+ ```
850
+
851
+ - **Parameters**:
852
+ - `selector` _(string)_: The target element’s selector.
853
+
854
+ ---
855
+
856
+ #### `shouldNotBeInViewport(selector)`
857
+
858
+ Asserts that the element is not in the viewport.
859
+
860
+ ```javascript
861
+ await shouldNotBeInViewport("#element");
862
+ ```
863
+
864
+ - **Parameters**:
865
+ - `selector` _(string)_: The target element’s selector.
866
+
867
+ ---
868
+
869
+ #### `shouldNotBeVisible(selector)`
870
+
871
+ Asserts that the element is not visible.
872
+
873
+ ```javascript
874
+ await shouldNotBeVisible("#element");
875
+ ```
876
+
877
+ - **Parameters**:
878
+ - `selector` _(string)_: The target element’s selector.
879
+
880
+ ---
881
+
882
+ #### `shouldNotContainText(selector, text)`
883
+
884
+ Asserts that the element does not contain the specified text.
885
+
886
+ ```javascript
887
+ await shouldNotContainText("#element", "Some text");
888
+ ```
889
+
890
+ - **Parameters**:
891
+ - `selector` _(string)_: The target element’s selector.
892
+ - `text` _(string)_: The text that should not be present in the element.
893
+
894
+ ---
895
+
896
+ #### `shouldNotHaveAccessibleDescription(selector, description)`
897
+
898
+ Asserts that the element does not have the specified accessible description.
899
+
900
+ ```javascript
901
+ await shouldNotHaveAccessibleDescription("#element", "Description");
902
+ ```
903
+
904
+ - **Parameters**:
905
+ - `selector` _(string)_: The target element’s selector.
906
+ - `description` _(string)_: The description that should not be associated with the element.
907
+
908
+ ---
909
+
910
+ #### `shouldNotHaveAccessibleName(selector, name)`
911
+
912
+ Asserts that the element does not have the specified accessible name.
913
+
914
+ ```javascript
915
+ await shouldNotHaveAccessibleName("#element", "Element Name");
916
+ ```
917
+
918
+ - **Parameters**:
919
+ - `selector` _(string)_: The target element’s selector.
920
+ - `name` _(string)_: The name that should not be associated with the element.
921
+
922
+ ---
923
+
924
+ #### `shouldNotHaveAttribute(selector, attribute, value)`
925
+
926
+ Asserts that the element does not have the specified attribute with the given value.
927
+
928
+ ```javascript
929
+ await shouldNotHaveAttribute("#element", "type", "submit");
930
+ ```
931
+
932
+ - **Parameters**:
933
+ - `selector` _(string)_: The target element’s selector.
934
+ - `attribute` _(string)_: The attribute to check.
935
+ - `value` _(string)_: The expected value of the attribute.
936
+
937
+ ---
938
+
939
+ #### `shouldNotHaveClass(selector, className)`
940
+
941
+ Asserts that the element does not have the specified class.
942
+
943
+ ```javascript
944
+ await shouldNotHaveClass("#element", "disabled");
945
+ ```
946
+
947
+ - **Parameters**:
948
+ - `selector` _(string)_: The target element’s selector.
949
+ - `className` _(string)_: The class that should not be associated with the element.
950
+
951
+ ---
952
+
953
+ #### `shouldNotHaveCount(selector, count)`
954
+
955
+ Asserts that the number of elements matching the selector is not equal to the specified count.
956
+
957
+ ```javascript
958
+ await shouldNotHaveCount("#element", 5);
959
+ ```
960
+
961
+ - **Parameters**:
962
+ - `selector` _(string)_: The target element’s selector.
963
+ - `count` _(number)_: The expected count of elements.
964
+
965
+ ---
966
+
967
+ #### `shouldNotHaveCSS(selector, property, value)`
968
+
969
+ Asserts that the element does not have the specified CSS property with the given value.
970
+
971
+ ```javascript
972
+ await shouldNotHaveCSS("#element", "color", "red");
973
+ ```
974
+
975
+ - **Parameters**:
976
+ - `selector` _(string)_: The target element’s selector.
977
+ - `property` _(string)_: The CSS property to check.
978
+ - `value` _(string)_: The expected value of the property.
979
+
980
+ ---
981
+
982
+ #### `shouldNotHaveId(selector, id)`
983
+
984
+ Asserts that the element does not have the specified ID.
985
+
986
+ ```javascript
987
+ await shouldNotHaveId("#element", "unique-id");
988
+ ```
989
+
990
+ - **Parameters**:
991
+ - `selector` _(string)_: The target element’s selector.
992
+ - `id` _(string)_: The ID that should not be associated with the element.
993
+
994
+ ---
995
+
996
+ #### `shouldNotHaveJSProperty(selector, property, value)`
997
+
998
+ Asserts that the element does not have the specified JavaScript property with the given value.
999
+
1000
+ ```javascript
1001
+ await shouldNotHaveJSProperty("#element", "disabled", true);
1002
+ ```
1003
+
1004
+ - **Parameters**:
1005
+ - `selector` _(string)_: The target element’s selector.
1006
+ - `property` _(string)_: The JavaScript property to check.
1007
+ - `value` _(any)_: The value that the property should not have.
1008
+
1009
+ ---
1010
+
1011
+ #### `shouldNotHaveRole(selector, role)`
1012
+
1013
+ Asserts that the element does not have the specified role.
1014
+
1015
+ ```javascript
1016
+ await shouldNotHaveRole("#element", "button");
1017
+ ```
1018
+
1019
+ - **Parameters**:
1020
+ - `selector` _(string)_: The target element’s selector.
1021
+ - `role` _(string)_: The role that should not be associated with the element.
1022
+
1023
+ ---
1024
+
1025
+ #### `shouldNotHaveScreenshot(selector)`
1026
+
1027
+ Asserts that the element does not have a screenshot.
1028
+
1029
+ ```javascript
1030
+ await shouldNotHaveScreenshot("#element");
1031
+ ```
1032
+
1033
+ - **Parameters**:
1034
+ - `selector` _(string)_: The target element’s selector.
1035
+
1036
+ ---
1037
+
1038
+ #### `shouldNotHaveText(selector, text)`
1039
+
1040
+ Asserts that the element does not contain the specified text.
1041
+
1042
+ ```javascript
1043
+ await shouldNotHaveText("#element", "Some text");
1044
+ ```
1045
+
1046
+ - **Parameters**:
1047
+ - `selector` _(string)_: The target element’s selector.
1048
+ - `text` _(string)_: The text that should not be present in the element.
1049
+
1050
+ ---
1051
+
1052
+ #### `shouldNotHaveValue(selector, value)`
1053
+
1054
+ Asserts that the element does not have the specified value.
1055
+
1056
+ ```javascript
1057
+ await shouldNotHaveValue("#element", "input value");
1058
+ ```
1059
+
1060
+ - **Parameters**:
1061
+ - `selector` _(string)_: The target element’s selector.
1062
+ - `value` _(string)_: The value that should not be present in the element.
1063
+
1064
+ ---
1065
+
1066
+ #### `shouldNotHaveValues(selector, values)`
1067
+
1068
+ Asserts that the element does not have the specified values.
1069
+
1070
+ ```javascript
1071
+ await shouldNotHaveValues("#element", ["value1", "value2"]);
1072
+ ```
1073
+
1074
+ - **Parameters**:
1075
+ - `selector` _(string)_: The target element’s selector.
1076
+ - `values` _(array)_: The values that should not be present in the element.
1077
+
1078
+ ---
1079
+
1080
+ #### `shouldNotPageHaveScreenshot()`
1081
+
1082
+ Asserts that the page does not have a screenshot.
1083
+
1084
+ ```javascript
1085
+ await shouldNotPageHaveScreenshot();
1086
+ ```
1087
+
1088
+ - **Parameters**:
1089
+ - None.
1090
+
1091
+ ---
1092
+
1093
+ #### `shouldNotPageHaveTitle(title)`
1094
+
1095
+ Asserts that the page does not have the specified title.
1096
+
1097
+ ```javascript
1098
+ await shouldNotPageHaveTitle("Page Title");
1099
+ ```
1100
+
1101
+ - **Parameters**:
1102
+ - `title` _(string)_: The title that should not be associated with the page.
1103
+
1104
+ ---
1105
+
1106
+ #### `shouldNotPageHaveURL(url)`
1107
+
1108
+ Asserts that the page does not have the specified URL.
1109
+
1110
+ ```javascript
1111
+ await shouldNotPageHaveURL("https://example.com");
1112
+ ```
1113
+
1114
+ - **Parameters**:
1115
+ - `url` _(string)_: The URL that should not be associated with the page.
1116
+
1117
+ ---
1118
+
1119
+ #### `shouldNotResponseBeOK(response)`
1120
+
1121
+ Asserts that the response is not OK (status code 200).
1122
+
1123
+ ```javascript
1124
+ await shouldNotResponseBeOK(response);
1125
+ ```
1126
+
1127
+ - **Parameters**:
1128
+ - `response` _(object)_: The response object to check.
1129
+
1130
+ ---
1131
+
1132
+ #### `shouldBe(selector, expected)`
1133
+
1134
+ Asserts that the element’s text content is equal to the expected value.
1135
+
1136
+ ```javascript
1137
+ await shouldBe("#element", "expected text");
1138
+ ```
1139
+
1140
+ - **Parameters**:
1141
+ - `selector` _(string)_: The target element’s selector.
1142
+ - `expected` _(string)_: The expected text content.
1143
+
1144
+ ---
1145
+
1146
+ #### `shouldBeCloseTo(selector, expected, precision)`
1147
+
1148
+ Asserts that the element’s text content is a number close to the expected value, within the specified precision.
1149
+
1150
+ ```javascript
1151
+ await shouldBeCloseTo("#element", 100, 2);
1152
+ ```
1153
+
1154
+ - **Parameters**:
1155
+ - `selector` _(string)_: The target element’s selector.
1156
+ - `expected` _(number)_: The expected value.
1157
+ - `precision` _(number)_: The allowed precision (number of decimal places).
1158
+
1159
+ ---
1160
+
1161
+ #### `shouldBeDefined(selector)`
1162
+
1163
+ Asserts that the element’s text content is defined.
1164
+
1165
+ ```javascript
1166
+ await shouldBeDefined("#element");
1167
+ ```
1168
+
1169
+ - **Parameters**:
1170
+ - `selector` _(string)_: The target element’s selector.
1171
+
1172
+ ---
1173
+
1174
+ #### `shouldBeFalsy(selector)`
1175
+
1176
+ Asserts that the element’s text content is falsy (e.g., `false`, `0`, `null`, `undefined`, `NaN`, or an empty string).
1177
+
1178
+ ```javascript
1179
+ await shouldBeFalsy("#element");
1180
+ ```
1181
+
1182
+ - **Parameters**:
1183
+ - `selector` _(string)_: The target element’s selector.
1184
+
1185
+ ---
1186
+
1187
+ #### `shouldBeGreaterThan(selector, expected)`
1188
+
1189
+ Asserts that the element’s text content, converted to a number, is greater than the expected value.
1190
+
1191
+ ```javascript
1192
+ await shouldBeGreaterThan("#element", 100);
1193
+ ```
1194
+
1195
+ - **Parameters**:
1196
+ - `selector` _(string)_: The target element’s selector.
1197
+ - `expected` _(number)_: The expected value.
1198
+
1199
+ ---
1200
+
1201
+ #### `shouldBeGreaterThanOrEqual(selector, expected)`
1202
+
1203
+ Asserts that the element’s text content, converted to a number, is greater than or equal to the expected value.
1204
+
1205
+ ```javascript
1206
+ await shouldBeGreaterThanOrEqual("#element", 100);
1207
+ ```
1208
+
1209
+ - **Parameters**:
1210
+ - `selector` _(string)_: The target element’s selector.
1211
+ - `expected` _(number)_: The expected value.
1212
+
1213
+ ---
1214
+
1215
+ #### `shouldBeInstanceOf(selector, constructor)`
1216
+
1217
+ Asserts that the element’s text content is an instance of the specified constructor.
1218
+
1219
+ ```javascript
1220
+ await shouldBeInstanceOf("#element", Array);
1221
+ ```
1222
+
1223
+ - **Parameters**:
1224
+ - `selector` _(string)_: The target element’s selector.
1225
+ - `constructor` _(function)_: The constructor function (e.g., `Array`, `Date`, etc.).
1226
+
1227
+ ---
1228
+
1229
+ #### `shouldBeLessThan(selector, expected)`
1230
+
1231
+ Asserts that the element’s text content, converted to a number, is less than the expected value.
1232
+
1233
+ ```javascript
1234
+ await shouldBeLessThan("#element", 100);
1235
+ ```
1236
+
1237
+ - **Parameters**:
1238
+ - `selector` _(string)_: The target element’s selector.
1239
+ - `expected` _(number)_: The expected value.
1240
+
1241
+ ---
1242
+
1243
+ #### `shouldBeLessThanOrEqual(selector, expected)`
1244
+
1245
+ Asserts that the element’s text content, converted to a number, is less than or equal to the expected value.
1246
+
1247
+ ```javascript
1248
+ await shouldBeLessThanOrEqual("#element", 100);
1249
+ ```
1250
+
1251
+ - **Parameters**:
1252
+ - `selector` _(string)_: The target element’s selector.
1253
+ - `expected` _(number)_: The expected value.
1254
+
1255
+ ---
1256
+
1257
+ #### `shouldBeNaN(selector)`
1258
+
1259
+ Asserts that the element’s text content, converted to a number, is `NaN` (Not-a-Number).
1260
+
1261
+ ```javascript
1262
+ await shouldBeNaN("#element");
1263
+ ```
1264
+
1265
+ - **Parameters**:
1266
+ - `selector` _(string)_: The target element’s selector.
1267
+
1268
+ ---
1269
+
1270
+ #### `shouldBeNull(selector)`
1271
+
1272
+ Asserts that the element’s text content is `null`.
1273
+
1274
+ ```javascript
1275
+ await shouldBeNull("#element");
1276
+ ```
1277
+
1278
+ - **Parameters**:
1279
+ - `selector` _(string)_: The target element’s selector.
1280
+
1281
+ ---
1282
+
1283
+ #### `shouldBeTruthy(selector)`
1284
+
1285
+ Asserts that the element’s text content is truthy (i.e., a value that evaluates to `true` in a Boolean context).
1286
+
1287
+ ```javascript
1288
+ await shouldBeTruthy("#element");
1289
+ ```
1290
+
1291
+ - **Parameters**:
1292
+ - `selector` _(string)_: The target element’s selector.
1293
+
1294
+ ---
1295
+
1296
+ #### `shouldBeUndefined(selector)`
1297
+
1298
+ Asserts that the element’s text content is `undefined`.
1299
+
1300
+ ```javascript
1301
+ await shouldBeUndefined("#element");
1302
+ ```
1303
+
1304
+ - **Parameters**:
1305
+ - `selector` _(string)_: The target element’s selector.
1306
+
1307
+ ---
1308
+
1309
+ #### `shouldContain(selector, substring)`
1310
+
1311
+ Asserts that the element’s text content contains the specified substring.
1312
+
1313
+ ```javascript
1314
+ await shouldContain("#element", "expected substring");
1315
+ ```
1316
+
1317
+ - **Parameters**:
1318
+ - `selector` _(string)_: The target element’s selector.
1319
+ - `substring` _(string)_: The substring that should be contained in the text content.
1320
+
1321
+ ---
1322
+
1323
+ #### `shouldContainEqual(selector, expected)`
1324
+
1325
+ Asserts that the element’s text content contains an equal value to the expected value.
1326
+
1327
+ ```javascript
1328
+ await shouldContainEqual("#element", "expected value");
1329
+ ```
1330
+
1331
+ - **Parameters**:
1332
+ - `selector` _(string)_: The target element’s selector.
1333
+ - `expected` _(any)_: The expected value.
1334
+
1335
+ ---
1336
+
1337
+ #### `shouldEqual(selector, expected)`
1338
+
1339
+ Asserts that the element’s text content, converted to a number, is equal to the expected value.
1340
+
1341
+ ```javascript
1342
+ await shouldEqual("#element", 100);
1343
+ ```
1344
+
1345
+ - **Parameters**:
1346
+ - `selector` _(string)_: The target element’s selector.
1347
+ - `expected` _(number)_: The expected value.
1348
+
1349
+ ---
1350
+
1351
+ #### `shouldHaveLength(selector, length)`
1352
+
1353
+ Asserts that the element's text content has the specified length.
1354
+
1355
+ ```javascript
1356
+ await shouldHaveLength(".element", 5);
1357
+ ```
1358
+
1359
+ - **Parameters**:
1360
+ - `selector` _(string)_: The CSS selector for the element.
1361
+ - `length` _(number)_: The expected length of the text content.
1362
+
1363
+ ---
1364
+
1365
+ #### `shouldHaveProperty(selector, property)`
1366
+
1367
+ Asserts that the element's text content has the specified property.
1368
+
1369
+ ```javascript
1370
+ await shouldHaveProperty(".element", "propertyName");
1371
+ ```
1372
+
1373
+ - **Parameters**:
1374
+ - `selector` _(string)_: The CSS selector for the element.
1375
+ - `property` _(string)_: The property name to check for.
1376
+
1377
+ ---
1378
+
1379
+ #### `shouldMatch(selector, regex)`
1380
+
1381
+ Asserts that the element's text content matches the provided regular expression.
1382
+
1383
+ ```javascript
1384
+ await shouldMatch(".element", /pattern/);
1385
+ ```
1386
+
1387
+ - **Parameters**:
1388
+ - `selector` _(string)_: The CSS selector for the element.
1389
+ - `regex` _(RegExp)_: The regular expression to match against.
1390
+
1391
+ ---
1392
+
1393
+ #### `shouldMatchObject(selector, object)`
1394
+
1395
+ Asserts that the element's text content matches the provided object structure.
1396
+
1397
+ ```javascript
1398
+ await shouldMatchObject(".element", { key: "value" });
1399
+ ```
1400
+
1401
+ - **Parameters**:
1402
+ - `selector` _(string)_: The CSS selector for the element.
1403
+ - `object` _(object)_: The object to match against.
1404
+
1405
+ ---
1406
+
1407
+ #### `shouldStrictEqual(selector, expected)`
1408
+
1409
+ Asserts that the numeric value of the element's text content strictly equals the expected value.
1410
+
1411
+ ```javascript
1412
+ await shouldStrictEqual(".element", 42);
1413
+ ```
1414
+
1415
+ - **Parameters**:
1416
+ - `selector` _(string)_: The CSS selector for the element.
1417
+ - `expected` _(number)_: The expected numeric value.
1418
+
1419
+ ---
1420
+
1421
+ #### `shouldThrow(fn)`
1422
+
1423
+ Asserts that the provided function throws an error when executed.
1424
+
1425
+ ```javascript
1426
+ await shouldThrow(() => functionThatShouldThrow());
1427
+ ```
1428
+
1429
+ - **Parameters**:
1430
+ - `fn` _(Function)_: The function expected to throw an error.
1431
+
1432
+ ---
1433
+
1434
+ #### `shouldAny(selector, constructor)`
1435
+
1436
+ Asserts that the element's text content is an instance of the specified constructor.
1437
+
1438
+ ```javascript
1439
+ await shouldAny(".element", Constructor);
1440
+ ```
1441
+
1442
+ - **Parameters**:
1443
+ - `selector` _(string)_: The CSS selector for the element.
1444
+ - `constructor` _(Function)_: The constructor function to check against.
1445
+
1446
+ ---
1447
+
1448
+ #### `shouldAnything(selector)`
1449
+
1450
+ Asserts that the element's text content matches anything (always passes).
1451
+
1452
+ ```javascript
1453
+ await shouldAnything(".element");
1454
+ ```
1455
+
1456
+ - **Parameters**:
1457
+ - `selector` _(string)_: The CSS selector for the element.
1458
+
1459
+ ---
1460
+
1461
+ #### `shouldArrayContaining(selector, elements)`
1462
+
1463
+ Asserts that the element's text content contains all the elements in the provided array.
1464
+
1465
+ ```javascript
1466
+ await shouldArrayContaining(".element", ["item1", "item2"]);
1467
+ ```
1468
+
1469
+ - **Parameters**:
1470
+ - `selector` _(string)_: The CSS selector for the element.
1471
+ - `elements` _(Array)_: The array of elements to check for.
1472
+
1473
+ ---
1474
+
1475
+ #### `shouldCloseTo(selector, expected, precision)`
1476
+
1477
+ Asserts that the numeric value of the element's text content is close to the expected value within the specified precision.
1478
+
1479
+ ```javascript
1480
+ await shouldCloseTo(".element", 3.14159, 2);
1481
+ ```
1482
+
1483
+ - **Parameters**:
1484
+ - `selector` _(string)_: The CSS selector for the element.
1485
+ - `expected` _(number)_: The expected numeric value.
1486
+ - `precision` _(number)_: The number of decimal places to check.
1487
+
1488
+ ---
1489
+
1490
+ #### `shouldObjectContaining(selector, properties)`
1491
+
1492
+ Asserts that the element's text content contains an object with the specified properties.
1493
+
1494
+ ```javascript
1495
+ await shouldObjectContaining(".element", { key: "value" });
1496
+ ```
1497
+
1498
+ - **Parameters**:
1499
+
1500
+ - `selector` _(string)_: The CSS selector for the element.
1501
+ - `properties` _(object)_: The object properties to check for.
1502
+
1503
+ #### `shouldStringContaining(selector, substring)`
1504
+
1505
+ Asserts that the element's text content contains the specified substring.
1506
+
1507
+ ```javascript
1508
+ await shouldStringContaining(".element", "expected text");
1509
+ ```
1510
+
1511
+ - **Parameters**:
1512
+ - `selector` _(string)_: The CSS selector for the element.
1513
+ - `substring` _(string)_: The substring to check for.
1514
+
1515
+ ---
1516
+
1517
+ #### `shouldStringMatching(selector, regex)`
1518
+
1519
+ Asserts that the element's text content matches the specified regular expression.
1520
+
1521
+ ```javascript
1522
+ await shouldStringMatching(".element", /pattern/);
1523
+ ```
1524
+
1525
+ - **Parameters**:
1526
+ - `selector` _(string)_: The CSS selector for the element.
1527
+ - `regex` _(RegExp)_: The regular expression to match against.
1528
+
1529
+ ---
1530
+
1531
+ #### `shouldNotBe(selector, expected)`
1532
+
1533
+ Asserts that the element's text content is not strictly equal to the expected value.
1534
+
1535
+ ```javascript
1536
+ await shouldNotBe(".element", "unexpected value");
1537
+ ```
1538
+
1539
+ - **Parameters**:
1540
+ - `selector` _(string)_: The CSS selector for the element.
1541
+ - `expected` _(any)_: The value that should not match.
1542
+
1543
+ ---
1544
+
1545
+ #### `shouldNotBeCloseTo(selector, expected, precision)`
1546
+
1547
+ Asserts that the numeric value of the element's text content is not close to the expected value within the specified precision.
1548
+
1549
+ ```javascript
1550
+ await shouldNotBeCloseTo(".element", 3.14159, 2);
1551
+ ```
1552
+
1553
+ - **Parameters**:
1554
+ - `selector` _(string)_: The CSS selector for the element.
1555
+ - `expected` _(number)_: The numeric value that should not be close.
1556
+ - `precision` _(number)_: The number of decimal places to check.
1557
+
1558
+ ---
1559
+
1560
+ #### `shouldNotBeDefined(selector)`
1561
+
1562
+ Asserts that the element's text content is not defined.
1563
+
1564
+ ```javascript
1565
+ await shouldNotBeDefined(".element");
1566
+ ```
1567
+
1568
+ - **Parameters**:
1569
+ - `selector` _(string)_: The CSS selector for the element.
1570
+
1571
+ ---
1572
+
1573
+ #### `shouldNotBeFalsy(selector)`
1574
+
1575
+ Asserts that the element's text content is not falsy.
1576
+
1577
+ ```javascript
1578
+ await shouldNotBeFalsy(".element");
1579
+ ```
1580
+
1581
+ - **Parameters**:
1582
+ - `selector` _(string)_: The CSS selector for the element.
1583
+
1584
+ ---
1585
+
1586
+ #### `shouldNotBeGreaterThan(selector, expected)`
1587
+
1588
+ Asserts that the element's text content is not greater than the expected value.
1589
+
1590
+ ```javascript
1591
+ await shouldNotBeGreaterThan(".element", 100);
1592
+ ```
1593
+
1594
+ - **Parameters**:
1595
+ - `selector` _(string)_: The CSS selector for the element.
1596
+ - `expected` _(number)_: The value to compare against.
1597
+
1598
+ ---
1599
+
1600
+ #### `shouldNotBeGreaterThanOrEqual(selector, expected)`
1601
+
1602
+ Asserts that the numeric value of the element's text content is not greater than or equal to the expected value.
1603
+
1604
+ ```javascript
1605
+ await shouldNotBeGreaterThanOrEqual(".element", 100);
1606
+ ```
1607
+
1608
+ - **Parameters**:
1609
+ - `selector` _(string)_: The CSS selector for the element.
1610
+ - `expected` _(number)_: The value to compare against.
1611
+
1612
+ ---
1613
+
1614
+ #### `shouldNotBeInstanceOf(selector, constructor)`
1615
+
1616
+ Asserts that the element's text content is not an instance of the specified constructor.
1617
+
1618
+ ```javascript
1619
+ await shouldNotBeInstanceOf(".element", Constructor);
1620
+ ```
1621
+
1622
+ - **Parameters**:
1623
+ - `selector` _(string)_: The CSS selector for the element.
1624
+ - `constructor` _(Function)_: The constructor function to check against.
1625
+
1626
+ ---
1627
+
1628
+ #### `shouldNotBeLessThan(selector, expected)`
1629
+
1630
+ Asserts that the numeric value of the element's text content is not less than the expected value.
1631
+
1632
+ ```javascript
1633
+ await shouldNotBeLessThan(".element", 100);
1634
+ ```
1635
+
1636
+ - **Parameters**:
1637
+ - `selector` _(string)_: The CSS selector for the element.
1638
+ - `expected` _(number)_: The value to compare against.
1639
+
1640
+ ---
1641
+
1642
+ #### `shouldNotBeLessThanOrEqual(selector, expected)`
1643
+
1644
+ Asserts that the numeric value of the element's text content is not less than or equal to the expected value.
1645
+
1646
+ ```javascript
1647
+ await shouldNotBeLessThanOrEqual(".element", 100);
1648
+ ```
1649
+
1650
+ - **Parameters**:
1651
+ - `selector` _(string)_: The CSS selector for the element.
1652
+ - `expected` _(number)_: The value to compare against.
1653
+
1654
+ ---
1655
+
1656
+ #### `shouldNotBeNaN(selector)`
1657
+
1658
+ Asserts that the numeric value of the element's text content is not NaN.
1659
+
1660
+ ```javascript
1661
+ await shouldNotBeNaN(".element");
1662
+ ```
1663
+
1664
+ - **Parameters**:
1665
+ - `selector` _(string)_: The CSS selector for the element.
1666
+
1667
+ ---
1668
+
1669
+ #### `shouldNotBeNull(selector)`
1670
+
1671
+ Asserts that the element's text content is not null.
1672
+
1673
+ ```javascript
1674
+ await shouldNotBeNull(".element");
1675
+ ```
1676
+
1677
+ - **Parameters**:
1678
+ - `selector` _(string)_: The CSS selector for the element.
1679
+
1680
+ ---
1681
+
1682
+ #### `shouldNotBeTruthy(selector)`
1683
+
1684
+ Asserts that the element's text content is not truthy.
1685
+
1686
+ ```javascript
1687
+ await shouldNotBeTruthy(".element");
1688
+ ```
1689
+
1690
+ - **Parameters**:
1691
+ - `selector` _(string)_: The CSS selector for the element.
1692
+
1693
+ ---
1694
+
1695
+ #### `shouldNotBeUndefined(selector)`
1696
+
1697
+ Asserts that the element's text content is not undefined.
1698
+
1699
+ ```javascript
1700
+ await shouldNotBeUndefined(".element");
1701
+ ```
1702
+
1703
+ - **Parameters**:
1704
+ - `selector` _(string)_: The CSS selector for the element.
1705
+
1706
+ ---
1707
+
1708
+ #### `shouldNotContain(selector, substring)`
1709
+
1710
+ Asserts that the element's text content does not contain the specified substring.
1711
+
1712
+ ```javascript
1713
+ await shouldNotContain(".element", "unexpected text");
1714
+ ```
1715
+
1716
+ - **Parameters**:
1717
+ - `selector` _(string)_: The CSS selector for the element.
1718
+ - `substring` _(string)_: The substring that should not be present.
1719
+
1720
+ ---
1721
+
1722
+ #### `shouldNotContainEqual(selector, expected)`
1723
+
1724
+ Asserts that the numeric value of the element's text content does not contain an element equal to the expected value.
1725
+
1726
+ ```javascript
1727
+ await shouldNotContainEqual(".element", 42);
1728
+ ```
1729
+
1730
+ - **Parameters**:
1731
+ - `selector` _(string)_: The CSS selector for the element.
1732
+ - `expected` _(any)_: The value that should not be present.
1733
+
1734
+ ---
1735
+
1736
+ #### `shouldNotEqual(selector, expected)`
1737
+
1738
+ Asserts that the numeric value of the element's text content does not equal the expected value.
1739
+
1740
+ ```javascript
1741
+ await shouldNotEqual(".element", 42);
1742
+ ```
1743
+
1744
+ - **Parameters**:
1745
+ - `selector` _(string)_: The CSS selector for the element.
1746
+ - `expected` _(number)_: The value that should not match.
1747
+
1748
+ ---
1749
+
1750
+ #### `shouldNotHaveLength(selector, length)`
1751
+
1752
+ Asserts that the element's text content does not have the specified length.
1753
+
1754
+ ```javascript
1755
+ await shouldNotHaveLength(".element", 5);
1756
+ ```
1757
+
1758
+ - **Parameters**:
1759
+ - `selector` _(string)_: The CSS selector for the element.
1760
+ - `length` _(number)_: The length that should not match.
1761
+
1762
+ ---
1763
+
1764
+ #### `shouldNotHaveProperty(selector, property)`
1765
+
1766
+ Asserts that the element’s text content does not have the specified property.
1767
+
1768
+ ```javascript
1769
+ await shouldNotHaveProperty("#element", "property-name");
1770
+ ```
1771
+
1772
+ - **Parameters**:
1773
+ - `selector` _(string)_: The target element’s selector.
1774
+ - `property` _(string)_: The property name that should not be present.
1775
+
1776
+ ---
1777
+
1778
+ #### `shouldNotMatch(selector, regex)`
1779
+
1780
+ Asserts that the element’s text content does not match the given regular expression.
1781
+
1782
+ ```javascript
1783
+ await shouldNotMatch("#element", /regex/);
1784
+ ```
1785
+
1786
+ - **Parameters**:
1787
+ - `selector` _(string)_: The target element’s selector.
1788
+ - `regex` _(RegExp)_: The regular expression that the text content should not match.
1789
+
1790
+ ---
1791
+
1792
+ #### `shouldNotMatchObject(selector, object)`
1793
+
1794
+ Asserts that the element’s text content does not match the given object.
1795
+
1796
+ ```javascript
1797
+ await shouldNotMatchObject("#element", { key: "value" });
1798
+ ```
1799
+
1800
+ - **Parameters**:
1801
+ - `selector` _(string)_: The target element’s selector.
1802
+ - `object` _(object)_: The object that the text content should not match.
1803
+
1804
+ ---
1805
+
1806
+ #### `shouldNotStrictEqual(selector, expected)`
1807
+
1808
+ Asserts that the element’s text content, converted to a number, does not strictly equal the expected value.
1809
+
1810
+ ```javascript
1811
+ await shouldNotStrictEqual("#element", 100);
1812
+ ```
1813
+
1814
+ - **Parameters**:
1815
+ - `selector` _(string)_: The target element’s selector.
1816
+ - `expected` _(number)_: The expected value.
1817
+
1818
+ ---
1819
+
1820
+ #### `shouldNotThrow(fn)`
1821
+
1822
+ Asserts that the provided function does not throw an error.
1823
+
1824
+ ```javascript
1825
+ await shouldNotThrow(() => {
1826
+ someFunction();
1827
+ });
1828
+ ```
1829
+
1830
+ - **Parameters**:
1831
+ - `fn` _(function)_: The function that should not throw an error.
1832
+
1833
+ ---
1834
+
1835
+ #### `shouldNotAny(selector, constructor)`
1836
+
1837
+ Asserts that the element’s text content is not an instance of the specified constructor.
1838
+
1839
+ ```javascript
1840
+ await shouldNotAny("#element", Array);
1841
+ ```
1842
+
1843
+ - **Parameters**:
1844
+ - `selector` _(string)_: The target element’s selector.
1845
+ - `constructor` _(function)_: The constructor function (e.g., `Array`, `Date`, etc.).
1846
+
1847
+ ---
1848
+
1849
+ #### `shouldNotAnything(selector)`
1850
+
1851
+ Asserts that the element’s text content is not `anything` (e.g., `null`, `undefined`, `false`).
1852
+
1853
+ ```javascript
1854
+ await shouldNotAnything("#element");
1855
+ ```
1856
+
1857
+ - **Parameters**:
1858
+ - `selector` _(string)_: The target element’s selector.
1859
+
1860
+ ---
1861
+
1862
+ #### `shouldNotArrayContaining(selector, elements)`
1863
+
1864
+ Asserts that the element’s text content is not an array containing the specified elements.
1865
+
1866
+ ```javascript
1867
+ await shouldNotArrayContaining("#element", ["item1", "item2"]);
1868
+ ```
1869
+
1870
+ - **Parameters**:
1871
+ - `selector` _(string)_: The target element’s selector.
1872
+ - `elements` _(array)_: The elements that the array should not contain.
1873
+
1874
+ ---
1875
+
1876
+ #### `shouldNotCloseTo(selector, expected, precision)`
1877
+
1878
+ Asserts that the element’s text content, converted to a number, is not close to the expected value within the specified precision.
1879
+
1880
+ ```javascript
1881
+ await shouldNotCloseTo("#element", 100, 2);
1882
+ ```
1883
+
1884
+ - **Parameters**:
1885
+ - `selector` _(string)_: The target element’s selector.
1886
+ - `expected` _(number)_: The expected value.
1887
+ - `precision` _(number)_: The allowed precision (number of decimal places).
1888
+
1889
+ ---
1890
+
1891
+ #### `shouldNotObjectContaining(selector, properties)`
1892
+
1893
+ Asserts that the element’s text content is not an object containing the specified properties.
1894
+
1895
+ ```javascript
1896
+ await shouldNotObjectContaining("#element", { key: "value" });
1897
+ ```
1898
+
1899
+ - **Parameters**:
1900
+ - `selector` _(string)_: The target element’s selector.
1901
+ - `properties` _(object)_: The properties that the object should not contain.
1902
+
1903
+ ---
1904
+
1905
+ #### `shouldNotStringContaining(selector, substring)`
1906
+
1907
+ Asserts that the element’s text content does not contain the specified substring.
1908
+
1909
+ ```javascript
1910
+ await shouldNotStringContaining("#element", "substring");
1911
+ ```
1912
+
1913
+ - **Parameters**:
1914
+ - `selector` _(string)_: The target element’s selector.
1915
+ - `substring` _(string)_: The substring that should not be contained in the text content.
1916
+
1917
+ ---
1918
+
1919
+ #### `shouldNotStringMatching(selector, regex)`
1920
+
1921
+ Asserts that the element’s text content does not match the specified regular expression.
1922
+
1923
+ ```javascript
1924
+ await shouldNotStringMatching("#element", /regex/);
1925
+ ```
1926
+
1927
+ - **Parameters**:
1928
+ - `selector` _(string)_: The target element’s selector.
1929
+ - `regex` _(RegExp)_: The regular expression that the text content should not match.
1930
+
1931
+ ---
1932
+
1933
+ ### **Frame Functions**
1934
+
1935
+ #### `screenshot(selector)`
1936
+
1937
+ Takes a screenshot of the specified element and saves it to the configured project path.
1938
+
1939
+ ```javascript
1940
+ await screenshot("div#content");
1941
+ ```
1942
+
1943
+ ---
1944
+
1945
+ #### `contentFrame(selector)`
1946
+
1947
+ Returns the `contentFrame` of the specified element (used for working with iframe content).
1948
+
1949
+ ```javascript
1950
+ const frame = await contentFrame("iframe#example");
1951
+ ```
1952
+
1953
+ ---
1954
+
1955
+ #### `frameLocator(selector)`
1956
+
1957
+ Returns the frame locator for the specified element.
1958
+
1959
+ ```javascript
1960
+ const locator = await frameLocator("iframe#example");
1961
+ ```
1962
+
1963
+ ---
1964
+
1965
+ ### **Element Locator Functions**
1966
+
1967
+ #### `nth(selector, index)`
1968
+
1969
+ Returns the nth element matching the selector.
1970
+
1971
+ ```javascript
1972
+ const nthElement = await nth("div.list-item", 2);
1973
+ ```
1974
+
1975
+ ---
1976
+
1977
+ #### `first(selector)`
1978
+
1979
+ Returns the first element matching the selector.
1980
+
1981
+ ```javascript
1982
+ const firstElement = await first("div.list-item");
1983
+ ```
1984
+
1985
+ ---
1986
+
1987
+ #### `last(selector)`
1988
+
1989
+ Returns the last element matching the selector.
1990
+
1991
+ ```javascript
1992
+ const lastElement = await last("div.list-item");
1993
+ ```
1994
+
1995
+ ---
1996
+
1997
+ #### `filter(selector, filter)`
1998
+
1999
+ Returns elements matching the selector and an additional filter.
2000
+
2001
+ ```javascript
2002
+ const filteredElements = await filter("div.list-item", { hasText: "Active" });
2003
+ ```
2004
+
2005
+ ---
2006
+
2007
+ #### `count(selector)`
2008
+
2009
+ Returns the number of elements matching the selector.
2010
+
2011
+ ```javascript
2012
+ const itemCount = await count("div.list-item");
2013
+ ```
2014
+
2015
+ ---
2016
+
2017
+ ### **Attribute-Based Locators**
2018
+
2019
+ #### `getByAltText(text)`
2020
+
2021
+ Returns elements that have the specified `alt` text.
2022
+
2023
+ ```javascript
2024
+ const image = await getByAltText("Profile Picture");
2025
+ ```
2026
+
2027
+ ---
2028
+
2029
+ #### `getByLabel(label)`
2030
+
2031
+ Returns elements with a label matching the specified text.
2032
+
2033
+ ```javascript
2034
+ const input = await getByLabel("Email Address");
2035
+ ```
2036
+
2037
+ ---
2038
+
2039
+ #### `getByPlaceholder(placeholder)`
2040
+
2041
+ Returns elements with a placeholder matching the specified text.
2042
+
2043
+ ```javascript
2044
+ const input = await getByPlaceholder("Enter your name");
2045
+ ```
2046
+
2047
+ ---
2048
+
2049
+ #### `getByRole(role)`
2050
+
2051
+ Returns elements with the specified role attribute.
2052
+
2053
+ ```javascript
2054
+ const button = await getByRole("button");
2055
+ ```
2056
+
2057
+ ---
2058
+
2059
+ #### `getByTestId(testId)`
2060
+
2061
+ Returns elements with the specified `data-testid` attribute.
2062
+
2063
+ ```javascript
2064
+ const element = await getByTestId("submit-button");
2065
+ ```