codeceptjs 3.3.0-beta.4 → 3.3.1
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 +43 -1
- package/README.md +26 -0
- 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 +58 -43
- 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 +99 -70
- package/docs/build/Playwright.js +187 -109
- package/docs/build/Protractor.js +70 -32
- package/docs/build/Puppeteer.js +141 -98
- package/docs/build/REST.js +4 -1
- package/docs/build/TestCafe.js +96 -65
- package/docs/build/WebDriver.js +183 -133
- package/docs/changelog.md +92 -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 +113 -15
- 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 +131 -29
- package/docs/helpers/Playwright.md +424 -215
- package/docs/helpers/Puppeteer.md +229 -92
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/TestCafe.md +166 -62
- package/docs/helpers/WebDriver.md +254 -103
- 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/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 +7 -2
- 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 +49 -13
- package/lib/helper/REST.js +4 -1
- package/lib/helper/WebDriver.js +6 -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 +4 -3
- package/typings/types.d.ts +598 -600
|
@@ -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 **[Promise][21]<any>**
|
|
453
|
+
|
|
452
454
|
### appendField
|
|
453
455
|
|
|
454
456
|
Appends text to a input field or textarea.
|
|
@@ -462,7 +464,8 @@ 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.
|
|
465
|
-
|
|
467
|
+
|
|
468
|
+
Returns **[Promise][21]<any>**
|
|
466
469
|
|
|
467
470
|
|
|
468
471
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -483,7 +486,8 @@ 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.
|
|
486
|
-
|
|
489
|
+
|
|
490
|
+
Returns **[Promise][21]<any>** Appium: not tested
|
|
487
491
|
|
|
488
492
|
### cancelPopup
|
|
489
493
|
|
|
@@ -505,8 +509,9 @@ I.checkOption('agree', '//form');
|
|
|
505
509
|
#### Parameters
|
|
506
510
|
|
|
507
511
|
- `field` **([string][19] | [object][18])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
508
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
509
|
-
|
|
512
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
513
|
+
|
|
514
|
+
Returns **[Promise][21]<any>** Appium: not tested
|
|
510
515
|
|
|
511
516
|
### clearCookie
|
|
512
517
|
|
|
@@ -522,6 +527,8 @@ I.clearCookie('test');
|
|
|
522
527
|
|
|
523
528
|
- `cookie` **[string][19]?** (optional, `null` by default) cookie name
|
|
524
529
|
|
|
530
|
+
Returns **[Promise][21]<any>**
|
|
531
|
+
|
|
525
532
|
### clearField
|
|
526
533
|
|
|
527
534
|
Clears a `<textarea>` or text `<input>` element's value.
|
|
@@ -537,6 +544,8 @@ I.clearField('#email');
|
|
|
537
544
|
- `field`
|
|
538
545
|
- `editable` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
539
546
|
|
|
547
|
+
Returns **[Promise][21]<any>**
|
|
548
|
+
|
|
540
549
|
### click
|
|
541
550
|
|
|
542
551
|
Perform a click on a link or a button, given by a locator.
|
|
@@ -564,11 +573,13 @@ I.click({css: 'nav a.login'});
|
|
|
564
573
|
#### Parameters
|
|
565
574
|
|
|
566
575
|
- `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.
|
|
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>**
|
|
568
579
|
|
|
569
580
|
|
|
570
581
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
571
|
-
|
|
582
|
+
|
|
572
583
|
|
|
573
584
|
### closeCurrentTab
|
|
574
585
|
|
|
@@ -578,6 +589,8 @@ Close current tab.
|
|
|
578
589
|
I.closeCurrentTab();
|
|
579
590
|
```
|
|
580
591
|
|
|
592
|
+
Returns **[Promise][21]<any>**
|
|
593
|
+
|
|
581
594
|
### closeOtherTabs
|
|
582
595
|
|
|
583
596
|
Close all tabs except for the current one.
|
|
@@ -586,9 +599,11 @@ Close all tabs except for the current one.
|
|
|
586
599
|
I.closeOtherTabs();
|
|
587
600
|
```
|
|
588
601
|
|
|
602
|
+
Returns **[Promise][21]<any>**
|
|
603
|
+
|
|
589
604
|
### defineTimeout
|
|
590
605
|
|
|
591
|
-
Set [WebDriver timeouts][
|
|
606
|
+
Set [WebDriver timeouts][22] in realtime.
|
|
592
607
|
|
|
593
608
|
Timeouts are expected to be passed as object:
|
|
594
609
|
|
|
@@ -614,11 +629,13 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
614
629
|
#### Parameters
|
|
615
630
|
|
|
616
631
|
- `text` **[string][19]** which is not present.
|
|
617
|
-
- `context` **([string][19] | [object][18])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
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>**
|
|
618
635
|
|
|
619
636
|
|
|
620
637
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
621
|
-
|
|
638
|
+
|
|
622
639
|
|
|
623
640
|
### dontSeeCheckboxIsChecked
|
|
624
641
|
|
|
@@ -632,7 +649,9 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
632
649
|
|
|
633
650
|
#### Parameters
|
|
634
651
|
|
|
635
|
-
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
652
|
+
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
653
|
+
|
|
654
|
+
Returns **[Promise][21]<any>** Appium: not tested
|
|
636
655
|
|
|
637
656
|
### dontSeeCookie
|
|
638
657
|
|
|
@@ -646,6 +665,8 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
646
665
|
|
|
647
666
|
- `name` **[string][19]** cookie name.
|
|
648
667
|
|
|
668
|
+
Returns **[Promise][21]<any>**
|
|
669
|
+
|
|
649
670
|
### dontSeeCurrentUrlEquals
|
|
650
671
|
|
|
651
672
|
Checks that current url is not equal to provided one.
|
|
@@ -660,6 +681,8 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
660
681
|
|
|
661
682
|
- `url` **[string][19]** value to check.
|
|
662
683
|
|
|
684
|
+
Returns **[Promise][21]<any>**
|
|
685
|
+
|
|
663
686
|
### dontSeeElement
|
|
664
687
|
|
|
665
688
|
Opposite to `seeElement`. Checks that element is not visible (or in DOM)
|
|
@@ -671,7 +694,8 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
671
694
|
#### Parameters
|
|
672
695
|
|
|
673
696
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|Strict locator.
|
|
674
|
-
|
|
697
|
+
|
|
698
|
+
Returns **[Promise][21]<any>**
|
|
675
699
|
|
|
676
700
|
|
|
677
701
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -689,6 +713,8 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
689
713
|
|
|
690
714
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|Strict locator.
|
|
691
715
|
|
|
716
|
+
Returns **[Promise][21]<any>**
|
|
717
|
+
|
|
692
718
|
### dontSeeInCurrentUrl
|
|
693
719
|
|
|
694
720
|
Checks that current url does not contain a provided fragment.
|
|
@@ -697,6 +723,8 @@ Checks that current url does not contain a provided fragment.
|
|
|
697
723
|
|
|
698
724
|
- `url` **[string][19]** value to check.
|
|
699
725
|
|
|
726
|
+
Returns **[Promise][21]<any>**
|
|
727
|
+
|
|
700
728
|
### dontSeeInField
|
|
701
729
|
|
|
702
730
|
Checks that value of input field or textarea doesn't equal to given value
|
|
@@ -712,6 +740,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
712
740
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
713
741
|
- `value` **[string][19]** value to check.
|
|
714
742
|
|
|
743
|
+
Returns **[Promise][21]<any>**
|
|
744
|
+
|
|
715
745
|
### dontSeeInSource
|
|
716
746
|
|
|
717
747
|
Checks that the current page does not contains the given string in its raw source code.
|
|
@@ -725,6 +755,8 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
725
755
|
- `text`
|
|
726
756
|
- `value` **[string][19]** to check.
|
|
727
757
|
|
|
758
|
+
Returns **[Promise][21]<any>**
|
|
759
|
+
|
|
728
760
|
### dontSeeInTitle
|
|
729
761
|
|
|
730
762
|
Checks that title does not contain text.
|
|
@@ -737,6 +769,8 @@ I.dontSeeInTitle('Error');
|
|
|
737
769
|
|
|
738
770
|
- `text` **[string][19]** value to check.
|
|
739
771
|
|
|
772
|
+
Returns **[Promise][21]<any>**
|
|
773
|
+
|
|
740
774
|
### doubleClick
|
|
741
775
|
|
|
742
776
|
Performs a double-click on an element matched by link|button|label|CSS or XPath.
|
|
@@ -752,11 +786,13 @@ I.doubleClick('.btn.edit');
|
|
|
752
786
|
#### Parameters
|
|
753
787
|
|
|
754
788
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
755
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in 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>**
|
|
756
792
|
|
|
757
793
|
|
|
758
794
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
759
|
-
|
|
795
|
+
|
|
760
796
|
|
|
761
797
|
### dragAndDrop
|
|
762
798
|
|
|
@@ -769,7 +805,9 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
769
805
|
#### Parameters
|
|
770
806
|
|
|
771
807
|
- `srcElement` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
772
|
-
- `destElement` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
808
|
+
- `destElement` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
809
|
+
|
|
810
|
+
Returns **[Promise][21]<any>** Appium: not tested
|
|
773
811
|
|
|
774
812
|
### dragSlider
|
|
775
813
|
|
|
@@ -784,14 +822,16 @@ I.dragSlider('#slider', -70);
|
|
|
784
822
|
#### Parameters
|
|
785
823
|
|
|
786
824
|
- `locator` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
787
|
-
- `offsetX` **[number][
|
|
825
|
+
- `offsetX` **[number][23]** position to drag.
|
|
826
|
+
|
|
827
|
+
Returns **[Promise][21]<any>**
|
|
788
828
|
|
|
789
829
|
### executeAsyncScript
|
|
790
830
|
|
|
791
831
|
Executes async script on page.
|
|
792
832
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
793
833
|
|
|
794
|
-
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][
|
|
834
|
+
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][24].
|
|
795
835
|
|
|
796
836
|
```js
|
|
797
837
|
I.executeAsyncScript(function(done) {
|
|
@@ -812,9 +852,9 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
812
852
|
#### Parameters
|
|
813
853
|
|
|
814
854
|
- `args` **...any** to be passed to function.
|
|
815
|
-
- `fn` **([string][19] | [function][
|
|
855
|
+
- `fn` **([string][19] | [function][25])** function to be executed in browser context.
|
|
816
856
|
|
|
817
|
-
Returns **[Promise][
|
|
857
|
+
Returns **[Promise][21]<any>**
|
|
818
858
|
|
|
819
859
|
### executeScript
|
|
820
860
|
|
|
@@ -845,9 +885,9 @@ let date = await I.executeScript(function(el) {
|
|
|
845
885
|
#### Parameters
|
|
846
886
|
|
|
847
887
|
- `args` **...any** to be passed to function.
|
|
848
|
-
- `fn` **([string][19] | [function][
|
|
888
|
+
- `fn` **([string][19] | [function][25])** function to be executed in browser context.
|
|
849
889
|
|
|
850
|
-
Returns **[Promise][
|
|
890
|
+
Returns **[Promise][21]<any>** Wraps [execute][26] command.
|
|
851
891
|
|
|
852
892
|
### fillField
|
|
853
893
|
|
|
@@ -870,10 +910,12 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
870
910
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
871
911
|
- `value` **([string][19] | [object][18])** text value to fill.
|
|
872
912
|
|
|
913
|
+
Returns **[Promise][21]<any>**
|
|
914
|
+
|
|
873
915
|
|
|
874
916
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
875
917
|
|
|
876
|
-
|
|
918
|
+
{{ custom }}
|
|
877
919
|
|
|
878
920
|
### forceClick
|
|
879
921
|
|
|
@@ -905,11 +947,13 @@ I.forceClick({css: 'nav a.login'});
|
|
|
905
947
|
#### Parameters
|
|
906
948
|
|
|
907
949
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
908
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in 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>**
|
|
909
953
|
|
|
910
954
|
|
|
911
955
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
912
|
-
|
|
956
|
+
|
|
913
957
|
|
|
914
958
|
### forceRightClick
|
|
915
959
|
|
|
@@ -931,11 +975,13 @@ I.forceRightClick('Menu');
|
|
|
931
975
|
#### Parameters
|
|
932
976
|
|
|
933
977
|
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
934
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in 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>**
|
|
935
981
|
|
|
936
982
|
|
|
937
983
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
938
|
-
|
|
984
|
+
|
|
939
985
|
|
|
940
986
|
### grabAllWindowHandles
|
|
941
987
|
|
|
@@ -946,7 +992,7 @@ Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
|
|
|
946
992
|
const windows = await I.grabAllWindowHandles();
|
|
947
993
|
```
|
|
948
994
|
|
|
949
|
-
Returns **[Promise][
|
|
995
|
+
Returns **[Promise][21]<[Array][27]<[string][19]>>**
|
|
950
996
|
|
|
951
997
|
### grabAttributeFrom
|
|
952
998
|
|
|
@@ -963,7 +1009,7 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
963
1009
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
964
1010
|
- `attr` **[string][19]** attribute name.
|
|
965
1011
|
|
|
966
|
-
Returns **[Promise][
|
|
1012
|
+
Returns **[Promise][21]<[string][19]>** attribute value
|
|
967
1013
|
|
|
968
1014
|
### grabAttributeFromAll
|
|
969
1015
|
|
|
@@ -979,7 +1025,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
979
1025
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
980
1026
|
- `attr` **[string][19]** attribute name.
|
|
981
1027
|
|
|
982
|
-
Returns **[Promise][
|
|
1028
|
+
Returns **[Promise][21]<[Array][27]<[string][19]>>** attribute value
|
|
983
1029
|
|
|
984
1030
|
### grabBrowserLogs
|
|
985
1031
|
|
|
@@ -991,7 +1037,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
991
1037
|
console.log(JSON.stringify(logs))
|
|
992
1038
|
```
|
|
993
1039
|
|
|
994
|
-
Returns **([Promise][
|
|
1040
|
+
Returns **([Promise][21]<[Array][27]<[object][18]>> | [undefined][28])** all browser logs
|
|
995
1041
|
|
|
996
1042
|
### grabCookie
|
|
997
1043
|
|
|
@@ -1008,7 +1054,7 @@ assert(cookie.value, '123456');
|
|
|
1008
1054
|
|
|
1009
1055
|
- `name` **[string][19]?** cookie name.
|
|
1010
1056
|
|
|
1011
|
-
Returns **([Promise][
|
|
1057
|
+
Returns **([Promise][21]<[string][19]> | [Promise][21]<[Array][27]<[string][19]>>)** attribute value
|
|
1012
1058
|
|
|
1013
1059
|
### grabCssPropertyFrom
|
|
1014
1060
|
|
|
@@ -1025,7 +1071,7 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
1025
1071
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1026
1072
|
- `cssProperty` **[string][19]** CSS property name.
|
|
1027
1073
|
|
|
1028
|
-
Returns **[Promise][
|
|
1074
|
+
Returns **[Promise][21]<[string][19]>** CSS value
|
|
1029
1075
|
|
|
1030
1076
|
### grabCssPropertyFromAll
|
|
1031
1077
|
|
|
@@ -1041,7 +1087,7 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
1041
1087
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1042
1088
|
- `cssProperty` **[string][19]** CSS property name.
|
|
1043
1089
|
|
|
1044
|
-
Returns **[Promise][
|
|
1090
|
+
Returns **[Promise][21]<[Array][27]<[string][19]>>** CSS value
|
|
1045
1091
|
|
|
1046
1092
|
### grabCurrentUrl
|
|
1047
1093
|
|
|
@@ -1053,7 +1099,7 @@ let url = await I.grabCurrentUrl();
|
|
|
1053
1099
|
console.log(`Current URL is [${url}]`);
|
|
1054
1100
|
```
|
|
1055
1101
|
|
|
1056
|
-
Returns **[Promise][
|
|
1102
|
+
Returns **[Promise][21]<[string][19]>** current URL
|
|
1057
1103
|
|
|
1058
1104
|
### grabCurrentWindowHandle
|
|
1059
1105
|
|
|
@@ -1064,7 +1110,7 @@ Useful for referencing it when calling `I.switchToWindow(handle)`
|
|
|
1064
1110
|
const window = await I.grabCurrentWindowHandle();
|
|
1065
1111
|
```
|
|
1066
1112
|
|
|
1067
|
-
Returns **[Promise][
|
|
1113
|
+
Returns **[Promise][21]<[string][19]>**
|
|
1068
1114
|
|
|
1069
1115
|
### grabElementBoundingRect
|
|
1070
1116
|
|
|
@@ -1092,7 +1138,7 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
1092
1138
|
- `prop`
|
|
1093
1139
|
- `elementSize` **[string][19]?** x, y, width or height of the given element.
|
|
1094
1140
|
|
|
1095
|
-
Returns **([Promise][
|
|
1141
|
+
Returns **([Promise][21]<DOMRect> | [Promise][21]<[number][23]>)** Element bounding rectangle
|
|
1096
1142
|
|
|
1097
1143
|
### grabGeoLocation
|
|
1098
1144
|
|
|
@@ -1103,7 +1149,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1103
1149
|
let geoLocation = await I.grabGeoLocation();
|
|
1104
1150
|
```
|
|
1105
1151
|
|
|
1106
|
-
Returns **[Promise][
|
|
1152
|
+
Returns **[Promise][21]<{latitude: [number][23], longitude: [number][23], altitude: [number][23]}>**
|
|
1107
1153
|
|
|
1108
1154
|
### grabHTMLFrom
|
|
1109
1155
|
|
|
@@ -1120,7 +1166,7 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1120
1166
|
- `locator`
|
|
1121
1167
|
- `element` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1122
1168
|
|
|
1123
|
-
Returns **[Promise][
|
|
1169
|
+
Returns **[Promise][21]<[string][19]>** HTML code for an element
|
|
1124
1170
|
|
|
1125
1171
|
### grabHTMLFromAll
|
|
1126
1172
|
|
|
@@ -1136,7 +1182,7 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1136
1182
|
- `locator`
|
|
1137
1183
|
- `element` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1138
1184
|
|
|
1139
|
-
Returns **[Promise][
|
|
1185
|
+
Returns **[Promise][21]<[Array][27]<[string][19]>>** HTML code for an element
|
|
1140
1186
|
|
|
1141
1187
|
### grabNumberOfOpenTabs
|
|
1142
1188
|
|
|
@@ -1147,7 +1193,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1147
1193
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1148
1194
|
```
|
|
1149
1195
|
|
|
1150
|
-
Returns **[Promise][
|
|
1196
|
+
Returns **[Promise][21]<[number][23]>** number of open tabs
|
|
1151
1197
|
|
|
1152
1198
|
### grabNumberOfVisibleElements
|
|
1153
1199
|
|
|
@@ -1162,7 +1208,7 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1162
1208
|
|
|
1163
1209
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1164
1210
|
|
|
1165
|
-
Returns **[Promise][
|
|
1211
|
+
Returns **[Promise][21]<[number][23]>** number of visible elements
|
|
1166
1212
|
|
|
1167
1213
|
### grabPageScrollPosition
|
|
1168
1214
|
|
|
@@ -1173,7 +1219,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1173
1219
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1174
1220
|
```
|
|
1175
1221
|
|
|
1176
|
-
Returns **[Promise][
|
|
1222
|
+
Returns **[Promise][21]<PageScrollPosition>** scroll position
|
|
1177
1223
|
|
|
1178
1224
|
### grabPopupText
|
|
1179
1225
|
|
|
@@ -1183,7 +1229,7 @@ Grab the text within the popup. If no popup is visible then it will return null.
|
|
|
1183
1229
|
await I.grabPopupText();
|
|
1184
1230
|
```
|
|
1185
1231
|
|
|
1186
|
-
Returns **[Promise][
|
|
1232
|
+
Returns **[Promise][21]<[string][19]>**
|
|
1187
1233
|
|
|
1188
1234
|
### grabSource
|
|
1189
1235
|
|
|
@@ -1194,7 +1240,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1194
1240
|
let pageSource = await I.grabSource();
|
|
1195
1241
|
```
|
|
1196
1242
|
|
|
1197
|
-
Returns **[Promise][
|
|
1243
|
+
Returns **[Promise][21]<[string][19]>** source code
|
|
1198
1244
|
|
|
1199
1245
|
### grabTextFrom
|
|
1200
1246
|
|
|
@@ -1211,7 +1257,7 @@ If multiple elements found returns first element.
|
|
|
1211
1257
|
|
|
1212
1258
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1213
1259
|
|
|
1214
|
-
Returns **[Promise][
|
|
1260
|
+
Returns **[Promise][21]<[string][19]>** attribute value
|
|
1215
1261
|
|
|
1216
1262
|
### grabTextFromAll
|
|
1217
1263
|
|
|
@@ -1226,7 +1272,7 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1226
1272
|
|
|
1227
1273
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1228
1274
|
|
|
1229
|
-
Returns **[Promise][
|
|
1275
|
+
Returns **[Promise][21]<[Array][27]<[string][19]>>** attribute value
|
|
1230
1276
|
|
|
1231
1277
|
### grabTitle
|
|
1232
1278
|
|
|
@@ -1237,7 +1283,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1237
1283
|
let title = await I.grabTitle();
|
|
1238
1284
|
```
|
|
1239
1285
|
|
|
1240
|
-
Returns **[Promise][
|
|
1286
|
+
Returns **[Promise][21]<[string][19]>** title
|
|
1241
1287
|
|
|
1242
1288
|
### grabValueFrom
|
|
1243
1289
|
|
|
@@ -1253,7 +1299,7 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1253
1299
|
|
|
1254
1300
|
- `locator` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1255
1301
|
|
|
1256
|
-
Returns **[Promise][
|
|
1302
|
+
Returns **[Promise][21]<[string][19]>** attribute value
|
|
1257
1303
|
|
|
1258
1304
|
### grabValueFromAll
|
|
1259
1305
|
|
|
@@ -1268,7 +1314,7 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1268
1314
|
|
|
1269
1315
|
- `locator` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1270
1316
|
|
|
1271
|
-
Returns **[Promise][
|
|
1317
|
+
Returns **[Promise][21]<[Array][27]<[string][19]>>** attribute value
|
|
1272
1318
|
|
|
1273
1319
|
### moveCursorTo
|
|
1274
1320
|
|
|
@@ -1285,8 +1331,10 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1285
1331
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1286
1332
|
- `xOffset`
|
|
1287
1333
|
- `yOffset`
|
|
1288
|
-
- `offsetX` **[number][
|
|
1289
|
-
- `offsetY` **[number][
|
|
1334
|
+
- `offsetX` **[number][23]** (optional, `0` by default) X-axis offset.
|
|
1335
|
+
- `offsetY` **[number][23]** (optional, `0` by default) Y-axis offset.
|
|
1336
|
+
|
|
1337
|
+
Returns **[Promise][21]<any>**
|
|
1290
1338
|
|
|
1291
1339
|
### openNewTab
|
|
1292
1340
|
|
|
@@ -1301,6 +1349,8 @@ I.openNewTab();
|
|
|
1301
1349
|
- `url`
|
|
1302
1350
|
- `windowName`
|
|
1303
1351
|
|
|
1352
|
+
Returns **[Promise][21]<any>**
|
|
1353
|
+
|
|
1304
1354
|
### pressKey
|
|
1305
1355
|
|
|
1306
1356
|
Presses a key in the browser (on a focused element).
|
|
@@ -1364,7 +1414,9 @@ Some of the supported key names are:
|
|
|
1364
1414
|
|
|
1365
1415
|
#### Parameters
|
|
1366
1416
|
|
|
1367
|
-
- `key` **([string][19] | [Array][27]<[string][19]>)** key or array of keys to press.
|
|
1417
|
+
- `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.
|
|
1368
1420
|
|
|
1369
1421
|
### pressKeyDown
|
|
1370
1422
|
|
|
@@ -1382,6 +1434,8 @@ I.pressKeyUp('Control');
|
|
|
1382
1434
|
|
|
1383
1435
|
- `key` **[string][19]** name of key to press down.
|
|
1384
1436
|
|
|
1437
|
+
Returns **[Promise][21]<any>**
|
|
1438
|
+
|
|
1385
1439
|
### pressKeyUp
|
|
1386
1440
|
|
|
1387
1441
|
Releases a key in the browser which was previously set to a down state.
|
|
@@ -1398,6 +1452,8 @@ I.pressKeyUp('Control');
|
|
|
1398
1452
|
|
|
1399
1453
|
- `key` **[string][19]** name of key to release.
|
|
1400
1454
|
|
|
1455
|
+
Returns **[Promise][21]<any>**
|
|
1456
|
+
|
|
1401
1457
|
### refreshPage
|
|
1402
1458
|
|
|
1403
1459
|
Reload the current page.
|
|
@@ -1406,6 +1462,8 @@ Reload the current page.
|
|
|
1406
1462
|
I.refreshPage();
|
|
1407
1463
|
```
|
|
1408
1464
|
|
|
1465
|
+
Returns **[Promise][21]<any>**
|
|
1466
|
+
|
|
1409
1467
|
### resizeWindow
|
|
1410
1468
|
|
|
1411
1469
|
Resize the current window to provided width and height.
|
|
@@ -1413,9 +1471,10 @@ First parameter can be set to `maximize`.
|
|
|
1413
1471
|
|
|
1414
1472
|
#### Parameters
|
|
1415
1473
|
|
|
1416
|
-
- `width` **[number][
|
|
1417
|
-
- `height` **[number][
|
|
1418
|
-
|
|
1474
|
+
- `width` **[number][23]** width in pixels or `maximize`.
|
|
1475
|
+
- `height` **[number][23]** height in pixels.
|
|
1476
|
+
|
|
1477
|
+
Returns **[Promise][21]<any>** Appium: not tested in web, in apps doesn't work
|
|
1419
1478
|
|
|
1420
1479
|
### rightClick
|
|
1421
1480
|
|
|
@@ -1433,11 +1492,13 @@ I.rightClick('Click me', '.context');
|
|
|
1433
1492
|
#### Parameters
|
|
1434
1493
|
|
|
1435
1494
|
- `locator` **([string][19] | [object][18])** clickable element located by CSS|XPath|strict locator.
|
|
1436
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) 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>**
|
|
1437
1498
|
|
|
1438
1499
|
|
|
1439
1500
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1440
|
-
|
|
1501
|
+
|
|
1441
1502
|
|
|
1442
1503
|
### runInWeb
|
|
1443
1504
|
|
|
@@ -1453,8 +1514,10 @@ Placeholder for ~ locator only test case write once run on both Appium and WebDr
|
|
|
1453
1514
|
|
|
1454
1515
|
#### Parameters
|
|
1455
1516
|
|
|
1456
|
-
- `caps`
|
|
1457
|
-
- `fn`
|
|
1517
|
+
- `caps` **any**
|
|
1518
|
+
- `fn` **any**
|
|
1519
|
+
|
|
1520
|
+
Returns **[Promise][21]<any>**
|
|
1458
1521
|
|
|
1459
1522
|
### runOnIOS
|
|
1460
1523
|
|
|
@@ -1462,8 +1525,10 @@ Placeholder for ~ locator only test case write once run on both Appium and WebDr
|
|
|
1462
1525
|
|
|
1463
1526
|
#### Parameters
|
|
1464
1527
|
|
|
1465
|
-
- `caps`
|
|
1466
|
-
- `fn`
|
|
1528
|
+
- `caps` **any**
|
|
1529
|
+
- `fn` **any**
|
|
1530
|
+
|
|
1531
|
+
Returns **[Promise][21]<any>**
|
|
1467
1532
|
|
|
1468
1533
|
### saveElementScreenshot
|
|
1469
1534
|
|
|
@@ -1479,6 +1544,8 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1479
1544
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1480
1545
|
- `fileName` **[string][19]** file name to save.
|
|
1481
1546
|
|
|
1547
|
+
Returns **[Promise][21]<any>**
|
|
1548
|
+
|
|
1482
1549
|
### saveScreenshot
|
|
1483
1550
|
|
|
1484
1551
|
Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
|
|
@@ -1495,6 +1562,8 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1495
1562
|
- `fileName` **[string][19]** file name to save.
|
|
1496
1563
|
- `fullPage` **[boolean][31]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1497
1564
|
|
|
1565
|
+
Returns **[Promise][21]<any>**
|
|
1566
|
+
|
|
1498
1567
|
### scrollIntoView
|
|
1499
1568
|
|
|
1500
1569
|
Scroll element into viewport.
|
|
@@ -1510,6 +1579,8 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1510
1579
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1511
1580
|
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][32].
|
|
1512
1581
|
|
|
1582
|
+
Returns **[Promise][21]<any>**
|
|
1583
|
+
|
|
1513
1584
|
### scrollPageToBottom
|
|
1514
1585
|
|
|
1515
1586
|
Scroll page to the bottom.
|
|
@@ -1518,6 +1589,8 @@ Scroll page to the bottom.
|
|
|
1518
1589
|
I.scrollPageToBottom();
|
|
1519
1590
|
```
|
|
1520
1591
|
|
|
1592
|
+
Returns **[Promise][21]<any>**
|
|
1593
|
+
|
|
1521
1594
|
### scrollPageToTop
|
|
1522
1595
|
|
|
1523
1596
|
Scroll page to the top.
|
|
@@ -1526,6 +1599,8 @@ Scroll page to the top.
|
|
|
1526
1599
|
I.scrollPageToTop();
|
|
1527
1600
|
```
|
|
1528
1601
|
|
|
1602
|
+
Returns **[Promise][21]<any>**
|
|
1603
|
+
|
|
1529
1604
|
### scrollTo
|
|
1530
1605
|
|
|
1531
1606
|
Scrolls to element matched by locator.
|
|
@@ -1539,8 +1614,10 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1539
1614
|
#### Parameters
|
|
1540
1615
|
|
|
1541
1616
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1542
|
-
- `offsetX` **[number][
|
|
1543
|
-
- `offsetY` **[number][
|
|
1617
|
+
- `offsetX` **[number][23]** (optional, `0` by default) X-axis offset.
|
|
1618
|
+
- `offsetY` **[number][23]** (optional, `0` by default) Y-axis offset.
|
|
1619
|
+
|
|
1620
|
+
Returns **[Promise][21]<any>**
|
|
1544
1621
|
|
|
1545
1622
|
### see
|
|
1546
1623
|
|
|
@@ -1556,11 +1633,13 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1556
1633
|
#### Parameters
|
|
1557
1634
|
|
|
1558
1635
|
- `text` **[string][19]** expected on page.
|
|
1559
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
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>**
|
|
1560
1639
|
|
|
1561
1640
|
|
|
1562
1641
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1563
|
-
|
|
1642
|
+
|
|
1564
1643
|
|
|
1565
1644
|
### seeAttributesOnElements
|
|
1566
1645
|
|
|
@@ -1575,6 +1654,8 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1575
1654
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1576
1655
|
- `attributes` **[object][18]** attributes and their values to check.
|
|
1577
1656
|
|
|
1657
|
+
Returns **[Promise][21]<any>**
|
|
1658
|
+
|
|
1578
1659
|
### seeCheckboxIsChecked
|
|
1579
1660
|
|
|
1580
1661
|
Verifies that the specified checkbox is checked.
|
|
@@ -1587,7 +1668,9 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1587
1668
|
|
|
1588
1669
|
#### Parameters
|
|
1589
1670
|
|
|
1590
|
-
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
1671
|
+
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
1672
|
+
|
|
1673
|
+
Returns **[Promise][21]<any>** Appium: not tested
|
|
1591
1674
|
|
|
1592
1675
|
### seeCookie
|
|
1593
1676
|
|
|
@@ -1601,6 +1684,8 @@ I.seeCookie('Auth');
|
|
|
1601
1684
|
|
|
1602
1685
|
- `name` **[string][19]** cookie name.
|
|
1603
1686
|
|
|
1687
|
+
Returns **[Promise][21]<any>**
|
|
1688
|
+
|
|
1604
1689
|
### seeCssPropertiesOnElements
|
|
1605
1690
|
|
|
1606
1691
|
Checks that all elements with given locator have given CSS properties.
|
|
@@ -1614,6 +1699,8 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1614
1699
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1615
1700
|
- `cssProperties` **[object][18]** object with CSS properties and their values to check.
|
|
1616
1701
|
|
|
1702
|
+
Returns **[Promise][21]<any>**
|
|
1703
|
+
|
|
1617
1704
|
### seeCurrentUrlEquals
|
|
1618
1705
|
|
|
1619
1706
|
Checks that current url is equal to provided one.
|
|
@@ -1629,6 +1716,8 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1629
1716
|
|
|
1630
1717
|
- `url` **[string][19]** value to check.
|
|
1631
1718
|
|
|
1719
|
+
Returns **[Promise][21]<any>**
|
|
1720
|
+
|
|
1632
1721
|
### seeElement
|
|
1633
1722
|
|
|
1634
1723
|
Checks that a given Element is visible
|
|
@@ -1641,7 +1730,8 @@ I.seeElement('#modal');
|
|
|
1641
1730
|
#### Parameters
|
|
1642
1731
|
|
|
1643
1732
|
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1644
|
-
|
|
1733
|
+
|
|
1734
|
+
Returns **[Promise][21]<any>**
|
|
1645
1735
|
|
|
1646
1736
|
|
|
1647
1737
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1660,6 +1750,8 @@ I.seeElementInDOM('#modal');
|
|
|
1660
1750
|
|
|
1661
1751
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1662
1752
|
|
|
1753
|
+
Returns **[Promise][21]<any>**
|
|
1754
|
+
|
|
1663
1755
|
### seeInCurrentUrl
|
|
1664
1756
|
|
|
1665
1757
|
Checks that current url contains a provided fragment.
|
|
@@ -1672,6 +1764,8 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1672
1764
|
|
|
1673
1765
|
- `url` **[string][19]** a fragment to check
|
|
1674
1766
|
|
|
1767
|
+
Returns **[Promise][21]<any>**
|
|
1768
|
+
|
|
1675
1769
|
### seeInField
|
|
1676
1770
|
|
|
1677
1771
|
Checks that the given input field or textarea equals to given value.
|
|
@@ -1689,6 +1783,8 @@ I.seeInField('#searchform input','Search');
|
|
|
1689
1783
|
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
1690
1784
|
- `value` **[string][19]** value to check.
|
|
1691
1785
|
|
|
1786
|
+
Returns **[Promise][21]<any>**
|
|
1787
|
+
|
|
1692
1788
|
### seeInPopup
|
|
1693
1789
|
|
|
1694
1790
|
Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the
|
|
@@ -1710,6 +1806,8 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1710
1806
|
|
|
1711
1807
|
- `text` **[string][19]** value to check.
|
|
1712
1808
|
|
|
1809
|
+
Returns **[Promise][21]<any>**
|
|
1810
|
+
|
|
1713
1811
|
### seeInTitle
|
|
1714
1812
|
|
|
1715
1813
|
Checks that title contains text.
|
|
@@ -1722,6 +1820,8 @@ I.seeInTitle('Home Page');
|
|
|
1722
1820
|
|
|
1723
1821
|
- `text` **[string][19]** text value to check.
|
|
1724
1822
|
|
|
1823
|
+
Returns **[Promise][21]<any>**
|
|
1824
|
+
|
|
1725
1825
|
### seeNumberOfElements
|
|
1726
1826
|
|
|
1727
1827
|
Asserts that an element appears a given number of times in the DOM.
|
|
@@ -1734,7 +1834,9 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1734
1834
|
#### Parameters
|
|
1735
1835
|
|
|
1736
1836
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1737
|
-
- `num` **[number][
|
|
1837
|
+
- `num` **[number][23]** number of elements.
|
|
1838
|
+
|
|
1839
|
+
Returns **[Promise][21]<any>**
|
|
1738
1840
|
|
|
1739
1841
|
|
|
1740
1842
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1752,7 +1854,9 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1752
1854
|
#### Parameters
|
|
1753
1855
|
|
|
1754
1856
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1755
|
-
- `num` **[number][
|
|
1857
|
+
- `num` **[number][23]** number of elements.
|
|
1858
|
+
|
|
1859
|
+
Returns **[Promise][21]<any>**
|
|
1756
1860
|
|
|
1757
1861
|
|
|
1758
1862
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1771,6 +1875,8 @@ I.seeTextEquals('text', 'h1');
|
|
|
1771
1875
|
- `text` **[string][19]** element value to check.
|
|
1772
1876
|
- `context` **([string][19] | [object][18])?** element located by CSS|XPath|strict locator.
|
|
1773
1877
|
|
|
1878
|
+
Returns **[Promise][21]<any>**
|
|
1879
|
+
|
|
1774
1880
|
### seeTitleEquals
|
|
1775
1881
|
|
|
1776
1882
|
Checks that title is equal to provided one.
|
|
@@ -1783,6 +1889,8 @@ I.seeTitleEquals('Test title.');
|
|
|
1783
1889
|
|
|
1784
1890
|
- `text` **[string][19]** value to check.
|
|
1785
1891
|
|
|
1892
|
+
Returns **[Promise][21]<any>**
|
|
1893
|
+
|
|
1786
1894
|
### selectOption
|
|
1787
1895
|
|
|
1788
1896
|
Selects an option in a drop-down select.
|
|
@@ -1809,6 +1917,8 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1809
1917
|
- `select` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1810
1918
|
- `option` **([string][19] | [Array][27]<any>)** visible text or value of option.
|
|
1811
1919
|
|
|
1920
|
+
Returns **[Promise][21]<any>**
|
|
1921
|
+
|
|
1812
1922
|
### setCookie
|
|
1813
1923
|
|
|
1814
1924
|
Sets cookie(s).
|
|
@@ -1827,8 +1937,10 @@ I.setCookie([
|
|
|
1827
1937
|
|
|
1828
1938
|
#### Parameters
|
|
1829
1939
|
|
|
1830
|
-
- `cookie` **(Cookie | [Array][27]<Cookie>)** a cookie object or array of cookie objects.
|
|
1831
|
-
|
|
1940
|
+
- `cookie` **(Cookie | [Array][27]<Cookie>)** a cookie object or array of cookie objects.
|
|
1941
|
+
|
|
1942
|
+
Returns **[Promise][21]<any>** Uses Selenium's JSON [cookie
|
|
1943
|
+
format][33].
|
|
1832
1944
|
|
|
1833
1945
|
### setGeoLocation
|
|
1834
1946
|
|
|
@@ -1841,9 +1953,11 @@ I.setGeoLocation(121.21, 11.56, 10);
|
|
|
1841
1953
|
|
|
1842
1954
|
#### Parameters
|
|
1843
1955
|
|
|
1844
|
-
- `latitude` **[number][
|
|
1845
|
-
- `longitude` **[number][
|
|
1846
|
-
- `altitude` **[number][
|
|
1956
|
+
- `latitude` **[number][23]** to set.
|
|
1957
|
+
- `longitude` **[number][23]** to set
|
|
1958
|
+
- `altitude` **[number][23]?** (optional, null by default) to set
|
|
1959
|
+
|
|
1960
|
+
Returns **[Promise][21]<any>**
|
|
1847
1961
|
|
|
1848
1962
|
### switchTo
|
|
1849
1963
|
|
|
@@ -1858,6 +1972,8 @@ I.switchTo(); // switch back to main page
|
|
|
1858
1972
|
|
|
1859
1973
|
- `locator` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1860
1974
|
|
|
1975
|
+
Returns **[Promise][21]<any>**
|
|
1976
|
+
|
|
1861
1977
|
### switchToNextTab
|
|
1862
1978
|
|
|
1863
1979
|
Switch focus to a particular tab by its number. It waits tabs loading and then switch tab.
|
|
@@ -1869,8 +1985,10 @@ I.switchToNextTab(2);
|
|
|
1869
1985
|
|
|
1870
1986
|
#### Parameters
|
|
1871
1987
|
|
|
1872
|
-
- `num` **[number][
|
|
1873
|
-
- `sec` **([number][
|
|
1988
|
+
- `num` **[number][23]?** (optional) number of tabs to switch forward, default: 1.
|
|
1989
|
+
- `sec` **([number][23] | null)?** (optional) time in seconds to wait.
|
|
1990
|
+
|
|
1991
|
+
Returns **[Promise][21]<any>**
|
|
1874
1992
|
|
|
1875
1993
|
### switchToPreviousTab
|
|
1876
1994
|
|
|
@@ -1883,8 +2001,10 @@ I.switchToPreviousTab(2);
|
|
|
1883
2001
|
|
|
1884
2002
|
#### Parameters
|
|
1885
2003
|
|
|
1886
|
-
- `num` **[number][
|
|
1887
|
-
- `sec` **[number][
|
|
2004
|
+
- `num` **[number][23]?** (optional) number of tabs to switch backward, default: 1.
|
|
2005
|
+
- `sec` **[number][23]??** (optional) time in seconds to wait.
|
|
2006
|
+
|
|
2007
|
+
Returns **[Promise][21]<any>**
|
|
1888
2008
|
|
|
1889
2009
|
### switchToWindow
|
|
1890
2010
|
|
|
@@ -1924,9 +2044,11 @@ I.type(['T', 'E', 'X', 'T']);
|
|
|
1924
2044
|
#### Parameters
|
|
1925
2045
|
|
|
1926
2046
|
- `keys`
|
|
1927
|
-
- `delay` **[number][
|
|
2047
|
+
- `delay` **[number][23]?** (optional) delay in ms between key presses
|
|
1928
2048
|
- `key` **([string][19] | [Array][27]<[string][19]>)** or array of keys to type.
|
|
1929
2049
|
|
|
2050
|
+
Returns **[Promise][21]<any>**
|
|
2051
|
+
|
|
1930
2052
|
### uncheckOption
|
|
1931
2053
|
|
|
1932
2054
|
Unselects a checkbox or radio button.
|
|
@@ -1943,8 +2065,9 @@ I.uncheckOption('agree', '//form');
|
|
|
1943
2065
|
#### Parameters
|
|
1944
2066
|
|
|
1945
2067
|
- `field` **([string][19] | [object][18])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1946
|
-
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1947
|
-
|
|
2068
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2069
|
+
|
|
2070
|
+
Returns **[Promise][21]<any>** Appium: not tested
|
|
1948
2071
|
|
|
1949
2072
|
### useWebDriverTo
|
|
1950
2073
|
|
|
@@ -1965,7 +2088,7 @@ I.useWebDriverTo('open multiple windows', async ({ browser }) {
|
|
|
1965
2088
|
#### Parameters
|
|
1966
2089
|
|
|
1967
2090
|
- `description` **[string][19]** used to show in logs.
|
|
1968
|
-
- `fn` **[function][
|
|
2091
|
+
- `fn` **[function][25]** async functuion that executed with WebDriver helper as argument
|
|
1969
2092
|
|
|
1970
2093
|
### wait
|
|
1971
2094
|
|
|
@@ -1977,7 +2100,9 @@ I.wait(2); // wait 2 secs
|
|
|
1977
2100
|
|
|
1978
2101
|
#### Parameters
|
|
1979
2102
|
|
|
1980
|
-
- `sec` **[number][
|
|
2103
|
+
- `sec` **[number][23]** number of second to wait.
|
|
2104
|
+
|
|
2105
|
+
Returns **[Promise][21]<any>**
|
|
1981
2106
|
|
|
1982
2107
|
### waitForClickable
|
|
1983
2108
|
|
|
@@ -1993,7 +2118,9 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
1993
2118
|
|
|
1994
2119
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1995
2120
|
- `waitTimeout`
|
|
1996
|
-
- `sec` **[number][
|
|
2121
|
+
- `sec` **[number][23]?** (optional, `1` by default) time in seconds to wait
|
|
2122
|
+
|
|
2123
|
+
Returns **[Promise][21]<any>**
|
|
1997
2124
|
|
|
1998
2125
|
### waitForDetached
|
|
1999
2126
|
|
|
@@ -2007,7 +2134,9 @@ I.waitForDetached('#popup');
|
|
|
2007
2134
|
#### Parameters
|
|
2008
2135
|
|
|
2009
2136
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2010
|
-
- `sec` **[number][
|
|
2137
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2138
|
+
|
|
2139
|
+
Returns **[Promise][21]<any>**
|
|
2011
2140
|
|
|
2012
2141
|
### waitForElement
|
|
2013
2142
|
|
|
@@ -2022,7 +2151,9 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
2022
2151
|
#### Parameters
|
|
2023
2152
|
|
|
2024
2153
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2025
|
-
- `sec` **[number][
|
|
2154
|
+
- `sec` **[number][23]?** (optional, `1` by default) time in seconds to wait
|
|
2155
|
+
|
|
2156
|
+
Returns **[Promise][21]<any>**
|
|
2026
2157
|
|
|
2027
2158
|
### waitForEnabled
|
|
2028
2159
|
|
|
@@ -2032,7 +2163,9 @@ Element can be located by CSS or XPath.
|
|
|
2032
2163
|
#### Parameters
|
|
2033
2164
|
|
|
2034
2165
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2035
|
-
- `sec` **[number][
|
|
2166
|
+
- `sec` **[number][23]** (optional) time in seconds to wait, 1 by default.
|
|
2167
|
+
|
|
2168
|
+
Returns **[Promise][21]<any>**
|
|
2036
2169
|
|
|
2037
2170
|
### waitForFunction
|
|
2038
2171
|
|
|
@@ -2051,9 +2184,11 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
2051
2184
|
|
|
2052
2185
|
#### Parameters
|
|
2053
2186
|
|
|
2054
|
-
- `fn` **([string][19] | [function][
|
|
2055
|
-
- `argsOrSec` **([Array][27]<any> | [number][
|
|
2056
|
-
- `sec` **[number][
|
|
2187
|
+
- `fn` **([string][19] | [function][25])** to be executed in browser context.
|
|
2188
|
+
- `argsOrSec` **([Array][27]<any> | [number][23])?** (optional, `1` by default) arguments for function or seconds.
|
|
2189
|
+
- `sec` **[number][23]?** (optional, `1` by default) time in seconds to wait
|
|
2190
|
+
|
|
2191
|
+
Returns **[Promise][21]<any>**
|
|
2057
2192
|
|
|
2058
2193
|
### waitForInvisible
|
|
2059
2194
|
|
|
@@ -2067,7 +2202,9 @@ I.waitForInvisible('#popup');
|
|
|
2067
2202
|
#### Parameters
|
|
2068
2203
|
|
|
2069
2204
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2070
|
-
- `sec` **[number][
|
|
2205
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2206
|
+
|
|
2207
|
+
Returns **[Promise][21]<any>**
|
|
2071
2208
|
|
|
2072
2209
|
### waitForText
|
|
2073
2210
|
|
|
@@ -2083,9 +2220,11 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2083
2220
|
#### Parameters
|
|
2084
2221
|
|
|
2085
2222
|
- `text` **[string][19]** to wait for.
|
|
2086
|
-
- `sec` **[number][
|
|
2223
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2087
2224
|
- `context` **([string][19] | [object][18])?** (optional) element located by CSS|XPath|strict locator.
|
|
2088
2225
|
|
|
2226
|
+
Returns **[Promise][21]<any>**
|
|
2227
|
+
|
|
2089
2228
|
### waitForValue
|
|
2090
2229
|
|
|
2091
2230
|
Waits for the specified value to be in value attribute.
|
|
@@ -2098,7 +2237,9 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2098
2237
|
|
|
2099
2238
|
- `field` **([string][19] | [object][18])** input field.
|
|
2100
2239
|
- `value` **[string][19]** expected value.
|
|
2101
|
-
- `sec` **[number][
|
|
2240
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2241
|
+
|
|
2242
|
+
Returns **[Promise][21]<any>**
|
|
2102
2243
|
|
|
2103
2244
|
### waitForVisible
|
|
2104
2245
|
|
|
@@ -2112,7 +2253,9 @@ I.waitForVisible('#popup');
|
|
|
2112
2253
|
#### Parameters
|
|
2113
2254
|
|
|
2114
2255
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2115
|
-
- `sec` **[number][
|
|
2256
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2257
|
+
|
|
2258
|
+
Returns **[Promise][21]<any>**
|
|
2116
2259
|
|
|
2117
2260
|
### waitInUrl
|
|
2118
2261
|
|
|
@@ -2125,7 +2268,9 @@ I.waitInUrl('/info', 2);
|
|
|
2125
2268
|
#### Parameters
|
|
2126
2269
|
|
|
2127
2270
|
- `urlPart` **[string][19]** value to check.
|
|
2128
|
-
- `sec` **[number][
|
|
2271
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2272
|
+
|
|
2273
|
+
Returns **[Promise][21]<any>**
|
|
2129
2274
|
|
|
2130
2275
|
### waitNumberOfVisibleElements
|
|
2131
2276
|
|
|
@@ -2138,8 +2283,10 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2138
2283
|
#### Parameters
|
|
2139
2284
|
|
|
2140
2285
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2141
|
-
- `num` **[number][
|
|
2142
|
-
- `sec` **[number][
|
|
2286
|
+
- `num` **[number][23]** number of elements.
|
|
2287
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2288
|
+
|
|
2289
|
+
Returns **[Promise][21]<any>**
|
|
2143
2290
|
|
|
2144
2291
|
### waitToHide
|
|
2145
2292
|
|
|
@@ -2153,7 +2300,9 @@ I.waitToHide('#popup');
|
|
|
2153
2300
|
#### Parameters
|
|
2154
2301
|
|
|
2155
2302
|
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
2156
|
-
- `sec` **[number][
|
|
2303
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2304
|
+
|
|
2305
|
+
Returns **[Promise][21]<any>**
|
|
2157
2306
|
|
|
2158
2307
|
### waitUrlEquals
|
|
2159
2308
|
|
|
@@ -2167,7 +2316,9 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2167
2316
|
#### Parameters
|
|
2168
2317
|
|
|
2169
2318
|
- `urlPart` **[string][19]** value to check.
|
|
2170
|
-
- `sec` **[number][
|
|
2319
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2320
|
+
|
|
2321
|
+
Returns **[Promise][21]<any>**
|
|
2171
2322
|
|
|
2172
2323
|
[1]: http://webdriver.io/
|
|
2173
2324
|
|
|
@@ -2209,15 +2360,15 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2209
2360
|
|
|
2210
2361
|
[20]: http://jster.net/category/windows-modals-popups
|
|
2211
2362
|
|
|
2212
|
-
[21]: https://
|
|
2363
|
+
[21]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2213
2364
|
|
|
2214
|
-
[22]: https://
|
|
2365
|
+
[22]: https://webdriver.io/docs/timeouts.html
|
|
2215
2366
|
|
|
2216
|
-
[23]: https://
|
|
2367
|
+
[23]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
2217
2368
|
|
|
2218
|
-
[24]: https://
|
|
2369
|
+
[24]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
2219
2370
|
|
|
2220
|
-
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
2371
|
+
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2221
2372
|
|
|
2222
2373
|
[26]: http://webdriver.io/api/protocol/execute.html
|
|
2223
2374
|
|