codeceptjs 3.3.5 → 3.3.7-beta.1
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 +37 -7
- 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 +37 -7
- package/docs/commands.md +5 -3
- package/docs/configuration.md +5 -5
- 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/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 +50 -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/build/WebDriver.js
CHANGED
|
@@ -44,11 +44,11 @@ let version;
|
|
|
44
44
|
* @prop {string} browser browser in which to perform testing.
|
|
45
45
|
* @prop {string} [basicAuth] - (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
46
46
|
* @prop {string} [host=localhost] - WebDriver host to connect.
|
|
47
|
-
* @prop {
|
|
47
|
+
* @prop {number} [port=4444] - WebDriver port to connect.
|
|
48
48
|
* @prop {string} [protocol=http] - protocol for WebDriver server.
|
|
49
49
|
* @prop {string} [path=/wd/hub] - path to WebDriver server,
|
|
50
50
|
* @prop {boolean} [restart=true] - restart browser between tests.
|
|
51
|
-
* @prop {boolean} [smartWait=false] - **enables [SmartWait](http://codecept.io/acceptance/#smartwait)**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
|
|
51
|
+
* @prop {boolean|number} [smartWait=false] - **enables [SmartWait](http://codecept.io/acceptance/#smartwait)**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
|
|
52
52
|
* @prop {boolean} [disableScreenshots=false] - don't save screenshots on failure.
|
|
53
53
|
* @prop {boolean} [fullPageScreenshots=false] (optional - make full page screenshots on failure.
|
|
54
54
|
* @prop {boolean} [uniqueScreenshotNames=false] - option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
@@ -945,13 +945,13 @@ class WebDriver extends Helper {
|
|
|
945
945
|
*
|
|
946
946
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
947
947
|
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
948
|
-
*
|
|
948
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
949
949
|
*
|
|
950
950
|
*
|
|
951
951
|
* {{ react }}
|
|
952
952
|
*/
|
|
953
953
|
async click(locator, context = null) {
|
|
954
|
-
const clickMethod = this.browser.isMobile && this.browser.
|
|
954
|
+
const clickMethod = this.browser.isMobile && !this.browser.isW3C ? 'touchClick' : 'elementClick';
|
|
955
955
|
const locateFn = prepareLocateFn.call(this, context);
|
|
956
956
|
|
|
957
957
|
const res = await findClickable.call(this, locator, locateFn);
|
|
@@ -992,7 +992,7 @@ class WebDriver extends Helper {
|
|
|
992
992
|
*
|
|
993
993
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
994
994
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
995
|
-
*
|
|
995
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
996
996
|
*
|
|
997
997
|
*
|
|
998
998
|
* {{ react }}
|
|
@@ -1031,7 +1031,8 @@ class WebDriver extends Helper {
|
|
|
1031
1031
|
*
|
|
1032
1032
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1033
1033
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1034
|
-
*
|
|
1034
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1035
|
+
*
|
|
1035
1036
|
*
|
|
1036
1037
|
* {{ react }}
|
|
1037
1038
|
*/
|
|
@@ -1063,7 +1064,8 @@ class WebDriver extends Helper {
|
|
|
1063
1064
|
*
|
|
1064
1065
|
* @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
|
|
1065
1066
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1066
|
-
*
|
|
1067
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1068
|
+
*
|
|
1067
1069
|
*
|
|
1068
1070
|
* {{ react }}
|
|
1069
1071
|
*/
|
|
@@ -1106,7 +1108,8 @@ class WebDriver extends Helper {
|
|
|
1106
1108
|
*
|
|
1107
1109
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1108
1110
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1109
|
-
*
|
|
1111
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1112
|
+
*
|
|
1110
1113
|
*
|
|
1111
1114
|
* {{ react }}
|
|
1112
1115
|
*/
|
|
@@ -1147,7 +1150,8 @@ class WebDriver extends Helper {
|
|
|
1147
1150
|
* ```
|
|
1148
1151
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1149
1152
|
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1150
|
-
*
|
|
1153
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1154
|
+
*
|
|
1151
1155
|
* {{ react }}
|
|
1152
1156
|
* {{ custom }}
|
|
1153
1157
|
*
|
|
@@ -1168,7 +1172,8 @@ class WebDriver extends Helper {
|
|
|
1168
1172
|
* ```
|
|
1169
1173
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
1170
1174
|
* @param {string} value text value to append.
|
|
1171
|
-
*
|
|
1175
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1176
|
+
*
|
|
1172
1177
|
* {{ react }}
|
|
1173
1178
|
*/
|
|
1174
1179
|
async appendField(field, value) {
|
|
@@ -1187,7 +1192,8 @@ class WebDriver extends Helper {
|
|
|
1187
1192
|
* I.clearField('#email');
|
|
1188
1193
|
* ```
|
|
1189
1194
|
* @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
|
|
1190
|
-
*
|
|
1195
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder.
|
|
1196
|
+
*
|
|
1191
1197
|
*
|
|
1192
1198
|
*/
|
|
1193
1199
|
async clearField(field) {
|
|
@@ -1218,7 +1224,8 @@ class WebDriver extends Helper {
|
|
|
1218
1224
|
* ```
|
|
1219
1225
|
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
1220
1226
|
* @param {string|Array<*>} option visible text or value of option.
|
|
1221
|
-
*
|
|
1227
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1228
|
+
*
|
|
1222
1229
|
*/
|
|
1223
1230
|
async selectOption(select, option) {
|
|
1224
1231
|
const res = await findFields.call(this, select);
|
|
@@ -1251,7 +1258,7 @@ class WebDriver extends Helper {
|
|
|
1251
1258
|
|
|
1252
1259
|
/**
|
|
1253
1260
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
1254
|
-
* Path to file is relative current codecept directory (where codecept.
|
|
1261
|
+
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
1255
1262
|
* File will be uploaded to remote system (if tests are running remotely).
|
|
1256
1263
|
*
|
|
1257
1264
|
* ```js
|
|
@@ -1260,8 +1267,9 @@ class WebDriver extends Helper {
|
|
|
1260
1267
|
* ```
|
|
1261
1268
|
*
|
|
1262
1269
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
1263
|
-
* @param {string} pathToFile local file path relative to codecept.
|
|
1264
|
-
*
|
|
1270
|
+
* @param {string} pathToFile local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
1271
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1272
|
+
*
|
|
1265
1273
|
* Appium: not tested
|
|
1266
1274
|
*/
|
|
1267
1275
|
async attachFile(locator, pathToFile) {
|
|
@@ -1301,11 +1309,12 @@ class WebDriver extends Helper {
|
|
|
1301
1309
|
* ```
|
|
1302
1310
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1303
1311
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1304
|
-
*
|
|
1312
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1313
|
+
*
|
|
1305
1314
|
* Appium: not tested
|
|
1306
1315
|
*/
|
|
1307
1316
|
async checkOption(field, context = null) {
|
|
1308
|
-
const clickMethod = this.browser.isMobile && this.browser.
|
|
1317
|
+
const clickMethod = this.browser.isMobile && !this.browser.isW3C ? 'touchClick' : 'elementClick';
|
|
1309
1318
|
const locateFn = prepareLocateFn.call(this, context);
|
|
1310
1319
|
|
|
1311
1320
|
const res = await findCheckable.call(this, field, locateFn);
|
|
@@ -1332,11 +1341,12 @@ class WebDriver extends Helper {
|
|
|
1332
1341
|
* ```
|
|
1333
1342
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1334
1343
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1335
|
-
*
|
|
1344
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1345
|
+
*
|
|
1336
1346
|
* Appium: not tested
|
|
1337
1347
|
*/
|
|
1338
1348
|
async uncheckOption(field, context = null) {
|
|
1339
|
-
const clickMethod = this.browser.isMobile && this.browser.
|
|
1349
|
+
const clickMethod = this.browser.isMobile && !this.browser.isW3C ? 'touchClick' : 'elementClick';
|
|
1340
1350
|
const locateFn = prepareLocateFn.call(this, context);
|
|
1341
1351
|
|
|
1342
1352
|
const res = await findCheckable.call(this, field, locateFn);
|
|
@@ -1575,7 +1585,8 @@ class WebDriver extends Helper {
|
|
|
1575
1585
|
* ```
|
|
1576
1586
|
*
|
|
1577
1587
|
* @param {string} text text value to check.
|
|
1578
|
-
*
|
|
1588
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1589
|
+
*
|
|
1579
1590
|
*/
|
|
1580
1591
|
async seeInTitle(text) {
|
|
1581
1592
|
const title = await this.browser.getTitle();
|
|
@@ -1590,7 +1601,8 @@ class WebDriver extends Helper {
|
|
|
1590
1601
|
* ```
|
|
1591
1602
|
*
|
|
1592
1603
|
* @param {string} text value to check.
|
|
1593
|
-
*
|
|
1604
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1605
|
+
*
|
|
1594
1606
|
*/
|
|
1595
1607
|
async seeTitleEquals(text) {
|
|
1596
1608
|
const title = await this.browser.getTitle();
|
|
@@ -1605,7 +1617,8 @@ class WebDriver extends Helper {
|
|
|
1605
1617
|
* ```
|
|
1606
1618
|
*
|
|
1607
1619
|
* @param {string} text value to check.
|
|
1608
|
-
*
|
|
1620
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1621
|
+
*
|
|
1609
1622
|
*/
|
|
1610
1623
|
async dontSeeInTitle(text) {
|
|
1611
1624
|
const title = await this.browser.getTitle();
|
|
@@ -1639,7 +1652,8 @@ class WebDriver extends Helper {
|
|
|
1639
1652
|
* ```
|
|
1640
1653
|
* @param {string} text expected on page.
|
|
1641
1654
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1642
|
-
*
|
|
1655
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1656
|
+
*
|
|
1643
1657
|
*
|
|
1644
1658
|
* {{ react }}
|
|
1645
1659
|
*/
|
|
@@ -1656,7 +1670,8 @@ class WebDriver extends Helper {
|
|
|
1656
1670
|
*
|
|
1657
1671
|
* @param {string} text element value to check.
|
|
1658
1672
|
* @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
|
|
1659
|
-
*
|
|
1673
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1674
|
+
*
|
|
1660
1675
|
*/
|
|
1661
1676
|
async seeTextEquals(text, context = null) {
|
|
1662
1677
|
return proceedSee.call(this, 'assert', text, context, true);
|
|
@@ -1673,7 +1688,8 @@ class WebDriver extends Helper {
|
|
|
1673
1688
|
*
|
|
1674
1689
|
* @param {string} text which is not present.
|
|
1675
1690
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
1676
|
-
*
|
|
1691
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1692
|
+
*
|
|
1677
1693
|
*
|
|
1678
1694
|
* {{ react }}
|
|
1679
1695
|
*/
|
|
@@ -1693,7 +1709,8 @@ class WebDriver extends Helper {
|
|
|
1693
1709
|
* ```
|
|
1694
1710
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1695
1711
|
* @param {string} value value to check.
|
|
1696
|
-
*
|
|
1712
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1713
|
+
*
|
|
1697
1714
|
*
|
|
1698
1715
|
*/
|
|
1699
1716
|
async seeInField(field, value) {
|
|
@@ -1711,7 +1728,8 @@ class WebDriver extends Helper {
|
|
|
1711
1728
|
*
|
|
1712
1729
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1713
1730
|
* @param {string} value value to check.
|
|
1714
|
-
*
|
|
1731
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1732
|
+
*
|
|
1715
1733
|
*
|
|
1716
1734
|
*/
|
|
1717
1735
|
async dontSeeInField(field, value) {
|
|
@@ -1728,7 +1746,8 @@ class WebDriver extends Helper {
|
|
|
1728
1746
|
* ```
|
|
1729
1747
|
*
|
|
1730
1748
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1731
|
-
*
|
|
1749
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1750
|
+
*
|
|
1732
1751
|
* Appium: not tested
|
|
1733
1752
|
*/
|
|
1734
1753
|
async seeCheckboxIsChecked(field) {
|
|
@@ -1745,7 +1764,8 @@ class WebDriver extends Helper {
|
|
|
1745
1764
|
* ```
|
|
1746
1765
|
*
|
|
1747
1766
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1748
|
-
*
|
|
1767
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1768
|
+
*
|
|
1749
1769
|
* Appium: not tested
|
|
1750
1770
|
*/
|
|
1751
1771
|
async dontSeeCheckboxIsChecked(field) {
|
|
@@ -1760,7 +1780,8 @@ class WebDriver extends Helper {
|
|
|
1760
1780
|
* I.seeElement('#modal');
|
|
1761
1781
|
* ```
|
|
1762
1782
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1763
|
-
*
|
|
1783
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1784
|
+
*
|
|
1764
1785
|
* {{ react }}
|
|
1765
1786
|
*
|
|
1766
1787
|
*/
|
|
@@ -1779,7 +1800,8 @@ class WebDriver extends Helper {
|
|
|
1779
1800
|
* ```
|
|
1780
1801
|
*
|
|
1781
1802
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1782
|
-
*
|
|
1803
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1804
|
+
*
|
|
1783
1805
|
* {{ react }}
|
|
1784
1806
|
*/
|
|
1785
1807
|
async dontSeeElement(locator) {
|
|
@@ -1799,7 +1821,8 @@ class WebDriver extends Helper {
|
|
|
1799
1821
|
* I.seeElementInDOM('#modal');
|
|
1800
1822
|
* ```
|
|
1801
1823
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1802
|
-
*
|
|
1824
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1825
|
+
*
|
|
1803
1826
|
*
|
|
1804
1827
|
*/
|
|
1805
1828
|
async seeElementInDOM(locator) {
|
|
@@ -1815,7 +1838,8 @@ class WebDriver extends Helper {
|
|
|
1815
1838
|
* ```
|
|
1816
1839
|
*
|
|
1817
1840
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1818
|
-
*
|
|
1841
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1842
|
+
*
|
|
1819
1843
|
*
|
|
1820
1844
|
*/
|
|
1821
1845
|
async dontSeeElementInDOM(locator) {
|
|
@@ -1830,7 +1854,8 @@ class WebDriver extends Helper {
|
|
|
1830
1854
|
* I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
1831
1855
|
* ```
|
|
1832
1856
|
* @param {string} text value to check.
|
|
1833
|
-
*
|
|
1857
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1858
|
+
*
|
|
1834
1859
|
*
|
|
1835
1860
|
*/
|
|
1836
1861
|
async seeInSource(text) {
|
|
@@ -1898,7 +1923,8 @@ class WebDriver extends Helper {
|
|
|
1898
1923
|
* ```
|
|
1899
1924
|
*
|
|
1900
1925
|
* @param {string} value to check.
|
|
1901
|
-
*
|
|
1926
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1927
|
+
*
|
|
1902
1928
|
*/
|
|
1903
1929
|
async dontSeeInSource(text) {
|
|
1904
1930
|
const source = await this.browser.getPageSource();
|
|
@@ -1916,7 +1942,8 @@ class WebDriver extends Helper {
|
|
|
1916
1942
|
*
|
|
1917
1943
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1918
1944
|
* @param {number} num number of elements.
|
|
1919
|
-
*
|
|
1945
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1946
|
+
*
|
|
1920
1947
|
* {{ react }}
|
|
1921
1948
|
*/
|
|
1922
1949
|
async seeNumberOfElements(locator, num) {
|
|
@@ -1934,7 +1961,8 @@ class WebDriver extends Helper {
|
|
|
1934
1961
|
*
|
|
1935
1962
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1936
1963
|
* @param {number} num number of elements.
|
|
1937
|
-
*
|
|
1964
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1965
|
+
*
|
|
1938
1966
|
* {{ react }}
|
|
1939
1967
|
*/
|
|
1940
1968
|
async seeNumberOfVisibleElements(locator, num) {
|
|
@@ -1951,7 +1979,8 @@ class WebDriver extends Helper {
|
|
|
1951
1979
|
*
|
|
1952
1980
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1953
1981
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
1954
|
-
*
|
|
1982
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1983
|
+
*
|
|
1955
1984
|
*/
|
|
1956
1985
|
async seeCssPropertiesOnElements(locator, cssProperties) {
|
|
1957
1986
|
const res = await this._locate(locator);
|
|
@@ -1994,7 +2023,8 @@ class WebDriver extends Helper {
|
|
|
1994
2023
|
*
|
|
1995
2024
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1996
2025
|
* @param {object} attributes attributes and their values to check.
|
|
1997
|
-
*
|
|
2026
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2027
|
+
*
|
|
1998
2028
|
*/
|
|
1999
2029
|
async seeAttributesOnElements(locator, attributes) {
|
|
2000
2030
|
const res = await this._locate(locator);
|
|
@@ -2048,7 +2078,8 @@ class WebDriver extends Helper {
|
|
|
2048
2078
|
* ```
|
|
2049
2079
|
*
|
|
2050
2080
|
* @param {string} url a fragment to check
|
|
2051
|
-
*
|
|
2081
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2082
|
+
*
|
|
2052
2083
|
*
|
|
2053
2084
|
*/
|
|
2054
2085
|
async seeInCurrentUrl(url) {
|
|
@@ -2060,7 +2091,8 @@ class WebDriver extends Helper {
|
|
|
2060
2091
|
* Checks that current url does not contain a provided fragment.
|
|
2061
2092
|
*
|
|
2062
2093
|
* @param {string} url value to check.
|
|
2063
|
-
*
|
|
2094
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2095
|
+
*
|
|
2064
2096
|
*
|
|
2065
2097
|
*/
|
|
2066
2098
|
async dontSeeInCurrentUrl(url) {
|
|
@@ -2079,7 +2111,8 @@ class WebDriver extends Helper {
|
|
|
2079
2111
|
* ```
|
|
2080
2112
|
*
|
|
2081
2113
|
* @param {string} url value to check.
|
|
2082
|
-
*
|
|
2114
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2115
|
+
*
|
|
2083
2116
|
*
|
|
2084
2117
|
*/
|
|
2085
2118
|
async seeCurrentUrlEquals(url) {
|
|
@@ -2097,7 +2130,8 @@ class WebDriver extends Helper {
|
|
|
2097
2130
|
* ```
|
|
2098
2131
|
*
|
|
2099
2132
|
* @param {string} url value to check.
|
|
2100
|
-
*
|
|
2133
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2134
|
+
*
|
|
2101
2135
|
*
|
|
2102
2136
|
*/
|
|
2103
2137
|
async dontSeeCurrentUrlEquals(url) {
|
|
@@ -2131,7 +2165,7 @@ class WebDriver extends Helper {
|
|
|
2131
2165
|
*
|
|
2132
2166
|
* @param {string|function} fn function to be executed in browser context.
|
|
2133
2167
|
* @param {...any} args to be passed to function.
|
|
2134
|
-
*
|
|
2168
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2135
2169
|
*
|
|
2136
2170
|
*
|
|
2137
2171
|
*
|
|
@@ -2165,7 +2199,7 @@ class WebDriver extends Helper {
|
|
|
2165
2199
|
*
|
|
2166
2200
|
* @param {string|function} fn function to be executed in browser context.
|
|
2167
2201
|
* @param {...any} args to be passed to function.
|
|
2168
|
-
*
|
|
2202
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2169
2203
|
*
|
|
2170
2204
|
*
|
|
2171
2205
|
*/
|
|
@@ -2184,7 +2218,8 @@ class WebDriver extends Helper {
|
|
|
2184
2218
|
*
|
|
2185
2219
|
* @param {LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2186
2220
|
* @param {ScrollIntoViewOptions} scrollIntoViewOptions see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
2187
|
-
*
|
|
2221
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2222
|
+
*
|
|
2188
2223
|
*
|
|
2189
2224
|
*/
|
|
2190
2225
|
async scrollIntoView(locator, scrollIntoViewOptions) {
|
|
@@ -2206,7 +2241,8 @@ class WebDriver extends Helper {
|
|
|
2206
2241
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2207
2242
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2208
2243
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2209
|
-
*
|
|
2244
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2245
|
+
*
|
|
2210
2246
|
*
|
|
2211
2247
|
*/
|
|
2212
2248
|
async scrollTo(locator, offsetX = 0, offsetY = 0) {
|
|
@@ -2221,7 +2257,7 @@ class WebDriver extends Helper {
|
|
|
2221
2257
|
assertElementExists(res);
|
|
2222
2258
|
const elem = usingFirstElement(res);
|
|
2223
2259
|
const elementId = getElementId(elem);
|
|
2224
|
-
if (this.browser.isMobile && this.browser.
|
|
2260
|
+
if (this.browser.isMobile && !this.browser.isW3C) return this.browser.touchScroll(offsetX, offsetY, elementId);
|
|
2225
2261
|
const location = await elem.getLocation();
|
|
2226
2262
|
assertElementExists(location, 'Failed to receive', 'location');
|
|
2227
2263
|
/* eslint-disable prefer-arrow-callback */
|
|
@@ -2229,7 +2265,7 @@ class WebDriver extends Helper {
|
|
|
2229
2265
|
/* eslint-enable */
|
|
2230
2266
|
}
|
|
2231
2267
|
|
|
2232
|
-
if (this.browser.isMobile && this.browser.
|
|
2268
|
+
if (this.browser.isMobile && !this.browser.isW3C) return this.browser.touchScroll(locator, offsetX, offsetY);
|
|
2233
2269
|
|
|
2234
2270
|
/* eslint-disable prefer-arrow-callback, comma-dangle */
|
|
2235
2271
|
return this.browser.execute(function (x, y) { return window.scrollTo(x, y); }, offsetX, offsetY);
|
|
@@ -2248,7 +2284,8 @@ class WebDriver extends Helper {
|
|
|
2248
2284
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
2249
2285
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2250
2286
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2251
|
-
*
|
|
2287
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2288
|
+
*
|
|
2252
2289
|
*/
|
|
2253
2290
|
async moveCursorTo(locator, xOffset, yOffset) {
|
|
2254
2291
|
const res = await this._locate(withStrictLocator(locator), true);
|
|
@@ -2259,7 +2296,7 @@ class WebDriver extends Helper {
|
|
|
2259
2296
|
}
|
|
2260
2297
|
|
|
2261
2298
|
/**
|
|
2262
|
-
* Saves screenshot of the specified locator to ouput folder (set in codecept.
|
|
2299
|
+
* Saves screenshot of the specified locator to ouput folder (set in codecept.conf.ts or codecept.conf.js).
|
|
2263
2300
|
* Filename is relative to output folder.
|
|
2264
2301
|
*
|
|
2265
2302
|
* ```js
|
|
@@ -2268,7 +2305,8 @@ class WebDriver extends Helper {
|
|
|
2268
2305
|
*
|
|
2269
2306
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2270
2307
|
* @param {string} fileName file name to save.
|
|
2271
|
-
*
|
|
2308
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2309
|
+
*
|
|
2272
2310
|
*
|
|
2273
2311
|
*/
|
|
2274
2312
|
async saveElementScreenshot(locator, fileName) {
|
|
@@ -2283,7 +2321,7 @@ class WebDriver extends Helper {
|
|
|
2283
2321
|
}
|
|
2284
2322
|
|
|
2285
2323
|
/**
|
|
2286
|
-
* Saves a screenshot to ouput folder (set in codecept.
|
|
2324
|
+
* Saves a screenshot to ouput folder (set in codecept.conf.ts or codecept.conf.js).
|
|
2287
2325
|
* Filename is relative to output folder.
|
|
2288
2326
|
* 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.
|
|
2289
2327
|
*
|
|
@@ -2294,7 +2332,8 @@ class WebDriver extends Helper {
|
|
|
2294
2332
|
*
|
|
2295
2333
|
* @param {string} fileName file name to save.
|
|
2296
2334
|
* @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
2297
|
-
*
|
|
2335
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2336
|
+
*
|
|
2298
2337
|
*/
|
|
2299
2338
|
async saveScreenshot(fileName, fullPage = false) {
|
|
2300
2339
|
const outputFile = screenshotOutputFolder(fileName);
|
|
@@ -2349,7 +2388,8 @@ class WebDriver extends Helper {
|
|
|
2349
2388
|
* ```
|
|
2350
2389
|
*
|
|
2351
2390
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2352
|
-
*
|
|
2391
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2392
|
+
*
|
|
2353
2393
|
*
|
|
2354
2394
|
*
|
|
2355
2395
|
* Uses Selenium's JSON [cookie
|
|
@@ -2369,7 +2409,8 @@ class WebDriver extends Helper {
|
|
|
2369
2409
|
* ```
|
|
2370
2410
|
*
|
|
2371
2411
|
* @param {?string} [cookie=null] (optional, `null` by default) cookie name
|
|
2372
|
-
*
|
|
2412
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2413
|
+
*
|
|
2373
2414
|
*/
|
|
2374
2415
|
async clearCookie(cookie) {
|
|
2375
2416
|
return this.browser.deleteCookies(cookie);
|
|
@@ -2383,7 +2424,8 @@ class WebDriver extends Helper {
|
|
|
2383
2424
|
* ```
|
|
2384
2425
|
*
|
|
2385
2426
|
* @param {string} name cookie name.
|
|
2386
|
-
*
|
|
2427
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2428
|
+
*
|
|
2387
2429
|
*/
|
|
2388
2430
|
async seeCookie(name) {
|
|
2389
2431
|
const cookie = await this.browser.getCookies([name]);
|
|
@@ -2398,7 +2440,8 @@ class WebDriver extends Helper {
|
|
|
2398
2440
|
* ```
|
|
2399
2441
|
*
|
|
2400
2442
|
* @param {string} name cookie name.
|
|
2401
|
-
*
|
|
2443
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2444
|
+
*
|
|
2402
2445
|
*/
|
|
2403
2446
|
async dontSeeCookie(name) {
|
|
2404
2447
|
const cookie = await this.browser.getCookies([name]);
|
|
@@ -2494,7 +2537,8 @@ class WebDriver extends Helper {
|
|
|
2494
2537
|
* ```
|
|
2495
2538
|
*
|
|
2496
2539
|
* @param {string} key name of key to press down.
|
|
2497
|
-
*
|
|
2540
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2541
|
+
*
|
|
2498
2542
|
*/
|
|
2499
2543
|
async pressKeyDown(key) {
|
|
2500
2544
|
key = getNormalizedKey.call(this, key);
|
|
@@ -2523,7 +2567,8 @@ class WebDriver extends Helper {
|
|
|
2523
2567
|
* ```
|
|
2524
2568
|
*
|
|
2525
2569
|
* @param {string} key name of key to release.
|
|
2526
|
-
*
|
|
2570
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2571
|
+
*
|
|
2527
2572
|
*/
|
|
2528
2573
|
async pressKeyUp(key) {
|
|
2529
2574
|
key = getNormalizedKey.call(this, key);
|
|
@@ -2600,7 +2645,7 @@ class WebDriver extends Helper {
|
|
|
2600
2645
|
* - `'Tab'`
|
|
2601
2646
|
*
|
|
2602
2647
|
* @param {string|string[]} key key or array of keys to press.
|
|
2603
|
-
*
|
|
2648
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2604
2649
|
*
|
|
2605
2650
|
*
|
|
2606
2651
|
* _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.
|
|
@@ -2661,7 +2706,8 @@ class WebDriver extends Helper {
|
|
|
2661
2706
|
*
|
|
2662
2707
|
* @param {string|string[]} key or array of keys to type.
|
|
2663
2708
|
* @param {?number} [delay=null] (optional) delay in ms between key presses
|
|
2664
|
-
*
|
|
2709
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2710
|
+
*
|
|
2665
2711
|
*/
|
|
2666
2712
|
async type(keys, delay = null) {
|
|
2667
2713
|
if (!Array.isArray(keys)) {
|
|
@@ -2683,7 +2729,8 @@ class WebDriver extends Helper {
|
|
|
2683
2729
|
*
|
|
2684
2730
|
* @param {number} width width in pixels or `maximize`.
|
|
2685
2731
|
* @param {number} height height in pixels.
|
|
2686
|
-
*
|
|
2732
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2733
|
+
*
|
|
2687
2734
|
* Appium: not tested in web, in apps doesn't work
|
|
2688
2735
|
*/
|
|
2689
2736
|
async resizeWindow(width, height) {
|
|
@@ -2720,7 +2767,8 @@ class WebDriver extends Helper {
|
|
|
2720
2767
|
*
|
|
2721
2768
|
* @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
|
|
2722
2769
|
* @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
|
|
2723
|
-
*
|
|
2770
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2771
|
+
*
|
|
2724
2772
|
* Appium: not tested
|
|
2725
2773
|
*/
|
|
2726
2774
|
async dragAndDrop(srcElement, destElement) {
|
|
@@ -2746,7 +2794,8 @@ class WebDriver extends Helper {
|
|
|
2746
2794
|
*
|
|
2747
2795
|
* @param {CodeceptJS.LocatorOrString} locator located by label|name|CSS|XPath|strict locator.
|
|
2748
2796
|
* @param {number} offsetX position to drag.
|
|
2749
|
-
*
|
|
2797
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2798
|
+
*
|
|
2750
2799
|
*/
|
|
2751
2800
|
async dragSlider(locator, offsetX = 0) {
|
|
2752
2801
|
const browser = this.browser;
|
|
@@ -2833,7 +2882,8 @@ class WebDriver extends Helper {
|
|
|
2833
2882
|
* I.closeOtherTabs();
|
|
2834
2883
|
* ```
|
|
2835
2884
|
*
|
|
2836
|
-
*
|
|
2885
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2886
|
+
*
|
|
2837
2887
|
*/
|
|
2838
2888
|
async closeOtherTabs() {
|
|
2839
2889
|
const handles = await this.browser.getWindowHandles();
|
|
@@ -2855,7 +2905,8 @@ class WebDriver extends Helper {
|
|
|
2855
2905
|
* ```
|
|
2856
2906
|
*
|
|
2857
2907
|
* @param {number} sec number of second to wait.
|
|
2858
|
-
*
|
|
2908
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2909
|
+
*
|
|
2859
2910
|
*/
|
|
2860
2911
|
async wait(sec) {
|
|
2861
2912
|
return new Promise(resolve => setTimeout(resolve, sec * 1000));
|
|
@@ -2867,7 +2918,8 @@ class WebDriver extends Helper {
|
|
|
2867
2918
|
*
|
|
2868
2919
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2869
2920
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
2870
|
-
*
|
|
2921
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2922
|
+
*
|
|
2871
2923
|
*/
|
|
2872
2924
|
async waitForEnabled(locator, sec = null) {
|
|
2873
2925
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2911,7 +2963,8 @@ class WebDriver extends Helper {
|
|
|
2911
2963
|
*
|
|
2912
2964
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2913
2965
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2914
|
-
*
|
|
2966
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2967
|
+
*
|
|
2915
2968
|
*/
|
|
2916
2969
|
async waitForElement(locator, sec = null) {
|
|
2917
2970
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -2938,7 +2991,8 @@ class WebDriver extends Helper {
|
|
|
2938
2991
|
*
|
|
2939
2992
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
2940
2993
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
2941
|
-
*
|
|
2994
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2995
|
+
*
|
|
2942
2996
|
*/
|
|
2943
2997
|
async waitForClickable(locator, waitTimeout) {
|
|
2944
2998
|
waitTimeout = waitTimeout || this.options.waitForTimeout;
|
|
@@ -2961,7 +3015,8 @@ class WebDriver extends Helper {
|
|
|
2961
3015
|
*
|
|
2962
3016
|
* @param {string} urlPart value to check.
|
|
2963
3017
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
2964
|
-
*
|
|
3018
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3019
|
+
*
|
|
2965
3020
|
*/
|
|
2966
3021
|
async waitInUrl(urlPart, sec = null) {
|
|
2967
3022
|
const client = this.browser;
|
|
@@ -3005,7 +3060,8 @@ class WebDriver extends Helper {
|
|
|
3005
3060
|
*
|
|
3006
3061
|
* @param {string} urlPart value to check.
|
|
3007
3062
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3008
|
-
*
|
|
3063
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3064
|
+
*
|
|
3009
3065
|
*/
|
|
3010
3066
|
async waitUrlEquals(urlPart, sec = null) {
|
|
3011
3067
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3040,7 +3096,8 @@ class WebDriver extends Helper {
|
|
|
3040
3096
|
* @param {string }text to wait for.
|
|
3041
3097
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3042
3098
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
3043
|
-
*
|
|
3099
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3100
|
+
*
|
|
3044
3101
|
*
|
|
3045
3102
|
*/
|
|
3046
3103
|
async waitForText(text, sec = null, context = null) {
|
|
@@ -3087,7 +3144,8 @@ class WebDriver extends Helper {
|
|
|
3087
3144
|
* @param {LocatorOrString} field input field.
|
|
3088
3145
|
* @param {string }value expected value.
|
|
3089
3146
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3090
|
-
*
|
|
3147
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3148
|
+
*
|
|
3091
3149
|
*/
|
|
3092
3150
|
async waitForValue(field, value, sec = null) {
|
|
3093
3151
|
const client = this.browser;
|
|
@@ -3132,7 +3190,8 @@ class WebDriver extends Helper {
|
|
|
3132
3190
|
*
|
|
3133
3191
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3134
3192
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3135
|
-
*
|
|
3193
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3194
|
+
*
|
|
3136
3195
|
*
|
|
3137
3196
|
*/
|
|
3138
3197
|
async waitForVisible(locator, sec = null) {
|
|
@@ -3169,7 +3228,8 @@ class WebDriver extends Helper {
|
|
|
3169
3228
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3170
3229
|
* @param {number} num number of elements.
|
|
3171
3230
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3172
|
-
*
|
|
3231
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3232
|
+
*
|
|
3173
3233
|
*/
|
|
3174
3234
|
async waitNumberOfVisibleElements(locator, num, sec = null) {
|
|
3175
3235
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3205,7 +3265,8 @@ class WebDriver extends Helper {
|
|
|
3205
3265
|
*
|
|
3206
3266
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3207
3267
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3208
|
-
*
|
|
3268
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3269
|
+
*
|
|
3209
3270
|
*/
|
|
3210
3271
|
async waitForInvisible(locator, sec = null) {
|
|
3211
3272
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3235,7 +3296,8 @@ class WebDriver extends Helper {
|
|
|
3235
3296
|
*
|
|
3236
3297
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3237
3298
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3238
|
-
*
|
|
3299
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3300
|
+
*
|
|
3239
3301
|
*/
|
|
3240
3302
|
async waitToHide(locator, sec = null) {
|
|
3241
3303
|
return this.waitForInvisible(locator, sec);
|
|
@@ -3251,7 +3313,8 @@ class WebDriver extends Helper {
|
|
|
3251
3313
|
*
|
|
3252
3314
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
3253
3315
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3254
|
-
*
|
|
3316
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3317
|
+
*
|
|
3255
3318
|
*/
|
|
3256
3319
|
async waitForDetached(locator, sec = null) {
|
|
3257
3320
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3290,7 +3353,8 @@ class WebDriver extends Helper {
|
|
|
3290
3353
|
* @param {string|function} fn to be executed in browser context.
|
|
3291
3354
|
* @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
|
|
3292
3355
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3293
|
-
*
|
|
3356
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3357
|
+
*
|
|
3294
3358
|
*/
|
|
3295
3359
|
async waitForFunction(fn, argsOrSec = null, sec = null) {
|
|
3296
3360
|
let args = [];
|
|
@@ -3318,7 +3382,8 @@ class WebDriver extends Helper {
|
|
|
3318
3382
|
* ```
|
|
3319
3383
|
*
|
|
3320
3384
|
* @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
3321
|
-
*
|
|
3385
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3386
|
+
*
|
|
3322
3387
|
*/
|
|
3323
3388
|
async switchTo(locator) {
|
|
3324
3389
|
this.browser.isInsideFrame = true;
|
|
@@ -3345,7 +3410,8 @@ class WebDriver extends Helper {
|
|
|
3345
3410
|
*
|
|
3346
3411
|
* @param {number} [num] (optional) number of tabs to switch forward, default: 1.
|
|
3347
3412
|
* @param {number | null} [sec] (optional) time in seconds to wait.
|
|
3348
|
-
*
|
|
3413
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3414
|
+
*
|
|
3349
3415
|
*/
|
|
3350
3416
|
async switchToNextTab(num = 1, sec = null) {
|
|
3351
3417
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3385,7 +3451,8 @@ class WebDriver extends Helper {
|
|
|
3385
3451
|
*
|
|
3386
3452
|
* @param {number} [num] (optional) number of tabs to switch backward, default: 1.
|
|
3387
3453
|
* @param {number?} [sec] (optional) time in seconds to wait.
|
|
3388
|
-
*
|
|
3454
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3455
|
+
*
|
|
3389
3456
|
*/
|
|
3390
3457
|
async switchToPreviousTab(num = 1, sec = null) {
|
|
3391
3458
|
const aSec = sec || this.options.waitForTimeout;
|
|
@@ -3422,7 +3489,8 @@ class WebDriver extends Helper {
|
|
|
3422
3489
|
* I.closeCurrentTab();
|
|
3423
3490
|
* ```
|
|
3424
3491
|
*
|
|
3425
|
-
*
|
|
3492
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3493
|
+
*
|
|
3426
3494
|
*/
|
|
3427
3495
|
async closeCurrentTab() {
|
|
3428
3496
|
await this.browser.closeWindow();
|
|
@@ -3437,7 +3505,8 @@ class WebDriver extends Helper {
|
|
|
3437
3505
|
* I.openNewTab();
|
|
3438
3506
|
* ```
|
|
3439
3507
|
*
|
|
3440
|
-
*
|
|
3508
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3509
|
+
*
|
|
3441
3510
|
*/
|
|
3442
3511
|
async openNewTab(url = 'about:blank', windowName = null) {
|
|
3443
3512
|
const client = this.browser;
|
|
@@ -3471,7 +3540,8 @@ class WebDriver extends Helper {
|
|
|
3471
3540
|
* ```js
|
|
3472
3541
|
* I.refreshPage();
|
|
3473
3542
|
* ```
|
|
3474
|
-
*
|
|
3543
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3544
|
+
*
|
|
3475
3545
|
*/
|
|
3476
3546
|
async refreshPage() {
|
|
3477
3547
|
const client = this.browser;
|
|
@@ -3484,7 +3554,8 @@ class WebDriver extends Helper {
|
|
|
3484
3554
|
* ```js
|
|
3485
3555
|
* I.scrollPageToTop();
|
|
3486
3556
|
* ```
|
|
3487
|
-
*
|
|
3557
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3558
|
+
*
|
|
3488
3559
|
*/
|
|
3489
3560
|
scrollPageToTop() {
|
|
3490
3561
|
const client = this.browser;
|
|
@@ -3501,7 +3572,8 @@ class WebDriver extends Helper {
|
|
|
3501
3572
|
* ```js
|
|
3502
3573
|
* I.scrollPageToBottom();
|
|
3503
3574
|
* ```
|
|
3504
|
-
*
|
|
3575
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3576
|
+
*
|
|
3505
3577
|
*/
|
|
3506
3578
|
scrollPageToBottom() {
|
|
3507
3579
|
const client = this.browser;
|
|
@@ -3552,7 +3624,8 @@ class WebDriver extends Helper {
|
|
|
3552
3624
|
* @param {number} latitude to set.
|
|
3553
3625
|
* @param {number} longitude to set
|
|
3554
3626
|
* @param {number=} altitude (optional, null by default) to set
|
|
3555
|
-
*
|
|
3627
|
+
* ⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
3628
|
+
*
|
|
3556
3629
|
*/
|
|
3557
3630
|
async setGeoLocation(latitude, longitude, altitude = null) {
|
|
3558
3631
|
if (altitude) {
|