codeceptjs 3.5.6 → 3.5.7-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/CHANGELOG.md +2950 -0
- package/docs/bdd.md +11 -7
- package/docs/build/ApiDataFactory.js +2 -1
- package/docs/build/Appium.js +25 -23
- package/docs/build/Expect.js +422 -0
- package/docs/build/Nightmare.js +53 -56
- package/docs/build/Playwright.js +166 -103
- package/docs/build/Protractor.js +66 -69
- package/docs/build/Puppeteer.js +79 -79
- package/docs/build/TestCafe.js +56 -55
- package/docs/build/WebDriver.js +81 -82
- package/docs/changelog.md +388 -1
- package/docs/commands.md +12 -0
- package/docs/community-helpers.md +8 -4
- package/docs/examples.md +8 -2
- package/docs/helpers/Appium.md +50 -32
- package/docs/helpers/Expect.md +275 -0
- package/docs/helpers/Nightmare.md +141 -94
- package/docs/helpers/Playwright.md +280 -211
- package/docs/helpers/Protractor.md +229 -169
- package/docs/helpers/Puppeteer.md +256 -185
- package/docs/helpers/TestCafe.md +201 -149
- package/docs/helpers/WebDriver.md +252 -178
- package/docs/mobile.md +17 -21
- package/docs/plugins.md +35 -1
- 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 -0
- package/docs/webapi/checkOption.mustache +1 -1
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +1 -1
- package/docs/webapi/clickLink.mustache +1 -1
- package/docs/webapi/closeCurrentTab.mustache +1 -1
- package/docs/webapi/closeOtherTabs.mustache +1 -1
- package/docs/webapi/dontSee.mustache +1 -1
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeCookie.mustache +1 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -1
- package/docs/webapi/dontSeeInTitle.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +1 -1
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragAndDrop.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/executeAsyncScript.mustache +0 -2
- package/docs/webapi/executeScript.mustache +0 -2
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/focus.mustache +1 -0
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.mustache +1 -1
- package/docs/webapi/grabCookie.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/ai.js +12 -3
- package/lib/cli.js +3 -1
- package/lib/command/dryRun.js +2 -1
- package/lib/helper/ApiDataFactory.js +2 -1
- package/lib/helper/Appium.js +7 -5
- package/lib/helper/Expect.js +422 -0
- package/lib/helper/Playwright.js +91 -32
- package/lib/helper/Puppeteer.js +2 -2
- package/lib/html.js +3 -3
- package/lib/interfaces/gherkin.js +21 -2
- package/lib/output.js +1 -1
- package/lib/pause.js +6 -3
- package/lib/plugin/autoLogin.js +35 -3
- package/lib/plugin/heal.js +40 -7
- package/lib/recorder.js +12 -5
- package/package.json +15 -8
- package/translations/de-DE.js +5 -0
- package/translations/fr-FR.js +1 -0
- package/translations/it-IT.js +1 -0
- package/translations/ja-JP.js +5 -0
- package/translations/pl-PL.js +5 -0
- package/translations/pt-BR.js +1 -0
- package/translations/ru-RU.js +1 -0
- package/translations/zh-CN.js +5 -0
- package/translations/zh-TW.js +5 -0
- package/typings/promiseBasedTypes.d.ts +904 -862
- package/typings/types.d.ts +904 -845
|
@@ -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][23]?** 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][23])?** **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][23]?** 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 **void
|
|
459
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
460
460
|
|
|
461
461
|
### appendField
|
|
462
462
|
|
|
@@ -473,7 +473,8 @@ I.appendField('password', secret('123456'));
|
|
|
473
473
|
|
|
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 **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
477
478
|
|
|
478
479
|
|
|
479
480
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -494,12 +495,13 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
494
495
|
|
|
495
496
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
496
497
|
- `pathToFile` **[string][17]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
497
|
-
|
|
498
|
+
|
|
499
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorderAppium: not tested
|
|
498
500
|
|
|
499
501
|
### blur
|
|
500
502
|
|
|
501
503
|
Remove focus from a text input, button, etc.
|
|
502
|
-
Calls [blur][
|
|
504
|
+
Calls [blur][20] on the element.
|
|
503
505
|
|
|
504
506
|
Examples:
|
|
505
507
|
|
|
@@ -517,7 +519,9 @@ I.dontSee('#add-to-cart-btn');
|
|
|
517
519
|
#### Parameters
|
|
518
520
|
|
|
519
521
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
520
|
-
- `options` **any?** Playwright only: [Additional options][
|
|
522
|
+
- `options` **any?** Playwright only: [Additional options][21] for available options object as 2nd argument.
|
|
523
|
+
|
|
524
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
521
525
|
|
|
522
526
|
### cancelPopup
|
|
523
527
|
|
|
@@ -539,8 +543,9 @@ I.checkOption('agree', '//form');
|
|
|
539
543
|
#### Parameters
|
|
540
544
|
|
|
541
545
|
- `field` **([string][17] | [object][16])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
542
|
-
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
543
|
-
|
|
546
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
547
|
+
|
|
548
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorderAppium: not tested
|
|
544
549
|
|
|
545
550
|
### clearCookie
|
|
546
551
|
|
|
@@ -554,8 +559,9 @@ I.clearCookie('test');
|
|
|
554
559
|
|
|
555
560
|
#### Parameters
|
|
556
561
|
|
|
557
|
-
- `cookie` **[string][17]?** (optional, `null` by default) cookie name
|
|
558
|
-
|
|
562
|
+
- `cookie` **[string][17]?** (optional, `null` by default) cookie name
|
|
563
|
+
|
|
564
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
559
565
|
|
|
560
566
|
### clearField
|
|
561
567
|
|
|
@@ -571,7 +577,8 @@ I.clearField('#email');
|
|
|
571
577
|
|
|
572
578
|
- `field`
|
|
573
579
|
- `editable` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
574
|
-
|
|
580
|
+
|
|
581
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder.
|
|
575
582
|
|
|
576
583
|
### click
|
|
577
584
|
|
|
@@ -600,12 +607,13 @@ I.click({css: 'nav a.login'});
|
|
|
600
607
|
#### Parameters
|
|
601
608
|
|
|
602
609
|
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
603
|
-
- `context` **([string][17]? | [object][16] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
604
|
-
|
|
610
|
+
- `context` **([string][17]? | [object][16] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
611
|
+
|
|
612
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
605
613
|
|
|
606
614
|
|
|
607
615
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
608
|
-
|
|
616
|
+
|
|
609
617
|
|
|
610
618
|
### closeCurrentTab
|
|
611
619
|
|
|
@@ -615,7 +623,7 @@ Close current tab.
|
|
|
615
623
|
I.closeCurrentTab();
|
|
616
624
|
```
|
|
617
625
|
|
|
618
|
-
|
|
626
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
619
627
|
|
|
620
628
|
### closeOtherTabs
|
|
621
629
|
|
|
@@ -625,11 +633,11 @@ Close all tabs except for the current one.
|
|
|
625
633
|
I.closeOtherTabs();
|
|
626
634
|
```
|
|
627
635
|
|
|
628
|
-
|
|
636
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
629
637
|
|
|
630
638
|
### defineTimeout
|
|
631
639
|
|
|
632
|
-
Set [WebDriver timeouts][
|
|
640
|
+
Set [WebDriver timeouts][22] in realtime.
|
|
633
641
|
|
|
634
642
|
Timeouts are expected to be passed as object:
|
|
635
643
|
|
|
@@ -655,12 +663,13 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
655
663
|
#### Parameters
|
|
656
664
|
|
|
657
665
|
- `text` **[string][17]** which is not present.
|
|
658
|
-
- `context` **([string][17] | [object][16])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
659
|
-
|
|
666
|
+
- `context` **([string][17] | [object][16])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
667
|
+
|
|
668
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
660
669
|
|
|
661
670
|
|
|
662
671
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
663
|
-
|
|
672
|
+
|
|
664
673
|
|
|
665
674
|
### dontSeeCheckboxIsChecked
|
|
666
675
|
|
|
@@ -675,7 +684,8 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
675
684
|
#### Parameters
|
|
676
685
|
|
|
677
686
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
678
|
-
|
|
687
|
+
|
|
688
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorderAppium: not tested
|
|
679
689
|
|
|
680
690
|
### dontSeeCookie
|
|
681
691
|
|
|
@@ -688,7 +698,8 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
688
698
|
#### Parameters
|
|
689
699
|
|
|
690
700
|
- `name` **[string][17]** cookie name.
|
|
691
|
-
|
|
701
|
+
|
|
702
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
692
703
|
|
|
693
704
|
### dontSeeCurrentUrlEquals
|
|
694
705
|
|
|
@@ -703,7 +714,8 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
703
714
|
#### Parameters
|
|
704
715
|
|
|
705
716
|
- `url` **[string][17]** value to check.
|
|
706
|
-
|
|
717
|
+
|
|
718
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
707
719
|
|
|
708
720
|
### dontSeeElement
|
|
709
721
|
|
|
@@ -716,7 +728,8 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
716
728
|
#### Parameters
|
|
717
729
|
|
|
718
730
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|Strict locator.
|
|
719
|
-
|
|
731
|
+
|
|
732
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
720
733
|
|
|
721
734
|
|
|
722
735
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -733,7 +746,8 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
733
746
|
#### Parameters
|
|
734
747
|
|
|
735
748
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|Strict locator.
|
|
736
|
-
|
|
749
|
+
|
|
750
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
737
751
|
|
|
738
752
|
### dontSeeInCurrentUrl
|
|
739
753
|
|
|
@@ -742,7 +756,8 @@ Checks that current url does not contain a provided fragment.
|
|
|
742
756
|
#### Parameters
|
|
743
757
|
|
|
744
758
|
- `url` **[string][17]** value to check.
|
|
745
|
-
|
|
759
|
+
|
|
760
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
746
761
|
|
|
747
762
|
### dontSeeInField
|
|
748
763
|
|
|
@@ -758,7 +773,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
758
773
|
|
|
759
774
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
760
775
|
- `value` **([string][17] | [object][16])** value to check.
|
|
761
|
-
|
|
776
|
+
|
|
777
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
762
778
|
|
|
763
779
|
### dontSeeInSource
|
|
764
780
|
|
|
@@ -772,7 +788,8 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
772
788
|
|
|
773
789
|
- `text`
|
|
774
790
|
- `value` **[string][17]** to check.
|
|
775
|
-
|
|
791
|
+
|
|
792
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
776
793
|
|
|
777
794
|
### dontSeeInTitle
|
|
778
795
|
|
|
@@ -785,7 +802,8 @@ I.dontSeeInTitle('Error');
|
|
|
785
802
|
#### Parameters
|
|
786
803
|
|
|
787
804
|
- `text` **[string][17]** value to check.
|
|
788
|
-
|
|
805
|
+
|
|
806
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
789
807
|
|
|
790
808
|
### doubleClick
|
|
791
809
|
|
|
@@ -802,12 +820,13 @@ I.doubleClick('.btn.edit');
|
|
|
802
820
|
#### Parameters
|
|
803
821
|
|
|
804
822
|
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
805
|
-
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
806
|
-
|
|
823
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
824
|
+
|
|
825
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
807
826
|
|
|
808
827
|
|
|
809
828
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
810
|
-
|
|
829
|
+
|
|
811
830
|
|
|
812
831
|
### dragAndDrop
|
|
813
832
|
|
|
@@ -821,7 +840,8 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
821
840
|
|
|
822
841
|
- `srcElement` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
823
842
|
- `destElement` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
824
|
-
|
|
843
|
+
|
|
844
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorderAppium: not tested
|
|
825
845
|
|
|
826
846
|
### dragSlider
|
|
827
847
|
|
|
@@ -836,15 +856,16 @@ I.dragSlider('#slider', -70);
|
|
|
836
856
|
#### Parameters
|
|
837
857
|
|
|
838
858
|
- `locator` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
839
|
-
- `offsetX` **[number][
|
|
840
|
-
|
|
859
|
+
- `offsetX` **[number][23]** position to drag.
|
|
860
|
+
|
|
861
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
841
862
|
|
|
842
863
|
### executeAsyncScript
|
|
843
864
|
|
|
844
865
|
Executes async script on page.
|
|
845
866
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
846
867
|
|
|
847
|
-
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][
|
|
868
|
+
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][24].
|
|
848
869
|
|
|
849
870
|
```js
|
|
850
871
|
I.executeAsyncScript(function(done) {
|
|
@@ -865,9 +886,9 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
865
886
|
#### Parameters
|
|
866
887
|
|
|
867
888
|
- `args` **...any** to be passed to function.
|
|
868
|
-
- `fn` **([string][17] | [function][
|
|
889
|
+
- `fn` **([string][17] | [function][25])** function to be executed in browser context.
|
|
869
890
|
|
|
870
|
-
Returns **[Promise][
|
|
891
|
+
Returns **[Promise][19]<any>** script return value
|
|
871
892
|
|
|
872
893
|
### executeScript
|
|
873
894
|
|
|
@@ -898,9 +919,9 @@ let date = await I.executeScript(function(el) {
|
|
|
898
919
|
#### Parameters
|
|
899
920
|
|
|
900
921
|
- `args` **...any** to be passed to function.
|
|
901
|
-
- `fn` **([string][17] | [function][
|
|
922
|
+
- `fn` **([string][17] | [function][25])** function to be executed in browser context.
|
|
902
923
|
|
|
903
|
-
Returns **[Promise][
|
|
924
|
+
Returns **[Promise][19]<any>** script return valueWraps [execute][26] command.
|
|
904
925
|
|
|
905
926
|
### fillField
|
|
906
927
|
|
|
@@ -922,16 +943,17 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
922
943
|
|
|
923
944
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
924
945
|
- `value` **([string][17] | [object][16])** text value to fill.
|
|
925
|
-
|
|
946
|
+
|
|
947
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
926
948
|
|
|
927
949
|
|
|
928
950
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
929
951
|
|
|
930
|
-
|
|
952
|
+
{{ custom }}
|
|
931
953
|
|
|
932
954
|
### focus
|
|
933
955
|
|
|
934
|
-
Calls [focus][
|
|
956
|
+
Calls [focus][20] on the matching element.
|
|
935
957
|
|
|
936
958
|
Examples:
|
|
937
959
|
|
|
@@ -946,6 +968,8 @@ I.see('#add-to-cart-bnt');
|
|
|
946
968
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
947
969
|
- `options` **any?** Playwright only: [Additional options][27] for available options object as 2nd argument.
|
|
948
970
|
|
|
971
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
972
|
+
|
|
949
973
|
### forceClick
|
|
950
974
|
|
|
951
975
|
Perform an emulated click on a link or a button, given by a locator.
|
|
@@ -976,12 +1000,13 @@ I.forceClick({css: 'nav a.login'});
|
|
|
976
1000
|
#### Parameters
|
|
977
1001
|
|
|
978
1002
|
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
979
|
-
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
980
|
-
|
|
1003
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1004
|
+
|
|
1005
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
981
1006
|
|
|
982
1007
|
|
|
983
1008
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
984
|
-
|
|
1009
|
+
|
|
985
1010
|
|
|
986
1011
|
### forceRightClick
|
|
987
1012
|
|
|
@@ -1003,12 +1028,13 @@ I.forceRightClick('Menu');
|
|
|
1003
1028
|
#### Parameters
|
|
1004
1029
|
|
|
1005
1030
|
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1006
|
-
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1007
|
-
|
|
1031
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1032
|
+
|
|
1033
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1008
1034
|
|
|
1009
1035
|
|
|
1010
1036
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1011
|
-
|
|
1037
|
+
|
|
1012
1038
|
|
|
1013
1039
|
### grabAllWindowHandles
|
|
1014
1040
|
|
|
@@ -1019,7 +1045,7 @@ Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
|
|
|
1019
1045
|
const windows = await I.grabAllWindowHandles();
|
|
1020
1046
|
```
|
|
1021
1047
|
|
|
1022
|
-
Returns **[Promise][
|
|
1048
|
+
Returns **[Promise][19]<[Array][28]<[string][17]>>**
|
|
1023
1049
|
|
|
1024
1050
|
### grabAttributeFrom
|
|
1025
1051
|
|
|
@@ -1036,7 +1062,7 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
1036
1062
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1037
1063
|
- `attr` **[string][17]** attribute name.
|
|
1038
1064
|
|
|
1039
|
-
Returns **[Promise][
|
|
1065
|
+
Returns **[Promise][19]<[string][17]>** attribute value
|
|
1040
1066
|
|
|
1041
1067
|
### grabAttributeFromAll
|
|
1042
1068
|
|
|
@@ -1052,7 +1078,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
1052
1078
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1053
1079
|
- `attr` **[string][17]** attribute name.
|
|
1054
1080
|
|
|
1055
|
-
Returns **[Promise][
|
|
1081
|
+
Returns **[Promise][19]<[Array][28]<[string][17]>>** attribute value
|
|
1056
1082
|
|
|
1057
1083
|
### grabBrowserLogs
|
|
1058
1084
|
|
|
@@ -1064,7 +1090,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
1064
1090
|
console.log(JSON.stringify(logs))
|
|
1065
1091
|
```
|
|
1066
1092
|
|
|
1067
|
-
Returns **([Promise][
|
|
1093
|
+
Returns **([Promise][19]<[Array][28]<[object][16]>> | [undefined][29])** all browser logs
|
|
1068
1094
|
|
|
1069
1095
|
### grabCookie
|
|
1070
1096
|
|
|
@@ -1081,7 +1107,7 @@ assert(cookie.value, '123456');
|
|
|
1081
1107
|
|
|
1082
1108
|
- `name` **[string][17]?** cookie name.
|
|
1083
1109
|
|
|
1084
|
-
Returns **
|
|
1110
|
+
Returns **any** attribute value
|
|
1085
1111
|
|
|
1086
1112
|
### grabCssPropertyFrom
|
|
1087
1113
|
|
|
@@ -1098,7 +1124,7 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
1098
1124
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1099
1125
|
- `cssProperty` **[string][17]** CSS property name.
|
|
1100
1126
|
|
|
1101
|
-
Returns **[Promise][
|
|
1127
|
+
Returns **[Promise][19]<[string][17]>** CSS value
|
|
1102
1128
|
|
|
1103
1129
|
### grabCssPropertyFromAll
|
|
1104
1130
|
|
|
@@ -1114,7 +1140,7 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
1114
1140
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1115
1141
|
- `cssProperty` **[string][17]** CSS property name.
|
|
1116
1142
|
|
|
1117
|
-
Returns **[Promise][
|
|
1143
|
+
Returns **[Promise][19]<[Array][28]<[string][17]>>** CSS value
|
|
1118
1144
|
|
|
1119
1145
|
### grabCurrentUrl
|
|
1120
1146
|
|
|
@@ -1126,7 +1152,7 @@ let url = await I.grabCurrentUrl();
|
|
|
1126
1152
|
console.log(`Current URL is [${url}]`);
|
|
1127
1153
|
```
|
|
1128
1154
|
|
|
1129
|
-
Returns **[Promise][
|
|
1155
|
+
Returns **[Promise][19]<[string][17]>** current URL
|
|
1130
1156
|
|
|
1131
1157
|
### grabCurrentWindowHandle
|
|
1132
1158
|
|
|
@@ -1137,7 +1163,7 @@ Useful for referencing it when calling `I.switchToWindow(handle)`
|
|
|
1137
1163
|
const window = await I.grabCurrentWindowHandle();
|
|
1138
1164
|
```
|
|
1139
1165
|
|
|
1140
|
-
Returns **[Promise][
|
|
1166
|
+
Returns **[Promise][19]<[string][17]>**
|
|
1141
1167
|
|
|
1142
1168
|
### grabElementBoundingRect
|
|
1143
1169
|
|
|
@@ -1165,7 +1191,7 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
1165
1191
|
- `prop`
|
|
1166
1192
|
- `elementSize` **[string][17]?** x, y, width or height of the given element.
|
|
1167
1193
|
|
|
1168
|
-
Returns **([Promise][
|
|
1194
|
+
Returns **([Promise][19]<DOMRect> | [Promise][19]<[number][23]>)** Element bounding rectangle
|
|
1169
1195
|
|
|
1170
1196
|
### grabGeoLocation
|
|
1171
1197
|
|
|
@@ -1176,7 +1202,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1176
1202
|
let geoLocation = await I.grabGeoLocation();
|
|
1177
1203
|
```
|
|
1178
1204
|
|
|
1179
|
-
Returns **[Promise][
|
|
1205
|
+
Returns **[Promise][19]<{latitude: [number][23], longitude: [number][23], altitude: [number][23]}>**
|
|
1180
1206
|
|
|
1181
1207
|
### grabHTMLFrom
|
|
1182
1208
|
|
|
@@ -1193,7 +1219,7 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1193
1219
|
- `locator`
|
|
1194
1220
|
- `element` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1195
1221
|
|
|
1196
|
-
Returns **[Promise][
|
|
1222
|
+
Returns **[Promise][19]<[string][17]>** HTML code for an element
|
|
1197
1223
|
|
|
1198
1224
|
### grabHTMLFromAll
|
|
1199
1225
|
|
|
@@ -1209,7 +1235,7 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1209
1235
|
- `locator`
|
|
1210
1236
|
- `element` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1211
1237
|
|
|
1212
|
-
Returns **[Promise][
|
|
1238
|
+
Returns **[Promise][19]<[Array][28]<[string][17]>>** HTML code for an element
|
|
1213
1239
|
|
|
1214
1240
|
### grabNumberOfOpenTabs
|
|
1215
1241
|
|
|
@@ -1220,7 +1246,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1220
1246
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1221
1247
|
```
|
|
1222
1248
|
|
|
1223
|
-
Returns **[Promise][
|
|
1249
|
+
Returns **[Promise][19]<[number][23]>** number of open tabs
|
|
1224
1250
|
|
|
1225
1251
|
### grabNumberOfVisibleElements
|
|
1226
1252
|
|
|
@@ -1235,7 +1261,7 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1235
1261
|
|
|
1236
1262
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1237
1263
|
|
|
1238
|
-
Returns **[Promise][
|
|
1264
|
+
Returns **[Promise][19]<[number][23]>** number of visible elements
|
|
1239
1265
|
|
|
1240
1266
|
### grabPageScrollPosition
|
|
1241
1267
|
|
|
@@ -1246,7 +1272,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1246
1272
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1247
1273
|
```
|
|
1248
1274
|
|
|
1249
|
-
Returns **[Promise][
|
|
1275
|
+
Returns **[Promise][19]<PageScrollPosition>** scroll position
|
|
1250
1276
|
|
|
1251
1277
|
### grabPopupText
|
|
1252
1278
|
|
|
@@ -1256,7 +1282,7 @@ Grab the text within the popup. If no popup is visible then it will return null.
|
|
|
1256
1282
|
await I.grabPopupText();
|
|
1257
1283
|
```
|
|
1258
1284
|
|
|
1259
|
-
Returns **[Promise][
|
|
1285
|
+
Returns **[Promise][19]<[string][17]>**
|
|
1260
1286
|
|
|
1261
1287
|
### grabSource
|
|
1262
1288
|
|
|
@@ -1267,7 +1293,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1267
1293
|
let pageSource = await I.grabSource();
|
|
1268
1294
|
```
|
|
1269
1295
|
|
|
1270
|
-
Returns **[Promise][
|
|
1296
|
+
Returns **[Promise][19]<[string][17]>** source code
|
|
1271
1297
|
|
|
1272
1298
|
### grabTextFrom
|
|
1273
1299
|
|
|
@@ -1284,7 +1310,7 @@ If multiple elements found returns first element.
|
|
|
1284
1310
|
|
|
1285
1311
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1286
1312
|
|
|
1287
|
-
Returns **[Promise][
|
|
1313
|
+
Returns **[Promise][19]<[string][17]>** attribute value
|
|
1288
1314
|
|
|
1289
1315
|
### grabTextFromAll
|
|
1290
1316
|
|
|
@@ -1299,7 +1325,7 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1299
1325
|
|
|
1300
1326
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1301
1327
|
|
|
1302
|
-
Returns **[Promise][
|
|
1328
|
+
Returns **[Promise][19]<[Array][28]<[string][17]>>** attribute value
|
|
1303
1329
|
|
|
1304
1330
|
### grabTitle
|
|
1305
1331
|
|
|
@@ -1310,7 +1336,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1310
1336
|
let title = await I.grabTitle();
|
|
1311
1337
|
```
|
|
1312
1338
|
|
|
1313
|
-
Returns **[Promise][
|
|
1339
|
+
Returns **[Promise][19]<[string][17]>** title
|
|
1314
1340
|
|
|
1315
1341
|
### grabValueFrom
|
|
1316
1342
|
|
|
@@ -1326,7 +1352,7 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1326
1352
|
|
|
1327
1353
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
1328
1354
|
|
|
1329
|
-
Returns **[Promise][
|
|
1355
|
+
Returns **[Promise][19]<[string][17]>** attribute value
|
|
1330
1356
|
|
|
1331
1357
|
### grabValueFromAll
|
|
1332
1358
|
|
|
@@ -1341,7 +1367,7 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1341
1367
|
|
|
1342
1368
|
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
1343
1369
|
|
|
1344
|
-
Returns **[Promise][
|
|
1370
|
+
Returns **[Promise][19]<[Array][28]<[string][17]>>** attribute value
|
|
1345
1371
|
|
|
1346
1372
|
### moveCursorTo
|
|
1347
1373
|
|
|
@@ -1358,9 +1384,10 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1358
1384
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1359
1385
|
- `xOffset`
|
|
1360
1386
|
- `yOffset`
|
|
1361
|
-
- `offsetX` **[number][
|
|
1362
|
-
- `offsetY` **[number][
|
|
1363
|
-
|
|
1387
|
+
- `offsetX` **[number][23]** (optional, `0` by default) X-axis offset.
|
|
1388
|
+
- `offsetY` **[number][23]** (optional, `0` by default) Y-axis offset.
|
|
1389
|
+
|
|
1390
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1364
1391
|
|
|
1365
1392
|
### openNewTab
|
|
1366
1393
|
|
|
@@ -1370,13 +1397,13 @@ Open new tab and switch to it.
|
|
|
1370
1397
|
I.openNewTab();
|
|
1371
1398
|
```
|
|
1372
1399
|
|
|
1373
|
-
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1374
|
-
|
|
1375
1400
|
#### Parameters
|
|
1376
1401
|
|
|
1377
1402
|
- `url`
|
|
1378
1403
|
- `windowName`
|
|
1379
1404
|
|
|
1405
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1406
|
+
|
|
1380
1407
|
### pressKey
|
|
1381
1408
|
|
|
1382
1409
|
Presses a key in the browser (on a focused element).
|
|
@@ -1441,7 +1468,8 @@ Some of the supported key names are:
|
|
|
1441
1468
|
#### Parameters
|
|
1442
1469
|
|
|
1443
1470
|
- `key` **([string][17] | [Array][28]<[string][17]>)** key or array of keys to press.
|
|
1444
|
-
|
|
1471
|
+
|
|
1472
|
+
Returns **[Promise][19]<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.
|
|
1445
1473
|
|
|
1446
1474
|
### pressKeyDown
|
|
1447
1475
|
|
|
@@ -1458,7 +1486,8 @@ I.pressKeyUp('Control');
|
|
|
1458
1486
|
#### Parameters
|
|
1459
1487
|
|
|
1460
1488
|
- `key` **[string][17]** name of key to press down.
|
|
1461
|
-
|
|
1489
|
+
|
|
1490
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1462
1491
|
|
|
1463
1492
|
### pressKeyUp
|
|
1464
1493
|
|
|
@@ -1475,7 +1504,8 @@ I.pressKeyUp('Control');
|
|
|
1475
1504
|
#### Parameters
|
|
1476
1505
|
|
|
1477
1506
|
- `key` **[string][17]** name of key to release.
|
|
1478
|
-
|
|
1507
|
+
|
|
1508
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1479
1509
|
|
|
1480
1510
|
### refreshPage
|
|
1481
1511
|
|
|
@@ -1485,7 +1515,7 @@ Reload the current page.
|
|
|
1485
1515
|
I.refreshPage();
|
|
1486
1516
|
```
|
|
1487
1517
|
|
|
1488
|
-
|
|
1518
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1489
1519
|
|
|
1490
1520
|
### resizeWindow
|
|
1491
1521
|
|
|
@@ -1494,9 +1524,10 @@ First parameter can be set to `maximize`.
|
|
|
1494
1524
|
|
|
1495
1525
|
#### Parameters
|
|
1496
1526
|
|
|
1497
|
-
- `width` **[number][
|
|
1498
|
-
- `height` **[number][
|
|
1499
|
-
|
|
1527
|
+
- `width` **[number][23]** width in pixels or `maximize`.
|
|
1528
|
+
- `height` **[number][23]** height in pixels.
|
|
1529
|
+
|
|
1530
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorderAppium: not tested in web, in apps doesn't work
|
|
1500
1531
|
|
|
1501
1532
|
### rightClick
|
|
1502
1533
|
|
|
@@ -1514,12 +1545,13 @@ I.rightClick('Click me', '.context');
|
|
|
1514
1545
|
#### Parameters
|
|
1515
1546
|
|
|
1516
1547
|
- `locator` **([string][17] | [object][16])** clickable element located by CSS|XPath|strict locator.
|
|
1517
|
-
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1518
|
-
|
|
1548
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1549
|
+
|
|
1550
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1519
1551
|
|
|
1520
1552
|
|
|
1521
1553
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1522
|
-
|
|
1554
|
+
|
|
1523
1555
|
|
|
1524
1556
|
### runInWeb
|
|
1525
1557
|
|
|
@@ -1560,7 +1592,8 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1560
1592
|
|
|
1561
1593
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1562
1594
|
- `fileName` **[string][17]** file name to save.
|
|
1563
|
-
|
|
1595
|
+
|
|
1596
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1564
1597
|
|
|
1565
1598
|
### saveScreenshot
|
|
1566
1599
|
|
|
@@ -1576,8 +1609,9 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1576
1609
|
#### Parameters
|
|
1577
1610
|
|
|
1578
1611
|
- `fileName` **[string][17]** file name to save.
|
|
1579
|
-
- `fullPage` **[boolean][32]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1580
|
-
|
|
1612
|
+
- `fullPage` **[boolean][32]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1613
|
+
|
|
1614
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1581
1615
|
|
|
1582
1616
|
### scrollIntoView
|
|
1583
1617
|
|
|
@@ -1593,7 +1627,8 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1593
1627
|
|
|
1594
1628
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1595
1629
|
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][33].
|
|
1596
|
-
|
|
1630
|
+
|
|
1631
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1597
1632
|
|
|
1598
1633
|
### scrollPageToBottom
|
|
1599
1634
|
|
|
@@ -1603,7 +1638,7 @@ Scroll page to the bottom.
|
|
|
1603
1638
|
I.scrollPageToBottom();
|
|
1604
1639
|
```
|
|
1605
1640
|
|
|
1606
|
-
|
|
1641
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1607
1642
|
|
|
1608
1643
|
### scrollPageToTop
|
|
1609
1644
|
|
|
@@ -1613,7 +1648,7 @@ Scroll page to the top.
|
|
|
1613
1648
|
I.scrollPageToTop();
|
|
1614
1649
|
```
|
|
1615
1650
|
|
|
1616
|
-
|
|
1651
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1617
1652
|
|
|
1618
1653
|
### scrollTo
|
|
1619
1654
|
|
|
@@ -1628,9 +1663,10 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1628
1663
|
#### Parameters
|
|
1629
1664
|
|
|
1630
1665
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1631
|
-
- `offsetX` **[number][
|
|
1632
|
-
- `offsetY` **[number][
|
|
1633
|
-
|
|
1666
|
+
- `offsetX` **[number][23]** (optional, `0` by default) X-axis offset.
|
|
1667
|
+
- `offsetY` **[number][23]** (optional, `0` by default) Y-axis offset.
|
|
1668
|
+
|
|
1669
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1634
1670
|
|
|
1635
1671
|
### see
|
|
1636
1672
|
|
|
@@ -1646,12 +1682,13 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1646
1682
|
#### Parameters
|
|
1647
1683
|
|
|
1648
1684
|
- `text` **[string][17]** expected on page.
|
|
1649
|
-
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1650
|
-
|
|
1685
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1686
|
+
|
|
1687
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1651
1688
|
|
|
1652
1689
|
|
|
1653
1690
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1654
|
-
|
|
1691
|
+
|
|
1655
1692
|
|
|
1656
1693
|
### seeAttributesOnElements
|
|
1657
1694
|
|
|
@@ -1665,7 +1702,8 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1665
1702
|
|
|
1666
1703
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1667
1704
|
- `attributes` **[object][16]** attributes and their values to check.
|
|
1668
|
-
|
|
1705
|
+
|
|
1706
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1669
1707
|
|
|
1670
1708
|
### seeCheckboxIsChecked
|
|
1671
1709
|
|
|
@@ -1680,7 +1718,8 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1680
1718
|
#### Parameters
|
|
1681
1719
|
|
|
1682
1720
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
1683
|
-
|
|
1721
|
+
|
|
1722
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorderAppium: not tested
|
|
1684
1723
|
|
|
1685
1724
|
### seeCookie
|
|
1686
1725
|
|
|
@@ -1693,7 +1732,8 @@ I.seeCookie('Auth');
|
|
|
1693
1732
|
#### Parameters
|
|
1694
1733
|
|
|
1695
1734
|
- `name` **[string][17]** cookie name.
|
|
1696
|
-
|
|
1735
|
+
|
|
1736
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1697
1737
|
|
|
1698
1738
|
### seeCssPropertiesOnElements
|
|
1699
1739
|
|
|
@@ -1707,7 +1747,8 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1707
1747
|
|
|
1708
1748
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1709
1749
|
- `cssProperties` **[object][16]** object with CSS properties and their values to check.
|
|
1710
|
-
|
|
1750
|
+
|
|
1751
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1711
1752
|
|
|
1712
1753
|
### seeCurrentUrlEquals
|
|
1713
1754
|
|
|
@@ -1723,7 +1764,8 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1723
1764
|
#### Parameters
|
|
1724
1765
|
|
|
1725
1766
|
- `url` **[string][17]** value to check.
|
|
1726
|
-
|
|
1767
|
+
|
|
1768
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1727
1769
|
|
|
1728
1770
|
### seeElement
|
|
1729
1771
|
|
|
@@ -1737,7 +1779,8 @@ I.seeElement('#modal');
|
|
|
1737
1779
|
#### Parameters
|
|
1738
1780
|
|
|
1739
1781
|
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1740
|
-
|
|
1782
|
+
|
|
1783
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1741
1784
|
|
|
1742
1785
|
|
|
1743
1786
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1755,7 +1798,8 @@ I.seeElementInDOM('#modal');
|
|
|
1755
1798
|
#### Parameters
|
|
1756
1799
|
|
|
1757
1800
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1758
|
-
|
|
1801
|
+
|
|
1802
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1759
1803
|
|
|
1760
1804
|
### seeInCurrentUrl
|
|
1761
1805
|
|
|
@@ -1768,7 +1812,8 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1768
1812
|
#### Parameters
|
|
1769
1813
|
|
|
1770
1814
|
- `url` **[string][17]** a fragment to check
|
|
1771
|
-
|
|
1815
|
+
|
|
1816
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1772
1817
|
|
|
1773
1818
|
### seeInField
|
|
1774
1819
|
|
|
@@ -1786,7 +1831,8 @@ I.seeInField('#searchform input','Search');
|
|
|
1786
1831
|
|
|
1787
1832
|
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
1788
1833
|
- `value` **([string][17] | [object][16])** value to check.
|
|
1789
|
-
|
|
1834
|
+
|
|
1835
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1790
1836
|
|
|
1791
1837
|
### seeInPopup
|
|
1792
1838
|
|
|
@@ -1808,7 +1854,8 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1808
1854
|
#### Parameters
|
|
1809
1855
|
|
|
1810
1856
|
- `text` **[string][17]** value to check.
|
|
1811
|
-
|
|
1857
|
+
|
|
1858
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1812
1859
|
|
|
1813
1860
|
### seeInTitle
|
|
1814
1861
|
|
|
@@ -1821,7 +1868,8 @@ I.seeInTitle('Home Page');
|
|
|
1821
1868
|
#### Parameters
|
|
1822
1869
|
|
|
1823
1870
|
- `text` **[string][17]** text value to check.
|
|
1824
|
-
|
|
1871
|
+
|
|
1872
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1825
1873
|
|
|
1826
1874
|
### seeNumberOfElements
|
|
1827
1875
|
|
|
@@ -1835,8 +1883,9 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1835
1883
|
#### Parameters
|
|
1836
1884
|
|
|
1837
1885
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1838
|
-
- `num` **[number][
|
|
1839
|
-
|
|
1886
|
+
- `num` **[number][23]** number of elements.
|
|
1887
|
+
|
|
1888
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1840
1889
|
|
|
1841
1890
|
|
|
1842
1891
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1854,8 +1903,9 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1854
1903
|
#### Parameters
|
|
1855
1904
|
|
|
1856
1905
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1857
|
-
- `num` **[number][
|
|
1858
|
-
|
|
1906
|
+
- `num` **[number][23]** number of elements.
|
|
1907
|
+
|
|
1908
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1859
1909
|
|
|
1860
1910
|
|
|
1861
1911
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1872,8 +1922,9 @@ I.seeTextEquals('text', 'h1');
|
|
|
1872
1922
|
#### Parameters
|
|
1873
1923
|
|
|
1874
1924
|
- `text` **[string][17]** element value to check.
|
|
1875
|
-
- `context` **([string][17] | [object][16])?** element located by CSS|XPath|strict locator.
|
|
1876
|
-
|
|
1925
|
+
- `context` **([string][17] | [object][16])?** element located by CSS|XPath|strict locator.
|
|
1926
|
+
|
|
1927
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1877
1928
|
|
|
1878
1929
|
### seeTitleEquals
|
|
1879
1930
|
|
|
@@ -1886,7 +1937,8 @@ I.seeTitleEquals('Test title.');
|
|
|
1886
1937
|
#### Parameters
|
|
1887
1938
|
|
|
1888
1939
|
- `text` **[string][17]** value to check.
|
|
1889
|
-
|
|
1940
|
+
|
|
1941
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1890
1942
|
|
|
1891
1943
|
### selectOption
|
|
1892
1944
|
|
|
@@ -1913,7 +1965,8 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1913
1965
|
|
|
1914
1966
|
- `select` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
1915
1967
|
- `option` **([string][17] | [Array][28]<any>)** visible text or value of option.
|
|
1916
|
-
|
|
1968
|
+
|
|
1969
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1917
1970
|
|
|
1918
1971
|
### setCookie
|
|
1919
1972
|
|
|
@@ -1934,8 +1987,9 @@ I.setCookie([
|
|
|
1934
1987
|
#### Parameters
|
|
1935
1988
|
|
|
1936
1989
|
- `cookie` **(Cookie | [Array][28]<Cookie>)** a cookie object or array of cookie objects.
|
|
1937
|
-
|
|
1938
|
-
|
|
1990
|
+
|
|
1991
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorderUses Selenium's JSON [cookie
|
|
1992
|
+
format][34].
|
|
1939
1993
|
|
|
1940
1994
|
### setGeoLocation
|
|
1941
1995
|
|
|
@@ -1948,10 +2002,11 @@ I.setGeoLocation(121.21, 11.56, 10);
|
|
|
1948
2002
|
|
|
1949
2003
|
#### Parameters
|
|
1950
2004
|
|
|
1951
|
-
- `latitude` **[number][
|
|
1952
|
-
- `longitude` **[number][
|
|
1953
|
-
- `altitude` **[number][
|
|
1954
|
-
|
|
2005
|
+
- `latitude` **[number][23]** to set.
|
|
2006
|
+
- `longitude` **[number][23]** to set
|
|
2007
|
+
- `altitude` **[number][23]?** (optional, null by default) to set
|
|
2008
|
+
|
|
2009
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1955
2010
|
|
|
1956
2011
|
### switchTo
|
|
1957
2012
|
|
|
@@ -1964,8 +2019,9 @@ I.switchTo(); // switch back to main page
|
|
|
1964
2019
|
|
|
1965
2020
|
#### Parameters
|
|
1966
2021
|
|
|
1967
|
-
- `locator` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1968
|
-
|
|
2022
|
+
- `locator` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
2023
|
+
|
|
2024
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1969
2025
|
|
|
1970
2026
|
### switchToNextTab
|
|
1971
2027
|
|
|
@@ -1978,9 +2034,10 @@ I.switchToNextTab(2);
|
|
|
1978
2034
|
|
|
1979
2035
|
#### Parameters
|
|
1980
2036
|
|
|
1981
|
-
- `num` **[number][
|
|
1982
|
-
- `sec` **([number][
|
|
1983
|
-
|
|
2037
|
+
- `num` **[number][23]?** (optional) number of tabs to switch forward, default: 1.
|
|
2038
|
+
- `sec` **([number][23] | null)?** (optional) time in seconds to wait.
|
|
2039
|
+
|
|
2040
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1984
2041
|
|
|
1985
2042
|
### switchToPreviousTab
|
|
1986
2043
|
|
|
@@ -1993,9 +2050,10 @@ I.switchToPreviousTab(2);
|
|
|
1993
2050
|
|
|
1994
2051
|
#### Parameters
|
|
1995
2052
|
|
|
1996
|
-
- `num` **[number][
|
|
1997
|
-
- `sec` **[number][
|
|
1998
|
-
|
|
2053
|
+
- `num` **[number][23]?** (optional) number of tabs to switch backward, default: 1.
|
|
2054
|
+
- `sec` **[number][23]??** (optional) time in seconds to wait.
|
|
2055
|
+
|
|
2056
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
1999
2057
|
|
|
2000
2058
|
### switchToWindow
|
|
2001
2059
|
|
|
@@ -2038,10 +2096,11 @@ I.type(secret('123456'));
|
|
|
2038
2096
|
#### Parameters
|
|
2039
2097
|
|
|
2040
2098
|
- `keys`
|
|
2041
|
-
- `delay` **[number][
|
|
2042
|
-
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2099
|
+
- `delay` **[number][23]?** (optional) delay in ms between key presses
|
|
2043
2100
|
- `key` **([string][17] | [Array][28]<[string][17]>)** or array of keys to type.
|
|
2044
2101
|
|
|
2102
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2103
|
+
|
|
2045
2104
|
### uncheckOption
|
|
2046
2105
|
|
|
2047
2106
|
Unselects a checkbox or radio button.
|
|
@@ -2058,8 +2117,9 @@ I.uncheckOption('agree', '//form');
|
|
|
2058
2117
|
#### Parameters
|
|
2059
2118
|
|
|
2060
2119
|
- `field` **([string][17] | [object][16])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
2061
|
-
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2062
|
-
|
|
2120
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2121
|
+
|
|
2122
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorderAppium: not tested
|
|
2063
2123
|
|
|
2064
2124
|
### useWebDriverTo
|
|
2065
2125
|
|
|
@@ -2080,7 +2140,7 @@ I.useWebDriverTo('open multiple windows', async ({ browser }) {
|
|
|
2080
2140
|
#### Parameters
|
|
2081
2141
|
|
|
2082
2142
|
- `description` **[string][17]** used to show in logs.
|
|
2083
|
-
- `fn` **[function][
|
|
2143
|
+
- `fn` **[function][25]** async functuion that executed with WebDriver helper as argument
|
|
2084
2144
|
|
|
2085
2145
|
### wait
|
|
2086
2146
|
|
|
@@ -2092,8 +2152,9 @@ I.wait(2); // wait 2 secs
|
|
|
2092
2152
|
|
|
2093
2153
|
#### Parameters
|
|
2094
2154
|
|
|
2095
|
-
- `sec` **[number][
|
|
2096
|
-
|
|
2155
|
+
- `sec` **[number][23]** number of second to wait.
|
|
2156
|
+
|
|
2157
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2097
2158
|
|
|
2098
2159
|
### waitForClickable
|
|
2099
2160
|
|
|
@@ -2109,8 +2170,9 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
2109
2170
|
|
|
2110
2171
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2111
2172
|
- `waitTimeout`
|
|
2112
|
-
- `sec` **[number][
|
|
2113
|
-
|
|
2173
|
+
- `sec` **[number][23]?** (optional, `1` by default) time in seconds to wait
|
|
2174
|
+
|
|
2175
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2114
2176
|
|
|
2115
2177
|
### waitForDetached
|
|
2116
2178
|
|
|
@@ -2124,8 +2186,9 @@ I.waitForDetached('#popup');
|
|
|
2124
2186
|
#### Parameters
|
|
2125
2187
|
|
|
2126
2188
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2127
|
-
- `sec` **[number][
|
|
2128
|
-
|
|
2189
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2190
|
+
|
|
2191
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2129
2192
|
|
|
2130
2193
|
### waitForElement
|
|
2131
2194
|
|
|
@@ -2140,8 +2203,9 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
2140
2203
|
#### Parameters
|
|
2141
2204
|
|
|
2142
2205
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2143
|
-
- `sec` **[number][
|
|
2144
|
-
|
|
2206
|
+
- `sec` **[number][23]?** (optional, `1` by default) time in seconds to wait
|
|
2207
|
+
|
|
2208
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2145
2209
|
|
|
2146
2210
|
### waitForEnabled
|
|
2147
2211
|
|
|
@@ -2151,8 +2215,9 @@ Element can be located by CSS or XPath.
|
|
|
2151
2215
|
#### Parameters
|
|
2152
2216
|
|
|
2153
2217
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2154
|
-
- `sec` **[number][
|
|
2155
|
-
|
|
2218
|
+
- `sec` **[number][23]** (optional) time in seconds to wait, 1 by default.
|
|
2219
|
+
|
|
2220
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2156
2221
|
|
|
2157
2222
|
### waitForFunction
|
|
2158
2223
|
|
|
@@ -2171,10 +2236,11 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
2171
2236
|
|
|
2172
2237
|
#### Parameters
|
|
2173
2238
|
|
|
2174
|
-
- `fn` **([string][17] | [function][
|
|
2175
|
-
- `argsOrSec` **([Array][28]<any> | [number][
|
|
2176
|
-
- `sec` **[number][
|
|
2177
|
-
|
|
2239
|
+
- `fn` **([string][17] | [function][25])** to be executed in browser context.
|
|
2240
|
+
- `argsOrSec` **([Array][28]<any> | [number][23])?** (optional, `1` by default) arguments for function or seconds.
|
|
2241
|
+
- `sec` **[number][23]?** (optional, `1` by default) time in seconds to wait
|
|
2242
|
+
|
|
2243
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2178
2244
|
|
|
2179
2245
|
### waitForInvisible
|
|
2180
2246
|
|
|
@@ -2188,8 +2254,9 @@ I.waitForInvisible('#popup');
|
|
|
2188
2254
|
#### Parameters
|
|
2189
2255
|
|
|
2190
2256
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2191
|
-
- `sec` **[number][
|
|
2192
|
-
|
|
2257
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2258
|
+
|
|
2259
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2193
2260
|
|
|
2194
2261
|
### waitForText
|
|
2195
2262
|
|
|
@@ -2205,9 +2272,10 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2205
2272
|
#### Parameters
|
|
2206
2273
|
|
|
2207
2274
|
- `text` **[string][17]** to wait for.
|
|
2208
|
-
- `sec` **[number][
|
|
2209
|
-
- `context` **([string][17] | [object][16])?** (optional) element located by CSS|XPath|strict locator.
|
|
2210
|
-
|
|
2275
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2276
|
+
- `context` **([string][17] | [object][16])?** (optional) element located by CSS|XPath|strict locator.
|
|
2277
|
+
|
|
2278
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2211
2279
|
|
|
2212
2280
|
### waitForValue
|
|
2213
2281
|
|
|
@@ -2221,8 +2289,9 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2221
2289
|
|
|
2222
2290
|
- `field` **([string][17] | [object][16])** input field.
|
|
2223
2291
|
- `value` **[string][17]** expected value.
|
|
2224
|
-
- `sec` **[number][
|
|
2225
|
-
|
|
2292
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2293
|
+
|
|
2294
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2226
2295
|
|
|
2227
2296
|
### waitForVisible
|
|
2228
2297
|
|
|
@@ -2236,8 +2305,9 @@ I.waitForVisible('#popup');
|
|
|
2236
2305
|
#### Parameters
|
|
2237
2306
|
|
|
2238
2307
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2239
|
-
- `sec` **[number][
|
|
2240
|
-
|
|
2308
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2309
|
+
|
|
2310
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2241
2311
|
|
|
2242
2312
|
### waitInUrl
|
|
2243
2313
|
|
|
@@ -2250,8 +2320,9 @@ I.waitInUrl('/info', 2);
|
|
|
2250
2320
|
#### Parameters
|
|
2251
2321
|
|
|
2252
2322
|
- `urlPart` **[string][17]** value to check.
|
|
2253
|
-
- `sec` **[number][
|
|
2254
|
-
|
|
2323
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2324
|
+
|
|
2325
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2255
2326
|
|
|
2256
2327
|
### waitNumberOfVisibleElements
|
|
2257
2328
|
|
|
@@ -2264,9 +2335,10 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2264
2335
|
#### Parameters
|
|
2265
2336
|
|
|
2266
2337
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2267
|
-
- `num` **[number][
|
|
2268
|
-
- `sec` **[number][
|
|
2269
|
-
|
|
2338
|
+
- `num` **[number][23]** number of elements.
|
|
2339
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2340
|
+
|
|
2341
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2270
2342
|
|
|
2271
2343
|
### waitToHide
|
|
2272
2344
|
|
|
@@ -2280,8 +2352,9 @@ I.waitToHide('#popup');
|
|
|
2280
2352
|
#### Parameters
|
|
2281
2353
|
|
|
2282
2354
|
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2283
|
-
- `sec` **[number][
|
|
2284
|
-
|
|
2355
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2356
|
+
|
|
2357
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2285
2358
|
|
|
2286
2359
|
### waitUrlEquals
|
|
2287
2360
|
|
|
@@ -2295,8 +2368,9 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2295
2368
|
#### Parameters
|
|
2296
2369
|
|
|
2297
2370
|
- `urlPart` **[string][17]** value to check.
|
|
2298
|
-
- `sec` **[number][
|
|
2299
|
-
|
|
2371
|
+
- `sec` **[number][23]** (optional, `1` by default) time in seconds to wait
|
|
2372
|
+
|
|
2373
|
+
Returns **[Promise][19]<void>** automatically synchronized promise through #recorder
|
|
2300
2374
|
|
|
2301
2375
|
[1]: http://webdriver.io/
|
|
2302
2376
|
|
|
@@ -2334,19 +2408,19 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2334
2408
|
|
|
2335
2409
|
[18]: http://jster.net/category/windows-modals-popups
|
|
2336
2410
|
|
|
2337
|
-
[19]: https://developer.mozilla.org/
|
|
2411
|
+
[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2338
2412
|
|
|
2339
|
-
[20]: https://
|
|
2413
|
+
[20]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
|
|
2340
2414
|
|
|
2341
|
-
[21]: https://
|
|
2415
|
+
[21]: https://playwright.dev/docs/api/class-locator#locator-blur
|
|
2342
2416
|
|
|
2343
|
-
[22]: https://
|
|
2417
|
+
[22]: https://webdriver.io/docs/timeouts.html
|
|
2344
2418
|
|
|
2345
|
-
[23]: https://
|
|
2419
|
+
[23]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
2346
2420
|
|
|
2347
|
-
[24]: https://
|
|
2421
|
+
[24]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
2348
2422
|
|
|
2349
|
-
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
2423
|
+
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2350
2424
|
|
|
2351
2425
|
[26]: http://webdriver.io/api/protocol/execute.html
|
|
2352
2426
|
|