codeceptjs 3.3.1 → 3.3.4
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/CHANGELOG.md +49 -0
- package/README.md +4 -25
- package/docs/api.md +4 -0
- package/docs/basics.md +2 -0
- package/docs/build/Appium.js +18 -28
- package/docs/build/JSONResponse.js +44 -3
- package/docs/build/Nightmare.js +53 -53
- package/docs/build/Playwright.js +95 -103
- package/docs/build/Protractor.js +66 -66
- package/docs/build/Puppeteer.js +74 -74
- package/docs/build/REST.js +8 -4
- package/docs/build/TestCafe.js +53 -53
- package/docs/build/WebDriver.js +84 -86
- package/docs/changelog.md +49 -0
- package/docs/helpers/Appium.md +212 -268
- package/docs/helpers/JSONResponse.md +24 -0
- package/docs/helpers/Nightmare.md +92 -141
- package/docs/helpers/Playwright.md +302 -413
- package/docs/helpers/Puppeteer.md +171 -231
- package/docs/helpers/REST.md +2 -0
- package/docs/helpers/TestCafe.md +125 -174
- package/docs/helpers/WebDriver.md +184 -247
- package/docs/plugins.md +41 -1
- package/docs/secrets.md +30 -0
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- package/docs/webapi/checkOption.mustache +1 -1
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +1 -1
- package/docs/webapi/clickLink.mustache +1 -1
- package/docs/webapi/closeCurrentTab.mustache +1 -1
- package/docs/webapi/closeOtherTabs.mustache +1 -1
- package/docs/webapi/dontSee.mustache +1 -1
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeCookie.mustache +1 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -1
- package/docs/webapi/dontSeeInTitle.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +1 -1
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragAndDrop.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.mustache +1 -1
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +1 -1
- package/docs/webapi/moveCursorTo.mustache +1 -1
- package/docs/webapi/openNewTab.mustache +1 -1
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/pressKeyDown.mustache +1 -1
- package/docs/webapi/pressKeyUp.mustache +1 -1
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
- package/docs/webapi/refreshPage.mustache +1 -1
- package/docs/webapi/resizeWindow.mustache +1 -1
- package/docs/webapi/rightClick.mustache +1 -1
- package/docs/webapi/saveElementScreenshot.mustache +1 -1
- package/docs/webapi/saveScreenshot.mustache +1 -1
- package/docs/webapi/say.mustache +1 -1
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/docs/webapi/scrollPageToBottom.mustache +1 -1
- package/docs/webapi/scrollPageToTop.mustache +1 -1
- package/docs/webapi/scrollTo.mustache +1 -1
- package/docs/webapi/see.mustache +1 -1
- package/docs/webapi/seeAttributesOnElements.mustache +1 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/seeCookie.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInCurrentUrl.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/webapi/seeInPopup.mustache +1 -1
- package/docs/webapi/seeInSource.mustache +1 -1
- package/docs/webapi/seeInTitle.mustache +1 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -1
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/seeTextEquals.mustache +1 -1
- package/docs/webapi/seeTitleEquals.mustache +1 -1
- package/docs/webapi/selectOption.mustache +1 -1
- package/docs/webapi/setCookie.mustache +1 -1
- package/docs/webapi/setGeoLocation.mustache +1 -1
- package/docs/webapi/switchTo.mustache +1 -1
- package/docs/webapi/switchToNextTab.mustache +1 -1
- package/docs/webapi/switchToPreviousTab.mustache +1 -1
- package/docs/webapi/type.mustache +1 -1
- package/docs/webapi/uncheckOption.mustache +1 -1
- package/docs/webapi/wait.mustache +1 -1
- package/docs/webapi/waitForClickable.mustache +1 -1
- package/docs/webapi/waitForDetached.mustache +1 -1
- package/docs/webapi/waitForElement.mustache +1 -1
- package/docs/webapi/waitForEnabled.mustache +1 -1
- package/docs/webapi/waitForFunction.mustache +1 -1
- package/docs/webapi/waitForInvisible.mustache +1 -1
- package/docs/webapi/waitForText.mustache +1 -1
- package/docs/webapi/waitForValue.mustache +1 -1
- package/docs/webapi/waitForVisible.mustache +1 -1
- package/docs/webapi/waitInUrl.mustache +1 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/waitToHide.mustache +1 -1
- package/docs/webapi/waitUrlEquals.mustache +1 -1
- package/lib/cli.js +1 -1
- package/lib/command/interactive.js +1 -1
- package/lib/command/run-workers.js +1 -1
- package/lib/command/workers/runTests.js +15 -0
- package/lib/helper/Appium.js +0 -10
- package/lib/helper/JSONResponse.js +44 -3
- package/lib/helper/Playwright.js +24 -32
- package/lib/helper/REST.js +8 -4
- package/lib/helper/WebDriver.js +5 -7
- package/lib/output.js +4 -0
- package/lib/plugin/customLocator.js +50 -3
- package/lib/plugin/retryFailedStep.js +1 -1
- package/lib/plugin/retryTo.js +1 -8
- package/lib/secret.js +30 -0
- package/lib/step.js +1 -1
- package/package.json +4 -4
- package/typings/types.d.ts +1016 -520
|
@@ -449,7 +449,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
449
449
|
|
|
450
450
|
- `url` **[string][19]** url path or global url.
|
|
451
451
|
|
|
452
|
-
Returns **
|
|
452
|
+
Returns **void** automatically synchronized promise with recorder #!
|
|
453
453
|
|
|
454
454
|
### appendField
|
|
455
455
|
|
|
@@ -464,8 +464,8 @@ I.appendField('#myTextField', 'appended');
|
|
|
464
464
|
|
|
465
465
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator
|
|
466
466
|
- `value` **[string][19]** text value to append.
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
468
|
+
|
|
469
469
|
|
|
470
470
|
|
|
471
471
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -486,8 +486,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
486
486
|
|
|
487
487
|
- `locator` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
488
488
|
- `pathToFile` **[string][19]** local file path relative to codecept.json config file.
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
490
|
+
Appium: not tested
|
|
491
491
|
|
|
492
492
|
### cancelPopup
|
|
493
493
|
|
|
@@ -509,9 +509,9 @@ I.checkOption('agree', '//form');
|
|
|
509
509
|
#### Parameters
|
|
510
510
|
|
|
511
511
|
- `field` **([string][19] | [object][18])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
512
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
513
|
-
|
|
514
|
-
|
|
512
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
513
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
514
|
+
Appium: not tested
|
|
515
515
|
|
|
516
516
|
### clearCookie
|
|
517
517
|
|
|
@@ -525,9 +525,8 @@ I.clearCookie('test');
|
|
|
525
525
|
|
|
526
526
|
#### Parameters
|
|
527
527
|
|
|
528
|
-
- `cookie` **[string][19]?** (optional, `null` by default) cookie name
|
|
529
|
-
|
|
530
|
-
Returns **[Promise][21]<any>**
|
|
528
|
+
- `cookie` **[string][19]?** (optional, `null` by default) cookie name
|
|
529
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
531
530
|
|
|
532
531
|
### clearField
|
|
533
532
|
|
|
@@ -543,8 +542,7 @@ I.clearField('#email');
|
|
|
543
542
|
|
|
544
543
|
- `field`
|
|
545
544
|
- `editable` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
546
|
-
|
|
547
|
-
Returns **[Promise][21]<any>**
|
|
545
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
548
546
|
|
|
549
547
|
### click
|
|
550
548
|
|
|
@@ -573,13 +571,12 @@ I.click({css: 'nav a.login'});
|
|
|
573
571
|
#### Parameters
|
|
574
572
|
|
|
575
573
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
576
|
-
- `context` **([string][19]? | [object][18] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
577
|
-
|
|
578
|
-
Returns **[Promise][21]<any>**
|
|
574
|
+
- `context` **([string][19]? | [object][18] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
575
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
579
576
|
|
|
580
577
|
|
|
581
578
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
582
|
-
|
|
579
|
+
|
|
583
580
|
|
|
584
581
|
### closeCurrentTab
|
|
585
582
|
|
|
@@ -589,7 +586,7 @@ Close current tab.
|
|
|
589
586
|
I.closeCurrentTab();
|
|
590
587
|
```
|
|
591
588
|
|
|
592
|
-
|
|
589
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
593
590
|
|
|
594
591
|
### closeOtherTabs
|
|
595
592
|
|
|
@@ -599,11 +596,11 @@ Close all tabs except for the current one.
|
|
|
599
596
|
I.closeOtherTabs();
|
|
600
597
|
```
|
|
601
598
|
|
|
602
|
-
|
|
599
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
603
600
|
|
|
604
601
|
### defineTimeout
|
|
605
602
|
|
|
606
|
-
Set [WebDriver timeouts][
|
|
603
|
+
Set [WebDriver timeouts][21] in realtime.
|
|
607
604
|
|
|
608
605
|
Timeouts are expected to be passed as object:
|
|
609
606
|
|
|
@@ -629,13 +626,12 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
629
626
|
#### Parameters
|
|
630
627
|
|
|
631
628
|
- `text` **[string][19]** which is not present.
|
|
632
|
-
- `context` **([string][19] | [object][18])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
633
|
-
|
|
634
|
-
Returns **[Promise][21]<any>**
|
|
629
|
+
- `context` **([string][19] | [object][18])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
630
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
635
631
|
|
|
636
632
|
|
|
637
633
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
638
|
-
|
|
634
|
+
|
|
639
635
|
|
|
640
636
|
### dontSeeCheckboxIsChecked
|
|
641
637
|
|
|
@@ -650,8 +646,8 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
650
646
|
#### Parameters
|
|
651
647
|
|
|
652
648
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
653
|
-
|
|
654
|
-
|
|
649
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
650
|
+
Appium: not tested
|
|
655
651
|
|
|
656
652
|
### dontSeeCookie
|
|
657
653
|
|
|
@@ -664,8 +660,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
664
660
|
#### Parameters
|
|
665
661
|
|
|
666
662
|
- `name` **[string][19]** cookie name.
|
|
667
|
-
|
|
668
|
-
Returns **[Promise][21]<any>**
|
|
663
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
669
664
|
|
|
670
665
|
### dontSeeCurrentUrlEquals
|
|
671
666
|
|
|
@@ -680,8 +675,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
680
675
|
#### Parameters
|
|
681
676
|
|
|
682
677
|
- `url` **[string][19]** value to check.
|
|
683
|
-
|
|
684
|
-
Returns **[Promise][21]<any>**
|
|
678
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
685
679
|
|
|
686
680
|
### dontSeeElement
|
|
687
681
|
|
|
@@ -694,8 +688,8 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
694
688
|
#### Parameters
|
|
695
689
|
|
|
696
690
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|Strict locator.
|
|
697
|
-
|
|
698
|
-
|
|
691
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
692
|
+
|
|
699
693
|
|
|
700
694
|
|
|
701
695
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -712,8 +706,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
712
706
|
#### Parameters
|
|
713
707
|
|
|
714
708
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|Strict locator.
|
|
715
|
-
|
|
716
|
-
Returns **[Promise][21]<any>**
|
|
709
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
717
710
|
|
|
718
711
|
### dontSeeInCurrentUrl
|
|
719
712
|
|
|
@@ -722,8 +715,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
722
715
|
#### Parameters
|
|
723
716
|
|
|
724
717
|
- `url` **[string][19]** value to check.
|
|
725
|
-
|
|
726
|
-
Returns **[Promise][21]<any>**
|
|
718
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
727
719
|
|
|
728
720
|
### dontSeeInField
|
|
729
721
|
|
|
@@ -739,8 +731,7 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
739
731
|
|
|
740
732
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
741
733
|
- `value` **[string][19]** value to check.
|
|
742
|
-
|
|
743
|
-
Returns **[Promise][21]<any>**
|
|
734
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
744
735
|
|
|
745
736
|
### dontSeeInSource
|
|
746
737
|
|
|
@@ -754,8 +745,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
754
745
|
|
|
755
746
|
- `text`
|
|
756
747
|
- `value` **[string][19]** to check.
|
|
757
|
-
|
|
758
|
-
Returns **[Promise][21]<any>**
|
|
748
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
759
749
|
|
|
760
750
|
### dontSeeInTitle
|
|
761
751
|
|
|
@@ -768,8 +758,7 @@ I.dontSeeInTitle('Error');
|
|
|
768
758
|
#### Parameters
|
|
769
759
|
|
|
770
760
|
- `text` **[string][19]** value to check.
|
|
771
|
-
|
|
772
|
-
Returns **[Promise][21]<any>**
|
|
761
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
773
762
|
|
|
774
763
|
### doubleClick
|
|
775
764
|
|
|
@@ -786,13 +775,12 @@ I.doubleClick('.btn.edit');
|
|
|
786
775
|
#### Parameters
|
|
787
776
|
|
|
788
777
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
789
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
790
|
-
|
|
791
|
-
Returns **[Promise][21]<any>**
|
|
778
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
779
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
792
780
|
|
|
793
781
|
|
|
794
782
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
795
|
-
|
|
783
|
+
|
|
796
784
|
|
|
797
785
|
### dragAndDrop
|
|
798
786
|
|
|
@@ -806,8 +794,8 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
806
794
|
|
|
807
795
|
- `srcElement` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
808
796
|
- `destElement` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
809
|
-
|
|
810
|
-
|
|
797
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
798
|
+
Appium: not tested
|
|
811
799
|
|
|
812
800
|
### dragSlider
|
|
813
801
|
|
|
@@ -822,16 +810,15 @@ I.dragSlider('#slider', -70);
|
|
|
822
810
|
#### Parameters
|
|
823
811
|
|
|
824
812
|
- `locator` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
825
|
-
- `offsetX` **[number][
|
|
826
|
-
|
|
827
|
-
Returns **[Promise][21]<any>**
|
|
813
|
+
- `offsetX` **[number][22]** position to drag.
|
|
814
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
828
815
|
|
|
829
816
|
### executeAsyncScript
|
|
830
817
|
|
|
831
818
|
Executes async script on page.
|
|
832
819
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
833
820
|
|
|
834
|
-
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][
|
|
821
|
+
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][23].
|
|
835
822
|
|
|
836
823
|
```js
|
|
837
824
|
I.executeAsyncScript(function(done) {
|
|
@@ -852,9 +839,8 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
852
839
|
#### Parameters
|
|
853
840
|
|
|
854
841
|
- `args` **...any** to be passed to function.
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
Returns **[Promise][21]<any>**
|
|
842
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
843
|
+
- `fn` **([string][19] | [function][24])** function to be executed in browser context.
|
|
858
844
|
|
|
859
845
|
### executeScript
|
|
860
846
|
|
|
@@ -885,9 +871,8 @@ let date = await I.executeScript(function(el) {
|
|
|
885
871
|
#### Parameters
|
|
886
872
|
|
|
887
873
|
- `args` **...any** to be passed to function.
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
Returns **[Promise][21]<any>** Wraps [execute][26] command.
|
|
874
|
+
[!] returns a _promise_ which is synchronized internally by recorderWraps [execute][25] command.
|
|
875
|
+
- `fn` **([string][19] | [function][24])** function to be executed in browser context.
|
|
891
876
|
|
|
892
877
|
### fillField
|
|
893
878
|
|
|
@@ -909,13 +894,13 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
909
894
|
|
|
910
895
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
911
896
|
- `value` **([string][19] | [object][18])** text value to fill.
|
|
912
|
-
|
|
913
|
-
|
|
897
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
898
|
+
|
|
914
899
|
|
|
915
900
|
|
|
916
901
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
917
902
|
|
|
918
|
-
{{ custom }}
|
|
903
|
+
{{ custom }}
|
|
919
904
|
|
|
920
905
|
### forceClick
|
|
921
906
|
|
|
@@ -947,13 +932,12 @@ I.forceClick({css: 'nav a.login'});
|
|
|
947
932
|
#### Parameters
|
|
948
933
|
|
|
949
934
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
950
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
951
|
-
|
|
952
|
-
Returns **[Promise][21]<any>**
|
|
935
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
936
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
953
937
|
|
|
954
938
|
|
|
955
939
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
956
|
-
|
|
940
|
+
|
|
957
941
|
|
|
958
942
|
### forceRightClick
|
|
959
943
|
|
|
@@ -975,13 +959,12 @@ I.forceRightClick('Menu');
|
|
|
975
959
|
#### Parameters
|
|
976
960
|
|
|
977
961
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
978
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
979
|
-
|
|
980
|
-
Returns **[Promise][21]<any>**
|
|
962
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
963
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
981
964
|
|
|
982
965
|
|
|
983
966
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
984
|
-
|
|
967
|
+
|
|
985
968
|
|
|
986
969
|
### grabAllWindowHandles
|
|
987
970
|
|
|
@@ -992,7 +975,7 @@ Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
|
|
|
992
975
|
const windows = await I.grabAllWindowHandles();
|
|
993
976
|
```
|
|
994
977
|
|
|
995
|
-
Returns **[Promise][
|
|
978
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>**
|
|
996
979
|
|
|
997
980
|
### grabAttributeFrom
|
|
998
981
|
|
|
@@ -1009,7 +992,7 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
1009
992
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1010
993
|
- `attr` **[string][19]** attribute name.
|
|
1011
994
|
|
|
1012
|
-
Returns **[Promise][
|
|
995
|
+
Returns **[Promise][26]<[string][19]>** attribute value
|
|
1013
996
|
|
|
1014
997
|
### grabAttributeFromAll
|
|
1015
998
|
|
|
@@ -1025,7 +1008,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
1025
1008
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1026
1009
|
- `attr` **[string][19]** attribute name.
|
|
1027
1010
|
|
|
1028
|
-
Returns **[Promise][
|
|
1011
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>** attribute value
|
|
1029
1012
|
|
|
1030
1013
|
### grabBrowserLogs
|
|
1031
1014
|
|
|
@@ -1037,7 +1020,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
1037
1020
|
console.log(JSON.stringify(logs))
|
|
1038
1021
|
```
|
|
1039
1022
|
|
|
1040
|
-
Returns **([Promise][
|
|
1023
|
+
Returns **([Promise][26]<[Array][27]<[object][18]>> | [undefined][28])** all browser logs
|
|
1041
1024
|
|
|
1042
1025
|
### grabCookie
|
|
1043
1026
|
|
|
@@ -1054,7 +1037,7 @@ assert(cookie.value, '123456');
|
|
|
1054
1037
|
|
|
1055
1038
|
- `name` **[string][19]?** cookie name.
|
|
1056
1039
|
|
|
1057
|
-
Returns **([Promise][
|
|
1040
|
+
Returns **([Promise][26]<[string][19]> | [Promise][26]<[Array][27]<[string][19]>>)** attribute value
|
|
1058
1041
|
|
|
1059
1042
|
### grabCssPropertyFrom
|
|
1060
1043
|
|
|
@@ -1071,7 +1054,7 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
1071
1054
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1072
1055
|
- `cssProperty` **[string][19]** CSS property name.
|
|
1073
1056
|
|
|
1074
|
-
Returns **[Promise][
|
|
1057
|
+
Returns **[Promise][26]<[string][19]>** CSS value
|
|
1075
1058
|
|
|
1076
1059
|
### grabCssPropertyFromAll
|
|
1077
1060
|
|
|
@@ -1087,7 +1070,7 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
1087
1070
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1088
1071
|
- `cssProperty` **[string][19]** CSS property name.
|
|
1089
1072
|
|
|
1090
|
-
Returns **[Promise][
|
|
1073
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>** CSS value
|
|
1091
1074
|
|
|
1092
1075
|
### grabCurrentUrl
|
|
1093
1076
|
|
|
@@ -1099,7 +1082,7 @@ let url = await I.grabCurrentUrl();
|
|
|
1099
1082
|
console.log(`Current URL is [${url}]`);
|
|
1100
1083
|
```
|
|
1101
1084
|
|
|
1102
|
-
Returns **[Promise][
|
|
1085
|
+
Returns **[Promise][26]<[string][19]>** current URL
|
|
1103
1086
|
|
|
1104
1087
|
### grabCurrentWindowHandle
|
|
1105
1088
|
|
|
@@ -1110,7 +1093,7 @@ Useful for referencing it when calling `I.switchToWindow(handle)`
|
|
|
1110
1093
|
const window = await I.grabCurrentWindowHandle();
|
|
1111
1094
|
```
|
|
1112
1095
|
|
|
1113
|
-
Returns **[Promise][
|
|
1096
|
+
Returns **[Promise][26]<[string][19]>**
|
|
1114
1097
|
|
|
1115
1098
|
### grabElementBoundingRect
|
|
1116
1099
|
|
|
@@ -1138,7 +1121,7 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
1138
1121
|
- `prop`
|
|
1139
1122
|
- `elementSize` **[string][19]?** x, y, width or height of the given element.
|
|
1140
1123
|
|
|
1141
|
-
Returns **([Promise][
|
|
1124
|
+
Returns **([Promise][26]<DOMRect> | [Promise][26]<[number][22]>)** Element bounding rectangle
|
|
1142
1125
|
|
|
1143
1126
|
### grabGeoLocation
|
|
1144
1127
|
|
|
@@ -1149,7 +1132,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1149
1132
|
let geoLocation = await I.grabGeoLocation();
|
|
1150
1133
|
```
|
|
1151
1134
|
|
|
1152
|
-
Returns **[Promise][
|
|
1135
|
+
Returns **[Promise][26]<{latitude: [number][22], longitude: [number][22], altitude: [number][22]}>**
|
|
1153
1136
|
|
|
1154
1137
|
### grabHTMLFrom
|
|
1155
1138
|
|
|
@@ -1166,7 +1149,7 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1166
1149
|
- `locator`
|
|
1167
1150
|
- `element` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1168
1151
|
|
|
1169
|
-
Returns **[Promise][
|
|
1152
|
+
Returns **[Promise][26]<[string][19]>** HTML code for an element
|
|
1170
1153
|
|
|
1171
1154
|
### grabHTMLFromAll
|
|
1172
1155
|
|
|
@@ -1182,7 +1165,7 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1182
1165
|
- `locator`
|
|
1183
1166
|
- `element` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1184
1167
|
|
|
1185
|
-
Returns **[Promise][
|
|
1168
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>** HTML code for an element
|
|
1186
1169
|
|
|
1187
1170
|
### grabNumberOfOpenTabs
|
|
1188
1171
|
|
|
@@ -1193,7 +1176,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1193
1176
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1194
1177
|
```
|
|
1195
1178
|
|
|
1196
|
-
Returns **[Promise][
|
|
1179
|
+
Returns **[Promise][26]<[number][22]>** number of open tabs
|
|
1197
1180
|
|
|
1198
1181
|
### grabNumberOfVisibleElements
|
|
1199
1182
|
|
|
@@ -1208,7 +1191,7 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1208
1191
|
|
|
1209
1192
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1210
1193
|
|
|
1211
|
-
Returns **[Promise][
|
|
1194
|
+
Returns **[Promise][26]<[number][22]>** number of visible elements
|
|
1212
1195
|
|
|
1213
1196
|
### grabPageScrollPosition
|
|
1214
1197
|
|
|
@@ -1219,7 +1202,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1219
1202
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1220
1203
|
```
|
|
1221
1204
|
|
|
1222
|
-
Returns **[Promise][
|
|
1205
|
+
Returns **[Promise][26]<PageScrollPosition>** scroll position
|
|
1223
1206
|
|
|
1224
1207
|
### grabPopupText
|
|
1225
1208
|
|
|
@@ -1229,7 +1212,7 @@ Grab the text within the popup. If no popup is visible then it will return null.
|
|
|
1229
1212
|
await I.grabPopupText();
|
|
1230
1213
|
```
|
|
1231
1214
|
|
|
1232
|
-
Returns **[Promise][
|
|
1215
|
+
Returns **[Promise][26]<[string][19]>**
|
|
1233
1216
|
|
|
1234
1217
|
### grabSource
|
|
1235
1218
|
|
|
@@ -1240,7 +1223,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1240
1223
|
let pageSource = await I.grabSource();
|
|
1241
1224
|
```
|
|
1242
1225
|
|
|
1243
|
-
Returns **[Promise][
|
|
1226
|
+
Returns **[Promise][26]<[string][19]>** source code
|
|
1244
1227
|
|
|
1245
1228
|
### grabTextFrom
|
|
1246
1229
|
|
|
@@ -1257,7 +1240,7 @@ If multiple elements found returns first element.
|
|
|
1257
1240
|
|
|
1258
1241
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1259
1242
|
|
|
1260
|
-
Returns **[Promise][
|
|
1243
|
+
Returns **[Promise][26]<[string][19]>** attribute value
|
|
1261
1244
|
|
|
1262
1245
|
### grabTextFromAll
|
|
1263
1246
|
|
|
@@ -1272,7 +1255,7 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1272
1255
|
|
|
1273
1256
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1274
1257
|
|
|
1275
|
-
Returns **[Promise][
|
|
1258
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>** attribute value
|
|
1276
1259
|
|
|
1277
1260
|
### grabTitle
|
|
1278
1261
|
|
|
@@ -1283,7 +1266,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1283
1266
|
let title = await I.grabTitle();
|
|
1284
1267
|
```
|
|
1285
1268
|
|
|
1286
|
-
Returns **[Promise][
|
|
1269
|
+
Returns **[Promise][26]<[string][19]>** title
|
|
1287
1270
|
|
|
1288
1271
|
### grabValueFrom
|
|
1289
1272
|
|
|
@@ -1299,7 +1282,7 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1299
1282
|
|
|
1300
1283
|
- `locator` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1301
1284
|
|
|
1302
|
-
Returns **[Promise][
|
|
1285
|
+
Returns **[Promise][26]<[string][19]>** attribute value
|
|
1303
1286
|
|
|
1304
1287
|
### grabValueFromAll
|
|
1305
1288
|
|
|
@@ -1314,7 +1297,7 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1314
1297
|
|
|
1315
1298
|
- `locator` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1316
1299
|
|
|
1317
|
-
Returns **[Promise][
|
|
1300
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>** attribute value
|
|
1318
1301
|
|
|
1319
1302
|
### moveCursorTo
|
|
1320
1303
|
|
|
@@ -1331,10 +1314,9 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1331
1314
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1332
1315
|
- `xOffset`
|
|
1333
1316
|
- `yOffset`
|
|
1334
|
-
- `offsetX` **[number][
|
|
1335
|
-
- `offsetY` **[number][
|
|
1336
|
-
|
|
1337
|
-
Returns **[Promise][21]<any>**
|
|
1317
|
+
- `offsetX` **[number][22]** (optional, `0` by default) X-axis offset.
|
|
1318
|
+
- `offsetY` **[number][22]** (optional, `0` by default) Y-axis offset.
|
|
1319
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1338
1320
|
|
|
1339
1321
|
### openNewTab
|
|
1340
1322
|
|
|
@@ -1344,13 +1326,13 @@ Open new tab and switch to it.
|
|
|
1344
1326
|
I.openNewTab();
|
|
1345
1327
|
```
|
|
1346
1328
|
|
|
1329
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1330
|
+
|
|
1347
1331
|
#### Parameters
|
|
1348
1332
|
|
|
1349
1333
|
- `url`
|
|
1350
1334
|
- `windowName`
|
|
1351
1335
|
|
|
1352
|
-
Returns **[Promise][21]<any>**
|
|
1353
|
-
|
|
1354
1336
|
### pressKey
|
|
1355
1337
|
|
|
1356
1338
|
Presses a key in the browser (on a focused element).
|
|
@@ -1415,8 +1397,7 @@ Some of the supported key names are:
|
|
|
1415
1397
|
#### Parameters
|
|
1416
1398
|
|
|
1417
1399
|
- `key` **([string][19] | [Array][27]<[string][19]>)** key or array of keys to press.
|
|
1418
|
-
|
|
1419
|
-
Returns **[Promise][21]<any>** _Note:_ In case a text field or textarea is focused be aware that some browsers do not respect active modifier when combining modifier keys with other keys.
|
|
1400
|
+
[!] returns a _promise_ which is synchronized internally by recorder_Note:_ In case a text field or textarea is focused be aware that some browsers do not respect active modifier when combining modifier keys with other keys.
|
|
1420
1401
|
|
|
1421
1402
|
### pressKeyDown
|
|
1422
1403
|
|
|
@@ -1433,8 +1414,7 @@ I.pressKeyUp('Control');
|
|
|
1433
1414
|
#### Parameters
|
|
1434
1415
|
|
|
1435
1416
|
- `key` **[string][19]** name of key to press down.
|
|
1436
|
-
|
|
1437
|
-
Returns **[Promise][21]<any>**
|
|
1417
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1438
1418
|
|
|
1439
1419
|
### pressKeyUp
|
|
1440
1420
|
|
|
@@ -1451,8 +1431,7 @@ I.pressKeyUp('Control');
|
|
|
1451
1431
|
#### Parameters
|
|
1452
1432
|
|
|
1453
1433
|
- `key` **[string][19]** name of key to release.
|
|
1454
|
-
|
|
1455
|
-
Returns **[Promise][21]<any>**
|
|
1434
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1456
1435
|
|
|
1457
1436
|
### refreshPage
|
|
1458
1437
|
|
|
@@ -1462,7 +1441,7 @@ Reload the current page.
|
|
|
1462
1441
|
I.refreshPage();
|
|
1463
1442
|
```
|
|
1464
1443
|
|
|
1465
|
-
|
|
1444
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1466
1445
|
|
|
1467
1446
|
### resizeWindow
|
|
1468
1447
|
|
|
@@ -1471,10 +1450,10 @@ First parameter can be set to `maximize`.
|
|
|
1471
1450
|
|
|
1472
1451
|
#### Parameters
|
|
1473
1452
|
|
|
1474
|
-
- `width` **[number][
|
|
1475
|
-
- `height` **[number][
|
|
1476
|
-
|
|
1477
|
-
|
|
1453
|
+
- `width` **[number][22]** width in pixels or `maximize`.
|
|
1454
|
+
- `height` **[number][22]** height in pixels.
|
|
1455
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1456
|
+
Appium: not tested in web, in apps doesn't work
|
|
1478
1457
|
|
|
1479
1458
|
### rightClick
|
|
1480
1459
|
|
|
@@ -1492,13 +1471,12 @@ I.rightClick('Click me', '.context');
|
|
|
1492
1471
|
#### Parameters
|
|
1493
1472
|
|
|
1494
1473
|
- `locator` **([string][19] | [object][18])** clickable element located by CSS|XPath|strict locator.
|
|
1495
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1496
|
-
|
|
1497
|
-
Returns **[Promise][21]<any>**
|
|
1474
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1475
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1498
1476
|
|
|
1499
1477
|
|
|
1500
1478
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1501
|
-
|
|
1479
|
+
|
|
1502
1480
|
|
|
1503
1481
|
### runInWeb
|
|
1504
1482
|
|
|
@@ -1517,8 +1495,6 @@ Placeholder for ~ locator only test case write once run on both Appium and WebDr
|
|
|
1517
1495
|
- `caps` **any**
|
|
1518
1496
|
- `fn` **any**
|
|
1519
1497
|
|
|
1520
|
-
Returns **[Promise][21]<any>**
|
|
1521
|
-
|
|
1522
1498
|
### runOnIOS
|
|
1523
1499
|
|
|
1524
1500
|
Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
|
|
@@ -1528,8 +1504,6 @@ Placeholder for ~ locator only test case write once run on both Appium and WebDr
|
|
|
1528
1504
|
- `caps` **any**
|
|
1529
1505
|
- `fn` **any**
|
|
1530
1506
|
|
|
1531
|
-
Returns **[Promise][21]<any>**
|
|
1532
|
-
|
|
1533
1507
|
### saveElementScreenshot
|
|
1534
1508
|
|
|
1535
1509
|
Saves screenshot of the specified locator to ouput folder (set in codecept.json or codecept.conf.js).
|
|
@@ -1543,8 +1517,7 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1543
1517
|
|
|
1544
1518
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1545
1519
|
- `fileName` **[string][19]** file name to save.
|
|
1546
|
-
|
|
1547
|
-
Returns **[Promise][21]<any>**
|
|
1520
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1548
1521
|
|
|
1549
1522
|
### saveScreenshot
|
|
1550
1523
|
|
|
@@ -1560,9 +1533,8 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1560
1533
|
#### Parameters
|
|
1561
1534
|
|
|
1562
1535
|
- `fileName` **[string][19]** file name to save.
|
|
1563
|
-
- `fullPage` **[boolean][31]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1564
|
-
|
|
1565
|
-
Returns **[Promise][21]<any>**
|
|
1536
|
+
- `fullPage` **[boolean][31]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1537
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1566
1538
|
|
|
1567
1539
|
### scrollIntoView
|
|
1568
1540
|
|
|
@@ -1578,8 +1550,7 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1578
1550
|
|
|
1579
1551
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1580
1552
|
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][32].
|
|
1581
|
-
|
|
1582
|
-
Returns **[Promise][21]<any>**
|
|
1553
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1583
1554
|
|
|
1584
1555
|
### scrollPageToBottom
|
|
1585
1556
|
|
|
@@ -1589,7 +1560,7 @@ Scroll page to the bottom.
|
|
|
1589
1560
|
I.scrollPageToBottom();
|
|
1590
1561
|
```
|
|
1591
1562
|
|
|
1592
|
-
|
|
1563
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1593
1564
|
|
|
1594
1565
|
### scrollPageToTop
|
|
1595
1566
|
|
|
@@ -1599,7 +1570,7 @@ Scroll page to the top.
|
|
|
1599
1570
|
I.scrollPageToTop();
|
|
1600
1571
|
```
|
|
1601
1572
|
|
|
1602
|
-
|
|
1573
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1603
1574
|
|
|
1604
1575
|
### scrollTo
|
|
1605
1576
|
|
|
@@ -1614,10 +1585,9 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1614
1585
|
#### Parameters
|
|
1615
1586
|
|
|
1616
1587
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1617
|
-
- `offsetX` **[number][
|
|
1618
|
-
- `offsetY` **[number][
|
|
1619
|
-
|
|
1620
|
-
Returns **[Promise][21]<any>**
|
|
1588
|
+
- `offsetX` **[number][22]** (optional, `0` by default) X-axis offset.
|
|
1589
|
+
- `offsetY` **[number][22]** (optional, `0` by default) Y-axis offset.
|
|
1590
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1621
1591
|
|
|
1622
1592
|
### see
|
|
1623
1593
|
|
|
@@ -1633,13 +1603,12 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1633
1603
|
#### Parameters
|
|
1634
1604
|
|
|
1635
1605
|
- `text` **[string][19]** expected on page.
|
|
1636
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1637
|
-
|
|
1638
|
-
Returns **[Promise][21]<any>**
|
|
1606
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1607
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1639
1608
|
|
|
1640
1609
|
|
|
1641
1610
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1642
|
-
|
|
1611
|
+
|
|
1643
1612
|
|
|
1644
1613
|
### seeAttributesOnElements
|
|
1645
1614
|
|
|
@@ -1653,8 +1622,7 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1653
1622
|
|
|
1654
1623
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1655
1624
|
- `attributes` **[object][18]** attributes and their values to check.
|
|
1656
|
-
|
|
1657
|
-
Returns **[Promise][21]<any>**
|
|
1625
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1658
1626
|
|
|
1659
1627
|
### seeCheckboxIsChecked
|
|
1660
1628
|
|
|
@@ -1669,8 +1637,8 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1669
1637
|
#### Parameters
|
|
1670
1638
|
|
|
1671
1639
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
1672
|
-
|
|
1673
|
-
|
|
1640
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1641
|
+
Appium: not tested
|
|
1674
1642
|
|
|
1675
1643
|
### seeCookie
|
|
1676
1644
|
|
|
@@ -1683,8 +1651,7 @@ I.seeCookie('Auth');
|
|
|
1683
1651
|
#### Parameters
|
|
1684
1652
|
|
|
1685
1653
|
- `name` **[string][19]** cookie name.
|
|
1686
|
-
|
|
1687
|
-
Returns **[Promise][21]<any>**
|
|
1654
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1688
1655
|
|
|
1689
1656
|
### seeCssPropertiesOnElements
|
|
1690
1657
|
|
|
@@ -1698,8 +1665,7 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1698
1665
|
|
|
1699
1666
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1700
1667
|
- `cssProperties` **[object][18]** object with CSS properties and their values to check.
|
|
1701
|
-
|
|
1702
|
-
Returns **[Promise][21]<any>**
|
|
1668
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1703
1669
|
|
|
1704
1670
|
### seeCurrentUrlEquals
|
|
1705
1671
|
|
|
@@ -1715,8 +1681,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1715
1681
|
#### Parameters
|
|
1716
1682
|
|
|
1717
1683
|
- `url` **[string][19]** value to check.
|
|
1718
|
-
|
|
1719
|
-
Returns **[Promise][21]<any>**
|
|
1684
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1720
1685
|
|
|
1721
1686
|
### seeElement
|
|
1722
1687
|
|
|
@@ -1730,8 +1695,8 @@ I.seeElement('#modal');
|
|
|
1730
1695
|
#### Parameters
|
|
1731
1696
|
|
|
1732
1697
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1733
|
-
|
|
1734
|
-
|
|
1698
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1699
|
+
|
|
1735
1700
|
|
|
1736
1701
|
|
|
1737
1702
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1749,8 +1714,7 @@ I.seeElementInDOM('#modal');
|
|
|
1749
1714
|
#### Parameters
|
|
1750
1715
|
|
|
1751
1716
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1752
|
-
|
|
1753
|
-
Returns **[Promise][21]<any>**
|
|
1717
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1754
1718
|
|
|
1755
1719
|
### seeInCurrentUrl
|
|
1756
1720
|
|
|
@@ -1763,8 +1727,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1763
1727
|
#### Parameters
|
|
1764
1728
|
|
|
1765
1729
|
- `url` **[string][19]** a fragment to check
|
|
1766
|
-
|
|
1767
|
-
Returns **[Promise][21]<any>**
|
|
1730
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1768
1731
|
|
|
1769
1732
|
### seeInField
|
|
1770
1733
|
|
|
@@ -1782,8 +1745,7 @@ I.seeInField('#searchform input','Search');
|
|
|
1782
1745
|
|
|
1783
1746
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
1784
1747
|
- `value` **[string][19]** value to check.
|
|
1785
|
-
|
|
1786
|
-
Returns **[Promise][21]<any>**
|
|
1748
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1787
1749
|
|
|
1788
1750
|
### seeInPopup
|
|
1789
1751
|
|
|
@@ -1805,8 +1767,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1805
1767
|
#### Parameters
|
|
1806
1768
|
|
|
1807
1769
|
- `text` **[string][19]** value to check.
|
|
1808
|
-
|
|
1809
|
-
Returns **[Promise][21]<any>**
|
|
1770
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1810
1771
|
|
|
1811
1772
|
### seeInTitle
|
|
1812
1773
|
|
|
@@ -1819,8 +1780,7 @@ I.seeInTitle('Home Page');
|
|
|
1819
1780
|
#### Parameters
|
|
1820
1781
|
|
|
1821
1782
|
- `text` **[string][19]** text value to check.
|
|
1822
|
-
|
|
1823
|
-
Returns **[Promise][21]<any>**
|
|
1783
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1824
1784
|
|
|
1825
1785
|
### seeNumberOfElements
|
|
1826
1786
|
|
|
@@ -1834,9 +1794,9 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1834
1794
|
#### Parameters
|
|
1835
1795
|
|
|
1836
1796
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1837
|
-
- `num` **[number][
|
|
1838
|
-
|
|
1839
|
-
|
|
1797
|
+
- `num` **[number][22]** number of elements.
|
|
1798
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1799
|
+
|
|
1840
1800
|
|
|
1841
1801
|
|
|
1842
1802
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1854,9 +1814,9 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1854
1814
|
#### Parameters
|
|
1855
1815
|
|
|
1856
1816
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1857
|
-
- `num` **[number][
|
|
1858
|
-
|
|
1859
|
-
|
|
1817
|
+
- `num` **[number][22]** number of elements.
|
|
1818
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1819
|
+
|
|
1860
1820
|
|
|
1861
1821
|
|
|
1862
1822
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1873,9 +1833,8 @@ I.seeTextEquals('text', 'h1');
|
|
|
1873
1833
|
#### Parameters
|
|
1874
1834
|
|
|
1875
1835
|
- `text` **[string][19]** element value to check.
|
|
1876
|
-
- `context` **([string][19] | [object][18])?** element located by CSS|XPath|strict locator.
|
|
1877
|
-
|
|
1878
|
-
Returns **[Promise][21]<any>**
|
|
1836
|
+
- `context` **([string][19] | [object][18])?** element located by CSS|XPath|strict locator.
|
|
1837
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1879
1838
|
|
|
1880
1839
|
### seeTitleEquals
|
|
1881
1840
|
|
|
@@ -1888,8 +1847,7 @@ I.seeTitleEquals('Test title.');
|
|
|
1888
1847
|
#### Parameters
|
|
1889
1848
|
|
|
1890
1849
|
- `text` **[string][19]** value to check.
|
|
1891
|
-
|
|
1892
|
-
Returns **[Promise][21]<any>**
|
|
1850
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1893
1851
|
|
|
1894
1852
|
### selectOption
|
|
1895
1853
|
|
|
@@ -1916,8 +1874,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1916
1874
|
|
|
1917
1875
|
- `select` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1918
1876
|
- `option` **([string][19] | [Array][27]<any>)** visible text or value of option.
|
|
1919
|
-
|
|
1920
|
-
Returns **[Promise][21]<any>**
|
|
1877
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1921
1878
|
|
|
1922
1879
|
### setCookie
|
|
1923
1880
|
|
|
@@ -1938,9 +1895,8 @@ I.setCookie([
|
|
|
1938
1895
|
#### Parameters
|
|
1939
1896
|
|
|
1940
1897
|
- `cookie` **(Cookie | [Array][27]<Cookie>)** a cookie object or array of cookie objects.
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
format][33].
|
|
1898
|
+
[!] returns a _promise_ which is synchronized internally by recorderUses Selenium's JSON [cookie
|
|
1899
|
+
format][33].
|
|
1944
1900
|
|
|
1945
1901
|
### setGeoLocation
|
|
1946
1902
|
|
|
@@ -1953,11 +1909,10 @@ I.setGeoLocation(121.21, 11.56, 10);
|
|
|
1953
1909
|
|
|
1954
1910
|
#### Parameters
|
|
1955
1911
|
|
|
1956
|
-
- `latitude` **[number][
|
|
1957
|
-
- `longitude` **[number][
|
|
1958
|
-
- `altitude` **[number][
|
|
1959
|
-
|
|
1960
|
-
Returns **[Promise][21]<any>**
|
|
1912
|
+
- `latitude` **[number][22]** to set.
|
|
1913
|
+
- `longitude` **[number][22]** to set
|
|
1914
|
+
- `altitude` **[number][22]?** (optional, null by default) to set
|
|
1915
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1961
1916
|
|
|
1962
1917
|
### switchTo
|
|
1963
1918
|
|
|
@@ -1970,9 +1925,8 @@ I.switchTo(); // switch back to main page
|
|
|
1970
1925
|
|
|
1971
1926
|
#### Parameters
|
|
1972
1927
|
|
|
1973
|
-
- `locator` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1974
|
-
|
|
1975
|
-
Returns **[Promise][21]<any>**
|
|
1928
|
+
- `locator` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1929
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1976
1930
|
|
|
1977
1931
|
### switchToNextTab
|
|
1978
1932
|
|
|
@@ -1985,10 +1939,9 @@ I.switchToNextTab(2);
|
|
|
1985
1939
|
|
|
1986
1940
|
#### Parameters
|
|
1987
1941
|
|
|
1988
|
-
- `num` **[number][
|
|
1989
|
-
- `sec` **([number][
|
|
1990
|
-
|
|
1991
|
-
Returns **[Promise][21]<any>**
|
|
1942
|
+
- `num` **[number][22]?** (optional) number of tabs to switch forward, default: 1.
|
|
1943
|
+
- `sec` **([number][22] | null)?** (optional) time in seconds to wait.
|
|
1944
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1992
1945
|
|
|
1993
1946
|
### switchToPreviousTab
|
|
1994
1947
|
|
|
@@ -2001,10 +1954,9 @@ I.switchToPreviousTab(2);
|
|
|
2001
1954
|
|
|
2002
1955
|
#### Parameters
|
|
2003
1956
|
|
|
2004
|
-
- `num` **[number][
|
|
2005
|
-
- `sec` **[number][
|
|
2006
|
-
|
|
2007
|
-
Returns **[Promise][21]<any>**
|
|
1957
|
+
- `num` **[number][22]?** (optional) number of tabs to switch backward, default: 1.
|
|
1958
|
+
- `sec` **[number][22]??** (optional) time in seconds to wait.
|
|
1959
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2008
1960
|
|
|
2009
1961
|
### switchToWindow
|
|
2010
1962
|
|
|
@@ -2044,11 +1996,10 @@ I.type(['T', 'E', 'X', 'T']);
|
|
|
2044
1996
|
#### Parameters
|
|
2045
1997
|
|
|
2046
1998
|
- `keys`
|
|
2047
|
-
- `delay` **[number][
|
|
1999
|
+
- `delay` **[number][22]?** (optional) delay in ms between key presses
|
|
2000
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2048
2001
|
- `key` **([string][19] | [Array][27]<[string][19]>)** or array of keys to type.
|
|
2049
2002
|
|
|
2050
|
-
Returns **[Promise][21]<any>**
|
|
2051
|
-
|
|
2052
2003
|
### uncheckOption
|
|
2053
2004
|
|
|
2054
2005
|
Unselects a checkbox or radio button.
|
|
@@ -2065,9 +2016,9 @@ I.uncheckOption('agree', '//form');
|
|
|
2065
2016
|
#### Parameters
|
|
2066
2017
|
|
|
2067
2018
|
- `field` **([string][19] | [object][18])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
2068
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2069
|
-
|
|
2070
|
-
|
|
2019
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2020
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2021
|
+
Appium: not tested
|
|
2071
2022
|
|
|
2072
2023
|
### useWebDriverTo
|
|
2073
2024
|
|
|
@@ -2088,7 +2039,7 @@ I.useWebDriverTo('open multiple windows', async ({ browser }) {
|
|
|
2088
2039
|
#### Parameters
|
|
2089
2040
|
|
|
2090
2041
|
- `description` **[string][19]** used to show in logs.
|
|
2091
|
-
- `fn` **[function][
|
|
2042
|
+
- `fn` **[function][24]** async functuion that executed with WebDriver helper as argument
|
|
2092
2043
|
|
|
2093
2044
|
### wait
|
|
2094
2045
|
|
|
@@ -2100,9 +2051,8 @@ I.wait(2); // wait 2 secs
|
|
|
2100
2051
|
|
|
2101
2052
|
#### Parameters
|
|
2102
2053
|
|
|
2103
|
-
- `sec` **[number][
|
|
2104
|
-
|
|
2105
|
-
Returns **[Promise][21]<any>**
|
|
2054
|
+
- `sec` **[number][22]** number of second to wait.
|
|
2055
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2106
2056
|
|
|
2107
2057
|
### waitForClickable
|
|
2108
2058
|
|
|
@@ -2118,9 +2068,8 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
2118
2068
|
|
|
2119
2069
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2120
2070
|
- `waitTimeout`
|
|
2121
|
-
- `sec` **[number][
|
|
2122
|
-
|
|
2123
|
-
Returns **[Promise][21]<any>**
|
|
2071
|
+
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2072
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2124
2073
|
|
|
2125
2074
|
### waitForDetached
|
|
2126
2075
|
|
|
@@ -2134,9 +2083,8 @@ I.waitForDetached('#popup');
|
|
|
2134
2083
|
#### Parameters
|
|
2135
2084
|
|
|
2136
2085
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2137
|
-
- `sec` **[number][
|
|
2138
|
-
|
|
2139
|
-
Returns **[Promise][21]<any>**
|
|
2086
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2087
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2140
2088
|
|
|
2141
2089
|
### waitForElement
|
|
2142
2090
|
|
|
@@ -2151,9 +2099,8 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
2151
2099
|
#### Parameters
|
|
2152
2100
|
|
|
2153
2101
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2154
|
-
- `sec` **[number][
|
|
2155
|
-
|
|
2156
|
-
Returns **[Promise][21]<any>**
|
|
2102
|
+
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2103
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2157
2104
|
|
|
2158
2105
|
### waitForEnabled
|
|
2159
2106
|
|
|
@@ -2163,9 +2110,8 @@ Element can be located by CSS or XPath.
|
|
|
2163
2110
|
#### Parameters
|
|
2164
2111
|
|
|
2165
2112
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2166
|
-
- `sec` **[number][
|
|
2167
|
-
|
|
2168
|
-
Returns **[Promise][21]<any>**
|
|
2113
|
+
- `sec` **[number][22]** (optional) time in seconds to wait, 1 by default.
|
|
2114
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2169
2115
|
|
|
2170
2116
|
### waitForFunction
|
|
2171
2117
|
|
|
@@ -2184,11 +2130,10 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
2184
2130
|
|
|
2185
2131
|
#### Parameters
|
|
2186
2132
|
|
|
2187
|
-
- `fn` **([string][19] | [function][
|
|
2188
|
-
- `argsOrSec` **([Array][27]<any> | [number][
|
|
2189
|
-
- `sec` **[number][
|
|
2190
|
-
|
|
2191
|
-
Returns **[Promise][21]<any>**
|
|
2133
|
+
- `fn` **([string][19] | [function][24])** to be executed in browser context.
|
|
2134
|
+
- `argsOrSec` **([Array][27]<any> | [number][22])?** (optional, `1` by default) arguments for function or seconds.
|
|
2135
|
+
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2136
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2192
2137
|
|
|
2193
2138
|
### waitForInvisible
|
|
2194
2139
|
|
|
@@ -2202,9 +2147,8 @@ I.waitForInvisible('#popup');
|
|
|
2202
2147
|
#### Parameters
|
|
2203
2148
|
|
|
2204
2149
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2205
|
-
- `sec` **[number][
|
|
2206
|
-
|
|
2207
|
-
Returns **[Promise][21]<any>**
|
|
2150
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2151
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2208
2152
|
|
|
2209
2153
|
### waitForText
|
|
2210
2154
|
|
|
@@ -2220,10 +2164,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2220
2164
|
#### Parameters
|
|
2221
2165
|
|
|
2222
2166
|
- `text` **[string][19]** to wait for.
|
|
2223
|
-
- `sec` **[number][
|
|
2224
|
-
- `context` **([string][19] | [object][18])?** (optional) element located by CSS|XPath|strict locator.
|
|
2225
|
-
|
|
2226
|
-
Returns **[Promise][21]<any>**
|
|
2167
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2168
|
+
- `context` **([string][19] | [object][18])?** (optional) element located by CSS|XPath|strict locator.
|
|
2169
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2227
2170
|
|
|
2228
2171
|
### waitForValue
|
|
2229
2172
|
|
|
@@ -2237,9 +2180,8 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2237
2180
|
|
|
2238
2181
|
- `field` **([string][19] | [object][18])** input field.
|
|
2239
2182
|
- `value` **[string][19]** expected value.
|
|
2240
|
-
- `sec` **[number][
|
|
2241
|
-
|
|
2242
|
-
Returns **[Promise][21]<any>**
|
|
2183
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2184
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2243
2185
|
|
|
2244
2186
|
### waitForVisible
|
|
2245
2187
|
|
|
@@ -2253,9 +2195,8 @@ I.waitForVisible('#popup');
|
|
|
2253
2195
|
#### Parameters
|
|
2254
2196
|
|
|
2255
2197
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2256
|
-
- `sec` **[number][
|
|
2257
|
-
|
|
2258
|
-
Returns **[Promise][21]<any>**
|
|
2198
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2199
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2259
2200
|
|
|
2260
2201
|
### waitInUrl
|
|
2261
2202
|
|
|
@@ -2268,9 +2209,8 @@ I.waitInUrl('/info', 2);
|
|
|
2268
2209
|
#### Parameters
|
|
2269
2210
|
|
|
2270
2211
|
- `urlPart` **[string][19]** value to check.
|
|
2271
|
-
- `sec` **[number][
|
|
2272
|
-
|
|
2273
|
-
Returns **[Promise][21]<any>**
|
|
2212
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2213
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2274
2214
|
|
|
2275
2215
|
### waitNumberOfVisibleElements
|
|
2276
2216
|
|
|
@@ -2283,10 +2223,9 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2283
2223
|
#### Parameters
|
|
2284
2224
|
|
|
2285
2225
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2286
|
-
- `num` **[number][
|
|
2287
|
-
- `sec` **[number][
|
|
2288
|
-
|
|
2289
|
-
Returns **[Promise][21]<any>**
|
|
2226
|
+
- `num` **[number][22]** number of elements.
|
|
2227
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2228
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2290
2229
|
|
|
2291
2230
|
### waitToHide
|
|
2292
2231
|
|
|
@@ -2300,9 +2239,8 @@ I.waitToHide('#popup');
|
|
|
2300
2239
|
#### Parameters
|
|
2301
2240
|
|
|
2302
2241
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2303
|
-
- `sec` **[number][
|
|
2304
|
-
|
|
2305
|
-
Returns **[Promise][21]<any>**
|
|
2242
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2243
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2306
2244
|
|
|
2307
2245
|
### waitUrlEquals
|
|
2308
2246
|
|
|
@@ -2316,9 +2254,8 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2316
2254
|
#### Parameters
|
|
2317
2255
|
|
|
2318
2256
|
- `urlPart` **[string][19]** value to check.
|
|
2319
|
-
- `sec` **[number][
|
|
2320
|
-
|
|
2321
|
-
Returns **[Promise][21]<any>**
|
|
2257
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2258
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2322
2259
|
|
|
2323
2260
|
[1]: http://webdriver.io/
|
|
2324
2261
|
|
|
@@ -2360,17 +2297,17 @@ Returns **[Promise][21]<any>**
|
|
|
2360
2297
|
|
|
2361
2298
|
[20]: http://jster.net/category/windows-modals-popups
|
|
2362
2299
|
|
|
2363
|
-
[21]: https://
|
|
2300
|
+
[21]: https://webdriver.io/docs/timeouts.html
|
|
2364
2301
|
|
|
2365
|
-
[22]: https://
|
|
2302
|
+
[22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
2366
2303
|
|
|
2367
|
-
[23]: https://
|
|
2304
|
+
[23]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
2368
2305
|
|
|
2369
|
-
[24]: https://
|
|
2306
|
+
[24]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2370
2307
|
|
|
2371
|
-
[25]:
|
|
2308
|
+
[25]: http://webdriver.io/api/protocol/execute.html
|
|
2372
2309
|
|
|
2373
|
-
[26]:
|
|
2310
|
+
[26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2374
2311
|
|
|
2375
2312
|
[27]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
2376
2313
|
|