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/Puppeteer.js
CHANGED
|
@@ -444,7 +444,7 @@ class Puppeteer extends Helper {
|
|
|
444
444
|
* I.seeInPopup('Popup text');
|
|
445
445
|
* ```
|
|
446
446
|
* @param {string} text value to check.
|
|
447
|
-
*
|
|
447
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
448
448
|
*/
|
|
449
449
|
async seeInPopup(text) {
|
|
450
450
|
popupStore.assertPopupVisible();
|
|
@@ -639,7 +639,7 @@ class Puppeteer extends Helper {
|
|
|
639
639
|
* ```
|
|
640
640
|
*
|
|
641
641
|
* @param {string} url url path or global url.
|
|
642
|
-
* @return {
|
|
642
|
+
* @return {void} automatically synchronized promise with recorder #!
|
|
643
643
|
*/
|
|
644
644
|
async amOnPage(url) {
|
|
645
645
|
if (!(/^\w+\:\/\//.test(url))) {
|
|
@@ -674,7 +674,7 @@ class Puppeteer extends Helper {
|
|
|
674
674
|
*
|
|
675
675
|
* @param {number} width width in pixels or `maximize`.
|
|
676
676
|
* @param {number} height height in pixels.
|
|
677
|
-
*
|
|
677
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
678
678
|
*
|
|
679
679
|
* Unlike other drivers Puppeteer changes the size of a viewport, not the window!
|
|
680
680
|
* Puppeteer does not control the window of a browser so it can't adjust its real size.
|
|
@@ -719,7 +719,7 @@ class Puppeteer extends Helper {
|
|
|
719
719
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
720
720
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
721
721
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
722
|
-
*
|
|
722
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
723
723
|
* {{ react }}
|
|
724
724
|
*/
|
|
725
725
|
async moveCursorTo(locator, offsetX = 0, offsetY = 0) {
|
|
@@ -741,7 +741,7 @@ class Puppeteer extends Helper {
|
|
|
741
741
|
*
|
|
742
742
|
* @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
|
|
743
743
|
* @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
|
|
744
|
-
*
|
|
744
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
745
745
|
*/
|
|
746
746
|
async dragAndDrop(srcElement, destElement) {
|
|
747
747
|
return proceedDragAndDrop.call(this, srcElement, destElement);
|
|
@@ -753,7 +753,7 @@ class Puppeteer extends Helper {
|
|
|
753
753
|
* ```js
|
|
754
754
|
* I.refreshPage();
|
|
755
755
|
* ```
|
|
756
|
-
*
|
|
756
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
757
757
|
*/
|
|
758
758
|
async refreshPage() {
|
|
759
759
|
return this.page.reload({ timeout: this.options.getPageTimeout, waitUntil: this.options.waitForNavigation });
|
|
@@ -765,7 +765,7 @@ class Puppeteer extends Helper {
|
|
|
765
765
|
* ```js
|
|
766
766
|
* I.scrollPageToTop();
|
|
767
767
|
* ```
|
|
768
|
-
*
|
|
768
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
769
769
|
*/
|
|
770
770
|
scrollPageToTop() {
|
|
771
771
|
return this.executeScript(() => {
|
|
@@ -779,7 +779,7 @@ class Puppeteer extends Helper {
|
|
|
779
779
|
* ```js
|
|
780
780
|
* I.scrollPageToBottom();
|
|
781
781
|
* ```
|
|
782
|
-
*
|
|
782
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
783
783
|
*/
|
|
784
784
|
scrollPageToBottom() {
|
|
785
785
|
return this.executeScript(() => {
|
|
@@ -804,7 +804,7 @@ class Puppeteer extends Helper {
|
|
|
804
804
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
805
805
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
806
806
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
807
|
-
*
|
|
807
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
808
808
|
*/
|
|
809
809
|
async scrollTo(locator, offsetX = 0, offsetY = 0) {
|
|
810
810
|
if (typeof locator === 'number' && typeof offsetX === 'number') {
|
|
@@ -833,7 +833,7 @@ class Puppeteer extends Helper {
|
|
|
833
833
|
* ```
|
|
834
834
|
*
|
|
835
835
|
* @param {string} text text value to check.
|
|
836
|
-
*
|
|
836
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
837
837
|
*/
|
|
838
838
|
async seeInTitle(text) {
|
|
839
839
|
const title = await this.page.title();
|
|
@@ -871,7 +871,7 @@ class Puppeteer extends Helper {
|
|
|
871
871
|
* ```
|
|
872
872
|
*
|
|
873
873
|
* @param {string} text value to check.
|
|
874
|
-
*
|
|
874
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
875
875
|
*/
|
|
876
876
|
async seeTitleEquals(text) {
|
|
877
877
|
const title = await this.page.title();
|
|
@@ -886,7 +886,7 @@ class Puppeteer extends Helper {
|
|
|
886
886
|
* ```
|
|
887
887
|
*
|
|
888
888
|
* @param {string} text value to check.
|
|
889
|
-
*
|
|
889
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
890
890
|
*/
|
|
891
891
|
async dontSeeInTitle(text) {
|
|
892
892
|
const title = await this.page.title();
|
|
@@ -1075,7 +1075,7 @@ class Puppeteer extends Helper {
|
|
|
1075
1075
|
* I.seeElement('#modal');
|
|
1076
1076
|
* ```
|
|
1077
1077
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1078
|
-
*
|
|
1078
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1079
1079
|
* {{ react }}
|
|
1080
1080
|
*/
|
|
1081
1081
|
async seeElement(locator) {
|
|
@@ -1095,7 +1095,7 @@ class Puppeteer extends Helper {
|
|
|
1095
1095
|
* ```
|
|
1096
1096
|
*
|
|
1097
1097
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1098
|
-
*
|
|
1098
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1099
1099
|
* {{ react }}
|
|
1100
1100
|
*/
|
|
1101
1101
|
async dontSeeElement(locator) {
|
|
@@ -1115,7 +1115,7 @@ class Puppeteer extends Helper {
|
|
|
1115
1115
|
* I.seeElementInDOM('#modal');
|
|
1116
1116
|
* ```
|
|
1117
1117
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1118
|
-
*
|
|
1118
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1119
1119
|
*/
|
|
1120
1120
|
async seeElementInDOM(locator) {
|
|
1121
1121
|
const els = await this._locate(locator);
|
|
@@ -1130,7 +1130,7 @@ class Puppeteer extends Helper {
|
|
|
1130
1130
|
* ```
|
|
1131
1131
|
*
|
|
1132
1132
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1133
|
-
*
|
|
1133
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1134
1134
|
*/
|
|
1135
1135
|
async dontSeeElementInDOM(locator) {
|
|
1136
1136
|
const els = await this._locate(locator);
|
|
@@ -1162,7 +1162,7 @@ class Puppeteer extends Helper {
|
|
|
1162
1162
|
*
|
|
1163
1163
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1164
1164
|
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1165
|
-
*
|
|
1165
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1166
1166
|
*
|
|
1167
1167
|
*
|
|
1168
1168
|
* {{ react }}
|
|
@@ -1199,7 +1199,7 @@ class Puppeteer extends Helper {
|
|
|
1199
1199
|
*
|
|
1200
1200
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1201
1201
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1202
|
-
*
|
|
1202
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1203
1203
|
*
|
|
1204
1204
|
*
|
|
1205
1205
|
* {{ react }}
|
|
@@ -1237,7 +1237,7 @@ class Puppeteer extends Helper {
|
|
|
1237
1237
|
* ```
|
|
1238
1238
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator
|
|
1239
1239
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator
|
|
1240
|
-
*
|
|
1240
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1241
1241
|
*
|
|
1242
1242
|
* {{ react }}
|
|
1243
1243
|
*/
|
|
@@ -1350,7 +1350,7 @@ class Puppeteer extends Helper {
|
|
|
1350
1350
|
*
|
|
1351
1351
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1352
1352
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1353
|
-
*
|
|
1353
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1354
1354
|
*
|
|
1355
1355
|
* {{ react }}
|
|
1356
1356
|
*/
|
|
@@ -1372,7 +1372,7 @@ class Puppeteer extends Helper {
|
|
|
1372
1372
|
*
|
|
1373
1373
|
* @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
|
|
1374
1374
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1375
|
-
*
|
|
1375
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1376
1376
|
*
|
|
1377
1377
|
* {{ react }}
|
|
1378
1378
|
*/
|
|
@@ -1393,7 +1393,7 @@ class Puppeteer extends Helper {
|
|
|
1393
1393
|
* ```
|
|
1394
1394
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1395
1395
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1396
|
-
*
|
|
1396
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1397
1397
|
*/
|
|
1398
1398
|
async checkOption(field, context = null) {
|
|
1399
1399
|
const elm = await this._locateCheckable(field, context);
|
|
@@ -1419,7 +1419,7 @@ class Puppeteer extends Helper {
|
|
|
1419
1419
|
* ```
|
|
1420
1420
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1421
1421
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1422
|
-
*
|
|
1422
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1423
1423
|
*/
|
|
1424
1424
|
async uncheckOption(field, context = null) {
|
|
1425
1425
|
const elm = await this._locateCheckable(field, context);
|
|
@@ -1442,7 +1442,7 @@ class Puppeteer extends Helper {
|
|
|
1442
1442
|
* ```
|
|
1443
1443
|
*
|
|
1444
1444
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1445
|
-
*
|
|
1445
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1446
1446
|
*/
|
|
1447
1447
|
async seeCheckboxIsChecked(field) {
|
|
1448
1448
|
return proceedIsChecked.call(this, 'assert', field);
|
|
@@ -1458,7 +1458,7 @@ class Puppeteer extends Helper {
|
|
|
1458
1458
|
* ```
|
|
1459
1459
|
*
|
|
1460
1460
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1461
|
-
*
|
|
1461
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1462
1462
|
*/
|
|
1463
1463
|
async dontSeeCheckboxIsChecked(field) {
|
|
1464
1464
|
return proceedIsChecked.call(this, 'negate', field);
|
|
@@ -1476,7 +1476,7 @@ class Puppeteer extends Helper {
|
|
|
1476
1476
|
* ```
|
|
1477
1477
|
*
|
|
1478
1478
|
* @param {string} key name of key to press down.
|
|
1479
|
-
*
|
|
1479
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1480
1480
|
*/
|
|
1481
1481
|
async pressKeyDown(key) {
|
|
1482
1482
|
key = getNormalizedKey.call(this, key);
|
|
@@ -1496,7 +1496,7 @@ class Puppeteer extends Helper {
|
|
|
1496
1496
|
* ```
|
|
1497
1497
|
*
|
|
1498
1498
|
* @param {string} key name of key to release.
|
|
1499
|
-
*
|
|
1499
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1500
1500
|
*/
|
|
1501
1501
|
async pressKeyUp(key) {
|
|
1502
1502
|
key = getNormalizedKey.call(this, key);
|
|
@@ -1564,7 +1564,7 @@ class Puppeteer extends Helper {
|
|
|
1564
1564
|
* - `'Tab'`
|
|
1565
1565
|
*
|
|
1566
1566
|
* @param {string|string[]} key key or array of keys to press.
|
|
1567
|
-
*
|
|
1567
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1568
1568
|
*
|
|
1569
1569
|
*
|
|
1570
1570
|
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
|
|
@@ -1612,7 +1612,7 @@ class Puppeteer extends Helper {
|
|
|
1612
1612
|
*
|
|
1613
1613
|
* @param {string|string[]} key or array of keys to type.
|
|
1614
1614
|
* @param {?number} [delay=null] (optional) delay in ms between key presses
|
|
1615
|
-
*
|
|
1615
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1616
1616
|
*/
|
|
1617
1617
|
async type(keys, delay = null) {
|
|
1618
1618
|
if (!Array.isArray(keys)) {
|
|
@@ -1641,7 +1641,7 @@ class Puppeteer extends Helper {
|
|
|
1641
1641
|
* ```
|
|
1642
1642
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1643
1643
|
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1644
|
-
*
|
|
1644
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1645
1645
|
* {{ react }}
|
|
1646
1646
|
*/
|
|
1647
1647
|
async fillField(field, value) {
|
|
@@ -1668,7 +1668,7 @@ class Puppeteer extends Helper {
|
|
|
1668
1668
|
* I.clearField('#email');
|
|
1669
1669
|
* ```
|
|
1670
1670
|
* @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
|
|
1671
|
-
*
|
|
1671
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1672
1672
|
*/
|
|
1673
1673
|
async clearField(field) {
|
|
1674
1674
|
return this.fillField(field, '');
|
|
@@ -1683,7 +1683,7 @@ class Puppeteer extends Helper {
|
|
|
1683
1683
|
* ```
|
|
1684
1684
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
1685
1685
|
* @param {string} value text value to append.
|
|
1686
|
-
*
|
|
1686
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1687
1687
|
*
|
|
1688
1688
|
* {{ react }}
|
|
1689
1689
|
*/
|
|
@@ -1707,7 +1707,7 @@ class Puppeteer extends Helper {
|
|
|
1707
1707
|
* ```
|
|
1708
1708
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1709
1709
|
* @param {string} value value to check.
|
|
1710
|
-
*
|
|
1710
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1711
1711
|
*/
|
|
1712
1712
|
async seeInField(field, value) {
|
|
1713
1713
|
return proceedSeeInField.call(this, 'assert', field, value);
|
|
@@ -1724,7 +1724,7 @@ class Puppeteer extends Helper {
|
|
|
1724
1724
|
*
|
|
1725
1725
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1726
1726
|
* @param {string} value value to check.
|
|
1727
|
-
*
|
|
1727
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1728
1728
|
*/
|
|
1729
1729
|
async dontSeeInField(field, value) {
|
|
1730
1730
|
return proceedSeeInField.call(this, 'negate', field, value);
|
|
@@ -1742,7 +1742,7 @@ class Puppeteer extends Helper {
|
|
|
1742
1742
|
*
|
|
1743
1743
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
1744
1744
|
* @param {string} pathToFile local file path relative to codecept.json config file.
|
|
1745
|
-
*
|
|
1745
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1746
1746
|
*
|
|
1747
1747
|
* > ⚠ 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.
|
|
1748
1748
|
*/
|
|
@@ -1779,7 +1779,7 @@ class Puppeteer extends Helper {
|
|
|
1779
1779
|
* ```
|
|
1780
1780
|
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
1781
1781
|
* @param {string|Array<*>} option visible text or value of option.
|
|
1782
|
-
*
|
|
1782
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1783
1783
|
*/
|
|
1784
1784
|
async selectOption(select, option) {
|
|
1785
1785
|
const els = await findVisibleFields.call(this, select);
|
|
@@ -1839,7 +1839,7 @@ class Puppeteer extends Helper {
|
|
|
1839
1839
|
* ```
|
|
1840
1840
|
*
|
|
1841
1841
|
* @param {string} url a fragment to check
|
|
1842
|
-
*
|
|
1842
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1843
1843
|
*/
|
|
1844
1844
|
async seeInCurrentUrl(url) {
|
|
1845
1845
|
stringIncludes('url').assert(url, await this._getPageUrl());
|
|
@@ -1849,7 +1849,7 @@ class Puppeteer extends Helper {
|
|
|
1849
1849
|
* Checks that current url does not contain a provided fragment.
|
|
1850
1850
|
*
|
|
1851
1851
|
* @param {string} url value to check.
|
|
1852
|
-
*
|
|
1852
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1853
1853
|
*/
|
|
1854
1854
|
async dontSeeInCurrentUrl(url) {
|
|
1855
1855
|
stringIncludes('url').negate(url, await this._getPageUrl());
|
|
@@ -1866,7 +1866,7 @@ class Puppeteer extends Helper {
|
|
|
1866
1866
|
* ```
|
|
1867
1867
|
*
|
|
1868
1868
|
* @param {string} url value to check.
|
|
1869
|
-
*
|
|
1869
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1870
1870
|
*/
|
|
1871
1871
|
async seeCurrentUrlEquals(url) {
|
|
1872
1872
|
urlEquals(this.options.url).assert(url, await this._getPageUrl());
|
|
@@ -1882,7 +1882,7 @@ class Puppeteer extends Helper {
|
|
|
1882
1882
|
* ```
|
|
1883
1883
|
*
|
|
1884
1884
|
* @param {string} url value to check.
|
|
1885
|
-
*
|
|
1885
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1886
1886
|
*/
|
|
1887
1887
|
async dontSeeCurrentUrlEquals(url) {
|
|
1888
1888
|
urlEquals(this.options.url).negate(url, await this._getPageUrl());
|
|
@@ -1899,7 +1899,7 @@ class Puppeteer extends Helper {
|
|
|
1899
1899
|
* ```
|
|
1900
1900
|
* @param {string} text expected on page.
|
|
1901
1901
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1902
|
-
*
|
|
1902
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1903
1903
|
*
|
|
1904
1904
|
* {{ react }}
|
|
1905
1905
|
*/
|
|
@@ -1916,7 +1916,7 @@ class Puppeteer extends Helper {
|
|
|
1916
1916
|
*
|
|
1917
1917
|
* @param {string} text element value to check.
|
|
1918
1918
|
* @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
|
|
1919
|
-
*
|
|
1919
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1920
1920
|
*/
|
|
1921
1921
|
async seeTextEquals(text, context = null) {
|
|
1922
1922
|
return proceedSee.call(this, 'assert', text, context, true);
|
|
@@ -1933,7 +1933,7 @@ class Puppeteer extends Helper {
|
|
|
1933
1933
|
*
|
|
1934
1934
|
* @param {string} text which is not present.
|
|
1935
1935
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
1936
|
-
*
|
|
1936
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1937
1937
|
*
|
|
1938
1938
|
* {{ react }}
|
|
1939
1939
|
*/
|
|
@@ -1992,7 +1992,7 @@ class Puppeteer extends Helper {
|
|
|
1992
1992
|
* I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
1993
1993
|
* ```
|
|
1994
1994
|
* @param {string} text value to check.
|
|
1995
|
-
*
|
|
1995
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1996
1996
|
*/
|
|
1997
1997
|
async seeInSource(text) {
|
|
1998
1998
|
const source = await this.page.content();
|
|
@@ -2007,7 +2007,7 @@ class Puppeteer extends Helper {
|
|
|
2007
2007
|
* ```
|
|
2008
2008
|
*
|
|
2009
2009
|
* @param {string} value to check.
|
|
2010
|
-
*
|
|
2010
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2011
2011
|
*/
|
|
2012
2012
|
async dontSeeInSource(text) {
|
|
2013
2013
|
const source = await this.page.content();
|
|
@@ -2025,7 +2025,7 @@ class Puppeteer extends Helper {
|
|
|
2025
2025
|
*
|
|
2026
2026
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2027
2027
|
* @param {number} num number of elements.
|
|
2028
|
-
*
|
|
2028
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2029
2029
|
*
|
|
2030
2030
|
* {{ react }}
|
|
2031
2031
|
*/
|
|
@@ -2044,7 +2044,7 @@ class Puppeteer extends Helper {
|
|
|
2044
2044
|
*
|
|
2045
2045
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2046
2046
|
* @param {number} num number of elements.
|
|
2047
|
-
*
|
|
2047
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2048
2048
|
*
|
|
2049
2049
|
* {{ react }}
|
|
2050
2050
|
*/
|
|
@@ -2069,7 +2069,7 @@ class Puppeteer extends Helper {
|
|
|
2069
2069
|
* ```
|
|
2070
2070
|
*
|
|
2071
2071
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2072
|
-
*
|
|
2072
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2073
2073
|
*/
|
|
2074
2074
|
async setCookie(cookie) {
|
|
2075
2075
|
if (Array.isArray(cookie)) {
|
|
@@ -2086,7 +2086,7 @@ class Puppeteer extends Helper {
|
|
|
2086
2086
|
* ```
|
|
2087
2087
|
*
|
|
2088
2088
|
* @param {string} name cookie name.
|
|
2089
|
-
*
|
|
2089
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2090
2090
|
*
|
|
2091
2091
|
*/
|
|
2092
2092
|
async seeCookie(name) {
|
|
@@ -2102,7 +2102,7 @@ class Puppeteer extends Helper {
|
|
|
2102
2102
|
* ```
|
|
2103
2103
|
*
|
|
2104
2104
|
* @param {string} name cookie name.
|
|
2105
|
-
*
|
|
2105
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2106
2106
|
*/
|
|
2107
2107
|
async dontSeeCookie(name) {
|
|
2108
2108
|
const cookies = await this.page.cookies();
|
|
@@ -2142,7 +2142,7 @@ class Puppeteer extends Helper {
|
|
|
2142
2142
|
* ```
|
|
2143
2143
|
*
|
|
2144
2144
|
* @param {?string} [cookie=null] (optional, `null` by default) cookie name
|
|
2145
|
-
*
|
|
2145
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2146
2146
|
*/
|
|
2147
2147
|
async clearCookie(name) {
|
|
2148
2148
|
const cookies = await this.page.cookies();
|
|
@@ -2180,7 +2180,7 @@ class Puppeteer extends Helper {
|
|
|
2180
2180
|
*
|
|
2181
2181
|
* @param {string|function} fn function to be executed in browser context.
|
|
2182
2182
|
* @param {...any} args to be passed to function.
|
|
2183
|
-
*
|
|
2183
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2184
2184
|
*
|
|
2185
2185
|
*
|
|
2186
2186
|
* If a function returns a Promise It will wait for it resolution.
|
|
@@ -2217,7 +2217,7 @@ class Puppeteer extends Helper {
|
|
|
2217
2217
|
*
|
|
2218
2218
|
* @param {string|function} fn function to be executed in browser context.
|
|
2219
2219
|
* @param {...any} args to be passed to function.
|
|
2220
|
-
*
|
|
2220
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2221
2221
|
*
|
|
2222
2222
|
*
|
|
2223
2223
|
* Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
@@ -2422,7 +2422,7 @@ class Puppeteer extends Helper {
|
|
|
2422
2422
|
*
|
|
2423
2423
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2424
2424
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
2425
|
-
*
|
|
2425
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2426
2426
|
* {{ react }}
|
|
2427
2427
|
*/
|
|
2428
2428
|
async seeCssPropertiesOnElements(locator, cssProperties) {
|
|
@@ -2469,7 +2469,7 @@ class Puppeteer extends Helper {
|
|
|
2469
2469
|
*
|
|
2470
2470
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2471
2471
|
* @param {object} attributes attributes and their values to check.
|
|
2472
|
-
*
|
|
2472
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2473
2473
|
* {{ react }}
|
|
2474
2474
|
*/
|
|
2475
2475
|
async seeAttributesOnElements(locator, attributes) {
|
|
@@ -2510,7 +2510,7 @@ class Puppeteer extends Helper {
|
|
|
2510
2510
|
*
|
|
2511
2511
|
* @param {CodeceptJS.LocatorOrString} locator located by label|name|CSS|XPath|strict locator.
|
|
2512
2512
|
* @param {number} offsetX position to drag.
|
|
2513
|
-
*
|
|
2513
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2514
2514
|
* {{ react }}
|
|
2515
2515
|
*/
|
|
2516
2516
|
async dragSlider(locator, offsetX = 0) {
|
|
@@ -2588,7 +2588,7 @@ class Puppeteer extends Helper {
|
|
|
2588
2588
|
*
|
|
2589
2589
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2590
2590
|
* @param {string} fileName file name to save.
|
|
2591
|
-
*
|
|
2591
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2592
2592
|
*/
|
|
2593
2593
|
async saveElementScreenshot(locator, fileName) {
|
|
2594
2594
|
const outputFile = screenshotOutputFolder(fileName);
|
|
@@ -2613,7 +2613,7 @@ class Puppeteer extends Helper {
|
|
|
2613
2613
|
*
|
|
2614
2614
|
* @param {string} fileName file name to save.
|
|
2615
2615
|
* @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
2616
|
-
*
|
|
2616
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2617
2617
|
*/
|
|
2618
2618
|
async saveScreenshot(fileName, fullPage) {
|
|
2619
2619
|
const fullPageOption = fullPage || this.options.fullPageScreenshots;
|
|
@@ -2648,7 +2648,7 @@ class Puppeteer extends Helper {
|
|
|
2648
2648
|
* ```
|
|
2649
2649
|
*
|
|
2650
2650
|
* @param {number} sec number of second to wait.
|
|
2651
|
-
*
|
|
2651
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2652
2652
|
*/
|
|
2653
2653
|
async wait(sec) {
|
|
2654
2654
|
return new Promise(((done) => {
|
|
@@ -2662,7 +2662,7 @@ class Puppeteer extends Helper {
|
|
|
2662
2662
|
*
|
|
2663
2663
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2664
2664
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
2665
|
-
*
|
|
2665
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2666
2666
|
*/
|
|
2667
2667
|
async waitForEnabled(locator, sec) {
|
|
2668
2668
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2701,7 +2701,7 @@ class Puppeteer extends Helper {
|
|
|
2701
2701
|
* @param {LocatorOrString} field input field.
|
|
2702
2702
|
* @param {string }value expected value.
|
|
2703
2703
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2704
|
-
*
|
|
2704
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2705
2705
|
*/
|
|
2706
2706
|
async waitForValue(field, value, sec) {
|
|
2707
2707
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2741,7 +2741,7 @@ class Puppeteer extends Helper {
|
|
|
2741
2741
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2742
2742
|
* @param {number} num number of elements.
|
|
2743
2743
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2744
|
-
*
|
|
2744
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2745
2745
|
* {{ react }}
|
|
2746
2746
|
*/
|
|
2747
2747
|
async waitNumberOfVisibleElements(locator, num, sec) {
|
|
@@ -2782,7 +2782,7 @@ class Puppeteer extends Helper {
|
|
|
2782
2782
|
*
|
|
2783
2783
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2784
2784
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2785
|
-
*
|
|
2785
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2786
2786
|
*/
|
|
2787
2787
|
async waitForClickable(locator, waitTimeout) {
|
|
2788
2788
|
const els = await this._locate(locator);
|
|
@@ -2808,7 +2808,7 @@ class Puppeteer extends Helper {
|
|
|
2808
2808
|
*
|
|
2809
2809
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2810
2810
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2811
|
-
*
|
|
2811
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2812
2812
|
* {{ react }}
|
|
2813
2813
|
*/
|
|
2814
2814
|
async waitForElement(locator, sec) {
|
|
@@ -2837,7 +2837,7 @@ class Puppeteer extends Helper {
|
|
|
2837
2837
|
*
|
|
2838
2838
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2839
2839
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2840
|
-
*
|
|
2840
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2841
2841
|
*
|
|
2842
2842
|
* This method accepts [React selectors](https://codecept.io/react).
|
|
2843
2843
|
*/
|
|
@@ -2867,7 +2867,7 @@ class Puppeteer extends Helper {
|
|
|
2867
2867
|
*
|
|
2868
2868
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2869
2869
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2870
|
-
*
|
|
2870
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2871
2871
|
*/
|
|
2872
2872
|
async waitForInvisible(locator, sec) {
|
|
2873
2873
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2895,7 +2895,7 @@ class Puppeteer extends Helper {
|
|
|
2895
2895
|
*
|
|
2896
2896
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2897
2897
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2898
|
-
*
|
|
2898
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2899
2899
|
*/
|
|
2900
2900
|
async waitToHide(locator, sec) {
|
|
2901
2901
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2928,7 +2928,7 @@ class Puppeteer extends Helper {
|
|
|
2928
2928
|
*
|
|
2929
2929
|
* @param {string} urlPart value to check.
|
|
2930
2930
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2931
|
-
*
|
|
2931
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2932
2932
|
*/
|
|
2933
2933
|
async waitInUrl(urlPart, sec = null) {
|
|
2934
2934
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2956,7 +2956,7 @@ class Puppeteer extends Helper {
|
|
|
2956
2956
|
*
|
|
2957
2957
|
* @param {string} urlPart value to check.
|
|
2958
2958
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2959
|
-
*
|
|
2959
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2960
2960
|
*/
|
|
2961
2961
|
async waitUrlEquals(urlPart, sec = null) {
|
|
2962
2962
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -2992,7 +2992,7 @@ class Puppeteer extends Helper {
|
|
|
2992
2992
|
* @param {string }text to wait for.
|
|
2993
2993
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2994
2994
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
2995
|
-
*
|
|
2995
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2996
2996
|
*/
|
|
2997
2997
|
async waitForText(text, sec = null, context = null) {
|
|
2998
2998
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3068,7 +3068,7 @@ class Puppeteer extends Helper {
|
|
|
3068
3068
|
* ```
|
|
3069
3069
|
*
|
|
3070
3070
|
* @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
3071
|
-
*
|
|
3071
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3072
3072
|
*/
|
|
3073
3073
|
async switchTo(locator) {
|
|
3074
3074
|
if (Number.isInteger(locator)) {
|
|
@@ -3122,7 +3122,7 @@ class Puppeteer extends Helper {
|
|
|
3122
3122
|
* @param {string|function} fn to be executed in browser context.
|
|
3123
3123
|
* @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
|
|
3124
3124
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3125
|
-
*
|
|
3125
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3126
3126
|
*/
|
|
3127
3127
|
async waitForFunction(fn, argsOrSec = null, sec = null) {
|
|
3128
3128
|
let args = [];
|
|
@@ -3171,7 +3171,7 @@ class Puppeteer extends Helper {
|
|
|
3171
3171
|
*
|
|
3172
3172
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3173
3173
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3174
|
-
*
|
|
3174
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3175
3175
|
*/
|
|
3176
3176
|
async waitForDetached(locator, sec) {
|
|
3177
3177
|
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
|
|
@@ -3220,7 +3220,7 @@ class Puppeteer extends Helper {
|
|
|
3220
3220
|
* loadEventEnd: 241
|
|
3221
3221
|
* }
|
|
3222
3222
|
* ```
|
|
3223
|
-
* @return {Promise<any>}
|
|
3223
|
+
* @return {Promise<any>} automatically synchronized promise through #recorder
|
|
3224
3224
|
*/
|
|
3225
3225
|
async grabDataFromPerformanceTiming() {
|
|
3226
3226
|
return perfTiming;
|
package/docs/build/REST.js
CHANGED
|
@@ -87,7 +87,7 @@ class REST extends Helper {
|
|
|
87
87
|
* @param {object} headers headers list
|
|
88
88
|
*/
|
|
89
89
|
haveRequestHeaders(headers) {
|
|
90
|
-
this.headers = { ...headers, ...
|
|
90
|
+
this.headers = { ...this.headers, ...headers };
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
@@ -113,7 +113,7 @@ class REST extends Helper {
|
|
|
113
113
|
*/
|
|
114
114
|
async _executeRequest(request) {
|
|
115
115
|
// Add custom headers. They can be set by amBearerAuthenticated() or haveRequestHeaders()
|
|
116
|
-
request.headers = { ...
|
|
116
|
+
request.headers = { ...this.headers, ...request.headers };
|
|
117
117
|
|
|
118
118
|
const _debugRequest = { ...request };
|
|
119
119
|
this.axios.defaults.timeout = request.timeout || this.options.timeout;
|