codeceptjs 3.5.8 → 3.5.9-beta.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/README.md +1 -1
- package/docs/build/Appium.js +18 -18
- package/docs/build/Nightmare.js +51 -52
- package/docs/build/Playwright.js +74 -75
- package/docs/build/Protractor.js +64 -65
- package/docs/build/Puppeteer.js +74 -75
- package/docs/build/TestCafe.js +54 -55
- package/docs/build/WebDriver.js +79 -80
- package/docs/changelog.md +1 -571
- package/docs/community-helpers.md +4 -8
- package/docs/examples.md +2 -8
- package/docs/helpers/Appium.md +18 -18
- package/docs/helpers/Nightmare.md +75 -77
- package/docs/helpers/Playwright.md +175 -177
- package/docs/helpers/Protractor.md +153 -155
- package/docs/helpers/Puppeteer.md +146 -148
- package/docs/helpers/TestCafe.md +124 -126
- package/docs/helpers/WebDriver.md +155 -157
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- package/docs/webapi/blur.mustache +1 -1
- package/docs/webapi/checkOption.mustache +1 -1
- package/docs/webapi/clearCookie.mustache +1 -2
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +1 -1
- package/docs/webapi/clickLink.mustache +1 -1
- package/docs/webapi/closeCurrentTab.mustache +1 -1
- package/docs/webapi/closeOtherTabs.mustache +1 -1
- package/docs/webapi/dontSee.mustache +1 -1
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeCookie.mustache +1 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -1
- package/docs/webapi/dontSeeInTitle.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +1 -1
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragAndDrop.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/focus.mustache +1 -1
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.mustache +1 -1
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +1 -1
- package/docs/webapi/moveCursorTo.mustache +1 -1
- package/docs/webapi/openNewTab.mustache +1 -1
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/pressKeyDown.mustache +1 -1
- package/docs/webapi/pressKeyUp.mustache +1 -1
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
- package/docs/webapi/refreshPage.mustache +1 -1
- package/docs/webapi/resizeWindow.mustache +1 -1
- package/docs/webapi/rightClick.mustache +1 -1
- package/docs/webapi/saveElementScreenshot.mustache +1 -1
- package/docs/webapi/saveScreenshot.mustache +1 -1
- package/docs/webapi/say.mustache +1 -1
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/docs/webapi/scrollPageToBottom.mustache +1 -1
- package/docs/webapi/scrollPageToTop.mustache +1 -1
- package/docs/webapi/scrollTo.mustache +1 -1
- package/docs/webapi/see.mustache +1 -1
- package/docs/webapi/seeAttributesOnElements.mustache +1 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/seeCookie.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInCurrentUrl.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/webapi/seeInPopup.mustache +1 -1
- package/docs/webapi/seeInSource.mustache +1 -1
- package/docs/webapi/seeInTitle.mustache +1 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -1
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/seeTextEquals.mustache +1 -1
- package/docs/webapi/seeTitleEquals.mustache +1 -1
- package/docs/webapi/selectOption.mustache +1 -1
- package/docs/webapi/setCookie.mustache +1 -1
- package/docs/webapi/setGeoLocation.mustache +1 -1
- package/docs/webapi/switchTo.mustache +1 -1
- package/docs/webapi/switchToNextTab.mustache +1 -1
- package/docs/webapi/switchToPreviousTab.mustache +1 -1
- package/docs/webapi/type.mustache +1 -1
- package/docs/webapi/uncheckOption.mustache +1 -1
- package/docs/webapi/wait.mustache +1 -1
- package/docs/webapi/waitForClickable.mustache +1 -1
- package/docs/webapi/waitForDetached.mustache +1 -1
- package/docs/webapi/waitForElement.mustache +1 -1
- package/docs/webapi/waitForEnabled.mustache +1 -1
- package/docs/webapi/waitForFunction.mustache +1 -1
- package/docs/webapi/waitForInvisible.mustache +1 -1
- package/docs/webapi/waitForText.mustache +1 -1
- package/docs/webapi/waitForValue.mustache +1 -1
- package/docs/webapi/waitForVisible.mustache +1 -1
- package/docs/webapi/waitInUrl.mustache +1 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/waitToHide.mustache +1 -1
- package/docs/webapi/waitUrlEquals.mustache +1 -1
- package/lib/helper/Playwright.js +2 -2
- package/package.json +1 -1
- package/typings/promiseBasedTypes.d.ts +418 -1007
- package/typings/types.d.ts +418 -424
|
@@ -30,18 +30,18 @@ Type: [object][16]
|
|
|
30
30
|
- `browser` **[string][17]** Browser in which to perform testing.
|
|
31
31
|
- `basicAuth` **[string][17]?** (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
32
32
|
- `host` **[string][17]?** WebDriver host to connect.
|
|
33
|
-
- `port` **[number][
|
|
33
|
+
- `port` **[number][22]?** WebDriver port to connect.
|
|
34
34
|
- `protocol` **[string][17]?** protocol for WebDriver server.
|
|
35
35
|
- `path` **[string][17]?** path to WebDriver server.
|
|
36
36
|
- `restart` **[boolean][32]?** restart browser between tests.
|
|
37
|
-
- `smartWait` **([boolean][32] | [number][
|
|
37
|
+
- `smartWait` **([boolean][32] | [number][22])?** **enables [SmartWait][36]**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
|
|
38
38
|
- `disableScreenshots` **[boolean][32]?** don't save screenshots on failure.
|
|
39
39
|
- `fullPageScreenshots` **[boolean][32]?** (optional - make full page screenshots on failure.
|
|
40
40
|
- `uniqueScreenshotNames` **[boolean][32]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
41
41
|
- `keepBrowserState` **[boolean][32]?** keep browser state between tests when `restart` is set to false.
|
|
42
42
|
- `keepCookies` **[boolean][32]?** keep cookies between tests when `restart` set to false.
|
|
43
43
|
- `windowSize` **[string][17]?** default window size. Set to `maximize` or a dimension in the format `640x480`.
|
|
44
|
-
- `waitForTimeout` **[number][
|
|
44
|
+
- `waitForTimeout` **[number][22]?** sets default wait time in _ms_ for all `wait*` functions.
|
|
45
45
|
- `desiredCapabilities` **[object][16]?** Selenium's [desired capabilities][6].
|
|
46
46
|
- `manualStart` **[boolean][32]?** do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
|
|
47
47
|
- `timeouts` **[object][16]?** [WebDriver timeouts][37] defined as hash.
|
|
@@ -456,7 +456,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
456
456
|
|
|
457
457
|
- `url` **[string][17]** url path or global url.
|
|
458
458
|
|
|
459
|
-
Returns **
|
|
459
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
460
460
|
|
|
461
461
|
### appendField
|
|
462
462
|
|
|
@@ -474,7 +474,7 @@ I.appendField('password', secret('123456'));
|
|
|
474
474
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator
|
|
475
475
|
- `value` **[string][17]** text value to append.
|
|
476
476
|
|
|
477
|
-
Returns **
|
|
477
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
478
478
|
|
|
479
479
|
|
|
480
480
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -496,12 +496,12 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
496
496
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
497
497
|
- `pathToFile` **[string][17]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
498
498
|
|
|
499
|
-
Returns **
|
|
499
|
+
Returns **void** automatically synchronized promise through #recorderAppium: not tested
|
|
500
500
|
|
|
501
501
|
### blur
|
|
502
502
|
|
|
503
503
|
Remove focus from a text input, button, etc.
|
|
504
|
-
Calls [blur][
|
|
504
|
+
Calls [blur][19] on the element.
|
|
505
505
|
|
|
506
506
|
Examples:
|
|
507
507
|
|
|
@@ -519,9 +519,9 @@ I.dontSee('#add-to-cart-btn');
|
|
|
519
519
|
#### Parameters
|
|
520
520
|
|
|
521
521
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
522
|
-
- `options` **any?** Playwright only: [Additional options][
|
|
522
|
+
- `options` **any?** Playwright only: [Additional options][20] for available options object as 2nd argument.
|
|
523
523
|
|
|
524
|
-
Returns **
|
|
524
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
525
525
|
|
|
526
526
|
### cancelPopup
|
|
527
527
|
|
|
@@ -545,7 +545,7 @@ I.checkOption('agree', '//form');
|
|
|
545
545
|
- `field` **([string][17] | [object][16])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
546
546
|
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
547
547
|
|
|
548
|
-
Returns **
|
|
548
|
+
Returns **void** automatically synchronized promise through #recorderAppium: not tested
|
|
549
549
|
|
|
550
550
|
### clearCookie
|
|
551
551
|
|
|
@@ -554,15 +554,13 @@ if none provided clears all cookies.
|
|
|
554
554
|
|
|
555
555
|
```js
|
|
556
556
|
I.clearCookie();
|
|
557
|
-
I.clearCookie('test');
|
|
557
|
+
I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
|
|
558
558
|
```
|
|
559
559
|
|
|
560
560
|
#### Parameters
|
|
561
561
|
|
|
562
562
|
- `cookie` **[string][17]?** (optional, `null` by default) cookie name
|
|
563
563
|
|
|
564
|
-
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
565
|
-
|
|
566
564
|
### clearField
|
|
567
565
|
|
|
568
566
|
Clears a `<textarea>` or text `<input>` element's value.
|
|
@@ -578,7 +576,7 @@ I.clearField('#email');
|
|
|
578
576
|
- `field`
|
|
579
577
|
- `editable` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
580
578
|
|
|
581
|
-
Returns **
|
|
579
|
+
Returns **void** automatically synchronized promise through #recorder.
|
|
582
580
|
|
|
583
581
|
### click
|
|
584
582
|
|
|
@@ -609,7 +607,7 @@ I.click({css: 'nav a.login'});
|
|
|
609
607
|
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
610
608
|
- `context` **([string][17]? | [object][16] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
611
609
|
|
|
612
|
-
Returns **
|
|
610
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
613
611
|
|
|
614
612
|
|
|
615
613
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -623,7 +621,7 @@ Close current tab.
|
|
|
623
621
|
I.closeCurrentTab();
|
|
624
622
|
```
|
|
625
623
|
|
|
626
|
-
Returns **
|
|
624
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
627
625
|
|
|
628
626
|
### closeOtherTabs
|
|
629
627
|
|
|
@@ -633,11 +631,11 @@ Close all tabs except for the current one.
|
|
|
633
631
|
I.closeOtherTabs();
|
|
634
632
|
```
|
|
635
633
|
|
|
636
|
-
Returns **
|
|
634
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
637
635
|
|
|
638
636
|
### defineTimeout
|
|
639
637
|
|
|
640
|
-
Set [WebDriver timeouts][
|
|
638
|
+
Set [WebDriver timeouts][21] in realtime.
|
|
641
639
|
|
|
642
640
|
Timeouts are expected to be passed as object:
|
|
643
641
|
|
|
@@ -665,7 +663,7 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
665
663
|
- `text` **[string][17]** which is not present.
|
|
666
664
|
- `context` **([string][17] | [object][16])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
667
665
|
|
|
668
|
-
Returns **
|
|
666
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
669
667
|
|
|
670
668
|
|
|
671
669
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -685,7 +683,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
685
683
|
|
|
686
684
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
687
685
|
|
|
688
|
-
Returns **
|
|
686
|
+
Returns **void** automatically synchronized promise through #recorderAppium: not tested
|
|
689
687
|
|
|
690
688
|
### dontSeeCookie
|
|
691
689
|
|
|
@@ -699,7 +697,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
699
697
|
|
|
700
698
|
- `name` **[string][17]** cookie name.
|
|
701
699
|
|
|
702
|
-
Returns **
|
|
700
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
703
701
|
|
|
704
702
|
### dontSeeCurrentUrlEquals
|
|
705
703
|
|
|
@@ -715,7 +713,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
715
713
|
|
|
716
714
|
- `url` **[string][17]** value to check.
|
|
717
715
|
|
|
718
|
-
Returns **
|
|
716
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
719
717
|
|
|
720
718
|
### dontSeeElement
|
|
721
719
|
|
|
@@ -729,7 +727,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
729
727
|
|
|
730
728
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|Strict locator.
|
|
731
729
|
|
|
732
|
-
Returns **
|
|
730
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
733
731
|
|
|
734
732
|
|
|
735
733
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -747,7 +745,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
747
745
|
|
|
748
746
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|Strict locator.
|
|
749
747
|
|
|
750
|
-
Returns **
|
|
748
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
751
749
|
|
|
752
750
|
### dontSeeInCurrentUrl
|
|
753
751
|
|
|
@@ -757,7 +755,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
757
755
|
|
|
758
756
|
- `url` **[string][17]** value to check.
|
|
759
757
|
|
|
760
|
-
Returns **
|
|
758
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
761
759
|
|
|
762
760
|
### dontSeeInField
|
|
763
761
|
|
|
@@ -774,7 +772,7 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
774
772
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
775
773
|
- `value` **([string][17] | [object][16])** value to check.
|
|
776
774
|
|
|
777
|
-
Returns **
|
|
775
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
778
776
|
|
|
779
777
|
### dontSeeInSource
|
|
780
778
|
|
|
@@ -789,7 +787,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
789
787
|
- `text`
|
|
790
788
|
- `value` **[string][17]** to check.
|
|
791
789
|
|
|
792
|
-
Returns **
|
|
790
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
793
791
|
|
|
794
792
|
### dontSeeInTitle
|
|
795
793
|
|
|
@@ -803,7 +801,7 @@ I.dontSeeInTitle('Error');
|
|
|
803
801
|
|
|
804
802
|
- `text` **[string][17]** value to check.
|
|
805
803
|
|
|
806
|
-
Returns **
|
|
804
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
807
805
|
|
|
808
806
|
### doubleClick
|
|
809
807
|
|
|
@@ -822,7 +820,7 @@ I.doubleClick('.btn.edit');
|
|
|
822
820
|
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
823
821
|
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
824
822
|
|
|
825
|
-
Returns **
|
|
823
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
826
824
|
|
|
827
825
|
|
|
828
826
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -841,7 +839,7 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
841
839
|
- `srcElement` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
842
840
|
- `destElement` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
843
841
|
|
|
844
|
-
Returns **
|
|
842
|
+
Returns **void** automatically synchronized promise through #recorderAppium: not tested
|
|
845
843
|
|
|
846
844
|
### dragSlider
|
|
847
845
|
|
|
@@ -856,16 +854,16 @@ I.dragSlider('#slider', -70);
|
|
|
856
854
|
#### Parameters
|
|
857
855
|
|
|
858
856
|
- `locator` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
859
|
-
- `offsetX` **[number][
|
|
857
|
+
- `offsetX` **[number][22]** position to drag.
|
|
860
858
|
|
|
861
|
-
Returns **
|
|
859
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
862
860
|
|
|
863
861
|
### executeAsyncScript
|
|
864
862
|
|
|
865
863
|
Executes async script on page.
|
|
866
864
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
867
865
|
|
|
868
|
-
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][
|
|
866
|
+
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][23].
|
|
869
867
|
|
|
870
868
|
```js
|
|
871
869
|
I.executeAsyncScript(function(done) {
|
|
@@ -886,9 +884,9 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
886
884
|
#### Parameters
|
|
887
885
|
|
|
888
886
|
- `args` **...any** to be passed to function.
|
|
889
|
-
- `fn` **([string][17] | [function][
|
|
887
|
+
- `fn` **([string][17] | [function][24])** function to be executed in browser context.
|
|
890
888
|
|
|
891
|
-
Returns **[Promise][
|
|
889
|
+
Returns **[Promise][25]<any>** script return value
|
|
892
890
|
|
|
893
891
|
### executeScript
|
|
894
892
|
|
|
@@ -919,9 +917,9 @@ let date = await I.executeScript(function(el) {
|
|
|
919
917
|
#### Parameters
|
|
920
918
|
|
|
921
919
|
- `args` **...any** to be passed to function.
|
|
922
|
-
- `fn` **([string][17] | [function][
|
|
920
|
+
- `fn` **([string][17] | [function][24])** function to be executed in browser context.
|
|
923
921
|
|
|
924
|
-
Returns **[Promise][
|
|
922
|
+
Returns **[Promise][25]<any>** script return valueWraps [execute][26] command.
|
|
925
923
|
|
|
926
924
|
### fillField
|
|
927
925
|
|
|
@@ -944,7 +942,7 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
944
942
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
945
943
|
- `value` **([string][17] | [object][16])** text value to fill.
|
|
946
944
|
|
|
947
|
-
Returns **
|
|
945
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
948
946
|
|
|
949
947
|
|
|
950
948
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -953,7 +951,7 @@ This action supports [React locators](https://codecept.io/react#locators)
|
|
|
953
951
|
|
|
954
952
|
### focus
|
|
955
953
|
|
|
956
|
-
Calls [focus][
|
|
954
|
+
Calls [focus][19] on the matching element.
|
|
957
955
|
|
|
958
956
|
Examples:
|
|
959
957
|
|
|
@@ -968,7 +966,7 @@ I.see('#add-to-cart-bnt');
|
|
|
968
966
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
969
967
|
- `options` **any?** Playwright only: [Additional options][27] for available options object as 2nd argument.
|
|
970
968
|
|
|
971
|
-
Returns **
|
|
969
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
972
970
|
|
|
973
971
|
### forceClick
|
|
974
972
|
|
|
@@ -1002,7 +1000,7 @@ I.forceClick({css: 'nav a.login'});
|
|
|
1002
1000
|
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1003
1001
|
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1004
1002
|
|
|
1005
|
-
Returns **
|
|
1003
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1006
1004
|
|
|
1007
1005
|
|
|
1008
1006
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1030,7 +1028,7 @@ I.forceRightClick('Menu');
|
|
|
1030
1028
|
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1031
1029
|
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1032
1030
|
|
|
1033
|
-
Returns **
|
|
1031
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1034
1032
|
|
|
1035
1033
|
|
|
1036
1034
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1045,7 +1043,7 @@ Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
|
|
|
1045
1043
|
const windows = await I.grabAllWindowHandles();
|
|
1046
1044
|
```
|
|
1047
1045
|
|
|
1048
|
-
Returns **[Promise][
|
|
1046
|
+
Returns **[Promise][25]<[Array][28]<[string][17]>>**
|
|
1049
1047
|
|
|
1050
1048
|
### grabAttributeFrom
|
|
1051
1049
|
|
|
@@ -1062,7 +1060,7 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
1062
1060
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1063
1061
|
- `attr` **[string][17]** attribute name.
|
|
1064
1062
|
|
|
1065
|
-
Returns **[Promise][
|
|
1063
|
+
Returns **[Promise][25]<[string][17]>** attribute value
|
|
1066
1064
|
|
|
1067
1065
|
### grabAttributeFromAll
|
|
1068
1066
|
|
|
@@ -1078,7 +1076,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
1078
1076
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1079
1077
|
- `attr` **[string][17]** attribute name.
|
|
1080
1078
|
|
|
1081
|
-
Returns **[Promise][
|
|
1079
|
+
Returns **[Promise][25]<[Array][28]<[string][17]>>** attribute value
|
|
1082
1080
|
|
|
1083
1081
|
### grabBrowserLogs
|
|
1084
1082
|
|
|
@@ -1090,7 +1088,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
1090
1088
|
console.log(JSON.stringify(logs))
|
|
1091
1089
|
```
|
|
1092
1090
|
|
|
1093
|
-
Returns **([Promise][
|
|
1091
|
+
Returns **([Promise][25]<[Array][28]<[object][16]>> | [undefined][29])** all browser logs
|
|
1094
1092
|
|
|
1095
1093
|
### grabCookie
|
|
1096
1094
|
|
|
@@ -1124,7 +1122,7 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
1124
1122
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1125
1123
|
- `cssProperty` **[string][17]** CSS property name.
|
|
1126
1124
|
|
|
1127
|
-
Returns **[Promise][
|
|
1125
|
+
Returns **[Promise][25]<[string][17]>** CSS value
|
|
1128
1126
|
|
|
1129
1127
|
### grabCssPropertyFromAll
|
|
1130
1128
|
|
|
@@ -1140,7 +1138,7 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
1140
1138
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1141
1139
|
- `cssProperty` **[string][17]** CSS property name.
|
|
1142
1140
|
|
|
1143
|
-
Returns **[Promise][
|
|
1141
|
+
Returns **[Promise][25]<[Array][28]<[string][17]>>** CSS value
|
|
1144
1142
|
|
|
1145
1143
|
### grabCurrentUrl
|
|
1146
1144
|
|
|
@@ -1152,7 +1150,7 @@ let url = await I.grabCurrentUrl();
|
|
|
1152
1150
|
console.log(`Current URL is [${url}]`);
|
|
1153
1151
|
```
|
|
1154
1152
|
|
|
1155
|
-
Returns **[Promise][
|
|
1153
|
+
Returns **[Promise][25]<[string][17]>** current URL
|
|
1156
1154
|
|
|
1157
1155
|
### grabCurrentWindowHandle
|
|
1158
1156
|
|
|
@@ -1163,7 +1161,7 @@ Useful for referencing it when calling `I.switchToWindow(handle)`
|
|
|
1163
1161
|
const window = await I.grabCurrentWindowHandle();
|
|
1164
1162
|
```
|
|
1165
1163
|
|
|
1166
|
-
Returns **[Promise][
|
|
1164
|
+
Returns **[Promise][25]<[string][17]>**
|
|
1167
1165
|
|
|
1168
1166
|
### grabElementBoundingRect
|
|
1169
1167
|
|
|
@@ -1191,7 +1189,7 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
1191
1189
|
- `prop`
|
|
1192
1190
|
- `elementSize` **[string][17]?** x, y, width or height of the given element.
|
|
1193
1191
|
|
|
1194
|
-
Returns **([Promise][
|
|
1192
|
+
Returns **([Promise][25]<DOMRect> | [Promise][25]<[number][22]>)** Element bounding rectangle
|
|
1195
1193
|
|
|
1196
1194
|
### grabGeoLocation
|
|
1197
1195
|
|
|
@@ -1202,7 +1200,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1202
1200
|
let geoLocation = await I.grabGeoLocation();
|
|
1203
1201
|
```
|
|
1204
1202
|
|
|
1205
|
-
Returns **[Promise][
|
|
1203
|
+
Returns **[Promise][25]<{latitude: [number][22], longitude: [number][22], altitude: [number][22]}>**
|
|
1206
1204
|
|
|
1207
1205
|
### grabHTMLFrom
|
|
1208
1206
|
|
|
@@ -1219,7 +1217,7 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1219
1217
|
- `locator`
|
|
1220
1218
|
- `element` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1221
1219
|
|
|
1222
|
-
Returns **[Promise][
|
|
1220
|
+
Returns **[Promise][25]<[string][17]>** HTML code for an element
|
|
1223
1221
|
|
|
1224
1222
|
### grabHTMLFromAll
|
|
1225
1223
|
|
|
@@ -1235,7 +1233,7 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1235
1233
|
- `locator`
|
|
1236
1234
|
- `element` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1237
1235
|
|
|
1238
|
-
Returns **[Promise][
|
|
1236
|
+
Returns **[Promise][25]<[Array][28]<[string][17]>>** HTML code for an element
|
|
1239
1237
|
|
|
1240
1238
|
### grabNumberOfOpenTabs
|
|
1241
1239
|
|
|
@@ -1246,7 +1244,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1246
1244
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1247
1245
|
```
|
|
1248
1246
|
|
|
1249
|
-
Returns **[Promise][
|
|
1247
|
+
Returns **[Promise][25]<[number][22]>** number of open tabs
|
|
1250
1248
|
|
|
1251
1249
|
### grabNumberOfVisibleElements
|
|
1252
1250
|
|
|
@@ -1261,7 +1259,7 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1261
1259
|
|
|
1262
1260
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1263
1261
|
|
|
1264
|
-
Returns **[Promise][
|
|
1262
|
+
Returns **[Promise][25]<[number][22]>** number of visible elements
|
|
1265
1263
|
|
|
1266
1264
|
### grabPageScrollPosition
|
|
1267
1265
|
|
|
@@ -1272,7 +1270,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1272
1270
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1273
1271
|
```
|
|
1274
1272
|
|
|
1275
|
-
Returns **[Promise][
|
|
1273
|
+
Returns **[Promise][25]<PageScrollPosition>** scroll position
|
|
1276
1274
|
|
|
1277
1275
|
### grabPopupText
|
|
1278
1276
|
|
|
@@ -1282,7 +1280,7 @@ Grab the text within the popup. If no popup is visible then it will return null.
|
|
|
1282
1280
|
await I.grabPopupText();
|
|
1283
1281
|
```
|
|
1284
1282
|
|
|
1285
|
-
Returns **[Promise][
|
|
1283
|
+
Returns **[Promise][25]<[string][17]>**
|
|
1286
1284
|
|
|
1287
1285
|
### grabSource
|
|
1288
1286
|
|
|
@@ -1293,7 +1291,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1293
1291
|
let pageSource = await I.grabSource();
|
|
1294
1292
|
```
|
|
1295
1293
|
|
|
1296
|
-
Returns **[Promise][
|
|
1294
|
+
Returns **[Promise][25]<[string][17]>** source code
|
|
1297
1295
|
|
|
1298
1296
|
### grabTextFrom
|
|
1299
1297
|
|
|
@@ -1310,7 +1308,7 @@ If multiple elements found returns first element.
|
|
|
1310
1308
|
|
|
1311
1309
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1312
1310
|
|
|
1313
|
-
Returns **[Promise][
|
|
1311
|
+
Returns **[Promise][25]<[string][17]>** attribute value
|
|
1314
1312
|
|
|
1315
1313
|
### grabTextFromAll
|
|
1316
1314
|
|
|
@@ -1325,7 +1323,7 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1325
1323
|
|
|
1326
1324
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1327
1325
|
|
|
1328
|
-
Returns **[Promise][
|
|
1326
|
+
Returns **[Promise][25]<[Array][28]<[string][17]>>** attribute value
|
|
1329
1327
|
|
|
1330
1328
|
### grabTitle
|
|
1331
1329
|
|
|
@@ -1336,7 +1334,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1336
1334
|
let title = await I.grabTitle();
|
|
1337
1335
|
```
|
|
1338
1336
|
|
|
1339
|
-
Returns **[Promise][
|
|
1337
|
+
Returns **[Promise][25]<[string][17]>** title
|
|
1340
1338
|
|
|
1341
1339
|
### grabValueFrom
|
|
1342
1340
|
|
|
@@ -1352,7 +1350,7 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1352
1350
|
|
|
1353
1351
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
1354
1352
|
|
|
1355
|
-
Returns **[Promise][
|
|
1353
|
+
Returns **[Promise][25]<[string][17]>** attribute value
|
|
1356
1354
|
|
|
1357
1355
|
### grabValueFromAll
|
|
1358
1356
|
|
|
@@ -1367,7 +1365,7 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1367
1365
|
|
|
1368
1366
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
1369
1367
|
|
|
1370
|
-
Returns **[Promise][
|
|
1368
|
+
Returns **[Promise][25]<[Array][28]<[string][17]>>** attribute value
|
|
1371
1369
|
|
|
1372
1370
|
### moveCursorTo
|
|
1373
1371
|
|
|
@@ -1384,10 +1382,10 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1384
1382
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1385
1383
|
- `xOffset`
|
|
1386
1384
|
- `yOffset`
|
|
1387
|
-
- `offsetX` **[number][
|
|
1388
|
-
- `offsetY` **[number][
|
|
1385
|
+
- `offsetX` **[number][22]** (optional, `0` by default) X-axis offset.
|
|
1386
|
+
- `offsetY` **[number][22]** (optional, `0` by default) Y-axis offset.
|
|
1389
1387
|
|
|
1390
|
-
Returns **
|
|
1388
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1391
1389
|
|
|
1392
1390
|
### openNewTab
|
|
1393
1391
|
|
|
@@ -1402,7 +1400,7 @@ I.openNewTab();
|
|
|
1402
1400
|
- `url`
|
|
1403
1401
|
- `windowName`
|
|
1404
1402
|
|
|
1405
|
-
Returns **
|
|
1403
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1406
1404
|
|
|
1407
1405
|
### pressKey
|
|
1408
1406
|
|
|
@@ -1469,7 +1467,7 @@ Some of the supported key names are:
|
|
|
1469
1467
|
|
|
1470
1468
|
- `key` **([string][17] | [Array][28]<[string][17]>)** key or array of keys to press.
|
|
1471
1469
|
|
|
1472
|
-
Returns **
|
|
1470
|
+
Returns **void** automatically synchronized promise through #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.
|
|
1473
1471
|
|
|
1474
1472
|
### pressKeyDown
|
|
1475
1473
|
|
|
@@ -1487,7 +1485,7 @@ I.pressKeyUp('Control');
|
|
|
1487
1485
|
|
|
1488
1486
|
- `key` **[string][17]** name of key to press down.
|
|
1489
1487
|
|
|
1490
|
-
Returns **
|
|
1488
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1491
1489
|
|
|
1492
1490
|
### pressKeyUp
|
|
1493
1491
|
|
|
@@ -1505,7 +1503,7 @@ I.pressKeyUp('Control');
|
|
|
1505
1503
|
|
|
1506
1504
|
- `key` **[string][17]** name of key to release.
|
|
1507
1505
|
|
|
1508
|
-
Returns **
|
|
1506
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1509
1507
|
|
|
1510
1508
|
### refreshPage
|
|
1511
1509
|
|
|
@@ -1515,7 +1513,7 @@ Reload the current page.
|
|
|
1515
1513
|
I.refreshPage();
|
|
1516
1514
|
```
|
|
1517
1515
|
|
|
1518
|
-
Returns **
|
|
1516
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1519
1517
|
|
|
1520
1518
|
### resizeWindow
|
|
1521
1519
|
|
|
@@ -1524,10 +1522,10 @@ First parameter can be set to `maximize`.
|
|
|
1524
1522
|
|
|
1525
1523
|
#### Parameters
|
|
1526
1524
|
|
|
1527
|
-
- `width` **[number][
|
|
1528
|
-
- `height` **[number][
|
|
1525
|
+
- `width` **[number][22]** width in pixels or `maximize`.
|
|
1526
|
+
- `height` **[number][22]** height in pixels.
|
|
1529
1527
|
|
|
1530
|
-
Returns **
|
|
1528
|
+
Returns **void** automatically synchronized promise through #recorderAppium: not tested in web, in apps doesn't work
|
|
1531
1529
|
|
|
1532
1530
|
### rightClick
|
|
1533
1531
|
|
|
@@ -1547,7 +1545,7 @@ I.rightClick('Click me', '.context');
|
|
|
1547
1545
|
- `locator` **([string][17] | [object][16])** clickable element located by CSS|XPath|strict locator.
|
|
1548
1546
|
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1549
1547
|
|
|
1550
|
-
Returns **
|
|
1548
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1551
1549
|
|
|
1552
1550
|
|
|
1553
1551
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1593,7 +1591,7 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1593
1591
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1594
1592
|
- `fileName` **[string][17]** file name to save.
|
|
1595
1593
|
|
|
1596
|
-
Returns **
|
|
1594
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1597
1595
|
|
|
1598
1596
|
### saveScreenshot
|
|
1599
1597
|
|
|
@@ -1611,7 +1609,7 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1611
1609
|
- `fileName` **[string][17]** file name to save.
|
|
1612
1610
|
- `fullPage` **[boolean][32]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1613
1611
|
|
|
1614
|
-
Returns **
|
|
1612
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1615
1613
|
|
|
1616
1614
|
### scrollIntoView
|
|
1617
1615
|
|
|
@@ -1628,7 +1626,7 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1628
1626
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1629
1627
|
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][33].
|
|
1630
1628
|
|
|
1631
|
-
Returns **
|
|
1629
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1632
1630
|
|
|
1633
1631
|
### scrollPageToBottom
|
|
1634
1632
|
|
|
@@ -1638,7 +1636,7 @@ Scroll page to the bottom.
|
|
|
1638
1636
|
I.scrollPageToBottom();
|
|
1639
1637
|
```
|
|
1640
1638
|
|
|
1641
|
-
Returns **
|
|
1639
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1642
1640
|
|
|
1643
1641
|
### scrollPageToTop
|
|
1644
1642
|
|
|
@@ -1648,7 +1646,7 @@ Scroll page to the top.
|
|
|
1648
1646
|
I.scrollPageToTop();
|
|
1649
1647
|
```
|
|
1650
1648
|
|
|
1651
|
-
Returns **
|
|
1649
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1652
1650
|
|
|
1653
1651
|
### scrollTo
|
|
1654
1652
|
|
|
@@ -1663,10 +1661,10 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1663
1661
|
#### Parameters
|
|
1664
1662
|
|
|
1665
1663
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1666
|
-
- `offsetX` **[number][
|
|
1667
|
-
- `offsetY` **[number][
|
|
1664
|
+
- `offsetX` **[number][22]** (optional, `0` by default) X-axis offset.
|
|
1665
|
+
- `offsetY` **[number][22]** (optional, `0` by default) Y-axis offset.
|
|
1668
1666
|
|
|
1669
|
-
Returns **
|
|
1667
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1670
1668
|
|
|
1671
1669
|
### see
|
|
1672
1670
|
|
|
@@ -1684,7 +1682,7 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1684
1682
|
- `text` **[string][17]** expected on page.
|
|
1685
1683
|
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1686
1684
|
|
|
1687
|
-
Returns **
|
|
1685
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1688
1686
|
|
|
1689
1687
|
|
|
1690
1688
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1703,7 +1701,7 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1703
1701
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1704
1702
|
- `attributes` **[object][16]** attributes and their values to check.
|
|
1705
1703
|
|
|
1706
|
-
Returns **
|
|
1704
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1707
1705
|
|
|
1708
1706
|
### seeCheckboxIsChecked
|
|
1709
1707
|
|
|
@@ -1719,7 +1717,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1719
1717
|
|
|
1720
1718
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
1721
1719
|
|
|
1722
|
-
Returns **
|
|
1720
|
+
Returns **void** automatically synchronized promise through #recorderAppium: not tested
|
|
1723
1721
|
|
|
1724
1722
|
### seeCookie
|
|
1725
1723
|
|
|
@@ -1733,7 +1731,7 @@ I.seeCookie('Auth');
|
|
|
1733
1731
|
|
|
1734
1732
|
- `name` **[string][17]** cookie name.
|
|
1735
1733
|
|
|
1736
|
-
Returns **
|
|
1734
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1737
1735
|
|
|
1738
1736
|
### seeCssPropertiesOnElements
|
|
1739
1737
|
|
|
@@ -1748,7 +1746,7 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1748
1746
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1749
1747
|
- `cssProperties` **[object][16]** object with CSS properties and their values to check.
|
|
1750
1748
|
|
|
1751
|
-
Returns **
|
|
1749
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1752
1750
|
|
|
1753
1751
|
### seeCurrentUrlEquals
|
|
1754
1752
|
|
|
@@ -1765,7 +1763,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1765
1763
|
|
|
1766
1764
|
- `url` **[string][17]** value to check.
|
|
1767
1765
|
|
|
1768
|
-
Returns **
|
|
1766
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1769
1767
|
|
|
1770
1768
|
### seeElement
|
|
1771
1769
|
|
|
@@ -1780,7 +1778,7 @@ I.seeElement('#modal');
|
|
|
1780
1778
|
|
|
1781
1779
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1782
1780
|
|
|
1783
|
-
Returns **
|
|
1781
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1784
1782
|
|
|
1785
1783
|
|
|
1786
1784
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1799,7 +1797,7 @@ I.seeElementInDOM('#modal');
|
|
|
1799
1797
|
|
|
1800
1798
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1801
1799
|
|
|
1802
|
-
Returns **
|
|
1800
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1803
1801
|
|
|
1804
1802
|
### seeInCurrentUrl
|
|
1805
1803
|
|
|
@@ -1813,7 +1811,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1813
1811
|
|
|
1814
1812
|
- `url` **[string][17]** a fragment to check
|
|
1815
1813
|
|
|
1816
|
-
Returns **
|
|
1814
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1817
1815
|
|
|
1818
1816
|
### seeInField
|
|
1819
1817
|
|
|
@@ -1832,7 +1830,7 @@ I.seeInField('#searchform input','Search');
|
|
|
1832
1830
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
1833
1831
|
- `value` **([string][17] | [object][16])** value to check.
|
|
1834
1832
|
|
|
1835
|
-
Returns **
|
|
1833
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1836
1834
|
|
|
1837
1835
|
### seeInPopup
|
|
1838
1836
|
|
|
@@ -1855,7 +1853,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1855
1853
|
|
|
1856
1854
|
- `text` **[string][17]** value to check.
|
|
1857
1855
|
|
|
1858
|
-
Returns **
|
|
1856
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1859
1857
|
|
|
1860
1858
|
### seeInTitle
|
|
1861
1859
|
|
|
@@ -1869,7 +1867,7 @@ I.seeInTitle('Home Page');
|
|
|
1869
1867
|
|
|
1870
1868
|
- `text` **[string][17]** text value to check.
|
|
1871
1869
|
|
|
1872
|
-
Returns **
|
|
1870
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1873
1871
|
|
|
1874
1872
|
### seeNumberOfElements
|
|
1875
1873
|
|
|
@@ -1883,9 +1881,9 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1883
1881
|
#### Parameters
|
|
1884
1882
|
|
|
1885
1883
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1886
|
-
- `num` **[number][
|
|
1884
|
+
- `num` **[number][22]** number of elements.
|
|
1887
1885
|
|
|
1888
|
-
Returns **
|
|
1886
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1889
1887
|
|
|
1890
1888
|
|
|
1891
1889
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1903,9 +1901,9 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1903
1901
|
#### Parameters
|
|
1904
1902
|
|
|
1905
1903
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1906
|
-
- `num` **[number][
|
|
1904
|
+
- `num` **[number][22]** number of elements.
|
|
1907
1905
|
|
|
1908
|
-
Returns **
|
|
1906
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1909
1907
|
|
|
1910
1908
|
|
|
1911
1909
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1924,7 +1922,7 @@ I.seeTextEquals('text', 'h1');
|
|
|
1924
1922
|
- `text` **[string][17]** element value to check.
|
|
1925
1923
|
- `context` **([string][17] | [object][16])?** element located by CSS|XPath|strict locator.
|
|
1926
1924
|
|
|
1927
|
-
Returns **
|
|
1925
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1928
1926
|
|
|
1929
1927
|
### seeTitleEquals
|
|
1930
1928
|
|
|
@@ -1938,7 +1936,7 @@ I.seeTitleEquals('Test title.');
|
|
|
1938
1936
|
|
|
1939
1937
|
- `text` **[string][17]** value to check.
|
|
1940
1938
|
|
|
1941
|
-
Returns **
|
|
1939
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1942
1940
|
|
|
1943
1941
|
### selectOption
|
|
1944
1942
|
|
|
@@ -1966,7 +1964,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1966
1964
|
- `select` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
1967
1965
|
- `option` **([string][17] | [Array][28]<any>)** visible text or value of option.
|
|
1968
1966
|
|
|
1969
|
-
Returns **
|
|
1967
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1970
1968
|
|
|
1971
1969
|
### setCookie
|
|
1972
1970
|
|
|
@@ -1988,7 +1986,7 @@ I.setCookie([
|
|
|
1988
1986
|
|
|
1989
1987
|
- `cookie` **(Cookie | [Array][28]<Cookie>)** a cookie object or array of cookie objects.
|
|
1990
1988
|
|
|
1991
|
-
Returns **
|
|
1989
|
+
Returns **void** automatically synchronized promise through #recorderUses Selenium's JSON [cookie
|
|
1992
1990
|
format][34].
|
|
1993
1991
|
|
|
1994
1992
|
### setGeoLocation
|
|
@@ -2002,11 +2000,11 @@ I.setGeoLocation(121.21, 11.56, 10);
|
|
|
2002
2000
|
|
|
2003
2001
|
#### Parameters
|
|
2004
2002
|
|
|
2005
|
-
- `latitude` **[number][
|
|
2006
|
-
- `longitude` **[number][
|
|
2007
|
-
- `altitude` **[number][
|
|
2003
|
+
- `latitude` **[number][22]** to set.
|
|
2004
|
+
- `longitude` **[number][22]** to set
|
|
2005
|
+
- `altitude` **[number][22]?** (optional, null by default) to set
|
|
2008
2006
|
|
|
2009
|
-
Returns **
|
|
2007
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2010
2008
|
|
|
2011
2009
|
### switchTo
|
|
2012
2010
|
|
|
@@ -2021,7 +2019,7 @@ I.switchTo(); // switch back to main page
|
|
|
2021
2019
|
|
|
2022
2020
|
- `locator` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
2023
2021
|
|
|
2024
|
-
Returns **
|
|
2022
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2025
2023
|
|
|
2026
2024
|
### switchToNextTab
|
|
2027
2025
|
|
|
@@ -2034,10 +2032,10 @@ I.switchToNextTab(2);
|
|
|
2034
2032
|
|
|
2035
2033
|
#### Parameters
|
|
2036
2034
|
|
|
2037
|
-
- `num` **[number][
|
|
2038
|
-
- `sec` **([number][
|
|
2035
|
+
- `num` **[number][22]?** (optional) number of tabs to switch forward, default: 1.
|
|
2036
|
+
- `sec` **([number][22] | null)?** (optional) time in seconds to wait.
|
|
2039
2037
|
|
|
2040
|
-
Returns **
|
|
2038
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2041
2039
|
|
|
2042
2040
|
### switchToPreviousTab
|
|
2043
2041
|
|
|
@@ -2050,10 +2048,10 @@ I.switchToPreviousTab(2);
|
|
|
2050
2048
|
|
|
2051
2049
|
#### Parameters
|
|
2052
2050
|
|
|
2053
|
-
- `num` **[number][
|
|
2054
|
-
- `sec` **[number][
|
|
2051
|
+
- `num` **[number][22]?** (optional) number of tabs to switch backward, default: 1.
|
|
2052
|
+
- `sec` **[number][22]??** (optional) time in seconds to wait.
|
|
2055
2053
|
|
|
2056
|
-
Returns **
|
|
2054
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2057
2055
|
|
|
2058
2056
|
### switchToWindow
|
|
2059
2057
|
|
|
@@ -2096,10 +2094,10 @@ I.type(secret('123456'));
|
|
|
2096
2094
|
#### Parameters
|
|
2097
2095
|
|
|
2098
2096
|
- `keys`
|
|
2099
|
-
- `delay` **[number][
|
|
2097
|
+
- `delay` **[number][22]?** (optional) delay in ms between key presses
|
|
2100
2098
|
- `key` **([string][17] | [Array][28]<[string][17]>)** or array of keys to type.
|
|
2101
2099
|
|
|
2102
|
-
Returns **
|
|
2100
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2103
2101
|
|
|
2104
2102
|
### uncheckOption
|
|
2105
2103
|
|
|
@@ -2119,7 +2117,7 @@ I.uncheckOption('agree', '//form');
|
|
|
2119
2117
|
- `field` **([string][17] | [object][16])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
2120
2118
|
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2121
2119
|
|
|
2122
|
-
Returns **
|
|
2120
|
+
Returns **void** automatically synchronized promise through #recorderAppium: not tested
|
|
2123
2121
|
|
|
2124
2122
|
### useWebDriverTo
|
|
2125
2123
|
|
|
@@ -2140,7 +2138,7 @@ I.useWebDriverTo('open multiple windows', async ({ browser }) {
|
|
|
2140
2138
|
#### Parameters
|
|
2141
2139
|
|
|
2142
2140
|
- `description` **[string][17]** used to show in logs.
|
|
2143
|
-
- `fn` **[function][
|
|
2141
|
+
- `fn` **[function][24]** async functuion that executed with WebDriver helper as argument
|
|
2144
2142
|
|
|
2145
2143
|
### wait
|
|
2146
2144
|
|
|
@@ -2152,9 +2150,9 @@ I.wait(2); // wait 2 secs
|
|
|
2152
2150
|
|
|
2153
2151
|
#### Parameters
|
|
2154
2152
|
|
|
2155
|
-
- `sec` **[number][
|
|
2153
|
+
- `sec` **[number][22]** number of second to wait.
|
|
2156
2154
|
|
|
2157
|
-
Returns **
|
|
2155
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2158
2156
|
|
|
2159
2157
|
### waitForClickable
|
|
2160
2158
|
|
|
@@ -2170,9 +2168,9 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
2170
2168
|
|
|
2171
2169
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2172
2170
|
- `waitTimeout`
|
|
2173
|
-
- `sec` **[number][
|
|
2171
|
+
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2174
2172
|
|
|
2175
|
-
Returns **
|
|
2173
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2176
2174
|
|
|
2177
2175
|
### waitForDetached
|
|
2178
2176
|
|
|
@@ -2186,9 +2184,9 @@ I.waitForDetached('#popup');
|
|
|
2186
2184
|
#### Parameters
|
|
2187
2185
|
|
|
2188
2186
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2189
|
-
- `sec` **[number][
|
|
2187
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2190
2188
|
|
|
2191
|
-
Returns **
|
|
2189
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2192
2190
|
|
|
2193
2191
|
### waitForElement
|
|
2194
2192
|
|
|
@@ -2203,9 +2201,9 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
2203
2201
|
#### Parameters
|
|
2204
2202
|
|
|
2205
2203
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2206
|
-
- `sec` **[number][
|
|
2204
|
+
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2207
2205
|
|
|
2208
|
-
Returns **
|
|
2206
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2209
2207
|
|
|
2210
2208
|
### waitForEnabled
|
|
2211
2209
|
|
|
@@ -2215,9 +2213,9 @@ Element can be located by CSS or XPath.
|
|
|
2215
2213
|
#### Parameters
|
|
2216
2214
|
|
|
2217
2215
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2218
|
-
- `sec` **[number][
|
|
2216
|
+
- `sec` **[number][22]** (optional) time in seconds to wait, 1 by default.
|
|
2219
2217
|
|
|
2220
|
-
Returns **
|
|
2218
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2221
2219
|
|
|
2222
2220
|
### waitForFunction
|
|
2223
2221
|
|
|
@@ -2236,11 +2234,11 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
2236
2234
|
|
|
2237
2235
|
#### Parameters
|
|
2238
2236
|
|
|
2239
|
-
- `fn` **([string][17] | [function][
|
|
2240
|
-
- `argsOrSec` **([Array][28]<any> | [number][
|
|
2241
|
-
- `sec` **[number][
|
|
2237
|
+
- `fn` **([string][17] | [function][24])** to be executed in browser context.
|
|
2238
|
+
- `argsOrSec` **([Array][28]<any> | [number][22])?** (optional, `1` by default) arguments for function or seconds.
|
|
2239
|
+
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
2242
2240
|
|
|
2243
|
-
Returns **
|
|
2241
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2244
2242
|
|
|
2245
2243
|
### waitForInvisible
|
|
2246
2244
|
|
|
@@ -2254,9 +2252,9 @@ I.waitForInvisible('#popup');
|
|
|
2254
2252
|
#### Parameters
|
|
2255
2253
|
|
|
2256
2254
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2257
|
-
- `sec` **[number][
|
|
2255
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2258
2256
|
|
|
2259
|
-
Returns **
|
|
2257
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2260
2258
|
|
|
2261
2259
|
### waitForText
|
|
2262
2260
|
|
|
@@ -2272,10 +2270,10 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2272
2270
|
#### Parameters
|
|
2273
2271
|
|
|
2274
2272
|
- `text` **[string][17]** to wait for.
|
|
2275
|
-
- `sec` **[number][
|
|
2273
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2276
2274
|
- `context` **([string][17] | [object][16])?** (optional) element located by CSS|XPath|strict locator.
|
|
2277
2275
|
|
|
2278
|
-
Returns **
|
|
2276
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2279
2277
|
|
|
2280
2278
|
### waitForValue
|
|
2281
2279
|
|
|
@@ -2289,9 +2287,9 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2289
2287
|
|
|
2290
2288
|
- `field` **([string][17] | [object][16])** input field.
|
|
2291
2289
|
- `value` **[string][17]** expected value.
|
|
2292
|
-
- `sec` **[number][
|
|
2290
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2293
2291
|
|
|
2294
|
-
Returns **
|
|
2292
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2295
2293
|
|
|
2296
2294
|
### waitForVisible
|
|
2297
2295
|
|
|
@@ -2305,9 +2303,9 @@ I.waitForVisible('#popup');
|
|
|
2305
2303
|
#### Parameters
|
|
2306
2304
|
|
|
2307
2305
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2308
|
-
- `sec` **[number][
|
|
2306
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2309
2307
|
|
|
2310
|
-
Returns **
|
|
2308
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2311
2309
|
|
|
2312
2310
|
### waitInUrl
|
|
2313
2311
|
|
|
@@ -2320,9 +2318,9 @@ I.waitInUrl('/info', 2);
|
|
|
2320
2318
|
#### Parameters
|
|
2321
2319
|
|
|
2322
2320
|
- `urlPart` **[string][17]** value to check.
|
|
2323
|
-
- `sec` **[number][
|
|
2321
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2324
2322
|
|
|
2325
|
-
Returns **
|
|
2323
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2326
2324
|
|
|
2327
2325
|
### waitNumberOfVisibleElements
|
|
2328
2326
|
|
|
@@ -2335,10 +2333,10 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2335
2333
|
#### Parameters
|
|
2336
2334
|
|
|
2337
2335
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2338
|
-
- `num` **[number][
|
|
2339
|
-
- `sec` **[number][
|
|
2336
|
+
- `num` **[number][22]** number of elements.
|
|
2337
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2340
2338
|
|
|
2341
|
-
Returns **
|
|
2339
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2342
2340
|
|
|
2343
2341
|
### waitToHide
|
|
2344
2342
|
|
|
@@ -2352,9 +2350,9 @@ I.waitToHide('#popup');
|
|
|
2352
2350
|
#### Parameters
|
|
2353
2351
|
|
|
2354
2352
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2355
|
-
- `sec` **[number][
|
|
2353
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2356
2354
|
|
|
2357
|
-
Returns **
|
|
2355
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2358
2356
|
|
|
2359
2357
|
### waitUrlEquals
|
|
2360
2358
|
|
|
@@ -2368,9 +2366,9 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2368
2366
|
#### Parameters
|
|
2369
2367
|
|
|
2370
2368
|
- `urlPart` **[string][17]** value to check.
|
|
2371
|
-
- `sec` **[number][
|
|
2369
|
+
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
2372
2370
|
|
|
2373
|
-
Returns **
|
|
2371
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2374
2372
|
|
|
2375
2373
|
[1]: http://webdriver.io/
|
|
2376
2374
|
|
|
@@ -2408,19 +2406,19 @@ Returns **[Promise][19]<void>** automatically synchronized promise through #r
|
|
|
2408
2406
|
|
|
2409
2407
|
[18]: http://jster.net/category/windows-modals-popups
|
|
2410
2408
|
|
|
2411
|
-
[19]: https://developer.mozilla.org/docs/Web/
|
|
2409
|
+
[19]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
|
|
2412
2410
|
|
|
2413
|
-
[20]: https://
|
|
2411
|
+
[20]: https://playwright.dev/docs/api/class-locator#locator-blur
|
|
2414
2412
|
|
|
2415
|
-
[21]: https://
|
|
2413
|
+
[21]: https://webdriver.io/docs/timeouts.html
|
|
2416
2414
|
|
|
2417
|
-
[22]: https://
|
|
2415
|
+
[22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
2418
2416
|
|
|
2419
|
-
[23]: https://
|
|
2417
|
+
[23]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
2420
2418
|
|
|
2421
|
-
[24]: https://
|
|
2419
|
+
[24]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2422
2420
|
|
|
2423
|
-
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
2421
|
+
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2424
2422
|
|
|
2425
2423
|
[26]: http://webdriver.io/api/protocol/execute.html
|
|
2426
2424
|
|