codeceptjs 3.3.1 → 3.3.4
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 +49 -0
- package/README.md +4 -25
- package/docs/api.md +4 -0
- package/docs/basics.md +2 -0
- package/docs/build/Appium.js +18 -28
- package/docs/build/JSONResponse.js +44 -3
- package/docs/build/Nightmare.js +53 -53
- package/docs/build/Playwright.js +95 -103
- package/docs/build/Protractor.js +66 -66
- package/docs/build/Puppeteer.js +74 -74
- package/docs/build/REST.js +8 -4
- package/docs/build/TestCafe.js +53 -53
- package/docs/build/WebDriver.js +84 -86
- package/docs/changelog.md +49 -0
- package/docs/helpers/Appium.md +212 -268
- package/docs/helpers/JSONResponse.md +24 -0
- package/docs/helpers/Nightmare.md +92 -141
- package/docs/helpers/Playwright.md +302 -413
- package/docs/helpers/Puppeteer.md +171 -231
- package/docs/helpers/REST.md +2 -0
- package/docs/helpers/TestCafe.md +125 -174
- package/docs/helpers/WebDriver.md +184 -247
- package/docs/plugins.md +41 -1
- package/docs/secrets.md +30 -0
- 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/cli.js +1 -1
- package/lib/command/interactive.js +1 -1
- package/lib/command/run-workers.js +1 -1
- package/lib/command/workers/runTests.js +15 -0
- package/lib/helper/Appium.js +0 -10
- package/lib/helper/JSONResponse.js +44 -3
- package/lib/helper/Playwright.js +24 -32
- package/lib/helper/REST.js +8 -4
- package/lib/helper/WebDriver.js +5 -7
- package/lib/output.js +4 -0
- package/lib/plugin/customLocator.js +50 -3
- package/lib/plugin/retryFailedStep.js +1 -1
- package/lib/plugin/retryTo.js +1 -8
- package/lib/secret.js +30 -0
- package/lib/step.js +1 -1
- package/package.json +4 -4
- package/typings/types.d.ts +1016 -520
package/docs/build/WebDriver.js
CHANGED
|
@@ -896,7 +896,7 @@ class WebDriver extends Helper {
|
|
|
896
896
|
* ```
|
|
897
897
|
*
|
|
898
898
|
* @param {string} url url path or global url.
|
|
899
|
-
* @return {
|
|
899
|
+
* @return {void} automatically synchronized promise with recorder #!
|
|
900
900
|
*
|
|
901
901
|
*/
|
|
902
902
|
amOnPage(url) {
|
|
@@ -936,13 +936,13 @@ class WebDriver extends Helper {
|
|
|
936
936
|
*
|
|
937
937
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
938
938
|
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
939
|
-
*
|
|
939
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
940
940
|
*
|
|
941
941
|
*
|
|
942
942
|
* {{ react }}
|
|
943
943
|
*/
|
|
944
944
|
async click(locator, context = null) {
|
|
945
|
-
const clickMethod = this.browser.isMobile ? 'touchClick' : 'elementClick';
|
|
945
|
+
const clickMethod = this.browser.isMobile && this.browser.capabilities.platformName !== 'android' ? 'touchClick' : 'elementClick';
|
|
946
946
|
const locateFn = prepareLocateFn.call(this, context);
|
|
947
947
|
|
|
948
948
|
const res = await findClickable.call(this, locator, locateFn);
|
|
@@ -983,7 +983,7 @@ class WebDriver extends Helper {
|
|
|
983
983
|
*
|
|
984
984
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
985
985
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
986
|
-
*
|
|
986
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
987
987
|
*
|
|
988
988
|
*
|
|
989
989
|
* {{ react }}
|
|
@@ -1022,7 +1022,7 @@ class WebDriver extends Helper {
|
|
|
1022
1022
|
*
|
|
1023
1023
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1024
1024
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1025
|
-
*
|
|
1025
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1026
1026
|
*
|
|
1027
1027
|
* {{ react }}
|
|
1028
1028
|
*/
|
|
@@ -1054,7 +1054,7 @@ class WebDriver extends Helper {
|
|
|
1054
1054
|
*
|
|
1055
1055
|
* @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
|
|
1056
1056
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1057
|
-
*
|
|
1057
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1058
1058
|
*
|
|
1059
1059
|
* {{ react }}
|
|
1060
1060
|
*/
|
|
@@ -1097,7 +1097,7 @@ class WebDriver extends Helper {
|
|
|
1097
1097
|
*
|
|
1098
1098
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1099
1099
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1100
|
-
*
|
|
1100
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1101
1101
|
*
|
|
1102
1102
|
* {{ react }}
|
|
1103
1103
|
*/
|
|
@@ -1138,7 +1138,7 @@ class WebDriver extends Helper {
|
|
|
1138
1138
|
* ```
|
|
1139
1139
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1140
1140
|
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1141
|
-
*
|
|
1141
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1142
1142
|
* {{ react }}
|
|
1143
1143
|
* {{ custom }}
|
|
1144
1144
|
*
|
|
@@ -1159,7 +1159,7 @@ class WebDriver extends Helper {
|
|
|
1159
1159
|
* ```
|
|
1160
1160
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
1161
1161
|
* @param {string} value text value to append.
|
|
1162
|
-
*
|
|
1162
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1163
1163
|
* {{ react }}
|
|
1164
1164
|
*/
|
|
1165
1165
|
async appendField(field, value) {
|
|
@@ -1178,7 +1178,7 @@ class WebDriver extends Helper {
|
|
|
1178
1178
|
* I.clearField('#email');
|
|
1179
1179
|
* ```
|
|
1180
1180
|
* @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
|
|
1181
|
-
*
|
|
1181
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1182
1182
|
*
|
|
1183
1183
|
*/
|
|
1184
1184
|
async clearField(field) {
|
|
@@ -1209,7 +1209,7 @@ class WebDriver extends Helper {
|
|
|
1209
1209
|
* ```
|
|
1210
1210
|
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
1211
1211
|
* @param {string|Array<*>} option visible text or value of option.
|
|
1212
|
-
*
|
|
1212
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1213
1213
|
*/
|
|
1214
1214
|
async selectOption(select, option) {
|
|
1215
1215
|
const res = await findFields.call(this, select);
|
|
@@ -1252,7 +1252,7 @@ class WebDriver extends Helper {
|
|
|
1252
1252
|
*
|
|
1253
1253
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
1254
1254
|
* @param {string} pathToFile local file path relative to codecept.json config file.
|
|
1255
|
-
*
|
|
1255
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1256
1256
|
* Appium: not tested
|
|
1257
1257
|
*/
|
|
1258
1258
|
async attachFile(locator, pathToFile) {
|
|
@@ -1292,11 +1292,11 @@ class WebDriver extends Helper {
|
|
|
1292
1292
|
* ```
|
|
1293
1293
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1294
1294
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1295
|
-
*
|
|
1295
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1296
1296
|
* Appium: not tested
|
|
1297
1297
|
*/
|
|
1298
1298
|
async checkOption(field, context = null) {
|
|
1299
|
-
const clickMethod = this.browser.isMobile ? 'touchClick' : 'elementClick';
|
|
1299
|
+
const clickMethod = this.browser.isMobile && this.browser.capabilities.platformName !== 'android' ? 'touchClick' : 'elementClick';
|
|
1300
1300
|
const locateFn = prepareLocateFn.call(this, context);
|
|
1301
1301
|
|
|
1302
1302
|
const res = await findCheckable.call(this, field, locateFn);
|
|
@@ -1323,11 +1323,11 @@ class WebDriver extends Helper {
|
|
|
1323
1323
|
* ```
|
|
1324
1324
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1325
1325
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1326
|
-
*
|
|
1326
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1327
1327
|
* Appium: not tested
|
|
1328
1328
|
*/
|
|
1329
1329
|
async uncheckOption(field, context = null) {
|
|
1330
|
-
const clickMethod = this.browser.isMobile ? 'touchClick' : 'elementClick';
|
|
1330
|
+
const clickMethod = this.browser.isMobile && this.browser.capabilities.platformName !== 'android' ? 'touchClick' : 'elementClick';
|
|
1331
1331
|
const locateFn = prepareLocateFn.call(this, context);
|
|
1332
1332
|
|
|
1333
1333
|
const res = await findCheckable.call(this, field, locateFn);
|
|
@@ -1566,7 +1566,7 @@ class WebDriver extends Helper {
|
|
|
1566
1566
|
* ```
|
|
1567
1567
|
*
|
|
1568
1568
|
* @param {string} text text value to check.
|
|
1569
|
-
*
|
|
1569
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1570
1570
|
*/
|
|
1571
1571
|
async seeInTitle(text) {
|
|
1572
1572
|
const title = await this.browser.getTitle();
|
|
@@ -1581,7 +1581,7 @@ class WebDriver extends Helper {
|
|
|
1581
1581
|
* ```
|
|
1582
1582
|
*
|
|
1583
1583
|
* @param {string} text value to check.
|
|
1584
|
-
*
|
|
1584
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1585
1585
|
*/
|
|
1586
1586
|
async seeTitleEquals(text) {
|
|
1587
1587
|
const title = await this.browser.getTitle();
|
|
@@ -1596,7 +1596,7 @@ class WebDriver extends Helper {
|
|
|
1596
1596
|
* ```
|
|
1597
1597
|
*
|
|
1598
1598
|
* @param {string} text value to check.
|
|
1599
|
-
*
|
|
1599
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1600
1600
|
*/
|
|
1601
1601
|
async dontSeeInTitle(text) {
|
|
1602
1602
|
const title = await this.browser.getTitle();
|
|
@@ -1630,7 +1630,7 @@ class WebDriver extends Helper {
|
|
|
1630
1630
|
* ```
|
|
1631
1631
|
* @param {string} text expected on page.
|
|
1632
1632
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1633
|
-
*
|
|
1633
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1634
1634
|
*
|
|
1635
1635
|
* {{ react }}
|
|
1636
1636
|
*/
|
|
@@ -1647,7 +1647,7 @@ class WebDriver extends Helper {
|
|
|
1647
1647
|
*
|
|
1648
1648
|
* @param {string} text element value to check.
|
|
1649
1649
|
* @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
|
|
1650
|
-
*
|
|
1650
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1651
1651
|
*/
|
|
1652
1652
|
async seeTextEquals(text, context = null) {
|
|
1653
1653
|
return proceedSee.call(this, 'assert', text, context, true);
|
|
@@ -1664,7 +1664,7 @@ class WebDriver extends Helper {
|
|
|
1664
1664
|
*
|
|
1665
1665
|
* @param {string} text which is not present.
|
|
1666
1666
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
1667
|
-
*
|
|
1667
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1668
1668
|
*
|
|
1669
1669
|
* {{ react }}
|
|
1670
1670
|
*/
|
|
@@ -1684,7 +1684,7 @@ class WebDriver extends Helper {
|
|
|
1684
1684
|
* ```
|
|
1685
1685
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1686
1686
|
* @param {string} value value to check.
|
|
1687
|
-
*
|
|
1687
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1688
1688
|
*
|
|
1689
1689
|
*/
|
|
1690
1690
|
async seeInField(field, value) {
|
|
@@ -1702,7 +1702,7 @@ class WebDriver extends Helper {
|
|
|
1702
1702
|
*
|
|
1703
1703
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1704
1704
|
* @param {string} value value to check.
|
|
1705
|
-
*
|
|
1705
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1706
1706
|
*
|
|
1707
1707
|
*/
|
|
1708
1708
|
async dontSeeInField(field, value) {
|
|
@@ -1719,7 +1719,7 @@ class WebDriver extends Helper {
|
|
|
1719
1719
|
* ```
|
|
1720
1720
|
*
|
|
1721
1721
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1722
|
-
*
|
|
1722
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1723
1723
|
* Appium: not tested
|
|
1724
1724
|
*/
|
|
1725
1725
|
async seeCheckboxIsChecked(field) {
|
|
@@ -1736,7 +1736,7 @@ class WebDriver extends Helper {
|
|
|
1736
1736
|
* ```
|
|
1737
1737
|
*
|
|
1738
1738
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1739
|
-
*
|
|
1739
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1740
1740
|
* Appium: not tested
|
|
1741
1741
|
*/
|
|
1742
1742
|
async dontSeeCheckboxIsChecked(field) {
|
|
@@ -1751,7 +1751,7 @@ class WebDriver extends Helper {
|
|
|
1751
1751
|
* I.seeElement('#modal');
|
|
1752
1752
|
* ```
|
|
1753
1753
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1754
|
-
*
|
|
1754
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1755
1755
|
* {{ react }}
|
|
1756
1756
|
*
|
|
1757
1757
|
*/
|
|
@@ -1770,7 +1770,7 @@ class WebDriver extends Helper {
|
|
|
1770
1770
|
* ```
|
|
1771
1771
|
*
|
|
1772
1772
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1773
|
-
*
|
|
1773
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1774
1774
|
* {{ react }}
|
|
1775
1775
|
*/
|
|
1776
1776
|
async dontSeeElement(locator) {
|
|
@@ -1790,7 +1790,7 @@ class WebDriver extends Helper {
|
|
|
1790
1790
|
* I.seeElementInDOM('#modal');
|
|
1791
1791
|
* ```
|
|
1792
1792
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1793
|
-
*
|
|
1793
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1794
1794
|
*
|
|
1795
1795
|
*/
|
|
1796
1796
|
async seeElementInDOM(locator) {
|
|
@@ -1806,7 +1806,7 @@ class WebDriver extends Helper {
|
|
|
1806
1806
|
* ```
|
|
1807
1807
|
*
|
|
1808
1808
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1809
|
-
*
|
|
1809
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1810
1810
|
*
|
|
1811
1811
|
*/
|
|
1812
1812
|
async dontSeeElementInDOM(locator) {
|
|
@@ -1821,7 +1821,7 @@ class WebDriver extends Helper {
|
|
|
1821
1821
|
* I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
1822
1822
|
* ```
|
|
1823
1823
|
* @param {string} text value to check.
|
|
1824
|
-
*
|
|
1824
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1825
1825
|
*
|
|
1826
1826
|
*/
|
|
1827
1827
|
async seeInSource(text) {
|
|
@@ -1889,7 +1889,7 @@ class WebDriver extends Helper {
|
|
|
1889
1889
|
* ```
|
|
1890
1890
|
*
|
|
1891
1891
|
* @param {string} value to check.
|
|
1892
|
-
*
|
|
1892
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1893
1893
|
*/
|
|
1894
1894
|
async dontSeeInSource(text) {
|
|
1895
1895
|
const source = await this.browser.getPageSource();
|
|
@@ -1907,7 +1907,7 @@ class WebDriver extends Helper {
|
|
|
1907
1907
|
*
|
|
1908
1908
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1909
1909
|
* @param {number} num number of elements.
|
|
1910
|
-
*
|
|
1910
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1911
1911
|
* {{ react }}
|
|
1912
1912
|
*/
|
|
1913
1913
|
async seeNumberOfElements(locator, num) {
|
|
@@ -1925,7 +1925,7 @@ class WebDriver extends Helper {
|
|
|
1925
1925
|
*
|
|
1926
1926
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1927
1927
|
* @param {number} num number of elements.
|
|
1928
|
-
*
|
|
1928
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1929
1929
|
* {{ react }}
|
|
1930
1930
|
*/
|
|
1931
1931
|
async seeNumberOfVisibleElements(locator, num) {
|
|
@@ -1942,7 +1942,7 @@ class WebDriver extends Helper {
|
|
|
1942
1942
|
*
|
|
1943
1943
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1944
1944
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
1945
|
-
*
|
|
1945
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1946
1946
|
*/
|
|
1947
1947
|
async seeCssPropertiesOnElements(locator, cssProperties) {
|
|
1948
1948
|
const res = await this._locate(locator);
|
|
@@ -1985,7 +1985,7 @@ class WebDriver extends Helper {
|
|
|
1985
1985
|
*
|
|
1986
1986
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1987
1987
|
* @param {object} attributes attributes and their values to check.
|
|
1988
|
-
*
|
|
1988
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1989
1989
|
*/
|
|
1990
1990
|
async seeAttributesOnElements(locator, attributes) {
|
|
1991
1991
|
const res = await this._locate(locator);
|
|
@@ -2039,7 +2039,7 @@ class WebDriver extends Helper {
|
|
|
2039
2039
|
* ```
|
|
2040
2040
|
*
|
|
2041
2041
|
* @param {string} url a fragment to check
|
|
2042
|
-
*
|
|
2042
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2043
2043
|
*
|
|
2044
2044
|
*/
|
|
2045
2045
|
async seeInCurrentUrl(url) {
|
|
@@ -2051,7 +2051,7 @@ class WebDriver extends Helper {
|
|
|
2051
2051
|
* Checks that current url does not contain a provided fragment.
|
|
2052
2052
|
*
|
|
2053
2053
|
* @param {string} url value to check.
|
|
2054
|
-
*
|
|
2054
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2055
2055
|
*
|
|
2056
2056
|
*/
|
|
2057
2057
|
async dontSeeInCurrentUrl(url) {
|
|
@@ -2070,7 +2070,7 @@ class WebDriver extends Helper {
|
|
|
2070
2070
|
* ```
|
|
2071
2071
|
*
|
|
2072
2072
|
* @param {string} url value to check.
|
|
2073
|
-
*
|
|
2073
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2074
2074
|
*
|
|
2075
2075
|
*/
|
|
2076
2076
|
async seeCurrentUrlEquals(url) {
|
|
@@ -2088,7 +2088,7 @@ class WebDriver extends Helper {
|
|
|
2088
2088
|
* ```
|
|
2089
2089
|
*
|
|
2090
2090
|
* @param {string} url value to check.
|
|
2091
|
-
*
|
|
2091
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2092
2092
|
*
|
|
2093
2093
|
*/
|
|
2094
2094
|
async dontSeeCurrentUrlEquals(url) {
|
|
@@ -2122,7 +2122,7 @@ class WebDriver extends Helper {
|
|
|
2122
2122
|
*
|
|
2123
2123
|
* @param {string|function} fn function to be executed in browser context.
|
|
2124
2124
|
* @param {...any} args to be passed to function.
|
|
2125
|
-
*
|
|
2125
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2126
2126
|
*
|
|
2127
2127
|
*
|
|
2128
2128
|
*
|
|
@@ -2156,7 +2156,7 @@ class WebDriver extends Helper {
|
|
|
2156
2156
|
*
|
|
2157
2157
|
* @param {string|function} fn function to be executed in browser context.
|
|
2158
2158
|
* @param {...any} args to be passed to function.
|
|
2159
|
-
*
|
|
2159
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2160
2160
|
*
|
|
2161
2161
|
*
|
|
2162
2162
|
*/
|
|
@@ -2175,7 +2175,7 @@ class WebDriver extends Helper {
|
|
|
2175
2175
|
*
|
|
2176
2176
|
* @param {LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2177
2177
|
* @param {ScrollIntoViewOptions} scrollIntoViewOptions see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
2178
|
-
*
|
|
2178
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2179
2179
|
*
|
|
2180
2180
|
*/
|
|
2181
2181
|
async scrollIntoView(locator, scrollIntoViewOptions) {
|
|
@@ -2197,7 +2197,7 @@ class WebDriver extends Helper {
|
|
|
2197
2197
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2198
2198
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2199
2199
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2200
|
-
*
|
|
2200
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2201
2201
|
*
|
|
2202
2202
|
*/
|
|
2203
2203
|
async scrollTo(locator, offsetX = 0, offsetY = 0) {
|
|
@@ -2212,7 +2212,7 @@ class WebDriver extends Helper {
|
|
|
2212
2212
|
assertElementExists(res);
|
|
2213
2213
|
const elem = usingFirstElement(res);
|
|
2214
2214
|
const elementId = getElementId(elem);
|
|
2215
|
-
if (this.browser.isMobile) return this.browser.touchScroll(offsetX, offsetY, elementId);
|
|
2215
|
+
if (this.browser.isMobile && this.browser.capabilities.platformName !== 'android') return this.browser.touchScroll(offsetX, offsetY, elementId);
|
|
2216
2216
|
const location = await elem.getLocation();
|
|
2217
2217
|
assertElementExists(location, 'Failed to receive', 'location');
|
|
2218
2218
|
/* eslint-disable prefer-arrow-callback */
|
|
@@ -2220,7 +2220,7 @@ class WebDriver extends Helper {
|
|
|
2220
2220
|
/* eslint-enable */
|
|
2221
2221
|
}
|
|
2222
2222
|
|
|
2223
|
-
if (this.browser.isMobile) return this.browser.touchScroll(locator, offsetX, offsetY);
|
|
2223
|
+
if (this.browser.isMobile && this.browser.capabilities.platformName !== 'android') return this.browser.touchScroll(locator, offsetX, offsetY);
|
|
2224
2224
|
|
|
2225
2225
|
/* eslint-disable prefer-arrow-callback, comma-dangle */
|
|
2226
2226
|
return this.browser.execute(function (x, y) { return window.scrollTo(x, y); }, offsetX, offsetY);
|
|
@@ -2239,7 +2239,7 @@ class WebDriver extends Helper {
|
|
|
2239
2239
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2240
2240
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2241
2241
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2242
|
-
*
|
|
2242
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2243
2243
|
*/
|
|
2244
2244
|
async moveCursorTo(locator, xOffset, yOffset) {
|
|
2245
2245
|
const res = await this._locate(withStrictLocator(locator), true);
|
|
@@ -2259,7 +2259,7 @@ class WebDriver extends Helper {
|
|
|
2259
2259
|
*
|
|
2260
2260
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2261
2261
|
* @param {string} fileName file name to save.
|
|
2262
|
-
*
|
|
2262
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2263
2263
|
*
|
|
2264
2264
|
*/
|
|
2265
2265
|
async saveElementScreenshot(locator, fileName) {
|
|
@@ -2285,7 +2285,7 @@ class WebDriver extends Helper {
|
|
|
2285
2285
|
*
|
|
2286
2286
|
* @param {string} fileName file name to save.
|
|
2287
2287
|
* @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
2288
|
-
*
|
|
2288
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2289
2289
|
*/
|
|
2290
2290
|
async saveScreenshot(fileName, fullPage = false) {
|
|
2291
2291
|
const outputFile = screenshotOutputFolder(fileName);
|
|
@@ -2340,7 +2340,7 @@ class WebDriver extends Helper {
|
|
|
2340
2340
|
* ```
|
|
2341
2341
|
*
|
|
2342
2342
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2343
|
-
*
|
|
2343
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2344
2344
|
*
|
|
2345
2345
|
*
|
|
2346
2346
|
* Uses Selenium's JSON [cookie
|
|
@@ -2360,7 +2360,7 @@ class WebDriver extends Helper {
|
|
|
2360
2360
|
* ```
|
|
2361
2361
|
*
|
|
2362
2362
|
* @param {?string} [cookie=null] (optional, `null` by default) cookie name
|
|
2363
|
-
*
|
|
2363
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2364
2364
|
*/
|
|
2365
2365
|
async clearCookie(cookie) {
|
|
2366
2366
|
return this.browser.deleteCookies(cookie);
|
|
@@ -2374,7 +2374,7 @@ class WebDriver extends Helper {
|
|
|
2374
2374
|
* ```
|
|
2375
2375
|
*
|
|
2376
2376
|
* @param {string} name cookie name.
|
|
2377
|
-
*
|
|
2377
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2378
2378
|
*/
|
|
2379
2379
|
async seeCookie(name) {
|
|
2380
2380
|
const cookie = await this.browser.getCookies([name]);
|
|
@@ -2389,7 +2389,7 @@ class WebDriver extends Helper {
|
|
|
2389
2389
|
* ```
|
|
2390
2390
|
*
|
|
2391
2391
|
* @param {string} name cookie name.
|
|
2392
|
-
*
|
|
2392
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2393
2393
|
*/
|
|
2394
2394
|
async dontSeeCookie(name) {
|
|
2395
2395
|
const cookie = await this.browser.getCookies([name]);
|
|
@@ -2485,7 +2485,7 @@ class WebDriver extends Helper {
|
|
|
2485
2485
|
* ```
|
|
2486
2486
|
*
|
|
2487
2487
|
* @param {string} key name of key to press down.
|
|
2488
|
-
*
|
|
2488
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2489
2489
|
*/
|
|
2490
2490
|
async pressKeyDown(key) {
|
|
2491
2491
|
key = getNormalizedKey.call(this, key);
|
|
@@ -2514,7 +2514,7 @@ class WebDriver extends Helper {
|
|
|
2514
2514
|
* ```
|
|
2515
2515
|
*
|
|
2516
2516
|
* @param {string} key name of key to release.
|
|
2517
|
-
*
|
|
2517
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2518
2518
|
*/
|
|
2519
2519
|
async pressKeyUp(key) {
|
|
2520
2520
|
key = getNormalizedKey.call(this, key);
|
|
@@ -2591,7 +2591,7 @@ class WebDriver extends Helper {
|
|
|
2591
2591
|
* - `'Tab'`
|
|
2592
2592
|
*
|
|
2593
2593
|
* @param {string|string[]} key key or array of keys to press.
|
|
2594
|
-
*
|
|
2594
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2595
2595
|
*
|
|
2596
2596
|
*
|
|
2597
2597
|
* _Note:_ In case a text field or textarea is focused be aware that some browsers do not respect active modifier when combining modifier keys with other keys.
|
|
@@ -2652,7 +2652,7 @@ class WebDriver extends Helper {
|
|
|
2652
2652
|
*
|
|
2653
2653
|
* @param {string|string[]} key or array of keys to type.
|
|
2654
2654
|
* @param {?number} [delay=null] (optional) delay in ms between key presses
|
|
2655
|
-
*
|
|
2655
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2656
2656
|
*/
|
|
2657
2657
|
async type(keys, delay = null) {
|
|
2658
2658
|
if (!Array.isArray(keys)) {
|
|
@@ -2674,7 +2674,7 @@ class WebDriver extends Helper {
|
|
|
2674
2674
|
*
|
|
2675
2675
|
* @param {number} width width in pixels or `maximize`.
|
|
2676
2676
|
* @param {number} height height in pixels.
|
|
2677
|
-
*
|
|
2677
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2678
2678
|
* Appium: not tested in web, in apps doesn't work
|
|
2679
2679
|
*/
|
|
2680
2680
|
async resizeWindow(width, height) {
|
|
@@ -2711,7 +2711,7 @@ class WebDriver extends Helper {
|
|
|
2711
2711
|
*
|
|
2712
2712
|
* @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
|
|
2713
2713
|
* @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
|
|
2714
|
-
*
|
|
2714
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2715
2715
|
* Appium: not tested
|
|
2716
2716
|
*/
|
|
2717
2717
|
async dragAndDrop(srcElement, destElement) {
|
|
@@ -2737,7 +2737,7 @@ class WebDriver extends Helper {
|
|
|
2737
2737
|
*
|
|
2738
2738
|
* @param {CodeceptJS.LocatorOrString} locator located by label|name|CSS|XPath|strict locator.
|
|
2739
2739
|
* @param {number} offsetX position to drag.
|
|
2740
|
-
*
|
|
2740
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2741
2741
|
*/
|
|
2742
2742
|
async dragSlider(locator, offsetX = 0) {
|
|
2743
2743
|
const browser = this.browser;
|
|
@@ -2824,7 +2824,7 @@ class WebDriver extends Helper {
|
|
|
2824
2824
|
* I.closeOtherTabs();
|
|
2825
2825
|
* ```
|
|
2826
2826
|
*
|
|
2827
|
-
*
|
|
2827
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2828
2828
|
*/
|
|
2829
2829
|
async closeOtherTabs() {
|
|
2830
2830
|
const handles = await this.browser.getWindowHandles();
|
|
@@ -2846,7 +2846,7 @@ class WebDriver extends Helper {
|
|
|
2846
2846
|
* ```
|
|
2847
2847
|
*
|
|
2848
2848
|
* @param {number} sec number of second to wait.
|
|
2849
|
-
*
|
|
2849
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2850
2850
|
*/
|
|
2851
2851
|
async wait(sec) {
|
|
2852
2852
|
return new Promise(resolve => setTimeout(resolve, sec * 1000));
|
|
@@ -2858,7 +2858,7 @@ class WebDriver extends Helper {
|
|
|
2858
2858
|
*
|
|
2859
2859
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2860
2860
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
2861
|
-
*
|
|
2861
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2862
2862
|
*/
|
|
2863
2863
|
async waitForEnabled(locator, sec = null) {
|
|
2864
2864
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2902,7 +2902,7 @@ class WebDriver extends Helper {
|
|
|
2902
2902
|
*
|
|
2903
2903
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2904
2904
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2905
|
-
*
|
|
2905
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2906
2906
|
*/
|
|
2907
2907
|
async waitForElement(locator, sec = null) {
|
|
2908
2908
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2929,7 +2929,7 @@ class WebDriver extends Helper {
|
|
|
2929
2929
|
*
|
|
2930
2930
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2931
2931
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2932
|
-
*
|
|
2932
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2933
2933
|
*/
|
|
2934
2934
|
async waitForClickable(locator, waitTimeout) {
|
|
2935
2935
|
waitTimeout = waitTimeout || this.options.waitForTimeout;
|
|
@@ -2952,7 +2952,7 @@ class WebDriver extends Helper {
|
|
|
2952
2952
|
*
|
|
2953
2953
|
* @param {string} urlPart value to check.
|
|
2954
2954
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2955
|
-
*
|
|
2955
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
2956
2956
|
*/
|
|
2957
2957
|
async waitInUrl(urlPart, sec = null) {
|
|
2958
2958
|
const client = this.browser;
|
|
@@ -2996,7 +2996,7 @@ class WebDriver extends Helper {
|
|
|
2996
2996
|
*
|
|
2997
2997
|
* @param {string} urlPart value to check.
|
|
2998
2998
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2999
|
-
*
|
|
2999
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3000
3000
|
*/
|
|
3001
3001
|
async waitUrlEquals(urlPart, sec = null) {
|
|
3002
3002
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3031,7 +3031,7 @@ class WebDriver extends Helper {
|
|
|
3031
3031
|
* @param {string }text to wait for.
|
|
3032
3032
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3033
3033
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
3034
|
-
*
|
|
3034
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3035
3035
|
*
|
|
3036
3036
|
*/
|
|
3037
3037
|
async waitForText(text, sec = null, context = null) {
|
|
@@ -3078,7 +3078,7 @@ class WebDriver extends Helper {
|
|
|
3078
3078
|
* @param {LocatorOrString} field input field.
|
|
3079
3079
|
* @param {string }value expected value.
|
|
3080
3080
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3081
|
-
*
|
|
3081
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3082
3082
|
*/
|
|
3083
3083
|
async waitForValue(field, value, sec = null) {
|
|
3084
3084
|
const client = this.browser;
|
|
@@ -3123,7 +3123,7 @@ class WebDriver extends Helper {
|
|
|
3123
3123
|
*
|
|
3124
3124
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3125
3125
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3126
|
-
*
|
|
3126
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3127
3127
|
*
|
|
3128
3128
|
*/
|
|
3129
3129
|
async waitForVisible(locator, sec = null) {
|
|
@@ -3160,7 +3160,7 @@ class WebDriver extends Helper {
|
|
|
3160
3160
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3161
3161
|
* @param {number} num number of elements.
|
|
3162
3162
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3163
|
-
*
|
|
3163
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3164
3164
|
*/
|
|
3165
3165
|
async waitNumberOfVisibleElements(locator, num, sec = null) {
|
|
3166
3166
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3196,7 +3196,7 @@ class WebDriver extends Helper {
|
|
|
3196
3196
|
*
|
|
3197
3197
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3198
3198
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3199
|
-
*
|
|
3199
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3200
3200
|
*/
|
|
3201
3201
|
async waitForInvisible(locator, sec = null) {
|
|
3202
3202
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3226,7 +3226,7 @@ class WebDriver extends Helper {
|
|
|
3226
3226
|
*
|
|
3227
3227
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3228
3228
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3229
|
-
*
|
|
3229
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3230
3230
|
*/
|
|
3231
3231
|
async waitToHide(locator, sec = null) {
|
|
3232
3232
|
return this.waitForInvisible(locator, sec);
|
|
@@ -3242,7 +3242,7 @@ class WebDriver extends Helper {
|
|
|
3242
3242
|
*
|
|
3243
3243
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3244
3244
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3245
|
-
*
|
|
3245
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3246
3246
|
*/
|
|
3247
3247
|
async waitForDetached(locator, sec = null) {
|
|
3248
3248
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3281,7 +3281,7 @@ class WebDriver extends Helper {
|
|
|
3281
3281
|
* @param {string|function} fn to be executed in browser context.
|
|
3282
3282
|
* @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
|
|
3283
3283
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3284
|
-
*
|
|
3284
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3285
3285
|
*/
|
|
3286
3286
|
async waitForFunction(fn, argsOrSec = null, sec = null) {
|
|
3287
3287
|
let args = [];
|
|
@@ -3309,7 +3309,7 @@ class WebDriver extends Helper {
|
|
|
3309
3309
|
* ```
|
|
3310
3310
|
*
|
|
3311
3311
|
* @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
3312
|
-
*
|
|
3312
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3313
3313
|
*/
|
|
3314
3314
|
async switchTo(locator) {
|
|
3315
3315
|
this.browser.isInsideFrame = true;
|
|
@@ -3336,7 +3336,7 @@ class WebDriver extends Helper {
|
|
|
3336
3336
|
*
|
|
3337
3337
|
* @param {number} [num] (optional) number of tabs to switch forward, default: 1.
|
|
3338
3338
|
* @param {number | null} [sec] (optional) time in seconds to wait.
|
|
3339
|
-
*
|
|
3339
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3340
3340
|
*/
|
|
3341
3341
|
async switchToNextTab(num = 1, sec = null) {
|
|
3342
3342
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3376,7 +3376,7 @@ class WebDriver extends Helper {
|
|
|
3376
3376
|
*
|
|
3377
3377
|
* @param {number} [num] (optional) number of tabs to switch backward, default: 1.
|
|
3378
3378
|
* @param {number?} [sec] (optional) time in seconds to wait.
|
|
3379
|
-
*
|
|
3379
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3380
3380
|
*/
|
|
3381
3381
|
async switchToPreviousTab(num = 1, sec = null) {
|
|
3382
3382
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3413,7 +3413,7 @@ class WebDriver extends Helper {
|
|
|
3413
3413
|
* I.closeCurrentTab();
|
|
3414
3414
|
* ```
|
|
3415
3415
|
*
|
|
3416
|
-
*
|
|
3416
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3417
3417
|
*/
|
|
3418
3418
|
async closeCurrentTab() {
|
|
3419
3419
|
await this.browser.closeWindow();
|
|
@@ -3428,7 +3428,7 @@ class WebDriver extends Helper {
|
|
|
3428
3428
|
* I.openNewTab();
|
|
3429
3429
|
* ```
|
|
3430
3430
|
*
|
|
3431
|
-
*
|
|
3431
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3432
3432
|
*/
|
|
3433
3433
|
async openNewTab(url = 'about:blank', windowName = null) {
|
|
3434
3434
|
const client = this.browser;
|
|
@@ -3462,7 +3462,7 @@ class WebDriver extends Helper {
|
|
|
3462
3462
|
* ```js
|
|
3463
3463
|
* I.refreshPage();
|
|
3464
3464
|
* ```
|
|
3465
|
-
*
|
|
3465
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3466
3466
|
*/
|
|
3467
3467
|
async refreshPage() {
|
|
3468
3468
|
const client = this.browser;
|
|
@@ -3475,7 +3475,7 @@ class WebDriver extends Helper {
|
|
|
3475
3475
|
* ```js
|
|
3476
3476
|
* I.scrollPageToTop();
|
|
3477
3477
|
* ```
|
|
3478
|
-
*
|
|
3478
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3479
3479
|
*/
|
|
3480
3480
|
scrollPageToTop() {
|
|
3481
3481
|
const client = this.browser;
|
|
@@ -3492,7 +3492,7 @@ class WebDriver extends Helper {
|
|
|
3492
3492
|
* ```js
|
|
3493
3493
|
* I.scrollPageToBottom();
|
|
3494
3494
|
* ```
|
|
3495
|
-
*
|
|
3495
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3496
3496
|
*/
|
|
3497
3497
|
scrollPageToBottom() {
|
|
3498
3498
|
const client = this.browser;
|
|
@@ -3543,7 +3543,7 @@ class WebDriver extends Helper {
|
|
|
3543
3543
|
* @param {number} latitude to set.
|
|
3544
3544
|
* @param {number} longitude to set
|
|
3545
3545
|
* @param {number=} altitude (optional, null by default) to set
|
|
3546
|
-
*
|
|
3546
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
3547
3547
|
*/
|
|
3548
3548
|
async setGeoLocation(latitude, longitude, altitude = null) {
|
|
3549
3549
|
if (altitude) {
|
|
@@ -3607,7 +3607,6 @@ class WebDriver extends Helper {
|
|
|
3607
3607
|
* Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
|
|
3608
3608
|
* @param {*} caps
|
|
3609
3609
|
* @param {*} fn
|
|
3610
|
-
* @return {Promise<any>}
|
|
3611
3610
|
*/
|
|
3612
3611
|
/* eslint-disable */
|
|
3613
3612
|
runOnIOS(caps, fn) {
|
|
@@ -3617,7 +3616,6 @@ class WebDriver extends Helper {
|
|
|
3617
3616
|
* Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
|
|
3618
3617
|
* @param {*} caps
|
|
3619
3618
|
* @param {*} fn
|
|
3620
|
-
* @return {Promise<any>}
|
|
3621
3619
|
*/
|
|
3622
3620
|
runOnAndroid(caps, fn) {
|
|
3623
3621
|
}
|