codeceptjs 3.3.0-beta.5 → 3.3.2
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 +50 -1
- package/README.md +6 -1
- package/docs/api.md +45 -30
- package/docs/bdd.md +1 -0
- package/docs/best.md +1 -1
- package/docs/build/ApiDataFactory.js +4 -3
- package/docs/build/Appium.js +53 -48
- package/docs/build/GraphQL.js +4 -2
- package/docs/build/GraphQLDataFactory.js +3 -3
- package/docs/build/JSONResponse.js +1 -1
- package/docs/build/Nightmare.js +101 -72
- package/docs/build/Playwright.js +166 -113
- package/docs/build/Protractor.js +72 -34
- package/docs/build/Puppeteer.js +143 -100
- package/docs/build/REST.js +5 -2
- package/docs/build/TestCafe.js +97 -66
- package/docs/build/WebDriver.js +183 -135
- package/docs/changelog.md +99 -0
- package/docs/custom-helpers.md +1 -1
- package/docs/data.md +2 -2
- package/docs/email.md +5 -0
- package/docs/helpers/ApiDataFactory.md +7 -3
- package/docs/helpers/Appium.md +217 -175
- package/docs/helpers/GraphQL.md +6 -0
- package/docs/helpers/GraphQLDataFactory.md +3 -3
- package/docs/helpers/JSONResponse.md +1 -1
- package/docs/helpers/MockRequest.md +8 -6
- package/docs/helpers/Nightmare.md +98 -45
- package/docs/helpers/Playwright.md +151 -59
- package/docs/helpers/Puppeteer.md +103 -26
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/TestCafe.md +77 -22
- package/docs/helpers/WebDriver.md +150 -62
- package/docs/index.md +1 -1
- package/docs/locators.md +1 -1
- package/docs/videos.md +2 -2
- package/docs/webapi/amOnPage.mustache +2 -1
- package/docs/webapi/appendField.mustache +2 -1
- package/docs/webapi/attachFile.mustache +2 -1
- package/docs/webapi/checkOption.mustache +2 -1
- package/docs/webapi/clearCookie.mustache +2 -1
- package/docs/webapi/clearField.mustache +1 -0
- package/docs/webapi/click.mustache +2 -1
- package/docs/webapi/clickLink.mustache +2 -1
- package/docs/webapi/closeCurrentTab.mustache +6 -4
- package/docs/webapi/closeOtherTabs.mustache +6 -4
- package/docs/webapi/dontSee.mustache +1 -0
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -0
- package/docs/webapi/dontSeeCookie.mustache +2 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +2 -1
- package/docs/webapi/dontSeeElement.mustache +2 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +2 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +2 -1
- package/docs/webapi/dontSeeInField.mustache +2 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -0
- package/docs/webapi/dontSeeInTitle.mustache +2 -1
- package/docs/webapi/doubleClick.mustache +1 -0
- package/docs/webapi/downloadFile.mustache +2 -1
- package/docs/webapi/dragAndDrop.mustache +1 -0
- package/docs/webapi/dragSlider.mustache +2 -1
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -0
- package/docs/webapi/forceClick.mustache +1 -0
- package/docs/webapi/forceRightClick.mustache +1 -0
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +2 -1
- package/docs/webapi/moveCursorTo.mustache +1 -0
- package/docs/webapi/openNewTab.mustache +6 -4
- package/docs/webapi/pressKey.mustache +2 -1
- package/docs/webapi/pressKeyDown.mustache +1 -0
- package/docs/webapi/pressKeyUp.mustache +1 -0
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -0
- package/docs/webapi/refreshPage.mustache +1 -0
- package/docs/webapi/resizeWindow.mustache +2 -1
- package/docs/webapi/rightClick.mustache +1 -0
- package/docs/webapi/saveElementScreenshot.mustache +1 -0
- package/docs/webapi/saveScreenshot.mustache +2 -1
- package/docs/webapi/say.mustache +2 -1
- package/docs/webapi/scrollIntoView.mustache +1 -0
- package/docs/webapi/scrollPageToBottom.mustache +1 -0
- package/docs/webapi/scrollPageToTop.mustache +1 -0
- package/docs/webapi/scrollTo.mustache +2 -1
- package/docs/webapi/see.mustache +2 -1
- package/docs/webapi/seeAttributesOnElements.mustache +2 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -0
- package/docs/webapi/seeCookie.mustache +1 -0
- package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +2 -1
- package/docs/webapi/seeElement.mustache +2 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -0
- package/docs/webapi/seeInCurrentUrl.mustache +2 -1
- package/docs/webapi/seeInField.mustache +1 -0
- package/docs/webapi/seeInPopup.mustache +1 -0
- package/docs/webapi/seeInSource.mustache +2 -1
- package/docs/webapi/seeInTitle.mustache +2 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -0
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -0
- package/docs/webapi/seeTextEquals.mustache +2 -1
- package/docs/webapi/seeTitleEquals.mustache +6 -5
- package/docs/webapi/selectOption.mustache +1 -0
- package/docs/webapi/setCookie.mustache +1 -0
- package/docs/webapi/setGeoLocation.mustache +1 -0
- package/docs/webapi/switchTo.mustache +2 -1
- package/docs/webapi/switchToNextTab.mustache +8 -7
- package/docs/webapi/switchToPreviousTab.mustache +8 -7
- package/docs/webapi/type.mustache +1 -0
- package/docs/webapi/uncheckOption.mustache +2 -1
- package/docs/webapi/wait.mustache +2 -1
- package/docs/webapi/waitForClickable.mustache +2 -1
- package/docs/webapi/waitForDetached.mustache +2 -1
- package/docs/webapi/waitForElement.mustache +2 -1
- package/docs/webapi/waitForEnabled.mustache +2 -1
- package/docs/webapi/waitForFunction.mustache +1 -0
- package/docs/webapi/waitForInvisible.mustache +2 -1
- package/docs/webapi/waitForText.mustache +2 -1
- package/docs/webapi/waitForValue.mustache +1 -0
- package/docs/webapi/waitForVisible.mustache +1 -0
- package/docs/webapi/waitInUrl.mustache +2 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -1
- package/docs/webapi/waitToHide.mustache +2 -1
- package/docs/webapi/waitUrlEquals.mustache +2 -1
- package/lib/command/definitions.js +9 -0
- package/lib/command/run.js +2 -2
- package/lib/command/workers/runTests.js +40 -0
- package/lib/helper/ApiDataFactory.js +4 -3
- package/lib/helper/Appium.js +2 -7
- package/lib/helper/GraphQL.js +4 -2
- package/lib/helper/GraphQLDataFactory.js +3 -3
- package/lib/helper/JSONResponse.js +1 -1
- package/lib/helper/Playwright.js +28 -17
- package/lib/helper/REST.js +5 -2
- package/lib/helper/WebDriver.js +4 -0
- package/lib/interfaces/bdd.js +5 -0
- package/lib/listener/steps.js +1 -0
- package/lib/plugin/fakerTransform.js +1 -1
- package/lib/plugin/stepByStepReport.js +8 -6
- package/lib/workers.js +12 -0
- package/package.json +3 -3
- package/typings/types.d.ts +578 -109
|
@@ -449,6 +449,8 @@ I.amOnPage('/login'); // opens a login page
|
|
|
449
449
|
|
|
450
450
|
- `url` **[string][19]** url path or global url.
|
|
451
451
|
|
|
452
|
+
Returns **void** automatically synchronized promise with recorder #!
|
|
453
|
+
|
|
452
454
|
### appendField
|
|
453
455
|
|
|
454
456
|
Appends text to a input field or textarea.
|
|
@@ -462,6 +464,7 @@ I.appendField('#myTextField', 'appended');
|
|
|
462
464
|
|
|
463
465
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator
|
|
464
466
|
- `value` **[string][19]** text value to append.
|
|
467
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
465
468
|
|
|
466
469
|
|
|
467
470
|
|
|
@@ -483,6 +486,7 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
483
486
|
|
|
484
487
|
- `locator` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
485
488
|
- `pathToFile` **[string][19]** local file path relative to codecept.json config file.
|
|
489
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
486
490
|
Appium: not tested
|
|
487
491
|
|
|
488
492
|
### cancelPopup
|
|
@@ -506,6 +510,7 @@ I.checkOption('agree', '//form');
|
|
|
506
510
|
|
|
507
511
|
- `field` **([string][19] | [object][18])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
508
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
|
|
509
514
|
Appium: not tested
|
|
510
515
|
|
|
511
516
|
### clearCookie
|
|
@@ -520,7 +525,8 @@ I.clearCookie('test');
|
|
|
520
525
|
|
|
521
526
|
#### Parameters
|
|
522
527
|
|
|
523
|
-
- `cookie` **[string][19]?** (optional, `null` by default) cookie name
|
|
528
|
+
- `cookie` **[string][19]?** (optional, `null` by default) cookie name
|
|
529
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
524
530
|
|
|
525
531
|
### clearField
|
|
526
532
|
|
|
@@ -536,6 +542,7 @@ I.clearField('#email');
|
|
|
536
542
|
|
|
537
543
|
- `field`
|
|
538
544
|
- `editable` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
545
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
539
546
|
|
|
540
547
|
### click
|
|
541
548
|
|
|
@@ -564,7 +571,8 @@ I.click({css: 'nav a.login'});
|
|
|
564
571
|
#### Parameters
|
|
565
572
|
|
|
566
573
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
567
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
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
|
|
568
576
|
|
|
569
577
|
|
|
570
578
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -578,6 +586,8 @@ Close current tab.
|
|
|
578
586
|
I.closeCurrentTab();
|
|
579
587
|
```
|
|
580
588
|
|
|
589
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
590
|
+
|
|
581
591
|
### closeOtherTabs
|
|
582
592
|
|
|
583
593
|
Close all tabs except for the current one.
|
|
@@ -586,6 +596,8 @@ Close all tabs except for the current one.
|
|
|
586
596
|
I.closeOtherTabs();
|
|
587
597
|
```
|
|
588
598
|
|
|
599
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
600
|
+
|
|
589
601
|
### defineTimeout
|
|
590
602
|
|
|
591
603
|
Set [WebDriver timeouts][21] in realtime.
|
|
@@ -615,6 +627,7 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
615
627
|
|
|
616
628
|
- `text` **[string][19]** which is not present.
|
|
617
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
|
|
618
631
|
|
|
619
632
|
|
|
620
633
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -632,7 +645,9 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
632
645
|
|
|
633
646
|
#### Parameters
|
|
634
647
|
|
|
635
|
-
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
648
|
+
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
649
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
650
|
+
Appium: not tested
|
|
636
651
|
|
|
637
652
|
### dontSeeCookie
|
|
638
653
|
|
|
@@ -645,6 +660,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
645
660
|
#### Parameters
|
|
646
661
|
|
|
647
662
|
- `name` **[string][19]** cookie name.
|
|
663
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
648
664
|
|
|
649
665
|
### dontSeeCurrentUrlEquals
|
|
650
666
|
|
|
@@ -659,6 +675,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
659
675
|
#### Parameters
|
|
660
676
|
|
|
661
677
|
- `url` **[string][19]** value to check.
|
|
678
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
662
679
|
|
|
663
680
|
### dontSeeElement
|
|
664
681
|
|
|
@@ -671,6 +688,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
671
688
|
#### Parameters
|
|
672
689
|
|
|
673
690
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|Strict locator.
|
|
691
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
674
692
|
|
|
675
693
|
|
|
676
694
|
|
|
@@ -688,6 +706,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
688
706
|
#### Parameters
|
|
689
707
|
|
|
690
708
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|Strict locator.
|
|
709
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
691
710
|
|
|
692
711
|
### dontSeeInCurrentUrl
|
|
693
712
|
|
|
@@ -696,6 +715,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
696
715
|
#### Parameters
|
|
697
716
|
|
|
698
717
|
- `url` **[string][19]** value to check.
|
|
718
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
699
719
|
|
|
700
720
|
### dontSeeInField
|
|
701
721
|
|
|
@@ -711,6 +731,7 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
711
731
|
|
|
712
732
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
713
733
|
- `value` **[string][19]** value to check.
|
|
734
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
714
735
|
|
|
715
736
|
### dontSeeInSource
|
|
716
737
|
|
|
@@ -724,6 +745,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
724
745
|
|
|
725
746
|
- `text`
|
|
726
747
|
- `value` **[string][19]** to check.
|
|
748
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
727
749
|
|
|
728
750
|
### dontSeeInTitle
|
|
729
751
|
|
|
@@ -736,6 +758,7 @@ I.dontSeeInTitle('Error');
|
|
|
736
758
|
#### Parameters
|
|
737
759
|
|
|
738
760
|
- `text` **[string][19]** value to check.
|
|
761
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
739
762
|
|
|
740
763
|
### doubleClick
|
|
741
764
|
|
|
@@ -753,6 +776,7 @@ I.doubleClick('.btn.edit');
|
|
|
753
776
|
|
|
754
777
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
755
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
|
|
756
780
|
|
|
757
781
|
|
|
758
782
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -769,7 +793,9 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
769
793
|
#### Parameters
|
|
770
794
|
|
|
771
795
|
- `srcElement` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
772
|
-
- `destElement` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
796
|
+
- `destElement` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
797
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
798
|
+
Appium: not tested
|
|
773
799
|
|
|
774
800
|
### dragSlider
|
|
775
801
|
|
|
@@ -784,7 +810,8 @@ I.dragSlider('#slider', -70);
|
|
|
784
810
|
#### Parameters
|
|
785
811
|
|
|
786
812
|
- `locator` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
787
|
-
- `offsetX` **[number][22]** position to drag.
|
|
813
|
+
- `offsetX` **[number][22]** position to drag.
|
|
814
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
788
815
|
|
|
789
816
|
### executeAsyncScript
|
|
790
817
|
|
|
@@ -812,10 +839,9 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
812
839
|
#### Parameters
|
|
813
840
|
|
|
814
841
|
- `args` **...any** to be passed to function.
|
|
842
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
815
843
|
- `fn` **([string][19] | [function][24])** function to be executed in browser context.
|
|
816
844
|
|
|
817
|
-
Returns **[Promise][25]<any>**
|
|
818
|
-
|
|
819
845
|
### executeScript
|
|
820
846
|
|
|
821
847
|
Executes sync script on a page.
|
|
@@ -845,10 +871,9 @@ let date = await I.executeScript(function(el) {
|
|
|
845
871
|
#### Parameters
|
|
846
872
|
|
|
847
873
|
- `args` **...any** to be passed to function.
|
|
874
|
+
[!] returns a _promise_ which is synchronized internally by recorderWraps [execute][25] command.
|
|
848
875
|
- `fn` **([string][19] | [function][24])** function to be executed in browser context.
|
|
849
876
|
|
|
850
|
-
Returns **[Promise][25]<any>** Wraps [execute][26] command.
|
|
851
|
-
|
|
852
877
|
### fillField
|
|
853
878
|
|
|
854
879
|
Fills a text field or textarea, after clearing its value, with the given string.
|
|
@@ -869,6 +894,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
869
894
|
|
|
870
895
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
871
896
|
- `value` **([string][19] | [object][18])** text value to fill.
|
|
897
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
898
|
+
|
|
872
899
|
|
|
873
900
|
|
|
874
901
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -906,6 +933,7 @@ I.forceClick({css: 'nav a.login'});
|
|
|
906
933
|
|
|
907
934
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
908
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
|
|
909
937
|
|
|
910
938
|
|
|
911
939
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -932,6 +960,7 @@ I.forceRightClick('Menu');
|
|
|
932
960
|
|
|
933
961
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
934
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
|
|
935
964
|
|
|
936
965
|
|
|
937
966
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -946,7 +975,7 @@ Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
|
|
|
946
975
|
const windows = await I.grabAllWindowHandles();
|
|
947
976
|
```
|
|
948
977
|
|
|
949
|
-
Returns **[Promise][
|
|
978
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>**
|
|
950
979
|
|
|
951
980
|
### grabAttributeFrom
|
|
952
981
|
|
|
@@ -963,7 +992,7 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
963
992
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
964
993
|
- `attr` **[string][19]** attribute name.
|
|
965
994
|
|
|
966
|
-
Returns **[Promise][
|
|
995
|
+
Returns **[Promise][26]<[string][19]>** attribute value
|
|
967
996
|
|
|
968
997
|
### grabAttributeFromAll
|
|
969
998
|
|
|
@@ -979,7 +1008,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
979
1008
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
980
1009
|
- `attr` **[string][19]** attribute name.
|
|
981
1010
|
|
|
982
|
-
Returns **[Promise][
|
|
1011
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>** attribute value
|
|
983
1012
|
|
|
984
1013
|
### grabBrowserLogs
|
|
985
1014
|
|
|
@@ -991,7 +1020,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
991
1020
|
console.log(JSON.stringify(logs))
|
|
992
1021
|
```
|
|
993
1022
|
|
|
994
|
-
Returns **([Promise][
|
|
1023
|
+
Returns **([Promise][26]<[Array][27]<[object][18]>> | [undefined][28])** all browser logs
|
|
995
1024
|
|
|
996
1025
|
### grabCookie
|
|
997
1026
|
|
|
@@ -1008,7 +1037,7 @@ assert(cookie.value, '123456');
|
|
|
1008
1037
|
|
|
1009
1038
|
- `name` **[string][19]?** cookie name.
|
|
1010
1039
|
|
|
1011
|
-
Returns **([Promise][
|
|
1040
|
+
Returns **([Promise][26]<[string][19]> | [Promise][26]<[Array][27]<[string][19]>>)** attribute value
|
|
1012
1041
|
|
|
1013
1042
|
### grabCssPropertyFrom
|
|
1014
1043
|
|
|
@@ -1025,7 +1054,7 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
1025
1054
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1026
1055
|
- `cssProperty` **[string][19]** CSS property name.
|
|
1027
1056
|
|
|
1028
|
-
Returns **[Promise][
|
|
1057
|
+
Returns **[Promise][26]<[string][19]>** CSS value
|
|
1029
1058
|
|
|
1030
1059
|
### grabCssPropertyFromAll
|
|
1031
1060
|
|
|
@@ -1041,7 +1070,7 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
1041
1070
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1042
1071
|
- `cssProperty` **[string][19]** CSS property name.
|
|
1043
1072
|
|
|
1044
|
-
Returns **[Promise][
|
|
1073
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>** CSS value
|
|
1045
1074
|
|
|
1046
1075
|
### grabCurrentUrl
|
|
1047
1076
|
|
|
@@ -1053,7 +1082,7 @@ let url = await I.grabCurrentUrl();
|
|
|
1053
1082
|
console.log(`Current URL is [${url}]`);
|
|
1054
1083
|
```
|
|
1055
1084
|
|
|
1056
|
-
Returns **[Promise][
|
|
1085
|
+
Returns **[Promise][26]<[string][19]>** current URL
|
|
1057
1086
|
|
|
1058
1087
|
### grabCurrentWindowHandle
|
|
1059
1088
|
|
|
@@ -1064,7 +1093,7 @@ Useful for referencing it when calling `I.switchToWindow(handle)`
|
|
|
1064
1093
|
const window = await I.grabCurrentWindowHandle();
|
|
1065
1094
|
```
|
|
1066
1095
|
|
|
1067
|
-
Returns **[Promise][
|
|
1096
|
+
Returns **[Promise][26]<[string][19]>**
|
|
1068
1097
|
|
|
1069
1098
|
### grabElementBoundingRect
|
|
1070
1099
|
|
|
@@ -1092,7 +1121,7 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
1092
1121
|
- `prop`
|
|
1093
1122
|
- `elementSize` **[string][19]?** x, y, width or height of the given element.
|
|
1094
1123
|
|
|
1095
|
-
Returns **([Promise][
|
|
1124
|
+
Returns **([Promise][26]<DOMRect> | [Promise][26]<[number][22]>)** Element bounding rectangle
|
|
1096
1125
|
|
|
1097
1126
|
### grabGeoLocation
|
|
1098
1127
|
|
|
@@ -1103,7 +1132,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1103
1132
|
let geoLocation = await I.grabGeoLocation();
|
|
1104
1133
|
```
|
|
1105
1134
|
|
|
1106
|
-
Returns **[Promise][
|
|
1135
|
+
Returns **[Promise][26]<{latitude: [number][22], longitude: [number][22], altitude: [number][22]}>**
|
|
1107
1136
|
|
|
1108
1137
|
### grabHTMLFrom
|
|
1109
1138
|
|
|
@@ -1120,7 +1149,7 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1120
1149
|
- `locator`
|
|
1121
1150
|
- `element` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1122
1151
|
|
|
1123
|
-
Returns **[Promise][
|
|
1152
|
+
Returns **[Promise][26]<[string][19]>** HTML code for an element
|
|
1124
1153
|
|
|
1125
1154
|
### grabHTMLFromAll
|
|
1126
1155
|
|
|
@@ -1136,7 +1165,7 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1136
1165
|
- `locator`
|
|
1137
1166
|
- `element` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1138
1167
|
|
|
1139
|
-
Returns **[Promise][
|
|
1168
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>** HTML code for an element
|
|
1140
1169
|
|
|
1141
1170
|
### grabNumberOfOpenTabs
|
|
1142
1171
|
|
|
@@ -1147,7 +1176,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1147
1176
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1148
1177
|
```
|
|
1149
1178
|
|
|
1150
|
-
Returns **[Promise][
|
|
1179
|
+
Returns **[Promise][26]<[number][22]>** number of open tabs
|
|
1151
1180
|
|
|
1152
1181
|
### grabNumberOfVisibleElements
|
|
1153
1182
|
|
|
@@ -1162,7 +1191,7 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1162
1191
|
|
|
1163
1192
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1164
1193
|
|
|
1165
|
-
Returns **[Promise][
|
|
1194
|
+
Returns **[Promise][26]<[number][22]>** number of visible elements
|
|
1166
1195
|
|
|
1167
1196
|
### grabPageScrollPosition
|
|
1168
1197
|
|
|
@@ -1173,7 +1202,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1173
1202
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1174
1203
|
```
|
|
1175
1204
|
|
|
1176
|
-
Returns **[Promise][
|
|
1205
|
+
Returns **[Promise][26]<PageScrollPosition>** scroll position
|
|
1177
1206
|
|
|
1178
1207
|
### grabPopupText
|
|
1179
1208
|
|
|
@@ -1183,7 +1212,7 @@ Grab the text within the popup. If no popup is visible then it will return null.
|
|
|
1183
1212
|
await I.grabPopupText();
|
|
1184
1213
|
```
|
|
1185
1214
|
|
|
1186
|
-
Returns **[Promise][
|
|
1215
|
+
Returns **[Promise][26]<[string][19]>**
|
|
1187
1216
|
|
|
1188
1217
|
### grabSource
|
|
1189
1218
|
|
|
@@ -1194,7 +1223,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1194
1223
|
let pageSource = await I.grabSource();
|
|
1195
1224
|
```
|
|
1196
1225
|
|
|
1197
|
-
Returns **[Promise][
|
|
1226
|
+
Returns **[Promise][26]<[string][19]>** source code
|
|
1198
1227
|
|
|
1199
1228
|
### grabTextFrom
|
|
1200
1229
|
|
|
@@ -1211,7 +1240,7 @@ If multiple elements found returns first element.
|
|
|
1211
1240
|
|
|
1212
1241
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1213
1242
|
|
|
1214
|
-
Returns **[Promise][
|
|
1243
|
+
Returns **[Promise][26]<[string][19]>** attribute value
|
|
1215
1244
|
|
|
1216
1245
|
### grabTextFromAll
|
|
1217
1246
|
|
|
@@ -1226,7 +1255,7 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1226
1255
|
|
|
1227
1256
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1228
1257
|
|
|
1229
|
-
Returns **[Promise][
|
|
1258
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>** attribute value
|
|
1230
1259
|
|
|
1231
1260
|
### grabTitle
|
|
1232
1261
|
|
|
@@ -1237,7 +1266,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1237
1266
|
let title = await I.grabTitle();
|
|
1238
1267
|
```
|
|
1239
1268
|
|
|
1240
|
-
Returns **[Promise][
|
|
1269
|
+
Returns **[Promise][26]<[string][19]>** title
|
|
1241
1270
|
|
|
1242
1271
|
### grabValueFrom
|
|
1243
1272
|
|
|
@@ -1253,7 +1282,7 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1253
1282
|
|
|
1254
1283
|
- `locator` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1255
1284
|
|
|
1256
|
-
Returns **[Promise][
|
|
1285
|
+
Returns **[Promise][26]<[string][19]>** attribute value
|
|
1257
1286
|
|
|
1258
1287
|
### grabValueFromAll
|
|
1259
1288
|
|
|
@@ -1268,7 +1297,7 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1268
1297
|
|
|
1269
1298
|
- `locator` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1270
1299
|
|
|
1271
|
-
Returns **[Promise][
|
|
1300
|
+
Returns **[Promise][26]<[Array][27]<[string][19]>>** attribute value
|
|
1272
1301
|
|
|
1273
1302
|
### moveCursorTo
|
|
1274
1303
|
|
|
@@ -1286,7 +1315,8 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1286
1315
|
- `xOffset`
|
|
1287
1316
|
- `yOffset`
|
|
1288
1317
|
- `offsetX` **[number][22]** (optional, `0` by default) X-axis offset.
|
|
1289
|
-
- `offsetY` **[number][22]** (optional, `0` by default) Y-axis offset.
|
|
1318
|
+
- `offsetY` **[number][22]** (optional, `0` by default) Y-axis offset.
|
|
1319
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1290
1320
|
|
|
1291
1321
|
### openNewTab
|
|
1292
1322
|
|
|
@@ -1296,6 +1326,8 @@ Open new tab and switch to it.
|
|
|
1296
1326
|
I.openNewTab();
|
|
1297
1327
|
```
|
|
1298
1328
|
|
|
1329
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1330
|
+
|
|
1299
1331
|
#### Parameters
|
|
1300
1332
|
|
|
1301
1333
|
- `url`
|
|
@@ -1364,7 +1396,8 @@ Some of the supported key names are:
|
|
|
1364
1396
|
|
|
1365
1397
|
#### Parameters
|
|
1366
1398
|
|
|
1367
|
-
- `key` **([string][19] | [Array][27]<[string][19]>)** key or array of keys to press.
|
|
1399
|
+
- `key` **([string][19] | [Array][27]<[string][19]>)** key or array of keys to press.
|
|
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.
|
|
1368
1401
|
|
|
1369
1402
|
### pressKeyDown
|
|
1370
1403
|
|
|
@@ -1381,6 +1414,7 @@ I.pressKeyUp('Control');
|
|
|
1381
1414
|
#### Parameters
|
|
1382
1415
|
|
|
1383
1416
|
- `key` **[string][19]** name of key to press down.
|
|
1417
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1384
1418
|
|
|
1385
1419
|
### pressKeyUp
|
|
1386
1420
|
|
|
@@ -1397,6 +1431,7 @@ I.pressKeyUp('Control');
|
|
|
1397
1431
|
#### Parameters
|
|
1398
1432
|
|
|
1399
1433
|
- `key` **[string][19]** name of key to release.
|
|
1434
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1400
1435
|
|
|
1401
1436
|
### refreshPage
|
|
1402
1437
|
|
|
@@ -1406,6 +1441,8 @@ Reload the current page.
|
|
|
1406
1441
|
I.refreshPage();
|
|
1407
1442
|
```
|
|
1408
1443
|
|
|
1444
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1445
|
+
|
|
1409
1446
|
### resizeWindow
|
|
1410
1447
|
|
|
1411
1448
|
Resize the current window to provided width and height.
|
|
@@ -1415,6 +1452,7 @@ First parameter can be set to `maximize`.
|
|
|
1415
1452
|
|
|
1416
1453
|
- `width` **[number][22]** width in pixels or `maximize`.
|
|
1417
1454
|
- `height` **[number][22]** height in pixels.
|
|
1455
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1418
1456
|
Appium: not tested in web, in apps doesn't work
|
|
1419
1457
|
|
|
1420
1458
|
### rightClick
|
|
@@ -1434,6 +1472,7 @@ I.rightClick('Click me', '.context');
|
|
|
1434
1472
|
|
|
1435
1473
|
- `locator` **([string][19] | [object][18])** clickable element located by CSS|XPath|strict locator.
|
|
1436
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
|
|
1437
1476
|
|
|
1438
1477
|
|
|
1439
1478
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1453,8 +1492,8 @@ Placeholder for ~ locator only test case write once run on both Appium and WebDr
|
|
|
1453
1492
|
|
|
1454
1493
|
#### Parameters
|
|
1455
1494
|
|
|
1456
|
-
- `caps`
|
|
1457
|
-
- `fn`
|
|
1495
|
+
- `caps` **any**
|
|
1496
|
+
- `fn` **any**
|
|
1458
1497
|
|
|
1459
1498
|
### runOnIOS
|
|
1460
1499
|
|
|
@@ -1462,8 +1501,8 @@ Placeholder for ~ locator only test case write once run on both Appium and WebDr
|
|
|
1462
1501
|
|
|
1463
1502
|
#### Parameters
|
|
1464
1503
|
|
|
1465
|
-
- `caps`
|
|
1466
|
-
- `fn`
|
|
1504
|
+
- `caps` **any**
|
|
1505
|
+
- `fn` **any**
|
|
1467
1506
|
|
|
1468
1507
|
### saveElementScreenshot
|
|
1469
1508
|
|
|
@@ -1478,6 +1517,7 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1478
1517
|
|
|
1479
1518
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1480
1519
|
- `fileName` **[string][19]** file name to save.
|
|
1520
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1481
1521
|
|
|
1482
1522
|
### saveScreenshot
|
|
1483
1523
|
|
|
@@ -1493,7 +1533,8 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1493
1533
|
#### Parameters
|
|
1494
1534
|
|
|
1495
1535
|
- `fileName` **[string][19]** file name to save.
|
|
1496
|
-
- `fullPage` **[boolean][31]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1536
|
+
- `fullPage` **[boolean][31]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1537
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1497
1538
|
|
|
1498
1539
|
### scrollIntoView
|
|
1499
1540
|
|
|
@@ -1509,6 +1550,7 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1509
1550
|
|
|
1510
1551
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1511
1552
|
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][32].
|
|
1553
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1512
1554
|
|
|
1513
1555
|
### scrollPageToBottom
|
|
1514
1556
|
|
|
@@ -1518,6 +1560,8 @@ Scroll page to the bottom.
|
|
|
1518
1560
|
I.scrollPageToBottom();
|
|
1519
1561
|
```
|
|
1520
1562
|
|
|
1563
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1564
|
+
|
|
1521
1565
|
### scrollPageToTop
|
|
1522
1566
|
|
|
1523
1567
|
Scroll page to the top.
|
|
@@ -1526,6 +1570,8 @@ Scroll page to the top.
|
|
|
1526
1570
|
I.scrollPageToTop();
|
|
1527
1571
|
```
|
|
1528
1572
|
|
|
1573
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1574
|
+
|
|
1529
1575
|
### scrollTo
|
|
1530
1576
|
|
|
1531
1577
|
Scrolls to element matched by locator.
|
|
@@ -1540,7 +1586,8 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1540
1586
|
|
|
1541
1587
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1542
1588
|
- `offsetX` **[number][22]** (optional, `0` by default) X-axis offset.
|
|
1543
|
-
- `offsetY` **[number][22]** (optional, `0` by default) Y-axis offset.
|
|
1589
|
+
- `offsetY` **[number][22]** (optional, `0` by default) Y-axis offset.
|
|
1590
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1544
1591
|
|
|
1545
1592
|
### see
|
|
1546
1593
|
|
|
@@ -1557,6 +1604,7 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1557
1604
|
|
|
1558
1605
|
- `text` **[string][19]** expected on page.
|
|
1559
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
|
|
1560
1608
|
|
|
1561
1609
|
|
|
1562
1610
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1574,6 +1622,7 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1574
1622
|
|
|
1575
1623
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1576
1624
|
- `attributes` **[object][18]** attributes and their values to check.
|
|
1625
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1577
1626
|
|
|
1578
1627
|
### seeCheckboxIsChecked
|
|
1579
1628
|
|
|
@@ -1587,7 +1636,9 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1587
1636
|
|
|
1588
1637
|
#### Parameters
|
|
1589
1638
|
|
|
1590
|
-
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
1639
|
+
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
1640
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1641
|
+
Appium: not tested
|
|
1591
1642
|
|
|
1592
1643
|
### seeCookie
|
|
1593
1644
|
|
|
@@ -1600,6 +1651,7 @@ I.seeCookie('Auth');
|
|
|
1600
1651
|
#### Parameters
|
|
1601
1652
|
|
|
1602
1653
|
- `name` **[string][19]** cookie name.
|
|
1654
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1603
1655
|
|
|
1604
1656
|
### seeCssPropertiesOnElements
|
|
1605
1657
|
|
|
@@ -1613,6 +1665,7 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1613
1665
|
|
|
1614
1666
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1615
1667
|
- `cssProperties` **[object][18]** object with CSS properties and their values to check.
|
|
1668
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1616
1669
|
|
|
1617
1670
|
### seeCurrentUrlEquals
|
|
1618
1671
|
|
|
@@ -1628,6 +1681,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1628
1681
|
#### Parameters
|
|
1629
1682
|
|
|
1630
1683
|
- `url` **[string][19]** value to check.
|
|
1684
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1631
1685
|
|
|
1632
1686
|
### seeElement
|
|
1633
1687
|
|
|
@@ -1641,6 +1695,7 @@ I.seeElement('#modal');
|
|
|
1641
1695
|
#### Parameters
|
|
1642
1696
|
|
|
1643
1697
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1698
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1644
1699
|
|
|
1645
1700
|
|
|
1646
1701
|
|
|
@@ -1659,6 +1714,7 @@ I.seeElementInDOM('#modal');
|
|
|
1659
1714
|
#### Parameters
|
|
1660
1715
|
|
|
1661
1716
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1717
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1662
1718
|
|
|
1663
1719
|
### seeInCurrentUrl
|
|
1664
1720
|
|
|
@@ -1671,6 +1727,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1671
1727
|
#### Parameters
|
|
1672
1728
|
|
|
1673
1729
|
- `url` **[string][19]** a fragment to check
|
|
1730
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1674
1731
|
|
|
1675
1732
|
### seeInField
|
|
1676
1733
|
|
|
@@ -1688,6 +1745,7 @@ I.seeInField('#searchform input','Search');
|
|
|
1688
1745
|
|
|
1689
1746
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
1690
1747
|
- `value` **[string][19]** value to check.
|
|
1748
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1691
1749
|
|
|
1692
1750
|
### seeInPopup
|
|
1693
1751
|
|
|
@@ -1709,6 +1767,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1709
1767
|
#### Parameters
|
|
1710
1768
|
|
|
1711
1769
|
- `text` **[string][19]** value to check.
|
|
1770
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1712
1771
|
|
|
1713
1772
|
### seeInTitle
|
|
1714
1773
|
|
|
@@ -1721,6 +1780,7 @@ I.seeInTitle('Home Page');
|
|
|
1721
1780
|
#### Parameters
|
|
1722
1781
|
|
|
1723
1782
|
- `text` **[string][19]** text value to check.
|
|
1783
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1724
1784
|
|
|
1725
1785
|
### seeNumberOfElements
|
|
1726
1786
|
|
|
@@ -1735,6 +1795,8 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1735
1795
|
|
|
1736
1796
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1737
1797
|
- `num` **[number][22]** number of elements.
|
|
1798
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1799
|
+
|
|
1738
1800
|
|
|
1739
1801
|
|
|
1740
1802
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1753,6 +1815,8 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1753
1815
|
|
|
1754
1816
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1755
1817
|
- `num` **[number][22]** number of elements.
|
|
1818
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1819
|
+
|
|
1756
1820
|
|
|
1757
1821
|
|
|
1758
1822
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1769,7 +1833,8 @@ I.seeTextEquals('text', 'h1');
|
|
|
1769
1833
|
#### Parameters
|
|
1770
1834
|
|
|
1771
1835
|
- `text` **[string][19]** element value to check.
|
|
1772
|
-
- `context` **([string][19] | [object][18])?** element located by CSS|XPath|strict locator.
|
|
1836
|
+
- `context` **([string][19] | [object][18])?** element located by CSS|XPath|strict locator.
|
|
1837
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1773
1838
|
|
|
1774
1839
|
### seeTitleEquals
|
|
1775
1840
|
|
|
@@ -1782,6 +1847,7 @@ I.seeTitleEquals('Test title.');
|
|
|
1782
1847
|
#### Parameters
|
|
1783
1848
|
|
|
1784
1849
|
- `text` **[string][19]** value to check.
|
|
1850
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1785
1851
|
|
|
1786
1852
|
### selectOption
|
|
1787
1853
|
|
|
@@ -1808,6 +1874,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1808
1874
|
|
|
1809
1875
|
- `select` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1810
1876
|
- `option` **([string][19] | [Array][27]<any>)** visible text or value of option.
|
|
1877
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1811
1878
|
|
|
1812
1879
|
### setCookie
|
|
1813
1880
|
|
|
@@ -1827,7 +1894,8 @@ I.setCookie([
|
|
|
1827
1894
|
|
|
1828
1895
|
#### Parameters
|
|
1829
1896
|
|
|
1830
|
-
- `cookie` **(Cookie | [Array][27]<Cookie>)** a cookie object or array of cookie objects.
|
|
1897
|
+
- `cookie` **(Cookie | [Array][27]<Cookie>)** a cookie object or array of cookie objects.
|
|
1898
|
+
[!] returns a _promise_ which is synchronized internally by recorderUses Selenium's JSON [cookie
|
|
1831
1899
|
format][33].
|
|
1832
1900
|
|
|
1833
1901
|
### setGeoLocation
|
|
@@ -1843,7 +1911,8 @@ I.setGeoLocation(121.21, 11.56, 10);
|
|
|
1843
1911
|
|
|
1844
1912
|
- `latitude` **[number][22]** to set.
|
|
1845
1913
|
- `longitude` **[number][22]** to set
|
|
1846
|
-
- `altitude` **[number][22]?** (optional, null by default) to set
|
|
1914
|
+
- `altitude` **[number][22]?** (optional, null by default) to set
|
|
1915
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1847
1916
|
|
|
1848
1917
|
### switchTo
|
|
1849
1918
|
|
|
@@ -1856,7 +1925,8 @@ I.switchTo(); // switch back to main page
|
|
|
1856
1925
|
|
|
1857
1926
|
#### Parameters
|
|
1858
1927
|
|
|
1859
|
-
- `locator` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
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
|
|
1860
1930
|
|
|
1861
1931
|
### switchToNextTab
|
|
1862
1932
|
|
|
@@ -1870,7 +1940,8 @@ I.switchToNextTab(2);
|
|
|
1870
1940
|
#### Parameters
|
|
1871
1941
|
|
|
1872
1942
|
- `num` **[number][22]?** (optional) number of tabs to switch forward, default: 1.
|
|
1873
|
-
- `sec` **([number][22] | null)?** (optional) time in seconds to wait.
|
|
1943
|
+
- `sec` **([number][22] | null)?** (optional) time in seconds to wait.
|
|
1944
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1874
1945
|
|
|
1875
1946
|
### switchToPreviousTab
|
|
1876
1947
|
|
|
@@ -1884,7 +1955,8 @@ I.switchToPreviousTab(2);
|
|
|
1884
1955
|
#### Parameters
|
|
1885
1956
|
|
|
1886
1957
|
- `num` **[number][22]?** (optional) number of tabs to switch backward, default: 1.
|
|
1887
|
-
- `sec` **[number][22]??** (optional) time in seconds to wait.
|
|
1958
|
+
- `sec` **[number][22]??** (optional) time in seconds to wait.
|
|
1959
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1888
1960
|
|
|
1889
1961
|
### switchToWindow
|
|
1890
1962
|
|
|
@@ -1924,7 +1996,8 @@ I.type(['T', 'E', 'X', 'T']);
|
|
|
1924
1996
|
#### Parameters
|
|
1925
1997
|
|
|
1926
1998
|
- `keys`
|
|
1927
|
-
- `delay` **[number][22]?** (optional) delay in ms between key presses
|
|
1999
|
+
- `delay` **[number][22]?** (optional) delay in ms between key presses
|
|
2000
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1928
2001
|
- `key` **([string][19] | [Array][27]<[string][19]>)** or array of keys to type.
|
|
1929
2002
|
|
|
1930
2003
|
### uncheckOption
|
|
@@ -1944,6 +2017,7 @@ I.uncheckOption('agree', '//form');
|
|
|
1944
2017
|
|
|
1945
2018
|
- `field` **([string][19] | [object][18])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1946
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
|
|
1947
2021
|
Appium: not tested
|
|
1948
2022
|
|
|
1949
2023
|
### useWebDriverTo
|
|
@@ -1978,6 +2052,7 @@ I.wait(2); // wait 2 secs
|
|
|
1978
2052
|
#### Parameters
|
|
1979
2053
|
|
|
1980
2054
|
- `sec` **[number][22]** number of second to wait.
|
|
2055
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1981
2056
|
|
|
1982
2057
|
### waitForClickable
|
|
1983
2058
|
|
|
@@ -1994,6 +2069,7 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
1994
2069
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1995
2070
|
- `waitTimeout`
|
|
1996
2071
|
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2072
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1997
2073
|
|
|
1998
2074
|
### waitForDetached
|
|
1999
2075
|
|
|
@@ -2007,7 +2083,8 @@ I.waitForDetached('#popup');
|
|
|
2007
2083
|
#### Parameters
|
|
2008
2084
|
|
|
2009
2085
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2010
|
-
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2086
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2087
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2011
2088
|
|
|
2012
2089
|
### waitForElement
|
|
2013
2090
|
|
|
@@ -2022,7 +2099,8 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
2022
2099
|
#### Parameters
|
|
2023
2100
|
|
|
2024
2101
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2025
|
-
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2102
|
+
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2103
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2026
2104
|
|
|
2027
2105
|
### waitForEnabled
|
|
2028
2106
|
|
|
@@ -2032,7 +2110,8 @@ Element can be located by CSS or XPath.
|
|
|
2032
2110
|
#### Parameters
|
|
2033
2111
|
|
|
2034
2112
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2035
|
-
- `sec` **[number][22]** (optional) time in seconds to wait, 1 by default.
|
|
2113
|
+
- `sec` **[number][22]** (optional) time in seconds to wait, 1 by default.
|
|
2114
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2036
2115
|
|
|
2037
2116
|
### waitForFunction
|
|
2038
2117
|
|
|
@@ -2053,7 +2132,8 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
2053
2132
|
|
|
2054
2133
|
- `fn` **([string][19] | [function][24])** to be executed in browser context.
|
|
2055
2134
|
- `argsOrSec` **([Array][27]<any> | [number][22])?** (optional, `1` by default) arguments for function or seconds.
|
|
2056
|
-
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2135
|
+
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2136
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2057
2137
|
|
|
2058
2138
|
### waitForInvisible
|
|
2059
2139
|
|
|
@@ -2067,7 +2147,8 @@ I.waitForInvisible('#popup');
|
|
|
2067
2147
|
#### Parameters
|
|
2068
2148
|
|
|
2069
2149
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2070
|
-
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2150
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2151
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2071
2152
|
|
|
2072
2153
|
### waitForText
|
|
2073
2154
|
|
|
@@ -2084,7 +2165,8 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2084
2165
|
|
|
2085
2166
|
- `text` **[string][19]** to wait for.
|
|
2086
2167
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2087
|
-
- `context` **([string][19] | [object][18])?** (optional) element located by CSS|XPath|strict locator.
|
|
2168
|
+
- `context` **([string][19] | [object][18])?** (optional) element located by CSS|XPath|strict locator.
|
|
2169
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2088
2170
|
|
|
2089
2171
|
### waitForValue
|
|
2090
2172
|
|
|
@@ -2098,7 +2180,8 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2098
2180
|
|
|
2099
2181
|
- `field` **([string][19] | [object][18])** input field.
|
|
2100
2182
|
- `value` **[string][19]** expected value.
|
|
2101
|
-
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2183
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2184
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2102
2185
|
|
|
2103
2186
|
### waitForVisible
|
|
2104
2187
|
|
|
@@ -2112,7 +2195,8 @@ I.waitForVisible('#popup');
|
|
|
2112
2195
|
#### Parameters
|
|
2113
2196
|
|
|
2114
2197
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2115
|
-
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2198
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2199
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2116
2200
|
|
|
2117
2201
|
### waitInUrl
|
|
2118
2202
|
|
|
@@ -2125,7 +2209,8 @@ I.waitInUrl('/info', 2);
|
|
|
2125
2209
|
#### Parameters
|
|
2126
2210
|
|
|
2127
2211
|
- `urlPart` **[string][19]** value to check.
|
|
2128
|
-
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2212
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2213
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2129
2214
|
|
|
2130
2215
|
### waitNumberOfVisibleElements
|
|
2131
2216
|
|
|
@@ -2139,7 +2224,8 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2139
2224
|
|
|
2140
2225
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2141
2226
|
- `num` **[number][22]** number of elements.
|
|
2142
|
-
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2227
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2228
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2143
2229
|
|
|
2144
2230
|
### waitToHide
|
|
2145
2231
|
|
|
@@ -2153,7 +2239,8 @@ I.waitToHide('#popup');
|
|
|
2153
2239
|
#### Parameters
|
|
2154
2240
|
|
|
2155
2241
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2156
|
-
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2242
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2243
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2157
2244
|
|
|
2158
2245
|
### waitUrlEquals
|
|
2159
2246
|
|
|
@@ -2167,7 +2254,8 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2167
2254
|
#### Parameters
|
|
2168
2255
|
|
|
2169
2256
|
- `urlPart` **[string][19]** value to check.
|
|
2170
|
-
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2257
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2258
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2171
2259
|
|
|
2172
2260
|
[1]: http://webdriver.io/
|
|
2173
2261
|
|
|
@@ -2217,9 +2305,9 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2217
2305
|
|
|
2218
2306
|
[24]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2219
2307
|
|
|
2220
|
-
[25]:
|
|
2308
|
+
[25]: http://webdriver.io/api/protocol/execute.html
|
|
2221
2309
|
|
|
2222
|
-
[26]:
|
|
2310
|
+
[26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2223
2311
|
|
|
2224
2312
|
[27]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
2225
2313
|
|