codeceptjs 3.3.1 → 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 +7 -0
- package/README.md +4 -25
- package/docs/build/Appium.js +18 -28
- package/docs/build/Nightmare.js +53 -53
- package/docs/build/Playwright.js +74 -99
- package/docs/build/Protractor.js +66 -66
- package/docs/build/Puppeteer.js +74 -74
- package/docs/build/REST.js +2 -2
- package/docs/build/TestCafe.js +53 -53
- package/docs/build/WebDriver.js +79 -81
- package/docs/changelog.md +7 -0
- package/docs/helpers/Appium.md +212 -268
- package/docs/helpers/Nightmare.md +92 -141
- package/docs/helpers/Playwright.md +266 -383
- package/docs/helpers/Puppeteer.md +171 -231
- package/docs/helpers/TestCafe.md +125 -174
- package/docs/helpers/WebDriver.md +184 -247
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- 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/grabDataFromPerformanceTiming.mustache +1 -1
- package/docs/webapi/moveCursorTo.mustache +1 -1
- package/docs/webapi/openNewTab.mustache +1 -1
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/pressKeyDown.mustache +1 -1
- package/docs/webapi/pressKeyUp.mustache +1 -1
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
- package/docs/webapi/refreshPage.mustache +1 -1
- package/docs/webapi/resizeWindow.mustache +1 -1
- package/docs/webapi/rightClick.mustache +1 -1
- package/docs/webapi/saveElementScreenshot.mustache +1 -1
- package/docs/webapi/saveScreenshot.mustache +1 -1
- package/docs/webapi/say.mustache +1 -1
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/docs/webapi/scrollPageToBottom.mustache +1 -1
- package/docs/webapi/scrollPageToTop.mustache +1 -1
- package/docs/webapi/scrollTo.mustache +1 -1
- package/docs/webapi/see.mustache +1 -1
- package/docs/webapi/seeAttributesOnElements.mustache +1 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/seeCookie.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInCurrentUrl.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/webapi/seeInPopup.mustache +1 -1
- package/docs/webapi/seeInSource.mustache +1 -1
- package/docs/webapi/seeInTitle.mustache +1 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -1
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/seeTextEquals.mustache +1 -1
- package/docs/webapi/seeTitleEquals.mustache +1 -1
- package/docs/webapi/selectOption.mustache +1 -1
- package/docs/webapi/setCookie.mustache +1 -1
- package/docs/webapi/setGeoLocation.mustache +1 -1
- package/docs/webapi/switchTo.mustache +1 -1
- package/docs/webapi/switchToNextTab.mustache +1 -1
- package/docs/webapi/switchToPreviousTab.mustache +1 -1
- package/docs/webapi/type.mustache +1 -1
- package/docs/webapi/uncheckOption.mustache +1 -1
- package/docs/webapi/wait.mustache +1 -1
- package/docs/webapi/waitForClickable.mustache +1 -1
- package/docs/webapi/waitForDetached.mustache +1 -1
- package/docs/webapi/waitForElement.mustache +1 -1
- package/docs/webapi/waitForEnabled.mustache +1 -1
- package/docs/webapi/waitForFunction.mustache +1 -1
- package/docs/webapi/waitForInvisible.mustache +1 -1
- package/docs/webapi/waitForText.mustache +1 -1
- package/docs/webapi/waitForValue.mustache +1 -1
- package/docs/webapi/waitForVisible.mustache +1 -1
- package/docs/webapi/waitInUrl.mustache +1 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/waitToHide.mustache +1 -1
- package/docs/webapi/waitUrlEquals.mustache +1 -1
- package/lib/helper/Appium.js +0 -10
- package/lib/helper/Playwright.js +3 -28
- package/lib/helper/REST.js +2 -2
- package/lib/helper/WebDriver.js +0 -2
- package/package.json +1 -1
- package/typings/types.d.ts +988 -517
package/docs/build/Playwright.js
CHANGED
|
@@ -553,8 +553,7 @@ class Playwright extends Helper {
|
|
|
553
553
|
* ```
|
|
554
554
|
*
|
|
555
555
|
* @param {string} description used to show in logs.
|
|
556
|
-
* @param {function} fn async function that executed with Playwright helper as
|
|
557
|
-
* @return {Promise<any>}
|
|
556
|
+
* @param {function} fn async function that executed with Playwright helper as argumen
|
|
558
557
|
*/
|
|
559
558
|
usePlaywrightTo(description, fn) {
|
|
560
559
|
return this._useTo(...arguments);
|
|
@@ -569,7 +568,6 @@ class Playwright extends Helper {
|
|
|
569
568
|
* I.click('#triggerPopup');
|
|
570
569
|
* I.acceptPopup();
|
|
571
570
|
* ```
|
|
572
|
-
* @return {Promise<any>}
|
|
573
571
|
*/
|
|
574
572
|
amAcceptingPopups() {
|
|
575
573
|
popupStore.actionType = 'accept';
|
|
@@ -579,7 +577,6 @@ class Playwright extends Helper {
|
|
|
579
577
|
* Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
|
|
580
578
|
* Don't confuse popups with modal windows, as created by [various
|
|
581
579
|
* libraries](http://jster.net/category/windows-modals-popups).
|
|
582
|
-
* @return {Promise<any>}
|
|
583
580
|
*/
|
|
584
581
|
acceptPopup() {
|
|
585
582
|
popupStore.assertPopupActionType('accept');
|
|
@@ -594,7 +591,6 @@ class Playwright extends Helper {
|
|
|
594
591
|
* I.click('#triggerPopup');
|
|
595
592
|
* I.cancelPopup();
|
|
596
593
|
* ```
|
|
597
|
-
* @return {Promise<any>}
|
|
598
594
|
*/
|
|
599
595
|
amCancellingPopups() {
|
|
600
596
|
popupStore.actionType = 'cancel';
|
|
@@ -602,7 +598,6 @@ class Playwright extends Helper {
|
|
|
602
598
|
|
|
603
599
|
/**
|
|
604
600
|
* Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt.
|
|
605
|
-
* @return {Promise<any>}
|
|
606
601
|
*/
|
|
607
602
|
cancelPopup() {
|
|
608
603
|
popupStore.assertPopupActionType('cancel');
|
|
@@ -616,7 +611,7 @@ class Playwright extends Helper {
|
|
|
616
611
|
* I.seeInPopup('Popup text');
|
|
617
612
|
* ```
|
|
618
613
|
* @param {string} text value to check.
|
|
619
|
-
*
|
|
614
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
620
615
|
*/
|
|
621
616
|
async seeInPopup(text) {
|
|
622
617
|
popupStore.assertPopupVisible();
|
|
@@ -627,7 +622,6 @@ class Playwright extends Helper {
|
|
|
627
622
|
/**
|
|
628
623
|
* Set current page
|
|
629
624
|
* @param {object} page page to set
|
|
630
|
-
* @return {Promise<any>}
|
|
631
625
|
*/
|
|
632
626
|
async _setPage(page) {
|
|
633
627
|
page = await page;
|
|
@@ -652,7 +646,6 @@ class Playwright extends Helper {
|
|
|
652
646
|
/**
|
|
653
647
|
* Add the 'dialog' event listener to a page
|
|
654
648
|
* @page {playwright.Page}
|
|
655
|
-
* @return {Promise<any>}
|
|
656
649
|
*
|
|
657
650
|
* The popup listener handles the dialog with the predefined action when it appears on the page.
|
|
658
651
|
* It also saves a reference to the object which is used in seeInPopup.
|
|
@@ -683,7 +676,6 @@ class Playwright extends Helper {
|
|
|
683
676
|
|
|
684
677
|
/**
|
|
685
678
|
* Gets page URL including hash.
|
|
686
|
-
* @return {Promise<any>}
|
|
687
679
|
*/
|
|
688
680
|
async _getPageUrl() {
|
|
689
681
|
return this.executeScript(() => window.location.href);
|
|
@@ -800,7 +792,7 @@ class Playwright extends Helper {
|
|
|
800
792
|
* ```
|
|
801
793
|
*
|
|
802
794
|
* @param {string} url url path or global url.
|
|
803
|
-
* @return {
|
|
795
|
+
* @return {void} automatically synchronized promise with recorder #!
|
|
804
796
|
*/
|
|
805
797
|
async amOnPage(url) {
|
|
806
798
|
if (this.isElectron) {
|
|
@@ -838,7 +830,7 @@ class Playwright extends Helper {
|
|
|
838
830
|
*
|
|
839
831
|
* @param {number} width width in pixels or `maximize`.
|
|
840
832
|
* @param {number} height height in pixels.
|
|
841
|
-
*
|
|
833
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
842
834
|
*
|
|
843
835
|
* Unlike other drivers Playwright changes the size of a viewport, not the window!
|
|
844
836
|
* Playwright does not control the window of a browser so it can't adjust its real size.
|
|
@@ -871,7 +863,6 @@ class Playwright extends Helper {
|
|
|
871
863
|
* ```
|
|
872
864
|
*
|
|
873
865
|
* @param {object} customHeaders headers to set
|
|
874
|
-
* @return {Promise<any>}
|
|
875
866
|
*/
|
|
876
867
|
async haveRequestHeaders(customHeaders) {
|
|
877
868
|
if (!customHeaders) {
|
|
@@ -892,7 +883,7 @@ class Playwright extends Helper {
|
|
|
892
883
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
893
884
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
894
885
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
895
|
-
*
|
|
886
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
896
887
|
*
|
|
897
888
|
*/
|
|
898
889
|
async moveCursorTo(locator, offsetX = 0, offsetY = 0) {
|
|
@@ -914,7 +905,7 @@ class Playwright extends Helper {
|
|
|
914
905
|
*
|
|
915
906
|
* @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
|
|
916
907
|
* @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
|
|
917
|
-
*
|
|
908
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
918
909
|
*
|
|
919
910
|
* @param {any} [options] [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
|
|
920
911
|
*
|
|
@@ -938,7 +929,7 @@ class Playwright extends Helper {
|
|
|
938
929
|
* ```js
|
|
939
930
|
* I.refreshPage();
|
|
940
931
|
* ```
|
|
941
|
-
*
|
|
932
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
942
933
|
*/
|
|
943
934
|
async refreshPage() {
|
|
944
935
|
return this.page.reload({ timeout: this.options.getPageTimeout, waitUntil: this.options.waitForNavigation });
|
|
@@ -950,7 +941,7 @@ class Playwright extends Helper {
|
|
|
950
941
|
* ```js
|
|
951
942
|
* I.scrollPageToTop();
|
|
952
943
|
* ```
|
|
953
|
-
*
|
|
944
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
954
945
|
*/
|
|
955
946
|
scrollPageToTop() {
|
|
956
947
|
return this.executeScript(() => {
|
|
@@ -964,7 +955,7 @@ class Playwright extends Helper {
|
|
|
964
955
|
* ```js
|
|
965
956
|
* I.scrollPageToBottom();
|
|
966
957
|
* ```
|
|
967
|
-
*
|
|
958
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
968
959
|
*/
|
|
969
960
|
async scrollPageToBottom() {
|
|
970
961
|
return this.executeScript(() => {
|
|
@@ -989,7 +980,7 @@ class Playwright extends Helper {
|
|
|
989
980
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
990
981
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
991
982
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
992
|
-
*
|
|
983
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
993
984
|
*/
|
|
994
985
|
async scrollTo(locator, offsetX = 0, offsetY = 0) {
|
|
995
986
|
if (typeof locator === 'number' && typeof offsetX === 'number') {
|
|
@@ -1018,7 +1009,7 @@ class Playwright extends Helper {
|
|
|
1018
1009
|
* ```
|
|
1019
1010
|
*
|
|
1020
1011
|
* @param {string} text text value to check.
|
|
1021
|
-
*
|
|
1012
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1022
1013
|
*/
|
|
1023
1014
|
async seeInTitle(text) {
|
|
1024
1015
|
const title = await this.page.title();
|
|
@@ -1056,7 +1047,7 @@ class Playwright extends Helper {
|
|
|
1056
1047
|
* ```
|
|
1057
1048
|
*
|
|
1058
1049
|
* @param {string} text value to check.
|
|
1059
|
-
*
|
|
1050
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1060
1051
|
*/
|
|
1061
1052
|
async seeTitleEquals(text) {
|
|
1062
1053
|
const title = await this.page.title();
|
|
@@ -1071,7 +1062,7 @@ class Playwright extends Helper {
|
|
|
1071
1062
|
* ```
|
|
1072
1063
|
*
|
|
1073
1064
|
* @param {string} text value to check.
|
|
1074
|
-
*
|
|
1065
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1075
1066
|
*/
|
|
1076
1067
|
async dontSeeInTitle(text) {
|
|
1077
1068
|
const title = await this.page.title();
|
|
@@ -1099,7 +1090,6 @@ class Playwright extends Helper {
|
|
|
1099
1090
|
* ```js
|
|
1100
1091
|
* const elements = await this.helpers['Playwright']._locate({name: 'password'});
|
|
1101
1092
|
* ```
|
|
1102
|
-
* @return {Promise<any>}
|
|
1103
1093
|
*/
|
|
1104
1094
|
async _locate(locator) {
|
|
1105
1095
|
const context = await this.context || await this._getContext();
|
|
@@ -1113,7 +1103,6 @@ class Playwright extends Helper {
|
|
|
1113
1103
|
* ```js
|
|
1114
1104
|
* this.helpers['Playwright']._locateCheckable('I agree with terms and conditions').then // ...
|
|
1115
1105
|
* ```
|
|
1116
|
-
* @return {Promise<any>}
|
|
1117
1106
|
*/
|
|
1118
1107
|
async _locateCheckable(locator, providedContext = null) {
|
|
1119
1108
|
const context = providedContext || await this._getContext();
|
|
@@ -1128,7 +1117,6 @@ class Playwright extends Helper {
|
|
|
1128
1117
|
* ```js
|
|
1129
1118
|
* this.helpers['Playwright']._locateClickable('Next page').then // ...
|
|
1130
1119
|
* ```
|
|
1131
|
-
* @return {Promise<any>}
|
|
1132
1120
|
*/
|
|
1133
1121
|
async _locateClickable(locator) {
|
|
1134
1122
|
const context = await this._getContext();
|
|
@@ -1141,7 +1129,6 @@ class Playwright extends Helper {
|
|
|
1141
1129
|
* ```js
|
|
1142
1130
|
* this.helpers['Playwright']._locateFields('Your email').then // ...
|
|
1143
1131
|
* ```
|
|
1144
|
-
* @return {Promise<any>}
|
|
1145
1132
|
*/
|
|
1146
1133
|
async _locateFields(locator) {
|
|
1147
1134
|
return findFields.call(this, locator);
|
|
@@ -1156,7 +1143,6 @@ class Playwright extends Helper {
|
|
|
1156
1143
|
* ```
|
|
1157
1144
|
*
|
|
1158
1145
|
* @param {number} [num=1]
|
|
1159
|
-
* @return {Promise<any>}
|
|
1160
1146
|
*/
|
|
1161
1147
|
async switchToNextTab(num = 1) {
|
|
1162
1148
|
if (this.isElectron) {
|
|
@@ -1183,7 +1169,6 @@ class Playwright extends Helper {
|
|
|
1183
1169
|
* I.switchToPreviousTab(2);
|
|
1184
1170
|
* ```
|
|
1185
1171
|
* @param {number} [num=1]
|
|
1186
|
-
* @return {Promise<any>}
|
|
1187
1172
|
*/
|
|
1188
1173
|
async switchToPreviousTab(num = 1) {
|
|
1189
1174
|
if (this.isElectron) {
|
|
@@ -1208,7 +1193,6 @@ class Playwright extends Helper {
|
|
|
1208
1193
|
* ```js
|
|
1209
1194
|
* I.closeCurrentTab();
|
|
1210
1195
|
* ```
|
|
1211
|
-
* @return {Promise<any>}
|
|
1212
1196
|
*/
|
|
1213
1197
|
async closeCurrentTab() {
|
|
1214
1198
|
if (this.isElectron) {
|
|
@@ -1226,7 +1210,6 @@ class Playwright extends Helper {
|
|
|
1226
1210
|
* ```js
|
|
1227
1211
|
* I.closeOtherTabs();
|
|
1228
1212
|
* ```
|
|
1229
|
-
* @return {Promise<any>}
|
|
1230
1213
|
*/
|
|
1231
1214
|
async closeOtherTabs() {
|
|
1232
1215
|
const pages = await this.browserContext.pages();
|
|
@@ -1251,7 +1234,6 @@ class Playwright extends Helper {
|
|
|
1251
1234
|
* // enable mobile
|
|
1252
1235
|
* I.openNewTab({ isMobile: true });
|
|
1253
1236
|
* ```
|
|
1254
|
-
* @return {Promise<any>}
|
|
1255
1237
|
*/
|
|
1256
1238
|
async openNewTab(options) {
|
|
1257
1239
|
if (this.isElectron) {
|
|
@@ -1285,7 +1267,7 @@ class Playwright extends Helper {
|
|
|
1285
1267
|
* I.seeElement('#modal');
|
|
1286
1268
|
* ```
|
|
1287
1269
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1288
|
-
*
|
|
1270
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1289
1271
|
*
|
|
1290
1272
|
*/
|
|
1291
1273
|
async seeElement(locator) {
|
|
@@ -1302,7 +1284,7 @@ class Playwright extends Helper {
|
|
|
1302
1284
|
* ```
|
|
1303
1285
|
*
|
|
1304
1286
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1305
|
-
*
|
|
1287
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1306
1288
|
*
|
|
1307
1289
|
*/
|
|
1308
1290
|
async dontSeeElement(locator) {
|
|
@@ -1319,7 +1301,7 @@ class Playwright extends Helper {
|
|
|
1319
1301
|
* I.seeElementInDOM('#modal');
|
|
1320
1302
|
* ```
|
|
1321
1303
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1322
|
-
*
|
|
1304
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1323
1305
|
*/
|
|
1324
1306
|
async seeElementInDOM(locator) {
|
|
1325
1307
|
const els = await this._locate(locator);
|
|
@@ -1334,7 +1316,7 @@ class Playwright extends Helper {
|
|
|
1334
1316
|
* ```
|
|
1335
1317
|
*
|
|
1336
1318
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1337
|
-
*
|
|
1319
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1338
1320
|
*/
|
|
1339
1321
|
async dontSeeElementInDOM(locator) {
|
|
1340
1322
|
const els = await this._locate(locator);
|
|
@@ -1397,7 +1379,7 @@ class Playwright extends Helper {
|
|
|
1397
1379
|
*
|
|
1398
1380
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1399
1381
|
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1400
|
-
*
|
|
1382
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1401
1383
|
*
|
|
1402
1384
|
*
|
|
1403
1385
|
* @param {any} [opts] [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
|
|
@@ -1419,7 +1401,6 @@ class Playwright extends Helper {
|
|
|
1419
1401
|
|
|
1420
1402
|
/**
|
|
1421
1403
|
* Clicks link and waits for navigation (deprecated)
|
|
1422
|
-
* @return {Promise<any>}
|
|
1423
1404
|
*/
|
|
1424
1405
|
async clickLink(locator, context = null) {
|
|
1425
1406
|
console.log('clickLink deprecated: Playwright automatically waits for navigation to happen.');
|
|
@@ -1455,7 +1436,7 @@ class Playwright extends Helper {
|
|
|
1455
1436
|
*
|
|
1456
1437
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1457
1438
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1458
|
-
*
|
|
1439
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1459
1440
|
*
|
|
1460
1441
|
*/
|
|
1461
1442
|
async forceClick(locator, context = null) {
|
|
@@ -1475,7 +1456,7 @@ class Playwright extends Helper {
|
|
|
1475
1456
|
*
|
|
1476
1457
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1477
1458
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1478
|
-
*
|
|
1459
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1479
1460
|
*
|
|
1480
1461
|
*
|
|
1481
1462
|
*/
|
|
@@ -1497,7 +1478,7 @@ class Playwright extends Helper {
|
|
|
1497
1478
|
*
|
|
1498
1479
|
* @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
|
|
1499
1480
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1500
|
-
*
|
|
1481
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1501
1482
|
*
|
|
1502
1483
|
*
|
|
1503
1484
|
*/
|
|
@@ -1518,7 +1499,7 @@ class Playwright extends Helper {
|
|
|
1518
1499
|
* ```
|
|
1519
1500
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1520
1501
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1521
|
-
*
|
|
1502
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1522
1503
|
*
|
|
1523
1504
|
* [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
|
|
1524
1505
|
*
|
|
@@ -1549,7 +1530,7 @@ class Playwright extends Helper {
|
|
|
1549
1530
|
* ```
|
|
1550
1531
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1551
1532
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1552
|
-
*
|
|
1533
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1553
1534
|
*
|
|
1554
1535
|
* [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
|
|
1555
1536
|
*
|
|
@@ -1577,7 +1558,7 @@ class Playwright extends Helper {
|
|
|
1577
1558
|
* ```
|
|
1578
1559
|
*
|
|
1579
1560
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1580
|
-
*
|
|
1561
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1581
1562
|
*/
|
|
1582
1563
|
async seeCheckboxIsChecked(field) {
|
|
1583
1564
|
return proceedIsChecked.call(this, 'assert', field);
|
|
@@ -1593,7 +1574,7 @@ class Playwright extends Helper {
|
|
|
1593
1574
|
* ```
|
|
1594
1575
|
*
|
|
1595
1576
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1596
|
-
*
|
|
1577
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1597
1578
|
*/
|
|
1598
1579
|
async dontSeeCheckboxIsChecked(field) {
|
|
1599
1580
|
return proceedIsChecked.call(this, 'negate', field);
|
|
@@ -1611,7 +1592,7 @@ class Playwright extends Helper {
|
|
|
1611
1592
|
* ```
|
|
1612
1593
|
*
|
|
1613
1594
|
* @param {string} key name of key to press down.
|
|
1614
|
-
*
|
|
1595
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1615
1596
|
*/
|
|
1616
1597
|
async pressKeyDown(key) {
|
|
1617
1598
|
key = getNormalizedKey.call(this, key);
|
|
@@ -1631,7 +1612,7 @@ class Playwright extends Helper {
|
|
|
1631
1612
|
* ```
|
|
1632
1613
|
*
|
|
1633
1614
|
* @param {string} key name of key to release.
|
|
1634
|
-
*
|
|
1615
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1635
1616
|
*/
|
|
1636
1617
|
async pressKeyUp(key) {
|
|
1637
1618
|
key = getNormalizedKey.call(this, key);
|
|
@@ -1699,7 +1680,7 @@ class Playwright extends Helper {
|
|
|
1699
1680
|
* - `'Tab'`
|
|
1700
1681
|
*
|
|
1701
1682
|
* @param {string|string[]} key key or array of keys to press.
|
|
1702
|
-
*
|
|
1683
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1703
1684
|
*
|
|
1704
1685
|
*
|
|
1705
1686
|
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
|
|
@@ -1747,7 +1728,7 @@ class Playwright extends Helper {
|
|
|
1747
1728
|
*
|
|
1748
1729
|
* @param {string|string[]} key or array of keys to type.
|
|
1749
1730
|
* @param {?number} [delay=null] (optional) delay in ms between key presses
|
|
1750
|
-
*
|
|
1731
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1751
1732
|
*/
|
|
1752
1733
|
async type(keys, delay = null) {
|
|
1753
1734
|
if (!Array.isArray(keys)) {
|
|
@@ -1776,7 +1757,7 @@ class Playwright extends Helper {
|
|
|
1776
1757
|
* ```
|
|
1777
1758
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1778
1759
|
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1779
|
-
*
|
|
1760
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1780
1761
|
*
|
|
1781
1762
|
*/
|
|
1782
1763
|
async fillField(field, value) {
|
|
@@ -1803,7 +1784,7 @@ class Playwright extends Helper {
|
|
|
1803
1784
|
* I.clearField('#email');
|
|
1804
1785
|
* ```
|
|
1805
1786
|
* @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
|
|
1806
|
-
*
|
|
1787
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1807
1788
|
*/
|
|
1808
1789
|
async clearField(field) {
|
|
1809
1790
|
return this.fillField(field, '');
|
|
@@ -1818,7 +1799,7 @@ class Playwright extends Helper {
|
|
|
1818
1799
|
* ```
|
|
1819
1800
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
1820
1801
|
* @param {string} value text value to append.
|
|
1821
|
-
*
|
|
1802
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1822
1803
|
*
|
|
1823
1804
|
*
|
|
1824
1805
|
*/
|
|
@@ -1842,7 +1823,7 @@ class Playwright extends Helper {
|
|
|
1842
1823
|
* ```
|
|
1843
1824
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1844
1825
|
* @param {string} value value to check.
|
|
1845
|
-
*
|
|
1826
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1846
1827
|
*/
|
|
1847
1828
|
async seeInField(field, value) {
|
|
1848
1829
|
return proceedSeeInField.call(this, 'assert', field, value);
|
|
@@ -1859,7 +1840,7 @@ class Playwright extends Helper {
|
|
|
1859
1840
|
*
|
|
1860
1841
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1861
1842
|
* @param {string} value value to check.
|
|
1862
|
-
*
|
|
1843
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1863
1844
|
*/
|
|
1864
1845
|
async dontSeeInField(field, value) {
|
|
1865
1846
|
return proceedSeeInField.call(this, 'negate', field, value);
|
|
@@ -1877,7 +1858,7 @@ class Playwright extends Helper {
|
|
|
1877
1858
|
*
|
|
1878
1859
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
1879
1860
|
* @param {string} pathToFile local file path relative to codecept.json config file.
|
|
1880
|
-
*
|
|
1861
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1881
1862
|
*
|
|
1882
1863
|
*/
|
|
1883
1864
|
async attachFile(locator, pathToFile) {
|
|
@@ -1913,7 +1894,7 @@ class Playwright extends Helper {
|
|
|
1913
1894
|
* ```
|
|
1914
1895
|
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
1915
1896
|
* @param {string|Array<*>} option visible text or value of option.
|
|
1916
|
-
*
|
|
1897
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1917
1898
|
*/
|
|
1918
1899
|
async selectOption(select, option) {
|
|
1919
1900
|
const els = await findFields.call(this, select);
|
|
@@ -1970,7 +1951,7 @@ class Playwright extends Helper {
|
|
|
1970
1951
|
* ```
|
|
1971
1952
|
*
|
|
1972
1953
|
* @param {string} url a fragment to check
|
|
1973
|
-
*
|
|
1954
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1974
1955
|
*/
|
|
1975
1956
|
async seeInCurrentUrl(url) {
|
|
1976
1957
|
stringIncludes('url').assert(url, await this._getPageUrl());
|
|
@@ -1980,7 +1961,7 @@ class Playwright extends Helper {
|
|
|
1980
1961
|
* Checks that current url does not contain a provided fragment.
|
|
1981
1962
|
*
|
|
1982
1963
|
* @param {string} url value to check.
|
|
1983
|
-
*
|
|
1964
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1984
1965
|
*/
|
|
1985
1966
|
async dontSeeInCurrentUrl(url) {
|
|
1986
1967
|
stringIncludes('url').negate(url, await this._getPageUrl());
|
|
@@ -1997,7 +1978,7 @@ class Playwright extends Helper {
|
|
|
1997
1978
|
* ```
|
|
1998
1979
|
*
|
|
1999
1980
|
* @param {string} url value to check.
|
|
2000
|
-
*
|
|
1981
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2001
1982
|
*/
|
|
2002
1983
|
async seeCurrentUrlEquals(url) {
|
|
2003
1984
|
urlEquals(this.options.url).assert(url, await this._getPageUrl());
|
|
@@ -2013,7 +1994,7 @@ class Playwright extends Helper {
|
|
|
2013
1994
|
* ```
|
|
2014
1995
|
*
|
|
2015
1996
|
* @param {string} url value to check.
|
|
2016
|
-
*
|
|
1997
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2017
1998
|
*/
|
|
2018
1999
|
async dontSeeCurrentUrlEquals(url) {
|
|
2019
2000
|
urlEquals(this.options.url).negate(url, await this._getPageUrl());
|
|
@@ -2030,7 +2011,7 @@ class Playwright extends Helper {
|
|
|
2030
2011
|
* ```
|
|
2031
2012
|
* @param {string} text expected on page.
|
|
2032
2013
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
2033
|
-
*
|
|
2014
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2034
2015
|
*
|
|
2035
2016
|
*
|
|
2036
2017
|
*/
|
|
@@ -2047,7 +2028,7 @@ class Playwright extends Helper {
|
|
|
2047
2028
|
*
|
|
2048
2029
|
* @param {string} text element value to check.
|
|
2049
2030
|
* @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
|
|
2050
|
-
*
|
|
2031
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2051
2032
|
*/
|
|
2052
2033
|
async seeTextEquals(text, context = null) {
|
|
2053
2034
|
return proceedSee.call(this, 'assert', text, context, true);
|
|
@@ -2064,7 +2045,7 @@ class Playwright extends Helper {
|
|
|
2064
2045
|
*
|
|
2065
2046
|
* @param {string} text which is not present.
|
|
2066
2047
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
2067
|
-
*
|
|
2048
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2068
2049
|
*
|
|
2069
2050
|
*
|
|
2070
2051
|
*/
|
|
@@ -2123,7 +2104,7 @@ class Playwright extends Helper {
|
|
|
2123
2104
|
* I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
2124
2105
|
* ```
|
|
2125
2106
|
* @param {string} text value to check.
|
|
2126
|
-
*
|
|
2107
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2127
2108
|
*/
|
|
2128
2109
|
async seeInSource(text) {
|
|
2129
2110
|
const source = await this.page.content();
|
|
@@ -2138,7 +2119,7 @@ class Playwright extends Helper {
|
|
|
2138
2119
|
* ```
|
|
2139
2120
|
*
|
|
2140
2121
|
* @param {string} value to check.
|
|
2141
|
-
*
|
|
2122
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2142
2123
|
*/
|
|
2143
2124
|
async dontSeeInSource(text) {
|
|
2144
2125
|
const source = await this.page.content();
|
|
@@ -2156,7 +2137,7 @@ class Playwright extends Helper {
|
|
|
2156
2137
|
*
|
|
2157
2138
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2158
2139
|
* @param {number} num number of elements.
|
|
2159
|
-
*
|
|
2140
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2160
2141
|
*
|
|
2161
2142
|
*
|
|
2162
2143
|
*/
|
|
@@ -2175,7 +2156,7 @@ class Playwright extends Helper {
|
|
|
2175
2156
|
*
|
|
2176
2157
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2177
2158
|
* @param {number} num number of elements.
|
|
2178
|
-
*
|
|
2159
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2179
2160
|
*
|
|
2180
2161
|
*
|
|
2181
2162
|
*/
|
|
@@ -2200,7 +2181,7 @@ class Playwright extends Helper {
|
|
|
2200
2181
|
* ```
|
|
2201
2182
|
*
|
|
2202
2183
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2203
|
-
*
|
|
2184
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2204
2185
|
*/
|
|
2205
2186
|
async setCookie(cookie) {
|
|
2206
2187
|
if (Array.isArray(cookie)) {
|
|
@@ -2217,7 +2198,7 @@ class Playwright extends Helper {
|
|
|
2217
2198
|
* ```
|
|
2218
2199
|
*
|
|
2219
2200
|
* @param {string} name cookie name.
|
|
2220
|
-
*
|
|
2201
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2221
2202
|
*
|
|
2222
2203
|
*/
|
|
2223
2204
|
async seeCookie(name) {
|
|
@@ -2233,7 +2214,7 @@ class Playwright extends Helper {
|
|
|
2233
2214
|
* ```
|
|
2234
2215
|
*
|
|
2235
2216
|
* @param {string} name cookie name.
|
|
2236
|
-
*
|
|
2217
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2237
2218
|
*/
|
|
2238
2219
|
async dontSeeCookie(name) {
|
|
2239
2220
|
const cookies = await this.browserContext.cookies();
|
|
@@ -2273,7 +2254,7 @@ class Playwright extends Helper {
|
|
|
2273
2254
|
* ```
|
|
2274
2255
|
*
|
|
2275
2256
|
* @param {?string} [cookie=null] (optional, `null` by default) cookie name
|
|
2276
|
-
*
|
|
2257
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2277
2258
|
*/
|
|
2278
2259
|
async clearCookie() {
|
|
2279
2260
|
// Playwright currently doesn't support to delete a certain cookie
|
|
@@ -2304,7 +2285,6 @@ class Playwright extends Helper {
|
|
|
2304
2285
|
*
|
|
2305
2286
|
* @param {string|function} fn function to be executed in browser context.
|
|
2306
2287
|
* @param {any} [arg] optional argument to pass to the function
|
|
2307
|
-
* @return {Promise<any>}
|
|
2308
2288
|
*/
|
|
2309
2289
|
async executeScript(fn, arg) {
|
|
2310
2290
|
let context = this.page;
|
|
@@ -2502,7 +2482,7 @@ class Playwright extends Helper {
|
|
|
2502
2482
|
*
|
|
2503
2483
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2504
2484
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
2505
|
-
*
|
|
2485
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2506
2486
|
*
|
|
2507
2487
|
*/
|
|
2508
2488
|
async seeCssPropertiesOnElements(locator, cssProperties) {
|
|
@@ -2548,7 +2528,7 @@ class Playwright extends Helper {
|
|
|
2548
2528
|
*
|
|
2549
2529
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2550
2530
|
* @param {object} attributes attributes and their values to check.
|
|
2551
|
-
*
|
|
2531
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2552
2532
|
*
|
|
2553
2533
|
*/
|
|
2554
2534
|
async seeAttributesOnElements(locator, attributes) {
|
|
@@ -2587,7 +2567,7 @@ class Playwright extends Helper {
|
|
|
2587
2567
|
*
|
|
2588
2568
|
* @param {CodeceptJS.LocatorOrString} locator located by label|name|CSS|XPath|strict locator.
|
|
2589
2569
|
* @param {number} offsetX position to drag.
|
|
2590
|
-
*
|
|
2570
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2591
2571
|
*
|
|
2592
2572
|
*/
|
|
2593
2573
|
async dragSlider(locator, offsetX = 0) {
|
|
@@ -2665,7 +2645,7 @@ class Playwright extends Helper {
|
|
|
2665
2645
|
*
|
|
2666
2646
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2667
2647
|
* @param {string} fileName file name to save.
|
|
2668
|
-
*
|
|
2648
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2669
2649
|
*
|
|
2670
2650
|
*/
|
|
2671
2651
|
async saveElementScreenshot(locator, fileName) {
|
|
@@ -2691,7 +2671,7 @@ class Playwright extends Helper {
|
|
|
2691
2671
|
*
|
|
2692
2672
|
* @param {string} fileName file name to save.
|
|
2693
2673
|
* @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
2694
|
-
*
|
|
2674
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2695
2675
|
*/
|
|
2696
2676
|
async saveScreenshot(fileName, fullPage) {
|
|
2697
2677
|
const fullPageOption = fullPage || this.options.fullPageScreenshots;
|
|
@@ -2807,7 +2787,7 @@ class Playwright extends Helper {
|
|
|
2807
2787
|
* ```
|
|
2808
2788
|
*
|
|
2809
2789
|
* @param {number} sec number of second to wait.
|
|
2810
|
-
*
|
|
2790
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2811
2791
|
*/
|
|
2812
2792
|
async wait(sec) {
|
|
2813
2793
|
return new Promise(((done) => {
|
|
@@ -2821,7 +2801,7 @@ class Playwright extends Helper {
|
|
|
2821
2801
|
*
|
|
2822
2802
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2823
2803
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
2824
|
-
*
|
|
2804
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2825
2805
|
*/
|
|
2826
2806
|
async waitForEnabled(locator, sec) {
|
|
2827
2807
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2856,7 +2836,7 @@ class Playwright extends Helper {
|
|
|
2856
2836
|
* @param {LocatorOrString} field input field.
|
|
2857
2837
|
* @param {string }value expected value.
|
|
2858
2838
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2859
|
-
*
|
|
2839
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2860
2840
|
*/
|
|
2861
2841
|
async waitForValue(field, value, sec) {
|
|
2862
2842
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2892,7 +2872,7 @@ class Playwright extends Helper {
|
|
|
2892
2872
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2893
2873
|
* @param {number} num number of elements.
|
|
2894
2874
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2895
|
-
*
|
|
2875
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2896
2876
|
*
|
|
2897
2877
|
*/
|
|
2898
2878
|
async waitNumberOfVisibleElements(locator, num, sec) {
|
|
@@ -2933,7 +2913,7 @@ class Playwright extends Helper {
|
|
|
2933
2913
|
*
|
|
2934
2914
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2935
2915
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2936
|
-
*
|
|
2916
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2937
2917
|
*/
|
|
2938
2918
|
async waitForClickable(locator, waitTimeout) {
|
|
2939
2919
|
console.log('I.waitForClickable is DEPRECATED: This is no longer needed, Playwright automatically waits for element to be clickable');
|
|
@@ -2951,7 +2931,7 @@ class Playwright extends Helper {
|
|
|
2951
2931
|
*
|
|
2952
2932
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2953
2933
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2954
|
-
*
|
|
2934
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2955
2935
|
*
|
|
2956
2936
|
*/
|
|
2957
2937
|
async waitForElement(locator, sec) {
|
|
@@ -2975,7 +2955,7 @@ class Playwright extends Helper {
|
|
|
2975
2955
|
*
|
|
2976
2956
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2977
2957
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2978
|
-
*
|
|
2958
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2979
2959
|
*
|
|
2980
2960
|
* This method accepts [React selectors](https://codecept.io/react).
|
|
2981
2961
|
*/
|
|
@@ -2999,7 +2979,7 @@ class Playwright extends Helper {
|
|
|
2999
2979
|
*
|
|
3000
2980
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3001
2981
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3002
|
-
*
|
|
2982
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3003
2983
|
*/
|
|
3004
2984
|
async waitForInvisible(locator, sec) {
|
|
3005
2985
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3021,7 +3001,7 @@ class Playwright extends Helper {
|
|
|
3021
3001
|
*
|
|
3022
3002
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3023
3003
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3024
|
-
*
|
|
3004
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3025
3005
|
*/
|
|
3026
3006
|
async waitToHide(locator, sec) {
|
|
3027
3007
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3048,7 +3028,7 @@ class Playwright extends Helper {
|
|
|
3048
3028
|
*
|
|
3049
3029
|
* @param {string} urlPart value to check.
|
|
3050
3030
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3051
|
-
*
|
|
3031
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3052
3032
|
*/
|
|
3053
3033
|
async waitInUrl(urlPart, sec = null) {
|
|
3054
3034
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3076,7 +3056,7 @@ class Playwright extends Helper {
|
|
|
3076
3056
|
*
|
|
3077
3057
|
* @param {string} urlPart value to check.
|
|
3078
3058
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3079
|
-
*
|
|
3059
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3080
3060
|
*/
|
|
3081
3061
|
async waitUrlEquals(urlPart, sec = null) {
|
|
3082
3062
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3112,7 +3092,7 @@ class Playwright extends Helper {
|
|
|
3112
3092
|
* @param {string }text to wait for.
|
|
3113
3093
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3114
3094
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
3115
|
-
*
|
|
3095
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3116
3096
|
*/
|
|
3117
3097
|
async waitForText(text, sec = null, context = null) {
|
|
3118
3098
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3152,7 +3132,6 @@ class Playwright extends Helper {
|
|
|
3152
3132
|
*
|
|
3153
3133
|
* @param {string|function} urlOrPredicate
|
|
3154
3134
|
* @param {?number} [sec=null] seconds to wait
|
|
3155
|
-
* @return {Promise<any>}
|
|
3156
3135
|
*/
|
|
3157
3136
|
async waitForRequest(urlOrPredicate, sec = null) {
|
|
3158
3137
|
const timeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3169,7 +3148,6 @@ class Playwright extends Helper {
|
|
|
3169
3148
|
*
|
|
3170
3149
|
* @param {string|function} urlOrPredicate
|
|
3171
3150
|
* @param {?number} [sec=null] number of seconds to wait
|
|
3172
|
-
* @return {Promise<any>}
|
|
3173
3151
|
*/
|
|
3174
3152
|
async waitForResponse(urlOrPredicate, sec = null) {
|
|
3175
3153
|
const timeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3185,7 +3163,7 @@ class Playwright extends Helper {
|
|
|
3185
3163
|
* ```
|
|
3186
3164
|
*
|
|
3187
3165
|
* @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
3188
|
-
*
|
|
3166
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3189
3167
|
*/
|
|
3190
3168
|
async switchTo(locator) {
|
|
3191
3169
|
if (Number.isInteger(locator)) {
|
|
@@ -3243,7 +3221,7 @@ class Playwright extends Helper {
|
|
|
3243
3221
|
* @param {string|function} fn to be executed in browser context.
|
|
3244
3222
|
* @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
|
|
3245
3223
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3246
|
-
*
|
|
3224
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3247
3225
|
*/
|
|
3248
3226
|
async waitForFunction(fn, argsOrSec = null, sec = null) {
|
|
3249
3227
|
let args = [];
|
|
@@ -3265,7 +3243,6 @@ class Playwright extends Helper {
|
|
|
3265
3243
|
* See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions)
|
|
3266
3244
|
*
|
|
3267
3245
|
* @param {*} opts
|
|
3268
|
-
* @return {Promise<any>}
|
|
3269
3246
|
*/
|
|
3270
3247
|
async waitForNavigation(opts = {}) {
|
|
3271
3248
|
opts = {
|
|
@@ -3293,7 +3270,7 @@ class Playwright extends Helper {
|
|
|
3293
3270
|
*
|
|
3294
3271
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3295
3272
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3296
|
-
*
|
|
3273
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3297
3274
|
*/
|
|
3298
3275
|
async waitForDetached(locator, sec) {
|
|
3299
3276
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3339,7 +3316,7 @@ class Playwright extends Helper {
|
|
|
3339
3316
|
* loadEventEnd: 241
|
|
3340
3317
|
* }
|
|
3341
3318
|
* ```
|
|
3342
|
-
* @return {Promise<any>}
|
|
3319
|
+
* @return {Promise<any>} automatically synchronized promise through #recorder
|
|
3343
3320
|
*/
|
|
3344
3321
|
async grabDataFromPerformanceTiming() {
|
|
3345
3322
|
return perfTiming;
|
|
@@ -3385,8 +3362,7 @@ class Playwright extends Helper {
|
|
|
3385
3362
|
* This method allows intercepting and mocking requests & responses. [Learn more about it](https://playwright.dev/docs/network#handle-requests)
|
|
3386
3363
|
*
|
|
3387
3364
|
* @param {string|RegExp} [url] URL, regex or pattern for to match URL
|
|
3388
|
-
* @param {function} [handler] a function to process
|
|
3389
|
-
* @return {Promise<any>}
|
|
3365
|
+
* @param {function} [handler] a function to process reques
|
|
3390
3366
|
*/
|
|
3391
3367
|
async mockRoute(url, handler) {
|
|
3392
3368
|
return this.browserContext.route(...arguments);
|
|
@@ -3402,8 +3378,7 @@ class Playwright extends Helper {
|
|
|
3402
3378
|
* If no handler is passed, all mock requests for the rote are disabled.
|
|
3403
3379
|
*
|
|
3404
3380
|
* @param {string|RegExp} [url] URL, regex or pattern for to match URL
|
|
3405
|
-
* @param {function} [handler] a function to process
|
|
3406
|
-
* @return {Promise<any>}
|
|
3381
|
+
* @param {function} [handler] a function to process reques
|
|
3407
3382
|
*/
|
|
3408
3383
|
async stopMockingRoute(url, handler) {
|
|
3409
3384
|
return this.browserContext.unroute(...arguments);
|