codeceptjs 3.5.10 → 3.5.11
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/docs/build/Appium.js +36 -36
- package/docs/build/Expect.js +33 -33
- package/docs/build/Nightmare.js +50 -50
- package/docs/build/Playwright.js +126 -122
- package/docs/build/Protractor.js +59 -59
- package/docs/build/Puppeteer.js +93 -89
- package/docs/build/TestCafe.js +48 -48
- package/docs/build/WebDriver.js +90 -92
- package/docs/helpers/Appium.md +1 -1
- package/docs/helpers/Expect.md +33 -33
- package/docs/helpers/Playwright.md +73 -35
- package/docs/helpers/Puppeteer.md +35 -24
- package/docs/helpers/WebDriver.md +26 -13
- package/docs/parallel.md +2 -2
- package/docs/plugins.md +3 -3
- package/docs/react.md +2 -1
- package/docs/vue.md +22 -0
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/lib/command/workers/runTests.js +17 -1
- package/lib/helper/Expect.js +33 -33
- package/lib/helper/Playwright.js +28 -24
- package/lib/helper/Puppeteer.js +23 -19
- package/lib/helper/WebDriver.js +15 -17
- package/lib/helper/extras/PlaywrightReactVueLocator.js +38 -0
- package/lib/plugin/retryFailedStep.js +2 -2
- package/lib/plugin/tryTo.js +5 -4
- package/package.json +15 -15
- package/typings/index.d.ts +1 -1
- package/typings/promiseBasedTypes.d.ts +119 -74
- package/typings/types.d.ts +111 -143
- package/lib/helper/extras/PlaywrightReact.js +0 -9
package/docs/build/WebDriver.js
CHANGED
|
@@ -776,7 +776,7 @@ class WebDriver extends Helper {
|
|
|
776
776
|
* ```
|
|
777
777
|
*
|
|
778
778
|
*
|
|
779
|
-
* @param {
|
|
779
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
780
780
|
*/
|
|
781
781
|
async _locate(locator, smartWait = false) {
|
|
782
782
|
if (require('../store').debugMode) smartWait = false;
|
|
@@ -835,7 +835,7 @@ class WebDriver extends Helper {
|
|
|
835
835
|
* this.helpers['WebDriver']._locateCheckable('I agree with terms and conditions').then // ...
|
|
836
836
|
* ```
|
|
837
837
|
*
|
|
838
|
-
* @param {
|
|
838
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
839
839
|
*/
|
|
840
840
|
async _locateCheckable(locator) {
|
|
841
841
|
return findCheckable.call(this, locator, this.$$.bind(this)).then(res => res);
|
|
@@ -849,7 +849,7 @@ class WebDriver extends Helper {
|
|
|
849
849
|
* const els = await this.helpers.WebDriver._locateClickable('Next page', '.pages');
|
|
850
850
|
* ```
|
|
851
851
|
*
|
|
852
|
-
* @param {
|
|
852
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
853
853
|
*/
|
|
854
854
|
async _locateClickable(locator, context) {
|
|
855
855
|
const locateFn = prepareLocateFn.call(this, context);
|
|
@@ -863,7 +863,7 @@ class WebDriver extends Helper {
|
|
|
863
863
|
* this.helpers['WebDriver']._locateFields('Your email').then // ...
|
|
864
864
|
* ```
|
|
865
865
|
*
|
|
866
|
-
* @param {
|
|
866
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
867
867
|
*/
|
|
868
868
|
async _locateFields(locator) {
|
|
869
869
|
return findFields.call(this, locator).then(res => res);
|
|
@@ -877,7 +877,7 @@ class WebDriver extends Helper {
|
|
|
877
877
|
* const webElements = await I.grabWebElements('#button');
|
|
878
878
|
* ```
|
|
879
879
|
*
|
|
880
|
-
* @param {
|
|
880
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
881
881
|
* @returns {Promise<*>} WebElement of being used Web helper
|
|
882
882
|
*
|
|
883
883
|
*
|
|
@@ -956,8 +956,8 @@ class WebDriver extends Helper {
|
|
|
956
956
|
* I.click({css: 'nav a.login'});
|
|
957
957
|
* ```
|
|
958
958
|
*
|
|
959
|
-
* @param {
|
|
960
|
-
* @param {?
|
|
959
|
+
* @param {string | object} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
960
|
+
* @param {?string | object | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
961
961
|
* @returns {void} automatically synchronized promise through #recorder
|
|
962
962
|
*
|
|
963
963
|
*
|
|
@@ -1004,8 +1004,8 @@ class WebDriver extends Helper {
|
|
|
1004
1004
|
* I.forceClick({css: 'nav a.login'});
|
|
1005
1005
|
* ```
|
|
1006
1006
|
*
|
|
1007
|
-
* @param {
|
|
1008
|
-
* @param {?
|
|
1007
|
+
* @param {string | object} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1008
|
+
* @param {?string | object} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1009
1009
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1010
1010
|
*
|
|
1011
1011
|
*
|
|
@@ -1044,8 +1044,8 @@ class WebDriver extends Helper {
|
|
|
1044
1044
|
* I.doubleClick('.btn.edit');
|
|
1045
1045
|
* ```
|
|
1046
1046
|
*
|
|
1047
|
-
* @param {
|
|
1048
|
-
* @param {?
|
|
1047
|
+
* @param {string | object} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1048
|
+
* @param {?string | object} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1049
1049
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1050
1050
|
*
|
|
1051
1051
|
*
|
|
@@ -1078,8 +1078,8 @@ class WebDriver extends Helper {
|
|
|
1078
1078
|
* I.rightClick('Click me', '.context');
|
|
1079
1079
|
* ```
|
|
1080
1080
|
*
|
|
1081
|
-
* @param {
|
|
1082
|
-
* @param {?
|
|
1081
|
+
* @param {string | object} locator clickable element located by CSS|XPath|strict locator.
|
|
1082
|
+
* @param {?string | object} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1083
1083
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1084
1084
|
*
|
|
1085
1085
|
*
|
|
@@ -1122,8 +1122,8 @@ class WebDriver extends Helper {
|
|
|
1122
1122
|
* I.forceRightClick('Menu');
|
|
1123
1123
|
* ```
|
|
1124
1124
|
*
|
|
1125
|
-
* @param {
|
|
1126
|
-
* @param {?
|
|
1125
|
+
* @param {string | object} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1126
|
+
* @param {?string | object} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1127
1127
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1128
1128
|
*
|
|
1129
1129
|
*
|
|
@@ -1164,8 +1164,8 @@ class WebDriver extends Helper {
|
|
|
1164
1164
|
* // or by strict locator
|
|
1165
1165
|
* I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
1166
1166
|
* ```
|
|
1167
|
-
* @param {
|
|
1168
|
-
* @param {
|
|
1167
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator.
|
|
1168
|
+
* @param {string | object} value text value to fill.
|
|
1169
1169
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1170
1170
|
*
|
|
1171
1171
|
* {{ react }}
|
|
@@ -1189,7 +1189,7 @@ class WebDriver extends Helper {
|
|
|
1189
1189
|
* // typing secret
|
|
1190
1190
|
* I.appendField('password', secret('123456'));
|
|
1191
1191
|
* ```
|
|
1192
|
-
* @param {
|
|
1192
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator
|
|
1193
1193
|
* @param {string} value text value to append.
|
|
1194
1194
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1195
1195
|
*
|
|
@@ -1211,7 +1211,7 @@ class WebDriver extends Helper {
|
|
|
1211
1211
|
* I.clearField('user[email]');
|
|
1212
1212
|
* I.clearField('#email');
|
|
1213
1213
|
* ```
|
|
1214
|
-
* @param {
|
|
1214
|
+
* @param {string | object} editable field located by label|name|CSS|XPath|strict locator.
|
|
1215
1215
|
* @returns {void} automatically synchronized promise through #recorder.
|
|
1216
1216
|
*
|
|
1217
1217
|
*
|
|
@@ -1243,7 +1243,7 @@ class WebDriver extends Helper {
|
|
|
1243
1243
|
* ```js
|
|
1244
1244
|
* I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
1245
1245
|
* ```
|
|
1246
|
-
* @param {
|
|
1246
|
+
* @param {string | object} select field located by label|name|CSS|XPath|strict locator.
|
|
1247
1247
|
* @param {string|Array<*>} option visible text or value of option.
|
|
1248
1248
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1249
1249
|
*
|
|
@@ -1279,6 +1279,8 @@ class WebDriver extends Helper {
|
|
|
1279
1279
|
}
|
|
1280
1280
|
|
|
1281
1281
|
/**
|
|
1282
|
+
* Appium: not tested
|
|
1283
|
+
*
|
|
1282
1284
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
1283
1285
|
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
1284
1286
|
* File will be uploaded to remote system (if tests are running remotely).
|
|
@@ -1288,11 +1290,10 @@ class WebDriver extends Helper {
|
|
|
1288
1290
|
* I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
1289
1291
|
* ```
|
|
1290
1292
|
*
|
|
1291
|
-
* @param {
|
|
1293
|
+
* @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
|
|
1292
1294
|
* @param {string} pathToFile local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
1293
1295
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1294
1296
|
*
|
|
1295
|
-
* Appium: not tested
|
|
1296
1297
|
*/
|
|
1297
1298
|
async attachFile(locator, pathToFile) {
|
|
1298
1299
|
let file = path.join(global.codecept_dir, pathToFile);
|
|
@@ -1319,6 +1320,7 @@ class WebDriver extends Helper {
|
|
|
1319
1320
|
}
|
|
1320
1321
|
|
|
1321
1322
|
/**
|
|
1323
|
+
* Appium: not tested
|
|
1322
1324
|
* Selects a checkbox or radio button.
|
|
1323
1325
|
* Element is located by label or name or CSS or XPath.
|
|
1324
1326
|
*
|
|
@@ -1329,11 +1331,10 @@ class WebDriver extends Helper {
|
|
|
1329
1331
|
* I.checkOption('I Agree to Terms and Conditions');
|
|
1330
1332
|
* I.checkOption('agree', '//form');
|
|
1331
1333
|
* ```
|
|
1332
|
-
* @param {
|
|
1333
|
-
* @param {?
|
|
1334
|
+
* @param {string | object} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1335
|
+
* @param {?string | object} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1334
1336
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1335
1337
|
*
|
|
1336
|
-
* Appium: not tested
|
|
1337
1338
|
*/
|
|
1338
1339
|
async checkOption(field, context = null) {
|
|
1339
1340
|
const clickMethod = this.browser.isMobile && !this.browser.isW3C ? 'touchClick' : 'elementClick';
|
|
@@ -1352,6 +1353,7 @@ class WebDriver extends Helper {
|
|
|
1352
1353
|
}
|
|
1353
1354
|
|
|
1354
1355
|
/**
|
|
1356
|
+
* Appium: not tested
|
|
1355
1357
|
* Unselects a checkbox or radio button.
|
|
1356
1358
|
* Element is located by label or name or CSS or XPath.
|
|
1357
1359
|
*
|
|
@@ -1362,11 +1364,10 @@ class WebDriver extends Helper {
|
|
|
1362
1364
|
* I.uncheckOption('I Agree to Terms and Conditions');
|
|
1363
1365
|
* I.uncheckOption('agree', '//form');
|
|
1364
1366
|
* ```
|
|
1365
|
-
* @param {
|
|
1366
|
-
* @param {?
|
|
1367
|
+
* @param {string | object} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1368
|
+
* @param {?string | object} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1367
1369
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1368
1370
|
*
|
|
1369
|
-
* Appium: not tested
|
|
1370
1371
|
*/
|
|
1371
1372
|
async uncheckOption(field, context = null) {
|
|
1372
1373
|
const clickMethod = this.browser.isMobile && !this.browser.isW3C ? 'touchClick' : 'elementClick';
|
|
@@ -1392,7 +1393,7 @@ class WebDriver extends Helper {
|
|
|
1392
1393
|
* let pins = await I.grabTextFromAll('#pin li');
|
|
1393
1394
|
* ```
|
|
1394
1395
|
*
|
|
1395
|
-
* @param {
|
|
1396
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1396
1397
|
* @returns {Promise<string[]>} attribute value
|
|
1397
1398
|
*
|
|
1398
1399
|
*
|
|
@@ -1413,7 +1414,7 @@ class WebDriver extends Helper {
|
|
|
1413
1414
|
* ```
|
|
1414
1415
|
* If multiple elements found returns first element.
|
|
1415
1416
|
*
|
|
1416
|
-
* @param {
|
|
1417
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1417
1418
|
* @returns {Promise<string>} attribute value
|
|
1418
1419
|
*
|
|
1419
1420
|
*
|
|
@@ -1436,7 +1437,7 @@ class WebDriver extends Helper {
|
|
|
1436
1437
|
* let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
1437
1438
|
* ```
|
|
1438
1439
|
*
|
|
1439
|
-
* @param {
|
|
1440
|
+
* @param {string | object} element located by CSS|XPath|strict locator.
|
|
1440
1441
|
* @returns {Promise<string[]>} HTML code for an element
|
|
1441
1442
|
*
|
|
1442
1443
|
*
|
|
@@ -1457,7 +1458,7 @@ class WebDriver extends Helper {
|
|
|
1457
1458
|
* let postHTML = await I.grabHTMLFrom('#post');
|
|
1458
1459
|
* ```
|
|
1459
1460
|
*
|
|
1460
|
-
* @param {
|
|
1461
|
+
* @param {string | object} element located by CSS|XPath|strict locator.
|
|
1461
1462
|
* @returns {Promise<string>} HTML code for an element
|
|
1462
1463
|
*
|
|
1463
1464
|
*
|
|
@@ -1479,7 +1480,7 @@ class WebDriver extends Helper {
|
|
|
1479
1480
|
* ```js
|
|
1480
1481
|
* let inputs = await I.grabValueFromAll('//form/input');
|
|
1481
1482
|
* ```
|
|
1482
|
-
* @param {
|
|
1483
|
+
* @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
|
|
1483
1484
|
* @returns {Promise<string[]>} attribute value
|
|
1484
1485
|
*
|
|
1485
1486
|
*
|
|
@@ -1500,7 +1501,7 @@ class WebDriver extends Helper {
|
|
|
1500
1501
|
* ```js
|
|
1501
1502
|
* let email = await I.grabValueFrom('input[name=email]');
|
|
1502
1503
|
* ```
|
|
1503
|
-
* @param {
|
|
1504
|
+
* @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
|
|
1504
1505
|
* @returns {Promise<string>} attribute value
|
|
1505
1506
|
*
|
|
1506
1507
|
*
|
|
@@ -1523,7 +1524,7 @@ class WebDriver extends Helper {
|
|
|
1523
1524
|
* const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
1524
1525
|
* ```
|
|
1525
1526
|
*
|
|
1526
|
-
* @param {
|
|
1527
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1527
1528
|
* @param {string} cssProperty CSS property name.
|
|
1528
1529
|
* @returns {Promise<string[]>} CSS value
|
|
1529
1530
|
*
|
|
@@ -1544,7 +1545,7 @@ class WebDriver extends Helper {
|
|
|
1544
1545
|
* const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
1545
1546
|
* ```
|
|
1546
1547
|
*
|
|
1547
|
-
* @param {
|
|
1548
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1548
1549
|
* @param {string} cssProperty CSS property name.
|
|
1549
1550
|
* @returns {Promise<string>} CSS value
|
|
1550
1551
|
*
|
|
@@ -1567,7 +1568,7 @@ class WebDriver extends Helper {
|
|
|
1567
1568
|
* ```js
|
|
1568
1569
|
* let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
1569
1570
|
* ```
|
|
1570
|
-
* @param {
|
|
1571
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1571
1572
|
* @param {string} attr attribute name.
|
|
1572
1573
|
* @returns {Promise<string[]>} attribute value
|
|
1573
1574
|
*
|
|
@@ -1587,7 +1588,7 @@ class WebDriver extends Helper {
|
|
|
1587
1588
|
* ```js
|
|
1588
1589
|
* let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
1589
1590
|
* ```
|
|
1590
|
-
* @param {
|
|
1591
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1591
1592
|
* @param {string} attr attribute name.
|
|
1592
1593
|
* @returns {Promise<string>} attribute value
|
|
1593
1594
|
*
|
|
@@ -1675,7 +1676,7 @@ class WebDriver extends Helper {
|
|
|
1675
1676
|
* I.see('Register', {css: 'form.register'}); // use strict locator
|
|
1676
1677
|
* ```
|
|
1677
1678
|
* @param {string} text expected on page.
|
|
1678
|
-
* @param {?
|
|
1679
|
+
* @param {?string | object} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1679
1680
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1680
1681
|
*
|
|
1681
1682
|
*
|
|
@@ -1693,7 +1694,7 @@ class WebDriver extends Helper {
|
|
|
1693
1694
|
* ```
|
|
1694
1695
|
*
|
|
1695
1696
|
* @param {string} text element value to check.
|
|
1696
|
-
* @param {
|
|
1697
|
+
* @param {(string | object)?} [context=null] element located by CSS|XPath|strict locator.
|
|
1697
1698
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1698
1699
|
*
|
|
1699
1700
|
*/
|
|
@@ -1711,7 +1712,7 @@ class WebDriver extends Helper {
|
|
|
1711
1712
|
* ```
|
|
1712
1713
|
*
|
|
1713
1714
|
* @param {string} text which is not present.
|
|
1714
|
-
* @param {
|
|
1715
|
+
* @param {string | object} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
1715
1716
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1716
1717
|
*
|
|
1717
1718
|
*
|
|
@@ -1731,8 +1732,8 @@ class WebDriver extends Helper {
|
|
|
1731
1732
|
* I.seeInField('form input[type=hidden]','hidden_value');
|
|
1732
1733
|
* I.seeInField('#searchform input','Search');
|
|
1733
1734
|
* ```
|
|
1734
|
-
* @param {
|
|
1735
|
-
* @param {
|
|
1735
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator.
|
|
1736
|
+
* @param {string | object} value value to check.
|
|
1736
1737
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1737
1738
|
*
|
|
1738
1739
|
*
|
|
@@ -1751,8 +1752,8 @@ class WebDriver extends Helper {
|
|
|
1751
1752
|
* I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
1752
1753
|
* ```
|
|
1753
1754
|
*
|
|
1754
|
-
* @param {
|
|
1755
|
-
* @param {
|
|
1755
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator.
|
|
1756
|
+
* @param {string | object} value value to check.
|
|
1756
1757
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1757
1758
|
*
|
|
1758
1759
|
*
|
|
@@ -1763,6 +1764,7 @@ class WebDriver extends Helper {
|
|
|
1763
1764
|
}
|
|
1764
1765
|
|
|
1765
1766
|
/**
|
|
1767
|
+
* Appium: not tested
|
|
1766
1768
|
* Verifies that the specified checkbox is checked.
|
|
1767
1769
|
*
|
|
1768
1770
|
* ```js
|
|
@@ -1771,16 +1773,16 @@ class WebDriver extends Helper {
|
|
|
1771
1773
|
* I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
1772
1774
|
* ```
|
|
1773
1775
|
*
|
|
1774
|
-
* @param {
|
|
1776
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator.
|
|
1775
1777
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1776
1778
|
*
|
|
1777
|
-
* Appium: not tested
|
|
1778
1779
|
*/
|
|
1779
1780
|
async seeCheckboxIsChecked(field) {
|
|
1780
1781
|
return proceedSeeCheckbox.call(this, 'assert', field);
|
|
1781
1782
|
}
|
|
1782
1783
|
|
|
1783
1784
|
/**
|
|
1785
|
+
* Appium: not tested
|
|
1784
1786
|
* Verifies that the specified checkbox is not checked.
|
|
1785
1787
|
*
|
|
1786
1788
|
* ```js
|
|
@@ -1789,10 +1791,9 @@ class WebDriver extends Helper {
|
|
|
1789
1791
|
* I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
1790
1792
|
* ```
|
|
1791
1793
|
*
|
|
1792
|
-
* @param {
|
|
1794
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator.
|
|
1793
1795
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1794
1796
|
*
|
|
1795
|
-
* Appium: not tested
|
|
1796
1797
|
*/
|
|
1797
1798
|
async dontSeeCheckboxIsChecked(field) {
|
|
1798
1799
|
return proceedSeeCheckbox.call(this, 'negate', field);
|
|
@@ -1805,7 +1806,7 @@ class WebDriver extends Helper {
|
|
|
1805
1806
|
* ```js
|
|
1806
1807
|
* I.seeElement('#modal');
|
|
1807
1808
|
* ```
|
|
1808
|
-
* @param {
|
|
1809
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
1809
1810
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1810
1811
|
*
|
|
1811
1812
|
* {{ react }}
|
|
@@ -1825,7 +1826,7 @@ class WebDriver extends Helper {
|
|
|
1825
1826
|
* I.dontSeeElement('.modal'); // modal is not shown
|
|
1826
1827
|
* ```
|
|
1827
1828
|
*
|
|
1828
|
-
* @param {
|
|
1829
|
+
* @param {string | object} locator located by CSS|XPath|Strict locator.
|
|
1829
1830
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1830
1831
|
*
|
|
1831
1832
|
* {{ react }}
|
|
@@ -1846,7 +1847,7 @@ class WebDriver extends Helper {
|
|
|
1846
1847
|
* ```js
|
|
1847
1848
|
* I.seeElementInDOM('#modal');
|
|
1848
1849
|
* ```
|
|
1849
|
-
* @param {
|
|
1850
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1850
1851
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1851
1852
|
*
|
|
1852
1853
|
*
|
|
@@ -1863,7 +1864,7 @@ class WebDriver extends Helper {
|
|
|
1863
1864
|
* I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
|
|
1864
1865
|
* ```
|
|
1865
1866
|
*
|
|
1866
|
-
* @param {
|
|
1867
|
+
* @param {string | object} locator located by CSS|XPath|Strict locator.
|
|
1867
1868
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1868
1869
|
*
|
|
1869
1870
|
*
|
|
@@ -1966,7 +1967,7 @@ class WebDriver extends Helper {
|
|
|
1966
1967
|
* I.seeNumberOfElements('#submitBtn', 1);
|
|
1967
1968
|
* ```
|
|
1968
1969
|
*
|
|
1969
|
-
* @param {
|
|
1970
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1970
1971
|
* @param {number} num number of elements.
|
|
1971
1972
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1972
1973
|
*
|
|
@@ -1985,7 +1986,7 @@ class WebDriver extends Helper {
|
|
|
1985
1986
|
* I.seeNumberOfVisibleElements('.buttons', 3);
|
|
1986
1987
|
* ```
|
|
1987
1988
|
*
|
|
1988
|
-
* @param {
|
|
1989
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1989
1990
|
* @param {number} num number of elements.
|
|
1990
1991
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1991
1992
|
*
|
|
@@ -2003,7 +2004,7 @@ class WebDriver extends Helper {
|
|
|
2003
2004
|
* I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
2004
2005
|
* ```
|
|
2005
2006
|
*
|
|
2006
|
-
* @param {
|
|
2007
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
2007
2008
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
2008
2009
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2009
2010
|
*
|
|
@@ -2049,7 +2050,7 @@ class WebDriver extends Helper {
|
|
|
2049
2050
|
* I.seeAttributesOnElements('//form', { method: "post"});
|
|
2050
2051
|
* ```
|
|
2051
2052
|
*
|
|
2052
|
-
* @param {
|
|
2053
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
2053
2054
|
* @param {object} attributes attributes and their values to check.
|
|
2054
2055
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2055
2056
|
*
|
|
@@ -2088,7 +2089,7 @@ class WebDriver extends Helper {
|
|
|
2088
2089
|
* let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
2089
2090
|
* ```
|
|
2090
2091
|
*
|
|
2091
|
-
* @param {
|
|
2092
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
2092
2093
|
* @returns {Promise<number>} number of visible elements
|
|
2093
2094
|
*/
|
|
2094
2095
|
async grabNumberOfVisibleElements(locator) {
|
|
@@ -2170,6 +2171,8 @@ class WebDriver extends Helper {
|
|
|
2170
2171
|
}
|
|
2171
2172
|
|
|
2172
2173
|
/**
|
|
2174
|
+
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
2175
|
+
*
|
|
2173
2176
|
* Executes sync script on a page.
|
|
2174
2177
|
* Pass arguments to function as additional parameters.
|
|
2175
2178
|
* Will return execution result to a test.
|
|
@@ -2197,9 +2200,6 @@ class WebDriver extends Helper {
|
|
|
2197
2200
|
* @param {...any} args to be passed to function.
|
|
2198
2201
|
* @returns {Promise<any>} script return value
|
|
2199
2202
|
*
|
|
2200
|
-
*
|
|
2201
|
-
*
|
|
2202
|
-
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
2203
2203
|
*/
|
|
2204
2204
|
executeScript(...args) {
|
|
2205
2205
|
return this.browser.execute.apply(this.browser, args);
|
|
@@ -2246,8 +2246,8 @@ class WebDriver extends Helper {
|
|
|
2246
2246
|
* I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
|
|
2247
2247
|
* ```
|
|
2248
2248
|
*
|
|
2249
|
-
* @param {
|
|
2250
|
-
* @param {ScrollIntoViewOptions} scrollIntoViewOptions
|
|
2249
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
2250
|
+
* @param {ScrollIntoViewOptions|boolean} scrollIntoViewOptions either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
2251
2251
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2252
2252
|
*
|
|
2253
2253
|
*
|
|
@@ -2268,7 +2268,7 @@ class WebDriver extends Helper {
|
|
|
2268
2268
|
* I.scrollTo('#submit', 5, 5);
|
|
2269
2269
|
* ```
|
|
2270
2270
|
*
|
|
2271
|
-
* @param {
|
|
2271
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
2272
2272
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2273
2273
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2274
2274
|
* @returns {void} automatically synchronized promise through #recorder
|
|
@@ -2311,7 +2311,7 @@ class WebDriver extends Helper {
|
|
|
2311
2311
|
* I.moveCursorTo('#submit', 5,5);
|
|
2312
2312
|
* ```
|
|
2313
2313
|
*
|
|
2314
|
-
* @param {
|
|
2314
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
2315
2315
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2316
2316
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2317
2317
|
* @returns {void} automatically synchronized promise through #recorder
|
|
@@ -2332,7 +2332,7 @@ class WebDriver extends Helper {
|
|
|
2332
2332
|
* I.saveElementScreenshot(`#submit`,'debug.png');
|
|
2333
2333
|
* ```
|
|
2334
2334
|
*
|
|
2335
|
-
* @param {
|
|
2335
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
2336
2336
|
* @param {string} fileName file name to save.
|
|
2337
2337
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2338
2338
|
*
|
|
@@ -2402,6 +2402,7 @@ class WebDriver extends Helper {
|
|
|
2402
2402
|
}
|
|
2403
2403
|
|
|
2404
2404
|
/**
|
|
2405
|
+
* Uses Selenium's JSON [cookie format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
|
|
2405
2406
|
* Sets cookie(s).
|
|
2406
2407
|
*
|
|
2407
2408
|
* Can be a single cookie object or an array of cookies:
|
|
@@ -2419,10 +2420,6 @@ class WebDriver extends Helper {
|
|
|
2419
2420
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2420
2421
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2421
2422
|
*
|
|
2422
|
-
*
|
|
2423
|
-
*
|
|
2424
|
-
* Uses Selenium's JSON [cookie
|
|
2425
|
-
* format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
|
|
2426
2423
|
*/
|
|
2427
2424
|
async setCookie(cookie) {
|
|
2428
2425
|
return this.browser.setCookies(cookie);
|
|
@@ -2511,7 +2508,7 @@ class WebDriver extends Helper {
|
|
|
2511
2508
|
}
|
|
2512
2509
|
|
|
2513
2510
|
/**
|
|
2514
|
-
* Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt
|
|
2511
|
+
* Dismisses the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`.
|
|
2515
2512
|
*
|
|
2516
2513
|
*/
|
|
2517
2514
|
async cancelPopup() {
|
|
@@ -2614,6 +2611,8 @@ class WebDriver extends Helper {
|
|
|
2614
2611
|
}
|
|
2615
2612
|
|
|
2616
2613
|
/**
|
|
2614
|
+
* _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.
|
|
2615
|
+
*
|
|
2617
2616
|
* Presses a key in the browser (on a focused element).
|
|
2618
2617
|
*
|
|
2619
2618
|
* _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
|
|
@@ -2675,8 +2674,6 @@ class WebDriver extends Helper {
|
|
|
2675
2674
|
* @param {string|string[]} key key or array of keys to press.
|
|
2676
2675
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2677
2676
|
*
|
|
2678
|
-
*
|
|
2679
|
-
* _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.
|
|
2680
2677
|
*/
|
|
2681
2678
|
async pressKey(key) {
|
|
2682
2679
|
const modifiers = [];
|
|
@@ -2756,6 +2753,8 @@ class WebDriver extends Helper {
|
|
|
2756
2753
|
}
|
|
2757
2754
|
|
|
2758
2755
|
/**
|
|
2756
|
+
* Appium: not tested in web, in apps doesn't work
|
|
2757
|
+
*
|
|
2759
2758
|
* Resize the current window to provided width and height.
|
|
2760
2759
|
* First parameter can be set to `maximize`.
|
|
2761
2760
|
*
|
|
@@ -2763,7 +2762,6 @@ class WebDriver extends Helper {
|
|
|
2763
2762
|
* @param {number} height height in pixels.
|
|
2764
2763
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2765
2764
|
*
|
|
2766
|
-
* Appium: not tested in web, in apps doesn't work
|
|
2767
2765
|
*/
|
|
2768
2766
|
async resizeWindow(width, height) {
|
|
2769
2767
|
return this._resizeBrowserWindow(this.browser, width, height);
|
|
@@ -2801,7 +2799,7 @@ class WebDriver extends Helper {
|
|
|
2801
2799
|
* I.see('#add-to-cart-bnt');
|
|
2802
2800
|
* ```
|
|
2803
2801
|
*
|
|
2804
|
-
* @param {
|
|
2802
|
+
* @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
|
|
2805
2803
|
* @param {any} [options] Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
|
|
2806
2804
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2807
2805
|
*
|
|
@@ -2831,7 +2829,7 @@ class WebDriver extends Helper {
|
|
|
2831
2829
|
* I.dontSee('#add-to-cart-btn');
|
|
2832
2830
|
* ```
|
|
2833
2831
|
*
|
|
2834
|
-
* @param {
|
|
2832
|
+
* @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
|
|
2835
2833
|
* @param {any} [options] Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
|
|
2836
2834
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2837
2835
|
*
|
|
@@ -2846,17 +2844,17 @@ class WebDriver extends Helper {
|
|
|
2846
2844
|
}
|
|
2847
2845
|
|
|
2848
2846
|
/**
|
|
2847
|
+
* Appium: not tested
|
|
2849
2848
|
* Drag an item to a destination element.
|
|
2850
2849
|
*
|
|
2851
2850
|
* ```js
|
|
2852
2851
|
* I.dragAndDrop('#dragHandle', '#container');
|
|
2853
2852
|
* ```
|
|
2854
2853
|
*
|
|
2855
|
-
* @param {
|
|
2856
|
-
* @param {
|
|
2854
|
+
* @param {string | object} srcElement located by CSS|XPath|strict locator.
|
|
2855
|
+
* @param {string | object} destElement located by CSS|XPath|strict locator.
|
|
2857
2856
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2858
2857
|
*
|
|
2859
|
-
* Appium: not tested
|
|
2860
2858
|
*/
|
|
2861
2859
|
async dragAndDrop(srcElement, destElement) {
|
|
2862
2860
|
let sourceEl = await this._locate(srcElement);
|
|
@@ -2879,7 +2877,7 @@ class WebDriver extends Helper {
|
|
|
2879
2877
|
* I.dragSlider('#slider', -70);
|
|
2880
2878
|
* ```
|
|
2881
2879
|
*
|
|
2882
|
-
* @param {
|
|
2880
|
+
* @param {string | object} locator located by label|name|CSS|XPath|strict locator.
|
|
2883
2881
|
* @param {number} offsetX position to drag.
|
|
2884
2882
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2885
2883
|
*
|
|
@@ -3005,7 +3003,7 @@ class WebDriver extends Helper {
|
|
|
3005
3003
|
* Waits for element to become enabled (by default waits for 1sec).
|
|
3006
3004
|
* Element can be located by CSS or XPath.
|
|
3007
3005
|
*
|
|
3008
|
-
* @param {
|
|
3006
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3009
3007
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
3010
3008
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3011
3009
|
*
|
|
@@ -3038,7 +3036,7 @@ class WebDriver extends Helper {
|
|
|
3038
3036
|
* I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
3039
3037
|
* ```
|
|
3040
3038
|
*
|
|
3041
|
-
* @param {
|
|
3039
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3042
3040
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3043
3041
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3044
3042
|
*
|
|
@@ -3061,7 +3059,7 @@ class WebDriver extends Helper {
|
|
|
3061
3059
|
* I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
3062
3060
|
* ```
|
|
3063
3061
|
*
|
|
3064
|
-
* @param {
|
|
3062
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3065
3063
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3066
3064
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3067
3065
|
*
|
|
@@ -3154,7 +3152,7 @@ class WebDriver extends Helper {
|
|
|
3154
3152
|
*
|
|
3155
3153
|
* @param {string }text to wait for.
|
|
3156
3154
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3157
|
-
* @param {
|
|
3155
|
+
* @param {string | object} [context] (optional) element located by CSS|XPath|strict locator.
|
|
3158
3156
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3159
3157
|
*
|
|
3160
3158
|
*
|
|
@@ -3184,7 +3182,7 @@ class WebDriver extends Helper {
|
|
|
3184
3182
|
* I.waitForValue('//input', "GoodValue");
|
|
3185
3183
|
* ```
|
|
3186
3184
|
*
|
|
3187
|
-
* @param {
|
|
3185
|
+
* @param {string | object} field input field.
|
|
3188
3186
|
* @param {string }value expected value.
|
|
3189
3187
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3190
3188
|
* @returns {void} automatically synchronized promise through #recorder
|
|
@@ -3216,7 +3214,7 @@ class WebDriver extends Helper {
|
|
|
3216
3214
|
* I.waitForVisible('#popup');
|
|
3217
3215
|
* ```
|
|
3218
3216
|
*
|
|
3219
|
-
* @param {
|
|
3217
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3220
3218
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3221
3219
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3222
3220
|
*
|
|
@@ -3243,7 +3241,7 @@ class WebDriver extends Helper {
|
|
|
3243
3241
|
* I.waitNumberOfVisibleElements('a', 3);
|
|
3244
3242
|
* ```
|
|
3245
3243
|
*
|
|
3246
|
-
* @param {
|
|
3244
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3247
3245
|
* @param {number} num number of elements.
|
|
3248
3246
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3249
3247
|
* @returns {void} automatically synchronized promise through #recorder
|
|
@@ -3271,7 +3269,7 @@ class WebDriver extends Helper {
|
|
|
3271
3269
|
* I.waitForInvisible('#popup');
|
|
3272
3270
|
* ```
|
|
3273
3271
|
*
|
|
3274
|
-
* @param {
|
|
3272
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3275
3273
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3276
3274
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3277
3275
|
*
|
|
@@ -3295,7 +3293,7 @@ class WebDriver extends Helper {
|
|
|
3295
3293
|
* I.waitToHide('#popup');
|
|
3296
3294
|
* ```
|
|
3297
3295
|
*
|
|
3298
|
-
* @param {
|
|
3296
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3299
3297
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3300
3298
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3301
3299
|
*
|
|
@@ -3312,7 +3310,7 @@ class WebDriver extends Helper {
|
|
|
3312
3310
|
* I.waitForDetached('#popup');
|
|
3313
3311
|
* ```
|
|
3314
3312
|
*
|
|
3315
|
-
* @param {
|
|
3313
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3316
3314
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3317
3315
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3318
3316
|
*
|
|
@@ -3372,7 +3370,7 @@ class WebDriver extends Helper {
|
|
|
3372
3370
|
* I.switchTo(); // switch back to main page
|
|
3373
3371
|
* ```
|
|
3374
3372
|
*
|
|
3375
|
-
* @param {?
|
|
3373
|
+
* @param {?string | object} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
3376
3374
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3377
3375
|
*
|
|
3378
3376
|
*/
|
|
@@ -3637,7 +3635,7 @@ class WebDriver extends Helper {
|
|
|
3637
3635
|
* const width = await I.grabElementBoundingRect('h3', 'width');
|
|
3638
3636
|
* // width == 527
|
|
3639
3637
|
* ```
|
|
3640
|
-
* @param {
|
|
3638
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3641
3639
|
* @param {string=} elementSize x, y, width or height of the given element.
|
|
3642
3640
|
* @returns {Promise<DOMRect>|Promise<number>} Element bounding rectangle
|
|
3643
3641
|
*
|