codeceptjs 3.3.5-beta.6 → 3.3.6
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 +69 -2
- package/bin/codecept.js +40 -3
- package/docs/basics.md +24 -1
- package/docs/build/Appium.js +41 -22
- package/docs/build/FileSystem.js +1 -1
- package/docs/build/Nightmare.js +106 -57
- package/docs/build/Playwright.js +187 -111
- package/docs/build/Protractor.js +132 -70
- package/docs/build/Puppeteer.js +143 -76
- package/docs/build/REST.js +2 -2
- package/docs/build/TestCafe.js +107 -57
- package/docs/build/WebDriver.js +162 -89
- package/docs/changelog.md +107 -2
- package/docs/commands.md +5 -3
- package/docs/community-helpers.md +7 -4
- package/docs/configuration.md +5 -5
- package/docs/examples.md +39 -48
- package/docs/helpers/Appium.md +25 -23
- package/docs/helpers/FileSystem.md +1 -1
- package/docs/helpers/Nightmare.md +57 -57
- package/docs/helpers/Playwright.md +76 -75
- package/docs/helpers/Puppeteer.md +76 -85
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/TestCafe.md +57 -57
- package/docs/helpers/WebDriver.md +84 -97
- package/docs/quickstart.md +1 -1
- package/docs/reports.md +1 -1
- package/docs/secrets.md +1 -1
- package/docs/typescript.md +9 -69
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +3 -3
- package/docs/webapi/checkOption.mustache +1 -1
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +1 -1
- package/docs/webapi/clickLink.mustache +1 -1
- package/docs/webapi/closeCurrentTab.mustache +1 -1
- package/docs/webapi/closeOtherTabs.mustache +1 -1
- package/docs/webapi/dontSee.mustache +1 -1
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeCookie.mustache +1 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -1
- package/docs/webapi/dontSeeInTitle.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +1 -1
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragAndDrop.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.mustache +1 -1
- package/docs/webapi/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 +2 -2
- package/docs/webapi/saveScreenshot.mustache +2 -2
- 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/command/configMigrate.js +1 -1
- package/lib/command/dryRun.js +2 -1
- package/lib/command/generate.js +35 -18
- package/lib/command/run-rerun.js +38 -0
- package/lib/command/utils.js +13 -3
- package/lib/config.js +2 -2
- package/lib/data/context.js +7 -0
- package/lib/helper/Appium.js +6 -4
- package/lib/helper/FileSystem.js +1 -1
- package/lib/helper/Nightmare.js +1 -1
- package/lib/helper/Playwright.js +48 -38
- package/lib/helper/Protractor.js +1 -1
- package/lib/helper/REST.js +2 -2
- package/lib/helper/TestCafe.js +1 -1
- package/lib/helper/WebDriver.js +7 -7
- package/lib/plugin/wdio.js +11 -2
- package/lib/utils.js +3 -0
- package/package.json +2 -2
- package/typings/index.d.ts +46 -46
- package/typings/types.d.ts +497 -443
- package/docs/wiki/.git/FETCH_HEAD +0 -1
- package/docs/wiki/.git/HEAD +0 -1
- package/docs/wiki/.git/ORIG_HEAD +0 -1
- package/docs/wiki/.git/config +0 -11
- package/docs/wiki/.git/description +0 -1
- package/docs/wiki/.git/hooks/applypatch-msg.sample +0 -15
- package/docs/wiki/.git/hooks/commit-msg.sample +0 -24
- package/docs/wiki/.git/hooks/fsmonitor-watchman.sample +0 -173
- package/docs/wiki/.git/hooks/post-update.sample +0 -8
- package/docs/wiki/.git/hooks/pre-applypatch.sample +0 -14
- package/docs/wiki/.git/hooks/pre-commit.sample +0 -49
- package/docs/wiki/.git/hooks/pre-merge-commit.sample +0 -13
- package/docs/wiki/.git/hooks/pre-push.sample +0 -53
- package/docs/wiki/.git/hooks/pre-rebase.sample +0 -169
- package/docs/wiki/.git/hooks/pre-receive.sample +0 -24
- package/docs/wiki/.git/hooks/prepare-commit-msg.sample +0 -42
- package/docs/wiki/.git/hooks/push-to-checkout.sample +0 -78
- package/docs/wiki/.git/hooks/update.sample +0 -128
- package/docs/wiki/.git/index +0 -0
- package/docs/wiki/.git/info/exclude +0 -6
- package/docs/wiki/.git/logs/HEAD +0 -1
- package/docs/wiki/.git/logs/refs/heads/master +0 -1
- package/docs/wiki/.git/logs/refs/remotes/origin/HEAD +0 -1
- package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.idx +0 -0
- package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.pack +0 -0
- package/docs/wiki/.git/packed-refs +0 -2
- package/docs/wiki/.git/refs/heads/master +0 -1
- package/docs/wiki/.git/refs/remotes/origin/HEAD +0 -1
package/docs/build/Protractor.js
CHANGED
|
@@ -36,7 +36,7 @@ let Runner;
|
|
|
36
36
|
*
|
|
37
37
|
* ### Configuration
|
|
38
38
|
*
|
|
39
|
-
* This helper should be configured in codecept.
|
|
39
|
+
* This helper should be configured in codecept.conf.ts or codecept.conf.js
|
|
40
40
|
*
|
|
41
41
|
* * `url` - base url of website to be tested
|
|
42
42
|
* * `browser` - browser in which perform testing
|
|
@@ -492,7 +492,7 @@ class Protractor extends Helper {
|
|
|
492
492
|
*
|
|
493
493
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
494
494
|
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
495
|
-
*
|
|
495
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
496
496
|
*
|
|
497
497
|
*/
|
|
498
498
|
async click(locator, context = null) {
|
|
@@ -519,7 +519,8 @@ class Protractor extends Helper {
|
|
|
519
519
|
*
|
|
520
520
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
521
521
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
522
|
-
*
|
|
522
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
523
|
+
*
|
|
523
524
|
*/
|
|
524
525
|
async doubleClick(locator, context = null) {
|
|
525
526
|
let matcher = this.browser;
|
|
@@ -546,7 +547,8 @@ class Protractor extends Helper {
|
|
|
546
547
|
*
|
|
547
548
|
* @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
|
|
548
549
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
549
|
-
*
|
|
550
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
551
|
+
*
|
|
550
552
|
*/
|
|
551
553
|
async rightClick(locator, context = null) {
|
|
552
554
|
/**
|
|
@@ -579,7 +581,8 @@ class Protractor extends Helper {
|
|
|
579
581
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
580
582
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
581
583
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
582
|
-
*
|
|
584
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
585
|
+
*
|
|
583
586
|
*/
|
|
584
587
|
async moveCursorTo(locator, offsetX = null, offsetY = null) {
|
|
585
588
|
let offset = null;
|
|
@@ -602,7 +605,8 @@ class Protractor extends Helper {
|
|
|
602
605
|
* ```
|
|
603
606
|
* @param {string} text expected on page.
|
|
604
607
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
605
|
-
*
|
|
608
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
609
|
+
*
|
|
606
610
|
*/
|
|
607
611
|
async see(text, context = null) {
|
|
608
612
|
return proceedSee.call(this, 'assert', text, context);
|
|
@@ -617,7 +621,8 @@ class Protractor extends Helper {
|
|
|
617
621
|
*
|
|
618
622
|
* @param {string} text element value to check.
|
|
619
623
|
* @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
|
|
620
|
-
*
|
|
624
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
625
|
+
*
|
|
621
626
|
*/
|
|
622
627
|
async seeTextEquals(text, context = null) {
|
|
623
628
|
return proceedSee.call(this, 'assert', text, context, true);
|
|
@@ -634,7 +639,8 @@ class Protractor extends Helper {
|
|
|
634
639
|
*
|
|
635
640
|
* @param {string} text which is not present.
|
|
636
641
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
637
|
-
*
|
|
642
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
643
|
+
*
|
|
638
644
|
*/
|
|
639
645
|
dontSee(text, context = null) {
|
|
640
646
|
return proceedSee.call(this, 'negate', text, context);
|
|
@@ -692,7 +698,8 @@ class Protractor extends Helper {
|
|
|
692
698
|
* ```
|
|
693
699
|
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
694
700
|
* @param {string|Array<*>} option visible text or value of option.
|
|
695
|
-
*
|
|
701
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
702
|
+
*
|
|
696
703
|
*/
|
|
697
704
|
async selectOption(select, option) {
|
|
698
705
|
const fields = await findFields(this.browser, select);
|
|
@@ -730,7 +737,8 @@ class Protractor extends Helper {
|
|
|
730
737
|
* ```
|
|
731
738
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
732
739
|
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
733
|
-
*
|
|
740
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
741
|
+
*
|
|
734
742
|
*/
|
|
735
743
|
async fillField(field, value) {
|
|
736
744
|
const els = await findFields(this.browser, field);
|
|
@@ -750,7 +758,8 @@ class Protractor extends Helper {
|
|
|
750
758
|
* ```
|
|
751
759
|
*
|
|
752
760
|
* @param {string|string[]} key key or array of keys to press.
|
|
753
|
-
*
|
|
761
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
762
|
+
*
|
|
754
763
|
* {{ keys }}
|
|
755
764
|
*/
|
|
756
765
|
async pressKey(key) {
|
|
@@ -774,7 +783,7 @@ class Protractor extends Helper {
|
|
|
774
783
|
|
|
775
784
|
/**
|
|
776
785
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
777
|
-
* Path to file is relative current codecept directory (where codecept.
|
|
786
|
+
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
778
787
|
* File will be uploaded to remote system (if tests are running remotely).
|
|
779
788
|
*
|
|
780
789
|
* ```js
|
|
@@ -783,8 +792,9 @@ class Protractor extends Helper {
|
|
|
783
792
|
* ```
|
|
784
793
|
*
|
|
785
794
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
786
|
-
* @param {string} pathToFile local file path relative to codecept.
|
|
787
|
-
*
|
|
795
|
+
* @param {string} pathToFile local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
796
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
797
|
+
*
|
|
788
798
|
*/
|
|
789
799
|
async attachFile(locator, pathToFile) {
|
|
790
800
|
const file = path.join(global.codecept_dir, pathToFile);
|
|
@@ -812,7 +822,8 @@ class Protractor extends Helper {
|
|
|
812
822
|
* ```
|
|
813
823
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
814
824
|
* @param {string} value value to check.
|
|
815
|
-
*
|
|
825
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
826
|
+
*
|
|
816
827
|
*/
|
|
817
828
|
async seeInField(field, value) {
|
|
818
829
|
return proceedSeeInField.call(this, 'assert', field, value);
|
|
@@ -829,7 +840,8 @@ class Protractor extends Helper {
|
|
|
829
840
|
*
|
|
830
841
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
831
842
|
* @param {string} value value to check.
|
|
832
|
-
*
|
|
843
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
844
|
+
*
|
|
833
845
|
*/
|
|
834
846
|
async dontSeeInField(field, value) {
|
|
835
847
|
return proceedSeeInField.call(this, 'negate', field, value);
|
|
@@ -844,7 +856,8 @@ class Protractor extends Helper {
|
|
|
844
856
|
* ```
|
|
845
857
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
846
858
|
* @param {string} value text value to append.
|
|
847
|
-
*
|
|
859
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
860
|
+
*
|
|
848
861
|
*/
|
|
849
862
|
async appendField(field, value) {
|
|
850
863
|
const els = await findFields(this.browser, field);
|
|
@@ -861,7 +874,8 @@ class Protractor extends Helper {
|
|
|
861
874
|
* I.clearField('#email');
|
|
862
875
|
* ```
|
|
863
876
|
* @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
|
|
864
|
-
*
|
|
877
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder.
|
|
878
|
+
*
|
|
865
879
|
*/
|
|
866
880
|
async clearField(field) {
|
|
867
881
|
const els = await findFields(this.browser, field);
|
|
@@ -882,7 +896,8 @@ class Protractor extends Helper {
|
|
|
882
896
|
* ```
|
|
883
897
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
884
898
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
885
|
-
*
|
|
899
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
900
|
+
*
|
|
886
901
|
*/
|
|
887
902
|
async checkOption(field, context = null) {
|
|
888
903
|
let matcher = this.browser;
|
|
@@ -910,7 +925,8 @@ class Protractor extends Helper {
|
|
|
910
925
|
* ```
|
|
911
926
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
912
927
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
913
|
-
*
|
|
928
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
929
|
+
*
|
|
914
930
|
*/
|
|
915
931
|
async uncheckOption(field, context = null) {
|
|
916
932
|
let matcher = this.browser;
|
|
@@ -935,7 +951,8 @@ class Protractor extends Helper {
|
|
|
935
951
|
* ```
|
|
936
952
|
*
|
|
937
953
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
938
|
-
*
|
|
954
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
955
|
+
*
|
|
939
956
|
*/
|
|
940
957
|
async seeCheckboxIsChecked(field) {
|
|
941
958
|
return proceedIsChecked.call(this, 'assert', field);
|
|
@@ -951,7 +968,8 @@ class Protractor extends Helper {
|
|
|
951
968
|
* ```
|
|
952
969
|
*
|
|
953
970
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
954
|
-
*
|
|
971
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
972
|
+
*
|
|
955
973
|
*/
|
|
956
974
|
async dontSeeCheckboxIsChecked(field) {
|
|
957
975
|
return proceedIsChecked.call(this, 'negate', field);
|
|
@@ -1185,7 +1203,8 @@ class Protractor extends Helper {
|
|
|
1185
1203
|
* ```
|
|
1186
1204
|
*
|
|
1187
1205
|
* @param {string} text text value to check.
|
|
1188
|
-
*
|
|
1206
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1207
|
+
*
|
|
1189
1208
|
*/
|
|
1190
1209
|
async seeInTitle(text) {
|
|
1191
1210
|
return this.browser.getTitle().then(title => stringIncludes('web page title').assert(text, title));
|
|
@@ -1199,7 +1218,8 @@ class Protractor extends Helper {
|
|
|
1199
1218
|
* ```
|
|
1200
1219
|
*
|
|
1201
1220
|
* @param {string} text value to check.
|
|
1202
|
-
*
|
|
1221
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1222
|
+
*
|
|
1203
1223
|
*/
|
|
1204
1224
|
async seeTitleEquals(text) {
|
|
1205
1225
|
const title = await this.browser.getTitle();
|
|
@@ -1214,7 +1234,8 @@ class Protractor extends Helper {
|
|
|
1214
1234
|
* ```
|
|
1215
1235
|
*
|
|
1216
1236
|
* @param {string} text value to check.
|
|
1217
|
-
*
|
|
1237
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1238
|
+
*
|
|
1218
1239
|
*/
|
|
1219
1240
|
async dontSeeInTitle(text) {
|
|
1220
1241
|
return this.browser.getTitle().then(title => stringIncludes('web page title').negate(text, title));
|
|
@@ -1245,7 +1266,8 @@ class Protractor extends Helper {
|
|
|
1245
1266
|
* I.seeElement('#modal');
|
|
1246
1267
|
* ```
|
|
1247
1268
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1248
|
-
*
|
|
1269
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1270
|
+
*
|
|
1249
1271
|
*/
|
|
1250
1272
|
async seeElement(locator) {
|
|
1251
1273
|
let els = await this._locate(locator, true);
|
|
@@ -1261,7 +1283,8 @@ class Protractor extends Helper {
|
|
|
1261
1283
|
* ```
|
|
1262
1284
|
*
|
|
1263
1285
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1264
|
-
*
|
|
1286
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1287
|
+
*
|
|
1265
1288
|
*/
|
|
1266
1289
|
async dontSeeElement(locator) {
|
|
1267
1290
|
let els = await this._locate(locator, false);
|
|
@@ -1277,7 +1300,8 @@ class Protractor extends Helper {
|
|
|
1277
1300
|
* I.seeElementInDOM('#modal');
|
|
1278
1301
|
* ```
|
|
1279
1302
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1280
|
-
*
|
|
1303
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1304
|
+
*
|
|
1281
1305
|
*/
|
|
1282
1306
|
async seeElementInDOM(locator) {
|
|
1283
1307
|
return this.browser.findElements(guessLocator(locator) || global.by.css(locator)).then(els => empty('elements').negate(els.fill('ELEMENT')));
|
|
@@ -1291,7 +1315,8 @@ class Protractor extends Helper {
|
|
|
1291
1315
|
* ```
|
|
1292
1316
|
*
|
|
1293
1317
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1294
|
-
*
|
|
1318
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1319
|
+
*
|
|
1295
1320
|
*/
|
|
1296
1321
|
async dontSeeElementInDOM(locator) {
|
|
1297
1322
|
return this.browser.findElements(guessLocator(locator) || global.by.css(locator)).then(els => empty('elements').assert(els.fill('ELEMENT')));
|
|
@@ -1304,7 +1329,8 @@ class Protractor extends Helper {
|
|
|
1304
1329
|
* I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
1305
1330
|
* ```
|
|
1306
1331
|
* @param {string} text value to check.
|
|
1307
|
-
*
|
|
1332
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1333
|
+
*
|
|
1308
1334
|
*/
|
|
1309
1335
|
async seeInSource(text) {
|
|
1310
1336
|
return this.browser.getPageSource().then(source => stringIncludes('HTML source of a page').assert(text, source));
|
|
@@ -1332,7 +1358,8 @@ class Protractor extends Helper {
|
|
|
1332
1358
|
* ```
|
|
1333
1359
|
*
|
|
1334
1360
|
* @param {string} value to check.
|
|
1335
|
-
*
|
|
1361
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1362
|
+
*
|
|
1336
1363
|
*/
|
|
1337
1364
|
async dontSeeInSource(text) {
|
|
1338
1365
|
return this.browser.getPageSource().then(source => stringIncludes('HTML source of a page').negate(text, source));
|
|
@@ -1349,7 +1376,8 @@ class Protractor extends Helper {
|
|
|
1349
1376
|
*
|
|
1350
1377
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1351
1378
|
* @param {number} num number of elements.
|
|
1352
|
-
*
|
|
1379
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1380
|
+
*
|
|
1353
1381
|
*/
|
|
1354
1382
|
async seeNumberOfElements(locator, num) {
|
|
1355
1383
|
const elements = await this._locate(locator);
|
|
@@ -1366,7 +1394,8 @@ class Protractor extends Helper {
|
|
|
1366
1394
|
*
|
|
1367
1395
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1368
1396
|
* @param {number} num number of elements.
|
|
1369
|
-
*
|
|
1397
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1398
|
+
*
|
|
1370
1399
|
*/
|
|
1371
1400
|
async seeNumberOfVisibleElements(locator, num) {
|
|
1372
1401
|
const res = await this.grabNumberOfVisibleElements(locator);
|
|
@@ -1399,7 +1428,8 @@ class Protractor extends Helper {
|
|
|
1399
1428
|
*
|
|
1400
1429
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1401
1430
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
1402
|
-
*
|
|
1431
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1432
|
+
*
|
|
1403
1433
|
*/
|
|
1404
1434
|
async seeCssPropertiesOnElements(locator, cssProperties) {
|
|
1405
1435
|
const els = await this._locate(locator);
|
|
@@ -1438,7 +1468,8 @@ class Protractor extends Helper {
|
|
|
1438
1468
|
*
|
|
1439
1469
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1440
1470
|
* @param {object} attributes attributes and their values to check.
|
|
1441
|
-
*
|
|
1471
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1472
|
+
*
|
|
1442
1473
|
*/
|
|
1443
1474
|
async seeAttributesOnElements(locator, attributes) {
|
|
1444
1475
|
const els = await this._locate(locator);
|
|
@@ -1490,7 +1521,7 @@ class Protractor extends Helper {
|
|
|
1490
1521
|
*
|
|
1491
1522
|
* @param {string|function} fn function to be executed in browser context.
|
|
1492
1523
|
* @param {...any} args to be passed to function.
|
|
1493
|
-
*
|
|
1524
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1494
1525
|
*
|
|
1495
1526
|
*/
|
|
1496
1527
|
async executeScript() {
|
|
@@ -1521,7 +1552,7 @@ class Protractor extends Helper {
|
|
|
1521
1552
|
*
|
|
1522
1553
|
* @param {string|function} fn function to be executed in browser context.
|
|
1523
1554
|
* @param {...any} args to be passed to function.
|
|
1524
|
-
*
|
|
1555
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1525
1556
|
*
|
|
1526
1557
|
*/
|
|
1527
1558
|
async executeAsyncScript() {
|
|
@@ -1537,7 +1568,8 @@ class Protractor extends Helper {
|
|
|
1537
1568
|
* ```
|
|
1538
1569
|
*
|
|
1539
1570
|
* @param {string} url a fragment to check
|
|
1540
|
-
*
|
|
1571
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1572
|
+
*
|
|
1541
1573
|
*/
|
|
1542
1574
|
async seeInCurrentUrl(url) {
|
|
1543
1575
|
return this.browser.getCurrentUrl().then(currentUrl => stringIncludes('url').assert(url, currentUrl));
|
|
@@ -1547,7 +1579,8 @@ class Protractor extends Helper {
|
|
|
1547
1579
|
* Checks that current url does not contain a provided fragment.
|
|
1548
1580
|
*
|
|
1549
1581
|
* @param {string} url value to check.
|
|
1550
|
-
*
|
|
1582
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1583
|
+
*
|
|
1551
1584
|
*/
|
|
1552
1585
|
async dontSeeInCurrentUrl(url) {
|
|
1553
1586
|
return this.browser.getCurrentUrl().then(currentUrl => stringIncludes('url').negate(url, currentUrl));
|
|
@@ -1564,7 +1597,8 @@ class Protractor extends Helper {
|
|
|
1564
1597
|
* ```
|
|
1565
1598
|
*
|
|
1566
1599
|
* @param {string} url value to check.
|
|
1567
|
-
*
|
|
1600
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1601
|
+
*
|
|
1568
1602
|
*/
|
|
1569
1603
|
async seeCurrentUrlEquals(url) {
|
|
1570
1604
|
return this.browser.getCurrentUrl().then(currentUrl => urlEquals(this.options.url).assert(url, currentUrl));
|
|
@@ -1580,14 +1614,15 @@ class Protractor extends Helper {
|
|
|
1580
1614
|
* ```
|
|
1581
1615
|
*
|
|
1582
1616
|
* @param {string} url value to check.
|
|
1583
|
-
*
|
|
1617
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1618
|
+
*
|
|
1584
1619
|
*/
|
|
1585
1620
|
async dontSeeCurrentUrlEquals(url) {
|
|
1586
1621
|
return this.browser.getCurrentUrl().then(currentUrl => urlEquals(this.options.url).negate(url, currentUrl));
|
|
1587
1622
|
}
|
|
1588
1623
|
|
|
1589
1624
|
/**
|
|
1590
|
-
* Saves screenshot of the specified locator to ouput folder (set in codecept.
|
|
1625
|
+
* Saves screenshot of the specified locator to ouput folder (set in codecept.conf.ts or codecept.conf.js).
|
|
1591
1626
|
* Filename is relative to output folder.
|
|
1592
1627
|
*
|
|
1593
1628
|
* ```js
|
|
@@ -1596,7 +1631,8 @@ class Protractor extends Helper {
|
|
|
1596
1631
|
*
|
|
1597
1632
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1598
1633
|
* @param {string} fileName file name to save.
|
|
1599
|
-
*
|
|
1634
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1635
|
+
*
|
|
1600
1636
|
*
|
|
1601
1637
|
*/
|
|
1602
1638
|
async saveElementScreenshot(locator, fileName) {
|
|
@@ -1620,7 +1656,7 @@ class Protractor extends Helper {
|
|
|
1620
1656
|
}
|
|
1621
1657
|
|
|
1622
1658
|
/**
|
|
1623
|
-
* Saves a screenshot to ouput folder (set in codecept.
|
|
1659
|
+
* Saves a screenshot to ouput folder (set in codecept.conf.ts or codecept.conf.js).
|
|
1624
1660
|
* Filename is relative to output folder.
|
|
1625
1661
|
* Optionally resize the window to the full available page `scrollHeight` and `scrollWidth` to capture the entire page by passing `true` in as the second argument.
|
|
1626
1662
|
*
|
|
@@ -1631,7 +1667,8 @@ class Protractor extends Helper {
|
|
|
1631
1667
|
*
|
|
1632
1668
|
* @param {string} fileName file name to save.
|
|
1633
1669
|
* @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1634
|
-
*
|
|
1670
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1671
|
+
*
|
|
1635
1672
|
*/
|
|
1636
1673
|
async saveScreenshot(fileName, fullPage = false) {
|
|
1637
1674
|
const outputFile = screenshotOutputFolder(fileName);
|
|
@@ -1673,7 +1710,8 @@ class Protractor extends Helper {
|
|
|
1673
1710
|
* ```
|
|
1674
1711
|
*
|
|
1675
1712
|
* @param {?string} [cookie=null] (optional, `null` by default) cookie name
|
|
1676
|
-
*
|
|
1713
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1714
|
+
*
|
|
1677
1715
|
*/
|
|
1678
1716
|
async clearCookie(cookie = null) {
|
|
1679
1717
|
if (!cookie) {
|
|
@@ -1690,7 +1728,8 @@ class Protractor extends Helper {
|
|
|
1690
1728
|
* ```
|
|
1691
1729
|
*
|
|
1692
1730
|
* @param {string} name cookie name.
|
|
1693
|
-
*
|
|
1731
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1732
|
+
*
|
|
1694
1733
|
*/
|
|
1695
1734
|
async seeCookie(name) {
|
|
1696
1735
|
return this.browser.manage().getCookie(name).then(res => truth(`cookie ${name}`, 'to be set').assert(res));
|
|
@@ -1704,7 +1743,8 @@ class Protractor extends Helper {
|
|
|
1704
1743
|
* ```
|
|
1705
1744
|
*
|
|
1706
1745
|
* @param {string} name cookie name.
|
|
1707
|
-
*
|
|
1746
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1747
|
+
*
|
|
1708
1748
|
*/
|
|
1709
1749
|
async dontSeeCookie(name) {
|
|
1710
1750
|
return this.browser.manage().getCookie(name).then(res => truth(`cookie ${name}`, 'to be set').negate(res));
|
|
@@ -1755,7 +1795,8 @@ class Protractor extends Helper {
|
|
|
1755
1795
|
* I.seeInPopup('Popup text');
|
|
1756
1796
|
* ```
|
|
1757
1797
|
* @param {string} text value to check.
|
|
1758
|
-
*
|
|
1798
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1799
|
+
*
|
|
1759
1800
|
*/
|
|
1760
1801
|
async seeInPopup(text) {
|
|
1761
1802
|
const popupAlert = await this.browser.switchTo().alert();
|
|
@@ -1795,7 +1836,8 @@ class Protractor extends Helper {
|
|
|
1795
1836
|
*
|
|
1796
1837
|
* @param {number} width width in pixels or `maximize`.
|
|
1797
1838
|
* @param {number} height height in pixels.
|
|
1798
|
-
*
|
|
1839
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1840
|
+
*
|
|
1799
1841
|
*/
|
|
1800
1842
|
async resizeWindow(width, height) {
|
|
1801
1843
|
if (width === 'maximize') {
|
|
@@ -1814,7 +1856,8 @@ class Protractor extends Helper {
|
|
|
1814
1856
|
*
|
|
1815
1857
|
* @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
|
|
1816
1858
|
* @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
|
|
1817
|
-
*
|
|
1859
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1860
|
+
*
|
|
1818
1861
|
*/
|
|
1819
1862
|
async dragAndDrop(srcElement, destElement) {
|
|
1820
1863
|
const srcEl = await this._locate(srcElement, true);
|
|
@@ -1957,7 +2000,8 @@ class Protractor extends Helper {
|
|
|
1957
2000
|
* ```
|
|
1958
2001
|
*
|
|
1959
2002
|
* @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1960
|
-
*
|
|
2003
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2004
|
+
*
|
|
1961
2005
|
*/
|
|
1962
2006
|
async switchTo(locator) {
|
|
1963
2007
|
if (Number.isInteger(locator)) {
|
|
@@ -1980,7 +2024,8 @@ class Protractor extends Helper {
|
|
|
1980
2024
|
* ```
|
|
1981
2025
|
*
|
|
1982
2026
|
* @param {number} sec number of second to wait.
|
|
1983
|
-
*
|
|
2027
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2028
|
+
*
|
|
1984
2029
|
*/
|
|
1985
2030
|
wait(sec) {
|
|
1986
2031
|
return this.browser.sleep(sec * 1000);
|
|
@@ -1997,7 +2042,8 @@ class Protractor extends Helper {
|
|
|
1997
2042
|
*
|
|
1998
2043
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1999
2044
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2000
|
-
*
|
|
2045
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2046
|
+
*
|
|
2001
2047
|
*/
|
|
2002
2048
|
async waitForElement(locator, sec = null) {
|
|
2003
2049
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2022,7 +2068,8 @@ class Protractor extends Helper {
|
|
|
2022
2068
|
*
|
|
2023
2069
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2024
2070
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2025
|
-
*
|
|
2071
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2072
|
+
*
|
|
2026
2073
|
*/
|
|
2027
2074
|
async waitForDetached(locator, sec = null) {
|
|
2028
2075
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2057,7 +2104,8 @@ class Protractor extends Helper {
|
|
|
2057
2104
|
*
|
|
2058
2105
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2059
2106
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2060
|
-
*
|
|
2107
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2108
|
+
*
|
|
2061
2109
|
*/
|
|
2062
2110
|
async waitForVisible(locator, sec = null) {
|
|
2063
2111
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2075,7 +2123,8 @@ class Protractor extends Helper {
|
|
|
2075
2123
|
*
|
|
2076
2124
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2077
2125
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2078
|
-
*
|
|
2126
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2127
|
+
*
|
|
2079
2128
|
*/
|
|
2080
2129
|
async waitToHide(locator, sec = null) {
|
|
2081
2130
|
return this.waitForInvisible(locator, sec);
|
|
@@ -2091,7 +2140,8 @@ class Protractor extends Helper {
|
|
|
2091
2140
|
*
|
|
2092
2141
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2093
2142
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2094
|
-
*
|
|
2143
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2144
|
+
*
|
|
2095
2145
|
*/
|
|
2096
2146
|
async waitForInvisible(locator, sec = null) {
|
|
2097
2147
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2116,7 +2166,8 @@ class Protractor extends Helper {
|
|
|
2116
2166
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2117
2167
|
* @param {number} num number of elements.
|
|
2118
2168
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2119
|
-
*
|
|
2169
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2170
|
+
*
|
|
2120
2171
|
*/
|
|
2121
2172
|
async waitNumberOfVisibleElements(locator, num, sec = null) {
|
|
2122
2173
|
function visibilityCountOf(loc, expectedCount) {
|
|
@@ -2143,7 +2194,8 @@ class Protractor extends Helper {
|
|
|
2143
2194
|
*
|
|
2144
2195
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2145
2196
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
2146
|
-
*
|
|
2197
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2198
|
+
*
|
|
2147
2199
|
*/
|
|
2148
2200
|
async waitForEnabled(locator, sec = null) {
|
|
2149
2201
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2165,7 +2217,8 @@ class Protractor extends Helper {
|
|
|
2165
2217
|
* @param {LocatorOrString} field input field.
|
|
2166
2218
|
* @param {string }value expected value.
|
|
2167
2219
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2168
|
-
*
|
|
2220
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2221
|
+
*
|
|
2169
2222
|
*/
|
|
2170
2223
|
async waitForValue(field, value, sec = null) {
|
|
2171
2224
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2205,7 +2258,8 @@ class Protractor extends Helper {
|
|
|
2205
2258
|
* @param {string|function} fn to be executed in browser context.
|
|
2206
2259
|
* @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
|
|
2207
2260
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2208
|
-
*
|
|
2261
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2262
|
+
*
|
|
2209
2263
|
*/
|
|
2210
2264
|
async waitForFunction(fn, argsOrSec = null, sec = null) {
|
|
2211
2265
|
let args = [];
|
|
@@ -2230,7 +2284,8 @@ class Protractor extends Helper {
|
|
|
2230
2284
|
*
|
|
2231
2285
|
* @param {string} urlPart value to check.
|
|
2232
2286
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2233
|
-
*
|
|
2287
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2288
|
+
*
|
|
2234
2289
|
*/
|
|
2235
2290
|
async waitInUrl(urlPart, sec = null) {
|
|
2236
2291
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2257,7 +2312,8 @@ class Protractor extends Helper {
|
|
|
2257
2312
|
*
|
|
2258
2313
|
* @param {string} urlPart value to check.
|
|
2259
2314
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2260
|
-
*
|
|
2315
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2316
|
+
*
|
|
2261
2317
|
*/
|
|
2262
2318
|
async waitUrlEquals(urlPart, sec = null) {
|
|
2263
2319
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2291,7 +2347,8 @@ class Protractor extends Helper {
|
|
|
2291
2347
|
* @param {string }text to wait for.
|
|
2292
2348
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2293
2349
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
2294
|
-
*
|
|
2350
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2351
|
+
*
|
|
2295
2352
|
*/
|
|
2296
2353
|
async waitForText(text, sec = null, context = null) {
|
|
2297
2354
|
if (!context) {
|
|
@@ -2317,7 +2374,8 @@ class Protractor extends Helper {
|
|
|
2317
2374
|
* ```js
|
|
2318
2375
|
* I.refreshPage();
|
|
2319
2376
|
* ```
|
|
2320
|
-
*
|
|
2377
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2378
|
+
*
|
|
2321
2379
|
*/
|
|
2322
2380
|
refreshPage() {
|
|
2323
2381
|
return this.browser.refresh();
|
|
@@ -2343,7 +2401,8 @@ class Protractor extends Helper {
|
|
|
2343
2401
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2344
2402
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2345
2403
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2346
|
-
*
|
|
2404
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2405
|
+
*
|
|
2347
2406
|
*/
|
|
2348
2407
|
async scrollTo(locator, offsetX = 0, offsetY = 0) {
|
|
2349
2408
|
if (typeof locator === 'number' && typeof offsetX === 'number') {
|
|
@@ -2375,7 +2434,8 @@ class Protractor extends Helper {
|
|
|
2375
2434
|
* ```js
|
|
2376
2435
|
* I.scrollPageToTop();
|
|
2377
2436
|
* ```
|
|
2378
|
-
*
|
|
2437
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2438
|
+
*
|
|
2379
2439
|
*/
|
|
2380
2440
|
async scrollPageToTop() {
|
|
2381
2441
|
return this.executeScript('window.scrollTo(0, 0);');
|
|
@@ -2387,7 +2447,8 @@ class Protractor extends Helper {
|
|
|
2387
2447
|
* ```js
|
|
2388
2448
|
* I.scrollPageToBottom();
|
|
2389
2449
|
* ```
|
|
2390
|
-
*
|
|
2450
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2451
|
+
*
|
|
2391
2452
|
*/
|
|
2392
2453
|
async scrollPageToBottom() {
|
|
2393
2454
|
/* eslint-disable prefer-arrow-callback, comma-dangle */
|
|
@@ -2469,7 +2530,8 @@ class Protractor extends Helper {
|
|
|
2469
2530
|
* ```
|
|
2470
2531
|
*
|
|
2471
2532
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2472
|
-
*
|
|
2533
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2534
|
+
*
|
|
2473
2535
|
*/
|
|
2474
2536
|
setCookie(cookie) {
|
|
2475
2537
|
return this.browser.manage().addCookie(cookie);
|