codeceptjs 3.3.0-beta.5 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -1
- package/README.md +6 -1
- package/docs/api.md +45 -30
- package/docs/bdd.md +1 -0
- package/docs/best.md +1 -1
- package/docs/build/ApiDataFactory.js +4 -3
- package/docs/build/Appium.js +53 -48
- package/docs/build/GraphQL.js +4 -2
- package/docs/build/GraphQLDataFactory.js +3 -3
- package/docs/build/JSONResponse.js +1 -1
- package/docs/build/Nightmare.js +101 -72
- package/docs/build/Playwright.js +166 -113
- package/docs/build/Protractor.js +72 -34
- package/docs/build/Puppeteer.js +143 -100
- package/docs/build/REST.js +5 -2
- package/docs/build/TestCafe.js +97 -66
- package/docs/build/WebDriver.js +183 -135
- package/docs/changelog.md +99 -0
- package/docs/custom-helpers.md +1 -1
- package/docs/data.md +2 -2
- package/docs/email.md +5 -0
- package/docs/helpers/ApiDataFactory.md +7 -3
- package/docs/helpers/Appium.md +217 -175
- package/docs/helpers/GraphQL.md +6 -0
- package/docs/helpers/GraphQLDataFactory.md +3 -3
- package/docs/helpers/JSONResponse.md +1 -1
- package/docs/helpers/MockRequest.md +8 -6
- package/docs/helpers/Nightmare.md +98 -45
- package/docs/helpers/Playwright.md +151 -59
- package/docs/helpers/Puppeteer.md +103 -26
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/TestCafe.md +77 -22
- package/docs/helpers/WebDriver.md +150 -62
- package/docs/index.md +1 -1
- package/docs/locators.md +1 -1
- package/docs/videos.md +2 -2
- package/docs/webapi/amOnPage.mustache +2 -1
- package/docs/webapi/appendField.mustache +2 -1
- package/docs/webapi/attachFile.mustache +2 -1
- package/docs/webapi/checkOption.mustache +2 -1
- package/docs/webapi/clearCookie.mustache +2 -1
- package/docs/webapi/clearField.mustache +1 -0
- package/docs/webapi/click.mustache +2 -1
- package/docs/webapi/clickLink.mustache +2 -1
- package/docs/webapi/closeCurrentTab.mustache +6 -4
- package/docs/webapi/closeOtherTabs.mustache +6 -4
- package/docs/webapi/dontSee.mustache +1 -0
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -0
- package/docs/webapi/dontSeeCookie.mustache +2 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +2 -1
- package/docs/webapi/dontSeeElement.mustache +2 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +2 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +2 -1
- package/docs/webapi/dontSeeInField.mustache +2 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -0
- package/docs/webapi/dontSeeInTitle.mustache +2 -1
- package/docs/webapi/doubleClick.mustache +1 -0
- package/docs/webapi/downloadFile.mustache +2 -1
- package/docs/webapi/dragAndDrop.mustache +1 -0
- package/docs/webapi/dragSlider.mustache +2 -1
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -0
- package/docs/webapi/forceClick.mustache +1 -0
- package/docs/webapi/forceRightClick.mustache +1 -0
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +2 -1
- package/docs/webapi/moveCursorTo.mustache +1 -0
- package/docs/webapi/openNewTab.mustache +6 -4
- package/docs/webapi/pressKey.mustache +2 -1
- package/docs/webapi/pressKeyDown.mustache +1 -0
- package/docs/webapi/pressKeyUp.mustache +1 -0
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -0
- package/docs/webapi/refreshPage.mustache +1 -0
- package/docs/webapi/resizeWindow.mustache +2 -1
- package/docs/webapi/rightClick.mustache +1 -0
- package/docs/webapi/saveElementScreenshot.mustache +1 -0
- package/docs/webapi/saveScreenshot.mustache +2 -1
- package/docs/webapi/say.mustache +2 -1
- package/docs/webapi/scrollIntoView.mustache +1 -0
- package/docs/webapi/scrollPageToBottom.mustache +1 -0
- package/docs/webapi/scrollPageToTop.mustache +1 -0
- package/docs/webapi/scrollTo.mustache +2 -1
- package/docs/webapi/see.mustache +2 -1
- package/docs/webapi/seeAttributesOnElements.mustache +2 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -0
- package/docs/webapi/seeCookie.mustache +1 -0
- package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +2 -1
- package/docs/webapi/seeElement.mustache +2 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -0
- package/docs/webapi/seeInCurrentUrl.mustache +2 -1
- package/docs/webapi/seeInField.mustache +1 -0
- package/docs/webapi/seeInPopup.mustache +1 -0
- package/docs/webapi/seeInSource.mustache +2 -1
- package/docs/webapi/seeInTitle.mustache +2 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -0
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -0
- package/docs/webapi/seeTextEquals.mustache +2 -1
- package/docs/webapi/seeTitleEquals.mustache +6 -5
- package/docs/webapi/selectOption.mustache +1 -0
- package/docs/webapi/setCookie.mustache +1 -0
- package/docs/webapi/setGeoLocation.mustache +1 -0
- package/docs/webapi/switchTo.mustache +2 -1
- package/docs/webapi/switchToNextTab.mustache +8 -7
- package/docs/webapi/switchToPreviousTab.mustache +8 -7
- package/docs/webapi/type.mustache +1 -0
- package/docs/webapi/uncheckOption.mustache +2 -1
- package/docs/webapi/wait.mustache +2 -1
- package/docs/webapi/waitForClickable.mustache +2 -1
- package/docs/webapi/waitForDetached.mustache +2 -1
- package/docs/webapi/waitForElement.mustache +2 -1
- package/docs/webapi/waitForEnabled.mustache +2 -1
- package/docs/webapi/waitForFunction.mustache +1 -0
- package/docs/webapi/waitForInvisible.mustache +2 -1
- package/docs/webapi/waitForText.mustache +2 -1
- package/docs/webapi/waitForValue.mustache +1 -0
- package/docs/webapi/waitForVisible.mustache +1 -0
- package/docs/webapi/waitInUrl.mustache +2 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -1
- package/docs/webapi/waitToHide.mustache +2 -1
- package/docs/webapi/waitUrlEquals.mustache +2 -1
- package/lib/command/definitions.js +9 -0
- package/lib/command/run.js +2 -2
- package/lib/command/workers/runTests.js +40 -0
- package/lib/helper/ApiDataFactory.js +4 -3
- package/lib/helper/Appium.js +2 -7
- package/lib/helper/GraphQL.js +4 -2
- package/lib/helper/GraphQLDataFactory.js +3 -3
- package/lib/helper/JSONResponse.js +1 -1
- package/lib/helper/Playwright.js +28 -17
- package/lib/helper/REST.js +5 -2
- package/lib/helper/WebDriver.js +4 -0
- package/lib/interfaces/bdd.js +5 -0
- package/lib/listener/steps.js +1 -0
- package/lib/plugin/fakerTransform.js +1 -1
- package/lib/plugin/stepByStepReport.js +8 -6
- package/lib/workers.js +12 -0
- package/package.json +3 -3
- package/typings/types.d.ts +578 -109
package/docs/build/Protractor.js
CHANGED
|
@@ -456,6 +456,7 @@ class Protractor extends Helper {
|
|
|
456
456
|
* ```
|
|
457
457
|
*
|
|
458
458
|
* @param {string} url url path or global url.
|
|
459
|
+
* @return {void} automatically synchronized promise with recorder #!
|
|
459
460
|
*/
|
|
460
461
|
async amOnPage(url) {
|
|
461
462
|
if (!(/^\w+\:\/\//.test(url))) {
|
|
@@ -490,7 +491,8 @@ class Protractor extends Helper {
|
|
|
490
491
|
* ```
|
|
491
492
|
*
|
|
492
493
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
493
|
-
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
494
|
+
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
495
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
494
496
|
*
|
|
495
497
|
*/
|
|
496
498
|
async click(locator, context = null) {
|
|
@@ -517,7 +519,7 @@ class Protractor extends Helper {
|
|
|
517
519
|
*
|
|
518
520
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
519
521
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
520
|
-
*
|
|
522
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
521
523
|
*/
|
|
522
524
|
async doubleClick(locator, context = null) {
|
|
523
525
|
let matcher = this.browser;
|
|
@@ -544,7 +546,7 @@ class Protractor extends Helper {
|
|
|
544
546
|
*
|
|
545
547
|
* @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
|
|
546
548
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
547
|
-
*
|
|
549
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
548
550
|
*/
|
|
549
551
|
async rightClick(locator, context = null) {
|
|
550
552
|
/**
|
|
@@ -577,7 +579,7 @@ class Protractor extends Helper {
|
|
|
577
579
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
578
580
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
579
581
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
580
|
-
*
|
|
582
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
581
583
|
*/
|
|
582
584
|
async moveCursorTo(locator, offsetX = null, offsetY = null) {
|
|
583
585
|
let offset = null;
|
|
@@ -600,6 +602,7 @@ class Protractor extends Helper {
|
|
|
600
602
|
* ```
|
|
601
603
|
* @param {string} text expected on page.
|
|
602
604
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
605
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
603
606
|
*/
|
|
604
607
|
async see(text, context = null) {
|
|
605
608
|
return proceedSee.call(this, 'assert', text, context);
|
|
@@ -614,6 +617,7 @@ class Protractor extends Helper {
|
|
|
614
617
|
*
|
|
615
618
|
* @param {string} text element value to check.
|
|
616
619
|
* @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
|
|
620
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
617
621
|
*/
|
|
618
622
|
async seeTextEquals(text, context = null) {
|
|
619
623
|
return proceedSee.call(this, 'assert', text, context, true);
|
|
@@ -630,7 +634,7 @@ class Protractor extends Helper {
|
|
|
630
634
|
*
|
|
631
635
|
* @param {string} text which is not present.
|
|
632
636
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
633
|
-
*
|
|
637
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
634
638
|
*/
|
|
635
639
|
dontSee(text, context = null) {
|
|
636
640
|
return proceedSee.call(this, 'negate', text, context);
|
|
@@ -688,7 +692,7 @@ class Protractor extends Helper {
|
|
|
688
692
|
* ```
|
|
689
693
|
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
690
694
|
* @param {string|Array<*>} option visible text or value of option.
|
|
691
|
-
*
|
|
695
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
692
696
|
*/
|
|
693
697
|
async selectOption(select, option) {
|
|
694
698
|
const fields = await findFields(this.browser, select);
|
|
@@ -726,7 +730,7 @@ class Protractor extends Helper {
|
|
|
726
730
|
* ```
|
|
727
731
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
728
732
|
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
729
|
-
*
|
|
733
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
730
734
|
*/
|
|
731
735
|
async fillField(field, value) {
|
|
732
736
|
const els = await findFields(this.browser, field);
|
|
@@ -746,6 +750,7 @@ class Protractor extends Helper {
|
|
|
746
750
|
* ```
|
|
747
751
|
*
|
|
748
752
|
* @param {string|string[]} key key or array of keys to press.
|
|
753
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
749
754
|
* {{ keys }}
|
|
750
755
|
*/
|
|
751
756
|
async pressKey(key) {
|
|
@@ -779,6 +784,7 @@ class Protractor extends Helper {
|
|
|
779
784
|
*
|
|
780
785
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
781
786
|
* @param {string} pathToFile local file path relative to codecept.json config file.
|
|
787
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
782
788
|
*/
|
|
783
789
|
async attachFile(locator, pathToFile) {
|
|
784
790
|
const file = path.join(global.codecept_dir, pathToFile);
|
|
@@ -806,7 +812,7 @@ class Protractor extends Helper {
|
|
|
806
812
|
* ```
|
|
807
813
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
808
814
|
* @param {string} value value to check.
|
|
809
|
-
*
|
|
815
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
810
816
|
*/
|
|
811
817
|
async seeInField(field, value) {
|
|
812
818
|
return proceedSeeInField.call(this, 'assert', field, value);
|
|
@@ -823,6 +829,7 @@ class Protractor extends Helper {
|
|
|
823
829
|
*
|
|
824
830
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
825
831
|
* @param {string} value value to check.
|
|
832
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
826
833
|
*/
|
|
827
834
|
async dontSeeInField(field, value) {
|
|
828
835
|
return proceedSeeInField.call(this, 'negate', field, value);
|
|
@@ -837,6 +844,7 @@ class Protractor extends Helper {
|
|
|
837
844
|
* ```
|
|
838
845
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
839
846
|
* @param {string} value text value to append.
|
|
847
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
840
848
|
*/
|
|
841
849
|
async appendField(field, value) {
|
|
842
850
|
const els = await findFields(this.browser, field);
|
|
@@ -853,7 +861,7 @@ class Protractor extends Helper {
|
|
|
853
861
|
* I.clearField('#email');
|
|
854
862
|
* ```
|
|
855
863
|
* @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
|
|
856
|
-
*
|
|
864
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
857
865
|
*/
|
|
858
866
|
async clearField(field) {
|
|
859
867
|
const els = await findFields(this.browser, field);
|
|
@@ -874,6 +882,7 @@ class Protractor extends Helper {
|
|
|
874
882
|
* ```
|
|
875
883
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
876
884
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
885
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
877
886
|
*/
|
|
878
887
|
async checkOption(field, context = null) {
|
|
879
888
|
let matcher = this.browser;
|
|
@@ -901,6 +910,7 @@ class Protractor extends Helper {
|
|
|
901
910
|
* ```
|
|
902
911
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
903
912
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
913
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
904
914
|
*/
|
|
905
915
|
async uncheckOption(field, context = null) {
|
|
906
916
|
let matcher = this.browser;
|
|
@@ -925,7 +935,7 @@ class Protractor extends Helper {
|
|
|
925
935
|
* ```
|
|
926
936
|
*
|
|
927
937
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
928
|
-
*
|
|
938
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
929
939
|
*/
|
|
930
940
|
async seeCheckboxIsChecked(field) {
|
|
931
941
|
return proceedIsChecked.call(this, 'assert', field);
|
|
@@ -941,7 +951,7 @@ class Protractor extends Helper {
|
|
|
941
951
|
* ```
|
|
942
952
|
*
|
|
943
953
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
944
|
-
*
|
|
954
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
945
955
|
*/
|
|
946
956
|
async dontSeeCheckboxIsChecked(field) {
|
|
947
957
|
return proceedIsChecked.call(this, 'negate', field);
|
|
@@ -1175,20 +1185,21 @@ class Protractor extends Helper {
|
|
|
1175
1185
|
* ```
|
|
1176
1186
|
*
|
|
1177
1187
|
* @param {string} text text value to check.
|
|
1188
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1178
1189
|
*/
|
|
1179
1190
|
async seeInTitle(text) {
|
|
1180
1191
|
return this.browser.getTitle().then(title => stringIncludes('web page title').assert(text, title));
|
|
1181
1192
|
}
|
|
1182
1193
|
|
|
1183
1194
|
/**
|
|
1184
|
-
*
|
|
1185
|
-
*
|
|
1186
|
-
* ```js
|
|
1187
|
-
* I.seeTitleEquals('Test title.');
|
|
1188
|
-
* ```
|
|
1195
|
+
* Checks that title is equal to provided one.
|
|
1189
1196
|
*
|
|
1190
|
-
*
|
|
1197
|
+
* ```js
|
|
1198
|
+
* I.seeTitleEquals('Test title.');
|
|
1199
|
+
* ```
|
|
1191
1200
|
*
|
|
1201
|
+
* @param {string} text value to check.
|
|
1202
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1192
1203
|
*/
|
|
1193
1204
|
async seeTitleEquals(text) {
|
|
1194
1205
|
const title = await this.browser.getTitle();
|
|
@@ -1203,6 +1214,7 @@ class Protractor extends Helper {
|
|
|
1203
1214
|
* ```
|
|
1204
1215
|
*
|
|
1205
1216
|
* @param {string} text value to check.
|
|
1217
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1206
1218
|
*/
|
|
1207
1219
|
async dontSeeInTitle(text) {
|
|
1208
1220
|
return this.browser.getTitle().then(title => stringIncludes('web page title').negate(text, title));
|
|
@@ -1233,6 +1245,7 @@ class Protractor extends Helper {
|
|
|
1233
1245
|
* I.seeElement('#modal');
|
|
1234
1246
|
* ```
|
|
1235
1247
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1248
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1236
1249
|
*/
|
|
1237
1250
|
async seeElement(locator) {
|
|
1238
1251
|
let els = await this._locate(locator, true);
|
|
@@ -1248,6 +1261,7 @@ class Protractor extends Helper {
|
|
|
1248
1261
|
* ```
|
|
1249
1262
|
*
|
|
1250
1263
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1264
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1251
1265
|
*/
|
|
1252
1266
|
async dontSeeElement(locator) {
|
|
1253
1267
|
let els = await this._locate(locator, false);
|
|
@@ -1263,7 +1277,7 @@ class Protractor extends Helper {
|
|
|
1263
1277
|
* I.seeElementInDOM('#modal');
|
|
1264
1278
|
* ```
|
|
1265
1279
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1266
|
-
*
|
|
1280
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1267
1281
|
*/
|
|
1268
1282
|
async seeElementInDOM(locator) {
|
|
1269
1283
|
return this.browser.findElements(guessLocator(locator) || global.by.css(locator)).then(els => empty('elements').negate(els.fill('ELEMENT')));
|
|
@@ -1277,6 +1291,7 @@ class Protractor extends Helper {
|
|
|
1277
1291
|
* ```
|
|
1278
1292
|
*
|
|
1279
1293
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1294
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1280
1295
|
*/
|
|
1281
1296
|
async dontSeeElementInDOM(locator) {
|
|
1282
1297
|
return this.browser.findElements(guessLocator(locator) || global.by.css(locator)).then(els => empty('elements').assert(els.fill('ELEMENT')));
|
|
@@ -1289,6 +1304,7 @@ class Protractor extends Helper {
|
|
|
1289
1304
|
* I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
1290
1305
|
* ```
|
|
1291
1306
|
* @param {string} text value to check.
|
|
1307
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1292
1308
|
*/
|
|
1293
1309
|
async seeInSource(text) {
|
|
1294
1310
|
return this.browser.getPageSource().then(source => stringIncludes('HTML source of a page').assert(text, source));
|
|
@@ -1316,7 +1332,7 @@ class Protractor extends Helper {
|
|
|
1316
1332
|
* ```
|
|
1317
1333
|
*
|
|
1318
1334
|
* @param {string} value to check.
|
|
1319
|
-
*
|
|
1335
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1320
1336
|
*/
|
|
1321
1337
|
async dontSeeInSource(text) {
|
|
1322
1338
|
return this.browser.getPageSource().then(source => stringIncludes('HTML source of a page').negate(text, source));
|
|
@@ -1333,7 +1349,7 @@ class Protractor extends Helper {
|
|
|
1333
1349
|
*
|
|
1334
1350
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1335
1351
|
* @param {number} num number of elements.
|
|
1336
|
-
*
|
|
1352
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1337
1353
|
*/
|
|
1338
1354
|
async seeNumberOfElements(locator, num) {
|
|
1339
1355
|
const elements = await this._locate(locator);
|
|
@@ -1350,7 +1366,7 @@ class Protractor extends Helper {
|
|
|
1350
1366
|
*
|
|
1351
1367
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1352
1368
|
* @param {number} num number of elements.
|
|
1353
|
-
*
|
|
1369
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1354
1370
|
*/
|
|
1355
1371
|
async seeNumberOfVisibleElements(locator, num) {
|
|
1356
1372
|
const res = await this.grabNumberOfVisibleElements(locator);
|
|
@@ -1383,6 +1399,7 @@ class Protractor extends Helper {
|
|
|
1383
1399
|
*
|
|
1384
1400
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1385
1401
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
1402
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1386
1403
|
*/
|
|
1387
1404
|
async seeCssPropertiesOnElements(locator, cssProperties) {
|
|
1388
1405
|
const els = await this._locate(locator);
|
|
@@ -1421,6 +1438,7 @@ class Protractor extends Helper {
|
|
|
1421
1438
|
*
|
|
1422
1439
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1423
1440
|
* @param {object} attributes attributes and their values to check.
|
|
1441
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1424
1442
|
*/
|
|
1425
1443
|
async seeAttributesOnElements(locator, attributes) {
|
|
1426
1444
|
const els = await this._locate(locator);
|
|
@@ -1472,7 +1490,7 @@ class Protractor extends Helper {
|
|
|
1472
1490
|
*
|
|
1473
1491
|
* @param {string|function} fn function to be executed in browser context.
|
|
1474
1492
|
* @param {...any} args to be passed to function.
|
|
1475
|
-
*
|
|
1493
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1476
1494
|
*
|
|
1477
1495
|
*/
|
|
1478
1496
|
async executeScript() {
|
|
@@ -1503,7 +1521,7 @@ class Protractor extends Helper {
|
|
|
1503
1521
|
*
|
|
1504
1522
|
* @param {string|function} fn function to be executed in browser context.
|
|
1505
1523
|
* @param {...any} args to be passed to function.
|
|
1506
|
-
*
|
|
1524
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1507
1525
|
*
|
|
1508
1526
|
*/
|
|
1509
1527
|
async executeAsyncScript() {
|
|
@@ -1519,6 +1537,7 @@ class Protractor extends Helper {
|
|
|
1519
1537
|
* ```
|
|
1520
1538
|
*
|
|
1521
1539
|
* @param {string} url a fragment to check
|
|
1540
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1522
1541
|
*/
|
|
1523
1542
|
async seeInCurrentUrl(url) {
|
|
1524
1543
|
return this.browser.getCurrentUrl().then(currentUrl => stringIncludes('url').assert(url, currentUrl));
|
|
@@ -1528,6 +1547,7 @@ class Protractor extends Helper {
|
|
|
1528
1547
|
* Checks that current url does not contain a provided fragment.
|
|
1529
1548
|
*
|
|
1530
1549
|
* @param {string} url value to check.
|
|
1550
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1531
1551
|
*/
|
|
1532
1552
|
async dontSeeInCurrentUrl(url) {
|
|
1533
1553
|
return this.browser.getCurrentUrl().then(currentUrl => stringIncludes('url').negate(url, currentUrl));
|
|
@@ -1544,6 +1564,7 @@ class Protractor extends Helper {
|
|
|
1544
1564
|
* ```
|
|
1545
1565
|
*
|
|
1546
1566
|
* @param {string} url value to check.
|
|
1567
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1547
1568
|
*/
|
|
1548
1569
|
async seeCurrentUrlEquals(url) {
|
|
1549
1570
|
return this.browser.getCurrentUrl().then(currentUrl => urlEquals(this.options.url).assert(url, currentUrl));
|
|
@@ -1559,6 +1580,7 @@ class Protractor extends Helper {
|
|
|
1559
1580
|
* ```
|
|
1560
1581
|
*
|
|
1561
1582
|
* @param {string} url value to check.
|
|
1583
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1562
1584
|
*/
|
|
1563
1585
|
async dontSeeCurrentUrlEquals(url) {
|
|
1564
1586
|
return this.browser.getCurrentUrl().then(currentUrl => urlEquals(this.options.url).negate(url, currentUrl));
|
|
@@ -1574,7 +1596,7 @@ class Protractor extends Helper {
|
|
|
1574
1596
|
*
|
|
1575
1597
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1576
1598
|
* @param {string} fileName file name to save.
|
|
1577
|
-
*
|
|
1599
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1578
1600
|
*
|
|
1579
1601
|
*/
|
|
1580
1602
|
async saveElementScreenshot(locator, fileName) {
|
|
@@ -1609,6 +1631,7 @@ class Protractor extends Helper {
|
|
|
1609
1631
|
*
|
|
1610
1632
|
* @param {string} fileName file name to save.
|
|
1611
1633
|
* @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1634
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1612
1635
|
*/
|
|
1613
1636
|
async saveScreenshot(fileName, fullPage = false) {
|
|
1614
1637
|
const outputFile = screenshotOutputFolder(fileName);
|
|
@@ -1650,6 +1673,7 @@ class Protractor extends Helper {
|
|
|
1650
1673
|
* ```
|
|
1651
1674
|
*
|
|
1652
1675
|
* @param {?string} [cookie=null] (optional, `null` by default) cookie name
|
|
1676
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1653
1677
|
*/
|
|
1654
1678
|
async clearCookie(cookie = null) {
|
|
1655
1679
|
if (!cookie) {
|
|
@@ -1666,7 +1690,7 @@ class Protractor extends Helper {
|
|
|
1666
1690
|
* ```
|
|
1667
1691
|
*
|
|
1668
1692
|
* @param {string} name cookie name.
|
|
1669
|
-
*
|
|
1693
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1670
1694
|
*/
|
|
1671
1695
|
async seeCookie(name) {
|
|
1672
1696
|
return this.browser.manage().getCookie(name).then(res => truth(`cookie ${name}`, 'to be set').assert(res));
|
|
@@ -1680,6 +1704,7 @@ class Protractor extends Helper {
|
|
|
1680
1704
|
* ```
|
|
1681
1705
|
*
|
|
1682
1706
|
* @param {string} name cookie name.
|
|
1707
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1683
1708
|
*/
|
|
1684
1709
|
async dontSeeCookie(name) {
|
|
1685
1710
|
return this.browser.manage().getCookie(name).then(res => truth(`cookie ${name}`, 'to be set').negate(res));
|
|
@@ -1730,7 +1755,7 @@ class Protractor extends Helper {
|
|
|
1730
1755
|
* I.seeInPopup('Popup text');
|
|
1731
1756
|
* ```
|
|
1732
1757
|
* @param {string} text value to check.
|
|
1733
|
-
*
|
|
1758
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1734
1759
|
*/
|
|
1735
1760
|
async seeInPopup(text) {
|
|
1736
1761
|
const popupAlert = await this.browser.switchTo().alert();
|
|
@@ -1770,6 +1795,7 @@ class Protractor extends Helper {
|
|
|
1770
1795
|
*
|
|
1771
1796
|
* @param {number} width width in pixels or `maximize`.
|
|
1772
1797
|
* @param {number} height height in pixels.
|
|
1798
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1773
1799
|
*/
|
|
1774
1800
|
async resizeWindow(width, height) {
|
|
1775
1801
|
if (width === 'maximize') {
|
|
@@ -1788,7 +1814,7 @@ class Protractor extends Helper {
|
|
|
1788
1814
|
*
|
|
1789
1815
|
* @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
|
|
1790
1816
|
* @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
|
|
1791
|
-
*
|
|
1817
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1792
1818
|
*/
|
|
1793
1819
|
async dragAndDrop(srcElement, destElement) {
|
|
1794
1820
|
const srcEl = await this._locate(srcElement, true);
|
|
@@ -1931,6 +1957,7 @@ class Protractor extends Helper {
|
|
|
1931
1957
|
* ```
|
|
1932
1958
|
*
|
|
1933
1959
|
* @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1960
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1934
1961
|
*/
|
|
1935
1962
|
async switchTo(locator) {
|
|
1936
1963
|
if (Number.isInteger(locator)) {
|
|
@@ -1953,6 +1980,7 @@ class Protractor extends Helper {
|
|
|
1953
1980
|
* ```
|
|
1954
1981
|
*
|
|
1955
1982
|
* @param {number} sec number of second to wait.
|
|
1983
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1956
1984
|
*/
|
|
1957
1985
|
wait(sec) {
|
|
1958
1986
|
return this.browser.sleep(sec * 1000);
|
|
@@ -1969,6 +1997,7 @@ class Protractor extends Helper {
|
|
|
1969
1997
|
*
|
|
1970
1998
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1971
1999
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2000
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1972
2001
|
*/
|
|
1973
2002
|
async waitForElement(locator, sec = null) {
|
|
1974
2003
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -1993,6 +2022,7 @@ class Protractor extends Helper {
|
|
|
1993
2022
|
*
|
|
1994
2023
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1995
2024
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2025
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1996
2026
|
*/
|
|
1997
2027
|
async waitForDetached(locator, sec = null) {
|
|
1998
2028
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2027,7 +2057,7 @@ class Protractor extends Helper {
|
|
|
2027
2057
|
*
|
|
2028
2058
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2029
2059
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2030
|
-
*
|
|
2060
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2031
2061
|
*/
|
|
2032
2062
|
async waitForVisible(locator, sec = null) {
|
|
2033
2063
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2045,6 +2075,7 @@ class Protractor extends Helper {
|
|
|
2045
2075
|
*
|
|
2046
2076
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2047
2077
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2078
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2048
2079
|
*/
|
|
2049
2080
|
async waitToHide(locator, sec = null) {
|
|
2050
2081
|
return this.waitForInvisible(locator, sec);
|
|
@@ -2060,6 +2091,7 @@ class Protractor extends Helper {
|
|
|
2060
2091
|
*
|
|
2061
2092
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2062
2093
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2094
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2063
2095
|
*/
|
|
2064
2096
|
async waitForInvisible(locator, sec = null) {
|
|
2065
2097
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2084,6 +2116,7 @@ class Protractor extends Helper {
|
|
|
2084
2116
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2085
2117
|
* @param {number} num number of elements.
|
|
2086
2118
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2119
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2087
2120
|
*/
|
|
2088
2121
|
async waitNumberOfVisibleElements(locator, num, sec = null) {
|
|
2089
2122
|
function visibilityCountOf(loc, expectedCount) {
|
|
@@ -2110,6 +2143,7 @@ class Protractor extends Helper {
|
|
|
2110
2143
|
*
|
|
2111
2144
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2112
2145
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
2146
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2113
2147
|
*/
|
|
2114
2148
|
async waitForEnabled(locator, sec = null) {
|
|
2115
2149
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2131,7 +2165,7 @@ class Protractor extends Helper {
|
|
|
2131
2165
|
* @param {LocatorOrString} field input field.
|
|
2132
2166
|
* @param {string }value expected value.
|
|
2133
2167
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2134
|
-
*
|
|
2168
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2135
2169
|
*/
|
|
2136
2170
|
async waitForValue(field, value, sec = null) {
|
|
2137
2171
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2171,7 +2205,7 @@ class Protractor extends Helper {
|
|
|
2171
2205
|
* @param {string|function} fn to be executed in browser context.
|
|
2172
2206
|
* @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
|
|
2173
2207
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2174
|
-
*
|
|
2208
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2175
2209
|
*/
|
|
2176
2210
|
async waitForFunction(fn, argsOrSec = null, sec = null) {
|
|
2177
2211
|
let args = [];
|
|
@@ -2196,6 +2230,7 @@ class Protractor extends Helper {
|
|
|
2196
2230
|
*
|
|
2197
2231
|
* @param {string} urlPart value to check.
|
|
2198
2232
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2233
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2199
2234
|
*/
|
|
2200
2235
|
async waitInUrl(urlPart, sec = null) {
|
|
2201
2236
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2222,6 +2257,7 @@ class Protractor extends Helper {
|
|
|
2222
2257
|
*
|
|
2223
2258
|
* @param {string} urlPart value to check.
|
|
2224
2259
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2260
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2225
2261
|
*/
|
|
2226
2262
|
async waitUrlEquals(urlPart, sec = null) {
|
|
2227
2263
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2255,6 +2291,7 @@ class Protractor extends Helper {
|
|
|
2255
2291
|
* @param {string }text to wait for.
|
|
2256
2292
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2257
2293
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
2294
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2258
2295
|
*/
|
|
2259
2296
|
async waitForText(text, sec = null, context = null) {
|
|
2260
2297
|
if (!context) {
|
|
@@ -2280,7 +2317,7 @@ class Protractor extends Helper {
|
|
|
2280
2317
|
* ```js
|
|
2281
2318
|
* I.refreshPage();
|
|
2282
2319
|
* ```
|
|
2283
|
-
*
|
|
2320
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2284
2321
|
*/
|
|
2285
2322
|
refreshPage() {
|
|
2286
2323
|
return this.browser.refresh();
|
|
@@ -2306,6 +2343,7 @@ class Protractor extends Helper {
|
|
|
2306
2343
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2307
2344
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2308
2345
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2346
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2309
2347
|
*/
|
|
2310
2348
|
async scrollTo(locator, offsetX = 0, offsetY = 0) {
|
|
2311
2349
|
if (typeof locator === 'number' && typeof offsetX === 'number') {
|
|
@@ -2337,7 +2375,7 @@ class Protractor extends Helper {
|
|
|
2337
2375
|
* ```js
|
|
2338
2376
|
* I.scrollPageToTop();
|
|
2339
2377
|
* ```
|
|
2340
|
-
*
|
|
2378
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2341
2379
|
*/
|
|
2342
2380
|
async scrollPageToTop() {
|
|
2343
2381
|
return this.executeScript('window.scrollTo(0, 0);');
|
|
@@ -2349,7 +2387,7 @@ class Protractor extends Helper {
|
|
|
2349
2387
|
* ```js
|
|
2350
2388
|
* I.scrollPageToBottom();
|
|
2351
2389
|
* ```
|
|
2352
|
-
*
|
|
2390
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2353
2391
|
*/
|
|
2354
2392
|
async scrollPageToBottom() {
|
|
2355
2393
|
/* eslint-disable prefer-arrow-callback, comma-dangle */
|
|
@@ -2431,7 +2469,7 @@ class Protractor extends Helper {
|
|
|
2431
2469
|
* ```
|
|
2432
2470
|
*
|
|
2433
2471
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2434
|
-
*
|
|
2472
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2435
2473
|
*/
|
|
2436
2474
|
setCookie(cookie) {
|
|
2437
2475
|
return this.browser.manage().addCookie(cookie);
|