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/Puppeteer.js
CHANGED
|
@@ -449,7 +449,8 @@ class Puppeteer extends Helper {
|
|
|
449
449
|
* I.seeInPopup('Popup text');
|
|
450
450
|
* ```
|
|
451
451
|
* @param {string} text value to check.
|
|
452
|
-
*
|
|
452
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
453
|
+
*
|
|
453
454
|
*/
|
|
454
455
|
async seeInPopup(text) {
|
|
455
456
|
popupStore.assertPopupVisible();
|
|
@@ -679,7 +680,8 @@ class Puppeteer extends Helper {
|
|
|
679
680
|
*
|
|
680
681
|
* @param {number} width width in pixels or `maximize`.
|
|
681
682
|
* @param {number} height height in pixels.
|
|
682
|
-
*
|
|
683
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
684
|
+
*
|
|
683
685
|
*
|
|
684
686
|
* Unlike other drivers Puppeteer changes the size of a viewport, not the window!
|
|
685
687
|
* Puppeteer does not control the window of a browser so it can't adjust its real size.
|
|
@@ -724,7 +726,8 @@ class Puppeteer extends Helper {
|
|
|
724
726
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
725
727
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
726
728
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
727
|
-
*
|
|
729
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
730
|
+
*
|
|
728
731
|
* {{ react }}
|
|
729
732
|
*/
|
|
730
733
|
async moveCursorTo(locator, offsetX = 0, offsetY = 0) {
|
|
@@ -746,7 +749,8 @@ class Puppeteer extends Helper {
|
|
|
746
749
|
*
|
|
747
750
|
* @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
|
|
748
751
|
* @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
|
|
749
|
-
*
|
|
752
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
753
|
+
*
|
|
750
754
|
*/
|
|
751
755
|
async dragAndDrop(srcElement, destElement) {
|
|
752
756
|
return proceedDragAndDrop.call(this, srcElement, destElement);
|
|
@@ -758,7 +762,8 @@ class Puppeteer extends Helper {
|
|
|
758
762
|
* ```js
|
|
759
763
|
* I.refreshPage();
|
|
760
764
|
* ```
|
|
761
|
-
*
|
|
765
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
766
|
+
*
|
|
762
767
|
*/
|
|
763
768
|
async refreshPage() {
|
|
764
769
|
return this.page.reload({ timeout: this.options.getPageTimeout, waitUntil: this.options.waitForNavigation });
|
|
@@ -770,7 +775,8 @@ class Puppeteer extends Helper {
|
|
|
770
775
|
* ```js
|
|
771
776
|
* I.scrollPageToTop();
|
|
772
777
|
* ```
|
|
773
|
-
*
|
|
778
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
779
|
+
*
|
|
774
780
|
*/
|
|
775
781
|
scrollPageToTop() {
|
|
776
782
|
return this.executeScript(() => {
|
|
@@ -784,7 +790,8 @@ class Puppeteer extends Helper {
|
|
|
784
790
|
* ```js
|
|
785
791
|
* I.scrollPageToBottom();
|
|
786
792
|
* ```
|
|
787
|
-
*
|
|
793
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
794
|
+
*
|
|
788
795
|
*/
|
|
789
796
|
scrollPageToBottom() {
|
|
790
797
|
return this.executeScript(() => {
|
|
@@ -809,7 +816,8 @@ class Puppeteer extends Helper {
|
|
|
809
816
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
810
817
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
811
818
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
812
|
-
*
|
|
819
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
820
|
+
*
|
|
813
821
|
*/
|
|
814
822
|
async scrollTo(locator, offsetX = 0, offsetY = 0) {
|
|
815
823
|
if (typeof locator === 'number' && typeof offsetX === 'number') {
|
|
@@ -839,7 +847,8 @@ class Puppeteer extends Helper {
|
|
|
839
847
|
* ```
|
|
840
848
|
*
|
|
841
849
|
* @param {string} text text value to check.
|
|
842
|
-
*
|
|
850
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
851
|
+
*
|
|
843
852
|
*/
|
|
844
853
|
async seeInTitle(text) {
|
|
845
854
|
const title = await this.page.title();
|
|
@@ -877,7 +886,8 @@ class Puppeteer extends Helper {
|
|
|
877
886
|
* ```
|
|
878
887
|
*
|
|
879
888
|
* @param {string} text value to check.
|
|
880
|
-
*
|
|
889
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
890
|
+
*
|
|
881
891
|
*/
|
|
882
892
|
async seeTitleEquals(text) {
|
|
883
893
|
const title = await this.page.title();
|
|
@@ -892,7 +902,8 @@ class Puppeteer extends Helper {
|
|
|
892
902
|
* ```
|
|
893
903
|
*
|
|
894
904
|
* @param {string} text value to check.
|
|
895
|
-
*
|
|
905
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
906
|
+
*
|
|
896
907
|
*/
|
|
897
908
|
async dontSeeInTitle(text) {
|
|
898
909
|
const title = await this.page.title();
|
|
@@ -1081,7 +1092,8 @@ class Puppeteer extends Helper {
|
|
|
1081
1092
|
* I.seeElement('#modal');
|
|
1082
1093
|
* ```
|
|
1083
1094
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1084
|
-
*
|
|
1095
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1096
|
+
*
|
|
1085
1097
|
* {{ react }}
|
|
1086
1098
|
*/
|
|
1087
1099
|
async seeElement(locator) {
|
|
@@ -1101,7 +1113,8 @@ class Puppeteer extends Helper {
|
|
|
1101
1113
|
* ```
|
|
1102
1114
|
*
|
|
1103
1115
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1104
|
-
*
|
|
1116
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1117
|
+
*
|
|
1105
1118
|
* {{ react }}
|
|
1106
1119
|
*/
|
|
1107
1120
|
async dontSeeElement(locator) {
|
|
@@ -1121,7 +1134,8 @@ class Puppeteer extends Helper {
|
|
|
1121
1134
|
* I.seeElementInDOM('#modal');
|
|
1122
1135
|
* ```
|
|
1123
1136
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1124
|
-
*
|
|
1137
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1138
|
+
*
|
|
1125
1139
|
*/
|
|
1126
1140
|
async seeElementInDOM(locator) {
|
|
1127
1141
|
const els = await this._locate(locator);
|
|
@@ -1136,7 +1150,8 @@ class Puppeteer extends Helper {
|
|
|
1136
1150
|
* ```
|
|
1137
1151
|
*
|
|
1138
1152
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1139
|
-
*
|
|
1153
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1154
|
+
*
|
|
1140
1155
|
*/
|
|
1141
1156
|
async dontSeeElementInDOM(locator) {
|
|
1142
1157
|
const els = await this._locate(locator);
|
|
@@ -1168,7 +1183,7 @@ class Puppeteer extends Helper {
|
|
|
1168
1183
|
*
|
|
1169
1184
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1170
1185
|
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1171
|
-
*
|
|
1186
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1172
1187
|
*
|
|
1173
1188
|
*
|
|
1174
1189
|
* {{ react }}
|
|
@@ -1205,7 +1220,7 @@ class Puppeteer extends Helper {
|
|
|
1205
1220
|
*
|
|
1206
1221
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1207
1222
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1208
|
-
*
|
|
1223
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1209
1224
|
*
|
|
1210
1225
|
*
|
|
1211
1226
|
* {{ react }}
|
|
@@ -1243,7 +1258,8 @@ class Puppeteer extends Helper {
|
|
|
1243
1258
|
* ```
|
|
1244
1259
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator
|
|
1245
1260
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator
|
|
1246
|
-
*
|
|
1261
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1262
|
+
*
|
|
1247
1263
|
*
|
|
1248
1264
|
* {{ react }}
|
|
1249
1265
|
*/
|
|
@@ -1361,7 +1377,8 @@ class Puppeteer extends Helper {
|
|
|
1361
1377
|
*
|
|
1362
1378
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1363
1379
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1364
|
-
*
|
|
1380
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1381
|
+
*
|
|
1365
1382
|
*
|
|
1366
1383
|
* {{ react }}
|
|
1367
1384
|
*/
|
|
@@ -1383,7 +1400,8 @@ class Puppeteer extends Helper {
|
|
|
1383
1400
|
*
|
|
1384
1401
|
* @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
|
|
1385
1402
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1386
|
-
*
|
|
1403
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1404
|
+
*
|
|
1387
1405
|
*
|
|
1388
1406
|
* {{ react }}
|
|
1389
1407
|
*/
|
|
@@ -1404,7 +1422,8 @@ class Puppeteer extends Helper {
|
|
|
1404
1422
|
* ```
|
|
1405
1423
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1406
1424
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1407
|
-
*
|
|
1425
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1426
|
+
*
|
|
1408
1427
|
*/
|
|
1409
1428
|
async checkOption(field, context = null) {
|
|
1410
1429
|
const elm = await this._locateCheckable(field, context);
|
|
@@ -1430,7 +1449,8 @@ class Puppeteer extends Helper {
|
|
|
1430
1449
|
* ```
|
|
1431
1450
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1432
1451
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1433
|
-
*
|
|
1452
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1453
|
+
*
|
|
1434
1454
|
*/
|
|
1435
1455
|
async uncheckOption(field, context = null) {
|
|
1436
1456
|
const elm = await this._locateCheckable(field, context);
|
|
@@ -1453,7 +1473,8 @@ class Puppeteer extends Helper {
|
|
|
1453
1473
|
* ```
|
|
1454
1474
|
*
|
|
1455
1475
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1456
|
-
*
|
|
1476
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1477
|
+
*
|
|
1457
1478
|
*/
|
|
1458
1479
|
async seeCheckboxIsChecked(field) {
|
|
1459
1480
|
return proceedIsChecked.call(this, 'assert', field);
|
|
@@ -1469,7 +1490,8 @@ class Puppeteer extends Helper {
|
|
|
1469
1490
|
* ```
|
|
1470
1491
|
*
|
|
1471
1492
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1472
|
-
*
|
|
1493
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1494
|
+
*
|
|
1473
1495
|
*/
|
|
1474
1496
|
async dontSeeCheckboxIsChecked(field) {
|
|
1475
1497
|
return proceedIsChecked.call(this, 'negate', field);
|
|
@@ -1487,7 +1509,8 @@ class Puppeteer extends Helper {
|
|
|
1487
1509
|
* ```
|
|
1488
1510
|
*
|
|
1489
1511
|
* @param {string} key name of key to press down.
|
|
1490
|
-
*
|
|
1512
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1513
|
+
*
|
|
1491
1514
|
*/
|
|
1492
1515
|
async pressKeyDown(key) {
|
|
1493
1516
|
key = getNormalizedKey.call(this, key);
|
|
@@ -1507,7 +1530,8 @@ class Puppeteer extends Helper {
|
|
|
1507
1530
|
* ```
|
|
1508
1531
|
*
|
|
1509
1532
|
* @param {string} key name of key to release.
|
|
1510
|
-
*
|
|
1533
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1534
|
+
*
|
|
1511
1535
|
*/
|
|
1512
1536
|
async pressKeyUp(key) {
|
|
1513
1537
|
key = getNormalizedKey.call(this, key);
|
|
@@ -1575,7 +1599,7 @@ class Puppeteer extends Helper {
|
|
|
1575
1599
|
* - `'Tab'`
|
|
1576
1600
|
*
|
|
1577
1601
|
* @param {string|string[]} key key or array of keys to press.
|
|
1578
|
-
*
|
|
1602
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1579
1603
|
*
|
|
1580
1604
|
*
|
|
1581
1605
|
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
|
|
@@ -1623,7 +1647,8 @@ class Puppeteer extends Helper {
|
|
|
1623
1647
|
*
|
|
1624
1648
|
* @param {string|string[]} key or array of keys to type.
|
|
1625
1649
|
* @param {?number} [delay=null] (optional) delay in ms between key presses
|
|
1626
|
-
*
|
|
1650
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1651
|
+
*
|
|
1627
1652
|
*/
|
|
1628
1653
|
async type(keys, delay = null) {
|
|
1629
1654
|
if (!Array.isArray(keys)) {
|
|
@@ -1652,7 +1677,8 @@ class Puppeteer extends Helper {
|
|
|
1652
1677
|
* ```
|
|
1653
1678
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1654
1679
|
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1655
|
-
*
|
|
1680
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1681
|
+
*
|
|
1656
1682
|
* {{ react }}
|
|
1657
1683
|
*/
|
|
1658
1684
|
async fillField(field, value) {
|
|
@@ -1679,7 +1705,8 @@ class Puppeteer extends Helper {
|
|
|
1679
1705
|
* I.clearField('#email');
|
|
1680
1706
|
* ```
|
|
1681
1707
|
* @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
|
|
1682
|
-
*
|
|
1708
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder.
|
|
1709
|
+
*
|
|
1683
1710
|
*/
|
|
1684
1711
|
async clearField(field) {
|
|
1685
1712
|
return this.fillField(field, '');
|
|
@@ -1694,7 +1721,8 @@ class Puppeteer extends Helper {
|
|
|
1694
1721
|
* ```
|
|
1695
1722
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
1696
1723
|
* @param {string} value text value to append.
|
|
1697
|
-
*
|
|
1724
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1725
|
+
*
|
|
1698
1726
|
*
|
|
1699
1727
|
* {{ react }}
|
|
1700
1728
|
*/
|
|
@@ -1718,7 +1746,8 @@ class Puppeteer extends Helper {
|
|
|
1718
1746
|
* ```
|
|
1719
1747
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1720
1748
|
* @param {string} value value to check.
|
|
1721
|
-
*
|
|
1749
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1750
|
+
*
|
|
1722
1751
|
*/
|
|
1723
1752
|
async seeInField(field, value) {
|
|
1724
1753
|
return proceedSeeInField.call(this, 'assert', field, value);
|
|
@@ -1735,7 +1764,8 @@ class Puppeteer extends Helper {
|
|
|
1735
1764
|
*
|
|
1736
1765
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1737
1766
|
* @param {string} value value to check.
|
|
1738
|
-
*
|
|
1767
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1768
|
+
*
|
|
1739
1769
|
*/
|
|
1740
1770
|
async dontSeeInField(field, value) {
|
|
1741
1771
|
return proceedSeeInField.call(this, 'negate', field, value);
|
|
@@ -1743,7 +1773,7 @@ class Puppeteer extends Helper {
|
|
|
1743
1773
|
|
|
1744
1774
|
/**
|
|
1745
1775
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
1746
|
-
* Path to file is relative current codecept directory (where codecept.
|
|
1776
|
+
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
1747
1777
|
* File will be uploaded to remote system (if tests are running remotely).
|
|
1748
1778
|
*
|
|
1749
1779
|
* ```js
|
|
@@ -1752,8 +1782,9 @@ class Puppeteer extends Helper {
|
|
|
1752
1782
|
* ```
|
|
1753
1783
|
*
|
|
1754
1784
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
1755
|
-
* @param {string} pathToFile local file path relative to codecept.
|
|
1756
|
-
*
|
|
1785
|
+
* @param {string} pathToFile local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
1786
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1787
|
+
*
|
|
1757
1788
|
*
|
|
1758
1789
|
* > ⚠ There is an [issue with file upload in Puppeteer 2.1.0 & 2.1.1](https://github.com/puppeteer/puppeteer/issues/5420), downgrade to 2.0.0 if you face it.
|
|
1759
1790
|
*/
|
|
@@ -1790,7 +1821,8 @@ class Puppeteer extends Helper {
|
|
|
1790
1821
|
* ```
|
|
1791
1822
|
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
1792
1823
|
* @param {string|Array<*>} option visible text or value of option.
|
|
1793
|
-
*
|
|
1824
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1825
|
+
*
|
|
1794
1826
|
*/
|
|
1795
1827
|
async selectOption(select, option) {
|
|
1796
1828
|
const els = await findVisibleFields.call(this, select);
|
|
@@ -1850,7 +1882,8 @@ class Puppeteer extends Helper {
|
|
|
1850
1882
|
* ```
|
|
1851
1883
|
*
|
|
1852
1884
|
* @param {string} url a fragment to check
|
|
1853
|
-
*
|
|
1885
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1886
|
+
*
|
|
1854
1887
|
*/
|
|
1855
1888
|
async seeInCurrentUrl(url) {
|
|
1856
1889
|
stringIncludes('url').assert(url, await this._getPageUrl());
|
|
@@ -1860,7 +1893,8 @@ class Puppeteer extends Helper {
|
|
|
1860
1893
|
* Checks that current url does not contain a provided fragment.
|
|
1861
1894
|
*
|
|
1862
1895
|
* @param {string} url value to check.
|
|
1863
|
-
*
|
|
1896
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1897
|
+
*
|
|
1864
1898
|
*/
|
|
1865
1899
|
async dontSeeInCurrentUrl(url) {
|
|
1866
1900
|
stringIncludes('url').negate(url, await this._getPageUrl());
|
|
@@ -1877,7 +1911,8 @@ class Puppeteer extends Helper {
|
|
|
1877
1911
|
* ```
|
|
1878
1912
|
*
|
|
1879
1913
|
* @param {string} url value to check.
|
|
1880
|
-
*
|
|
1914
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1915
|
+
*
|
|
1881
1916
|
*/
|
|
1882
1917
|
async seeCurrentUrlEquals(url) {
|
|
1883
1918
|
urlEquals(this.options.url).assert(url, await this._getPageUrl());
|
|
@@ -1893,7 +1928,8 @@ class Puppeteer extends Helper {
|
|
|
1893
1928
|
* ```
|
|
1894
1929
|
*
|
|
1895
1930
|
* @param {string} url value to check.
|
|
1896
|
-
*
|
|
1931
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1932
|
+
*
|
|
1897
1933
|
*/
|
|
1898
1934
|
async dontSeeCurrentUrlEquals(url) {
|
|
1899
1935
|
urlEquals(this.options.url).negate(url, await this._getPageUrl());
|
|
@@ -1910,7 +1946,8 @@ class Puppeteer extends Helper {
|
|
|
1910
1946
|
* ```
|
|
1911
1947
|
* @param {string} text expected on page.
|
|
1912
1948
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1913
|
-
*
|
|
1949
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1950
|
+
*
|
|
1914
1951
|
*
|
|
1915
1952
|
* {{ react }}
|
|
1916
1953
|
*/
|
|
@@ -1927,7 +1964,8 @@ class Puppeteer extends Helper {
|
|
|
1927
1964
|
*
|
|
1928
1965
|
* @param {string} text element value to check.
|
|
1929
1966
|
* @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
|
|
1930
|
-
*
|
|
1967
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1968
|
+
*
|
|
1931
1969
|
*/
|
|
1932
1970
|
async seeTextEquals(text, context = null) {
|
|
1933
1971
|
return proceedSee.call(this, 'assert', text, context, true);
|
|
@@ -1944,7 +1982,8 @@ class Puppeteer extends Helper {
|
|
|
1944
1982
|
*
|
|
1945
1983
|
* @param {string} text which is not present.
|
|
1946
1984
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
1947
|
-
*
|
|
1985
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1986
|
+
*
|
|
1948
1987
|
*
|
|
1949
1988
|
* {{ react }}
|
|
1950
1989
|
*/
|
|
@@ -2003,7 +2042,8 @@ class Puppeteer extends Helper {
|
|
|
2003
2042
|
* I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
2004
2043
|
* ```
|
|
2005
2044
|
* @param {string} text value to check.
|
|
2006
|
-
*
|
|
2045
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2046
|
+
*
|
|
2007
2047
|
*/
|
|
2008
2048
|
async seeInSource(text) {
|
|
2009
2049
|
const source = await this.page.content();
|
|
@@ -2018,7 +2058,8 @@ class Puppeteer extends Helper {
|
|
|
2018
2058
|
* ```
|
|
2019
2059
|
*
|
|
2020
2060
|
* @param {string} value to check.
|
|
2021
|
-
*
|
|
2061
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2062
|
+
*
|
|
2022
2063
|
*/
|
|
2023
2064
|
async dontSeeInSource(text) {
|
|
2024
2065
|
const source = await this.page.content();
|
|
@@ -2036,7 +2077,8 @@ class Puppeteer extends Helper {
|
|
|
2036
2077
|
*
|
|
2037
2078
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2038
2079
|
* @param {number} num number of elements.
|
|
2039
|
-
*
|
|
2080
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2081
|
+
*
|
|
2040
2082
|
*
|
|
2041
2083
|
* {{ react }}
|
|
2042
2084
|
*/
|
|
@@ -2055,7 +2097,8 @@ class Puppeteer extends Helper {
|
|
|
2055
2097
|
*
|
|
2056
2098
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2057
2099
|
* @param {number} num number of elements.
|
|
2058
|
-
*
|
|
2100
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2101
|
+
*
|
|
2059
2102
|
*
|
|
2060
2103
|
* {{ react }}
|
|
2061
2104
|
*/
|
|
@@ -2080,7 +2123,8 @@ class Puppeteer extends Helper {
|
|
|
2080
2123
|
* ```
|
|
2081
2124
|
*
|
|
2082
2125
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2083
|
-
*
|
|
2126
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2127
|
+
*
|
|
2084
2128
|
*/
|
|
2085
2129
|
async setCookie(cookie) {
|
|
2086
2130
|
if (Array.isArray(cookie)) {
|
|
@@ -2097,7 +2141,8 @@ class Puppeteer extends Helper {
|
|
|
2097
2141
|
* ```
|
|
2098
2142
|
*
|
|
2099
2143
|
* @param {string} name cookie name.
|
|
2100
|
-
*
|
|
2144
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2145
|
+
*
|
|
2101
2146
|
*
|
|
2102
2147
|
*/
|
|
2103
2148
|
async seeCookie(name) {
|
|
@@ -2113,7 +2158,8 @@ class Puppeteer extends Helper {
|
|
|
2113
2158
|
* ```
|
|
2114
2159
|
*
|
|
2115
2160
|
* @param {string} name cookie name.
|
|
2116
|
-
*
|
|
2161
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2162
|
+
*
|
|
2117
2163
|
*/
|
|
2118
2164
|
async dontSeeCookie(name) {
|
|
2119
2165
|
const cookies = await this.page.cookies();
|
|
@@ -2153,7 +2199,8 @@ class Puppeteer extends Helper {
|
|
|
2153
2199
|
* ```
|
|
2154
2200
|
*
|
|
2155
2201
|
* @param {?string} [cookie=null] (optional, `null` by default) cookie name
|
|
2156
|
-
*
|
|
2202
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2203
|
+
*
|
|
2157
2204
|
*/
|
|
2158
2205
|
async clearCookie(name) {
|
|
2159
2206
|
const cookies = await this.page.cookies();
|
|
@@ -2191,7 +2238,7 @@ class Puppeteer extends Helper {
|
|
|
2191
2238
|
*
|
|
2192
2239
|
* @param {string|function} fn function to be executed in browser context.
|
|
2193
2240
|
* @param {...any} args to be passed to function.
|
|
2194
|
-
*
|
|
2241
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2195
2242
|
*
|
|
2196
2243
|
*
|
|
2197
2244
|
* If a function returns a Promise It will wait for it resolution.
|
|
@@ -2228,7 +2275,7 @@ class Puppeteer extends Helper {
|
|
|
2228
2275
|
*
|
|
2229
2276
|
* @param {string|function} fn function to be executed in browser context.
|
|
2230
2277
|
* @param {...any} args to be passed to function.
|
|
2231
|
-
*
|
|
2278
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2232
2279
|
*
|
|
2233
2280
|
*
|
|
2234
2281
|
* Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
@@ -2433,7 +2480,8 @@ class Puppeteer extends Helper {
|
|
|
2433
2480
|
*
|
|
2434
2481
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2435
2482
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
2436
|
-
*
|
|
2483
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2484
|
+
*
|
|
2437
2485
|
* {{ react }}
|
|
2438
2486
|
*/
|
|
2439
2487
|
async seeCssPropertiesOnElements(locator, cssProperties) {
|
|
@@ -2480,7 +2528,8 @@ class Puppeteer extends Helper {
|
|
|
2480
2528
|
*
|
|
2481
2529
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2482
2530
|
* @param {object} attributes attributes and their values to check.
|
|
2483
|
-
*
|
|
2531
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2532
|
+
*
|
|
2484
2533
|
* {{ react }}
|
|
2485
2534
|
*/
|
|
2486
2535
|
async seeAttributesOnElements(locator, attributes) {
|
|
@@ -2521,7 +2570,8 @@ class Puppeteer extends Helper {
|
|
|
2521
2570
|
*
|
|
2522
2571
|
* @param {CodeceptJS.LocatorOrString} locator located by label|name|CSS|XPath|strict locator.
|
|
2523
2572
|
* @param {number} offsetX position to drag.
|
|
2524
|
-
*
|
|
2573
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2574
|
+
*
|
|
2525
2575
|
* {{ react }}
|
|
2526
2576
|
*/
|
|
2527
2577
|
async dragSlider(locator, offsetX = 0) {
|
|
@@ -2590,7 +2640,7 @@ class Puppeteer extends Helper {
|
|
|
2590
2640
|
}
|
|
2591
2641
|
|
|
2592
2642
|
/**
|
|
2593
|
-
* Saves screenshot of the specified locator to ouput folder (set in codecept.
|
|
2643
|
+
* Saves screenshot of the specified locator to ouput folder (set in codecept.conf.ts or codecept.conf.js).
|
|
2594
2644
|
* Filename is relative to output folder.
|
|
2595
2645
|
*
|
|
2596
2646
|
* ```js
|
|
@@ -2599,7 +2649,8 @@ class Puppeteer extends Helper {
|
|
|
2599
2649
|
*
|
|
2600
2650
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2601
2651
|
* @param {string} fileName file name to save.
|
|
2602
|
-
*
|
|
2652
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2653
|
+
*
|
|
2603
2654
|
*/
|
|
2604
2655
|
async saveElementScreenshot(locator, fileName) {
|
|
2605
2656
|
const outputFile = screenshotOutputFolder(fileName);
|
|
@@ -2613,7 +2664,7 @@ class Puppeteer extends Helper {
|
|
|
2613
2664
|
}
|
|
2614
2665
|
|
|
2615
2666
|
/**
|
|
2616
|
-
* Saves a screenshot to ouput folder (set in codecept.
|
|
2667
|
+
* Saves a screenshot to ouput folder (set in codecept.conf.ts or codecept.conf.js).
|
|
2617
2668
|
* Filename is relative to output folder.
|
|
2618
2669
|
* 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.
|
|
2619
2670
|
*
|
|
@@ -2624,7 +2675,8 @@ class Puppeteer extends Helper {
|
|
|
2624
2675
|
*
|
|
2625
2676
|
* @param {string} fileName file name to save.
|
|
2626
2677
|
* @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
2627
|
-
*
|
|
2678
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2679
|
+
*
|
|
2628
2680
|
*/
|
|
2629
2681
|
async saveScreenshot(fileName, fullPage) {
|
|
2630
2682
|
const fullPageOption = fullPage || this.options.fullPageScreenshots;
|
|
@@ -2659,7 +2711,8 @@ class Puppeteer extends Helper {
|
|
|
2659
2711
|
* ```
|
|
2660
2712
|
*
|
|
2661
2713
|
* @param {number} sec number of second to wait.
|
|
2662
|
-
*
|
|
2714
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2715
|
+
*
|
|
2663
2716
|
*/
|
|
2664
2717
|
async wait(sec) {
|
|
2665
2718
|
return new Promise(((done) => {
|
|
@@ -2673,7 +2726,8 @@ class Puppeteer extends Helper {
|
|
|
2673
2726
|
*
|
|
2674
2727
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2675
2728
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
2676
|
-
*
|
|
2729
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2730
|
+
*
|
|
2677
2731
|
*/
|
|
2678
2732
|
async waitForEnabled(locator, sec) {
|
|
2679
2733
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2712,7 +2766,8 @@ class Puppeteer extends Helper {
|
|
|
2712
2766
|
* @param {LocatorOrString} field input field.
|
|
2713
2767
|
* @param {string }value expected value.
|
|
2714
2768
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2715
|
-
*
|
|
2769
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2770
|
+
*
|
|
2716
2771
|
*/
|
|
2717
2772
|
async waitForValue(field, value, sec) {
|
|
2718
2773
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2752,7 +2807,8 @@ class Puppeteer extends Helper {
|
|
|
2752
2807
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2753
2808
|
* @param {number} num number of elements.
|
|
2754
2809
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2755
|
-
*
|
|
2810
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2811
|
+
*
|
|
2756
2812
|
* {{ react }}
|
|
2757
2813
|
*/
|
|
2758
2814
|
async waitNumberOfVisibleElements(locator, num, sec) {
|
|
@@ -2793,7 +2849,8 @@ class Puppeteer extends Helper {
|
|
|
2793
2849
|
*
|
|
2794
2850
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2795
2851
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2796
|
-
*
|
|
2852
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2853
|
+
*
|
|
2797
2854
|
*/
|
|
2798
2855
|
async waitForClickable(locator, waitTimeout) {
|
|
2799
2856
|
const els = await this._locate(locator);
|
|
@@ -2819,7 +2876,8 @@ class Puppeteer extends Helper {
|
|
|
2819
2876
|
*
|
|
2820
2877
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2821
2878
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2822
|
-
*
|
|
2879
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2880
|
+
*
|
|
2823
2881
|
* {{ react }}
|
|
2824
2882
|
*/
|
|
2825
2883
|
async waitForElement(locator, sec) {
|
|
@@ -2848,7 +2906,8 @@ class Puppeteer extends Helper {
|
|
|
2848
2906
|
*
|
|
2849
2907
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2850
2908
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2851
|
-
*
|
|
2909
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2910
|
+
*
|
|
2852
2911
|
*
|
|
2853
2912
|
* This method accepts [React selectors](https://codecept.io/react).
|
|
2854
2913
|
*/
|
|
@@ -2878,7 +2937,8 @@ class Puppeteer extends Helper {
|
|
|
2878
2937
|
*
|
|
2879
2938
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2880
2939
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2881
|
-
*
|
|
2940
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2941
|
+
*
|
|
2882
2942
|
*/
|
|
2883
2943
|
async waitForInvisible(locator, sec) {
|
|
2884
2944
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2906,7 +2966,8 @@ class Puppeteer extends Helper {
|
|
|
2906
2966
|
*
|
|
2907
2967
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2908
2968
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2909
|
-
*
|
|
2969
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2970
|
+
*
|
|
2910
2971
|
*/
|
|
2911
2972
|
async waitToHide(locator, sec) {
|
|
2912
2973
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2939,7 +3000,8 @@ class Puppeteer extends Helper {
|
|
|
2939
3000
|
*
|
|
2940
3001
|
* @param {string} urlPart value to check.
|
|
2941
3002
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2942
|
-
*
|
|
3003
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3004
|
+
*
|
|
2943
3005
|
*/
|
|
2944
3006
|
async waitInUrl(urlPart, sec = null) {
|
|
2945
3007
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2967,7 +3029,8 @@ class Puppeteer extends Helper {
|
|
|
2967
3029
|
*
|
|
2968
3030
|
* @param {string} urlPart value to check.
|
|
2969
3031
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2970
|
-
*
|
|
3032
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3033
|
+
*
|
|
2971
3034
|
*/
|
|
2972
3035
|
async waitUrlEquals(urlPart, sec = null) {
|
|
2973
3036
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3003,7 +3066,8 @@ class Puppeteer extends Helper {
|
|
|
3003
3066
|
* @param {string }text to wait for.
|
|
3004
3067
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3005
3068
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
3006
|
-
*
|
|
3069
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3070
|
+
*
|
|
3007
3071
|
*/
|
|
3008
3072
|
async waitForText(text, sec = null, context = null) {
|
|
3009
3073
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3079,7 +3143,8 @@ class Puppeteer extends Helper {
|
|
|
3079
3143
|
* ```
|
|
3080
3144
|
*
|
|
3081
3145
|
* @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
3082
|
-
*
|
|
3146
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3147
|
+
*
|
|
3083
3148
|
*/
|
|
3084
3149
|
async switchTo(locator) {
|
|
3085
3150
|
if (Number.isInteger(locator)) {
|
|
@@ -3133,7 +3198,8 @@ class Puppeteer extends Helper {
|
|
|
3133
3198
|
* @param {string|function} fn to be executed in browser context.
|
|
3134
3199
|
* @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
|
|
3135
3200
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3136
|
-
*
|
|
3201
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3202
|
+
*
|
|
3137
3203
|
*/
|
|
3138
3204
|
async waitForFunction(fn, argsOrSec = null, sec = null) {
|
|
3139
3205
|
let args = [];
|
|
@@ -3182,7 +3248,8 @@ class Puppeteer extends Helper {
|
|
|
3182
3248
|
*
|
|
3183
3249
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3184
3250
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3185
|
-
*
|
|
3251
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3252
|
+
*
|
|
3186
3253
|
*/
|
|
3187
3254
|
async waitForDetached(locator, sec) {
|
|
3188
3255
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|