codeceptjs 3.5.9 → 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/README.md +14 -16
- package/docs/build/Appium.js +49 -49
- package/docs/build/Expect.js +33 -33
- package/docs/build/Nightmare.js +50 -50
- package/docs/build/Playwright.js +239 -133
- package/docs/build/Protractor.js +59 -59
- package/docs/build/Puppeteer.js +127 -107
- package/docs/build/TestCafe.js +48 -48
- package/docs/build/WebDriver.js +112 -93
- package/docs/helpers/Appium.md +3 -3
- package/docs/helpers/Expect.md +33 -33
- package/docs/helpers/Playwright.md +431 -325
- package/docs/helpers/Puppeteer.md +50 -24
- package/docs/helpers/WebDriver.md +41 -13
- package/docs/internal-api.md +1 -0
- package/docs/parallel.md +114 -2
- package/docs/plugins.md +7 -5
- package/docs/react.md +2 -1
- package/docs/vue.md +22 -0
- package/docs/webapi/grabWebElement.mustache +9 -0
- package/docs/webapi/grabWebElements.mustache +9 -0
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/lib/ai.js +12 -3
- package/lib/colorUtils.js +10 -0
- package/lib/command/run-multiple.js +1 -1
- package/lib/command/run-workers.js +30 -4
- package/lib/command/workers/runTests.js +39 -0
- package/lib/event.js +2 -0
- package/lib/helper/Appium.js +13 -13
- package/lib/helper/Expect.js +33 -33
- package/lib/helper/Playwright.js +125 -37
- package/lib/helper/Puppeteer.js +49 -38
- package/lib/helper/WebDriver.js +29 -19
- package/lib/helper/extras/PlaywrightReactVueLocator.js +38 -0
- package/lib/html.js +3 -3
- package/lib/interfaces/gherkin.js +8 -1
- package/lib/interfaces/scenarioConfig.js +1 -0
- package/lib/locator.js +2 -2
- package/lib/pause.js +6 -3
- package/lib/plugin/autoLogin.js +4 -2
- package/lib/plugin/heal.js +40 -7
- package/lib/plugin/retryFailedStep.js +6 -1
- package/lib/plugin/stepByStepReport.js +2 -2
- package/lib/plugin/tryTo.js +5 -4
- package/lib/recorder.js +12 -5
- package/lib/ui.js +1 -0
- package/lib/workers.js +2 -0
- package/package.json +28 -25
- package/typings/index.d.ts +1 -1
- package/typings/promiseBasedTypes.d.ts +195 -76
- package/typings/types.d.ts +191 -145
- 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,12 +863,29 @@ 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);
|
|
870
870
|
}
|
|
871
871
|
|
|
872
|
+
/**
|
|
873
|
+
* Grab WebElements for given locator
|
|
874
|
+
* Resumes test execution, so **should be used inside an async function with `await`** operator.
|
|
875
|
+
*
|
|
876
|
+
* ```js
|
|
877
|
+
* const webElements = await I.grabWebElements('#button');
|
|
878
|
+
* ```
|
|
879
|
+
*
|
|
880
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
881
|
+
* @returns {Promise<*>} WebElement of being used Web helper
|
|
882
|
+
*
|
|
883
|
+
*
|
|
884
|
+
*/
|
|
885
|
+
async grabWebElements(locator) {
|
|
886
|
+
return this._locate(locator);
|
|
887
|
+
}
|
|
888
|
+
|
|
872
889
|
/**
|
|
873
890
|
* Set [WebDriver timeouts](https://webdriver.io/docs/timeouts.html) in realtime.
|
|
874
891
|
*
|
|
@@ -939,8 +956,8 @@ class WebDriver extends Helper {
|
|
|
939
956
|
* I.click({css: 'nav a.login'});
|
|
940
957
|
* ```
|
|
941
958
|
*
|
|
942
|
-
* @param {
|
|
943
|
-
* @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.
|
|
944
961
|
* @returns {void} automatically synchronized promise through #recorder
|
|
945
962
|
*
|
|
946
963
|
*
|
|
@@ -987,8 +1004,8 @@ class WebDriver extends Helper {
|
|
|
987
1004
|
* I.forceClick({css: 'nav a.login'});
|
|
988
1005
|
* ```
|
|
989
1006
|
*
|
|
990
|
-
* @param {
|
|
991
|
-
* @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.
|
|
992
1009
|
* @returns {void} automatically synchronized promise through #recorder
|
|
993
1010
|
*
|
|
994
1011
|
*
|
|
@@ -1027,8 +1044,8 @@ class WebDriver extends Helper {
|
|
|
1027
1044
|
* I.doubleClick('.btn.edit');
|
|
1028
1045
|
* ```
|
|
1029
1046
|
*
|
|
1030
|
-
* @param {
|
|
1031
|
-
* @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.
|
|
1032
1049
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1033
1050
|
*
|
|
1034
1051
|
*
|
|
@@ -1061,8 +1078,8 @@ class WebDriver extends Helper {
|
|
|
1061
1078
|
* I.rightClick('Click me', '.context');
|
|
1062
1079
|
* ```
|
|
1063
1080
|
*
|
|
1064
|
-
* @param {
|
|
1065
|
-
* @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.
|
|
1066
1083
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1067
1084
|
*
|
|
1068
1085
|
*
|
|
@@ -1105,8 +1122,8 @@ class WebDriver extends Helper {
|
|
|
1105
1122
|
* I.forceRightClick('Menu');
|
|
1106
1123
|
* ```
|
|
1107
1124
|
*
|
|
1108
|
-
* @param {
|
|
1109
|
-
* @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.
|
|
1110
1127
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1111
1128
|
*
|
|
1112
1129
|
*
|
|
@@ -1147,8 +1164,8 @@ class WebDriver extends Helper {
|
|
|
1147
1164
|
* // or by strict locator
|
|
1148
1165
|
* I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
1149
1166
|
* ```
|
|
1150
|
-
* @param {
|
|
1151
|
-
* @param {
|
|
1167
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator.
|
|
1168
|
+
* @param {string | object} value text value to fill.
|
|
1152
1169
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1153
1170
|
*
|
|
1154
1171
|
* {{ react }}
|
|
@@ -1172,7 +1189,7 @@ class WebDriver extends Helper {
|
|
|
1172
1189
|
* // typing secret
|
|
1173
1190
|
* I.appendField('password', secret('123456'));
|
|
1174
1191
|
* ```
|
|
1175
|
-
* @param {
|
|
1192
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator
|
|
1176
1193
|
* @param {string} value text value to append.
|
|
1177
1194
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1178
1195
|
*
|
|
@@ -1194,7 +1211,7 @@ class WebDriver extends Helper {
|
|
|
1194
1211
|
* I.clearField('user[email]');
|
|
1195
1212
|
* I.clearField('#email');
|
|
1196
1213
|
* ```
|
|
1197
|
-
* @param {
|
|
1214
|
+
* @param {string | object} editable field located by label|name|CSS|XPath|strict locator.
|
|
1198
1215
|
* @returns {void} automatically synchronized promise through #recorder.
|
|
1199
1216
|
*
|
|
1200
1217
|
*
|
|
@@ -1226,7 +1243,7 @@ class WebDriver extends Helper {
|
|
|
1226
1243
|
* ```js
|
|
1227
1244
|
* I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
1228
1245
|
* ```
|
|
1229
|
-
* @param {
|
|
1246
|
+
* @param {string | object} select field located by label|name|CSS|XPath|strict locator.
|
|
1230
1247
|
* @param {string|Array<*>} option visible text or value of option.
|
|
1231
1248
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1232
1249
|
*
|
|
@@ -1262,6 +1279,8 @@ class WebDriver extends Helper {
|
|
|
1262
1279
|
}
|
|
1263
1280
|
|
|
1264
1281
|
/**
|
|
1282
|
+
* Appium: not tested
|
|
1283
|
+
*
|
|
1265
1284
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
1266
1285
|
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
1267
1286
|
* File will be uploaded to remote system (if tests are running remotely).
|
|
@@ -1271,11 +1290,10 @@ class WebDriver extends Helper {
|
|
|
1271
1290
|
* I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
1272
1291
|
* ```
|
|
1273
1292
|
*
|
|
1274
|
-
* @param {
|
|
1293
|
+
* @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
|
|
1275
1294
|
* @param {string} pathToFile local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
1276
1295
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1277
1296
|
*
|
|
1278
|
-
* Appium: not tested
|
|
1279
1297
|
*/
|
|
1280
1298
|
async attachFile(locator, pathToFile) {
|
|
1281
1299
|
let file = path.join(global.codecept_dir, pathToFile);
|
|
@@ -1302,6 +1320,7 @@ class WebDriver extends Helper {
|
|
|
1302
1320
|
}
|
|
1303
1321
|
|
|
1304
1322
|
/**
|
|
1323
|
+
* Appium: not tested
|
|
1305
1324
|
* Selects a checkbox or radio button.
|
|
1306
1325
|
* Element is located by label or name or CSS or XPath.
|
|
1307
1326
|
*
|
|
@@ -1312,11 +1331,10 @@ class WebDriver extends Helper {
|
|
|
1312
1331
|
* I.checkOption('I Agree to Terms and Conditions');
|
|
1313
1332
|
* I.checkOption('agree', '//form');
|
|
1314
1333
|
* ```
|
|
1315
|
-
* @param {
|
|
1316
|
-
* @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.
|
|
1317
1336
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1318
1337
|
*
|
|
1319
|
-
* Appium: not tested
|
|
1320
1338
|
*/
|
|
1321
1339
|
async checkOption(field, context = null) {
|
|
1322
1340
|
const clickMethod = this.browser.isMobile && !this.browser.isW3C ? 'touchClick' : 'elementClick';
|
|
@@ -1335,6 +1353,7 @@ class WebDriver extends Helper {
|
|
|
1335
1353
|
}
|
|
1336
1354
|
|
|
1337
1355
|
/**
|
|
1356
|
+
* Appium: not tested
|
|
1338
1357
|
* Unselects a checkbox or radio button.
|
|
1339
1358
|
* Element is located by label or name or CSS or XPath.
|
|
1340
1359
|
*
|
|
@@ -1345,11 +1364,10 @@ class WebDriver extends Helper {
|
|
|
1345
1364
|
* I.uncheckOption('I Agree to Terms and Conditions');
|
|
1346
1365
|
* I.uncheckOption('agree', '//form');
|
|
1347
1366
|
* ```
|
|
1348
|
-
* @param {
|
|
1349
|
-
* @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.
|
|
1350
1369
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1351
1370
|
*
|
|
1352
|
-
* Appium: not tested
|
|
1353
1371
|
*/
|
|
1354
1372
|
async uncheckOption(field, context = null) {
|
|
1355
1373
|
const clickMethod = this.browser.isMobile && !this.browser.isW3C ? 'touchClick' : 'elementClick';
|
|
@@ -1375,7 +1393,7 @@ class WebDriver extends Helper {
|
|
|
1375
1393
|
* let pins = await I.grabTextFromAll('#pin li');
|
|
1376
1394
|
* ```
|
|
1377
1395
|
*
|
|
1378
|
-
* @param {
|
|
1396
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1379
1397
|
* @returns {Promise<string[]>} attribute value
|
|
1380
1398
|
*
|
|
1381
1399
|
*
|
|
@@ -1396,7 +1414,7 @@ class WebDriver extends Helper {
|
|
|
1396
1414
|
* ```
|
|
1397
1415
|
* If multiple elements found returns first element.
|
|
1398
1416
|
*
|
|
1399
|
-
* @param {
|
|
1417
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1400
1418
|
* @returns {Promise<string>} attribute value
|
|
1401
1419
|
*
|
|
1402
1420
|
*
|
|
@@ -1419,7 +1437,7 @@ class WebDriver extends Helper {
|
|
|
1419
1437
|
* let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
1420
1438
|
* ```
|
|
1421
1439
|
*
|
|
1422
|
-
* @param {
|
|
1440
|
+
* @param {string | object} element located by CSS|XPath|strict locator.
|
|
1423
1441
|
* @returns {Promise<string[]>} HTML code for an element
|
|
1424
1442
|
*
|
|
1425
1443
|
*
|
|
@@ -1440,7 +1458,7 @@ class WebDriver extends Helper {
|
|
|
1440
1458
|
* let postHTML = await I.grabHTMLFrom('#post');
|
|
1441
1459
|
* ```
|
|
1442
1460
|
*
|
|
1443
|
-
* @param {
|
|
1461
|
+
* @param {string | object} element located by CSS|XPath|strict locator.
|
|
1444
1462
|
* @returns {Promise<string>} HTML code for an element
|
|
1445
1463
|
*
|
|
1446
1464
|
*
|
|
@@ -1462,7 +1480,7 @@ class WebDriver extends Helper {
|
|
|
1462
1480
|
* ```js
|
|
1463
1481
|
* let inputs = await I.grabValueFromAll('//form/input');
|
|
1464
1482
|
* ```
|
|
1465
|
-
* @param {
|
|
1483
|
+
* @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
|
|
1466
1484
|
* @returns {Promise<string[]>} attribute value
|
|
1467
1485
|
*
|
|
1468
1486
|
*
|
|
@@ -1483,7 +1501,7 @@ class WebDriver extends Helper {
|
|
|
1483
1501
|
* ```js
|
|
1484
1502
|
* let email = await I.grabValueFrom('input[name=email]');
|
|
1485
1503
|
* ```
|
|
1486
|
-
* @param {
|
|
1504
|
+
* @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
|
|
1487
1505
|
* @returns {Promise<string>} attribute value
|
|
1488
1506
|
*
|
|
1489
1507
|
*
|
|
@@ -1506,7 +1524,7 @@ class WebDriver extends Helper {
|
|
|
1506
1524
|
* const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
1507
1525
|
* ```
|
|
1508
1526
|
*
|
|
1509
|
-
* @param {
|
|
1527
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1510
1528
|
* @param {string} cssProperty CSS property name.
|
|
1511
1529
|
* @returns {Promise<string[]>} CSS value
|
|
1512
1530
|
*
|
|
@@ -1527,7 +1545,7 @@ class WebDriver extends Helper {
|
|
|
1527
1545
|
* const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
1528
1546
|
* ```
|
|
1529
1547
|
*
|
|
1530
|
-
* @param {
|
|
1548
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1531
1549
|
* @param {string} cssProperty CSS property name.
|
|
1532
1550
|
* @returns {Promise<string>} CSS value
|
|
1533
1551
|
*
|
|
@@ -1550,7 +1568,7 @@ class WebDriver extends Helper {
|
|
|
1550
1568
|
* ```js
|
|
1551
1569
|
* let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
1552
1570
|
* ```
|
|
1553
|
-
* @param {
|
|
1571
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1554
1572
|
* @param {string} attr attribute name.
|
|
1555
1573
|
* @returns {Promise<string[]>} attribute value
|
|
1556
1574
|
*
|
|
@@ -1570,7 +1588,7 @@ class WebDriver extends Helper {
|
|
|
1570
1588
|
* ```js
|
|
1571
1589
|
* let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
1572
1590
|
* ```
|
|
1573
|
-
* @param {
|
|
1591
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1574
1592
|
* @param {string} attr attribute name.
|
|
1575
1593
|
* @returns {Promise<string>} attribute value
|
|
1576
1594
|
*
|
|
@@ -1658,7 +1676,7 @@ class WebDriver extends Helper {
|
|
|
1658
1676
|
* I.see('Register', {css: 'form.register'}); // use strict locator
|
|
1659
1677
|
* ```
|
|
1660
1678
|
* @param {string} text expected on page.
|
|
1661
|
-
* @param {?
|
|
1679
|
+
* @param {?string | object} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1662
1680
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1663
1681
|
*
|
|
1664
1682
|
*
|
|
@@ -1676,7 +1694,7 @@ class WebDriver extends Helper {
|
|
|
1676
1694
|
* ```
|
|
1677
1695
|
*
|
|
1678
1696
|
* @param {string} text element value to check.
|
|
1679
|
-
* @param {
|
|
1697
|
+
* @param {(string | object)?} [context=null] element located by CSS|XPath|strict locator.
|
|
1680
1698
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1681
1699
|
*
|
|
1682
1700
|
*/
|
|
@@ -1694,7 +1712,7 @@ class WebDriver extends Helper {
|
|
|
1694
1712
|
* ```
|
|
1695
1713
|
*
|
|
1696
1714
|
* @param {string} text which is not present.
|
|
1697
|
-
* @param {
|
|
1715
|
+
* @param {string | object} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
1698
1716
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1699
1717
|
*
|
|
1700
1718
|
*
|
|
@@ -1714,8 +1732,8 @@ class WebDriver extends Helper {
|
|
|
1714
1732
|
* I.seeInField('form input[type=hidden]','hidden_value');
|
|
1715
1733
|
* I.seeInField('#searchform input','Search');
|
|
1716
1734
|
* ```
|
|
1717
|
-
* @param {
|
|
1718
|
-
* @param {
|
|
1735
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator.
|
|
1736
|
+
* @param {string | object} value value to check.
|
|
1719
1737
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1720
1738
|
*
|
|
1721
1739
|
*
|
|
@@ -1734,8 +1752,8 @@ class WebDriver extends Helper {
|
|
|
1734
1752
|
* I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
1735
1753
|
* ```
|
|
1736
1754
|
*
|
|
1737
|
-
* @param {
|
|
1738
|
-
* @param {
|
|
1755
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator.
|
|
1756
|
+
* @param {string | object} value value to check.
|
|
1739
1757
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1740
1758
|
*
|
|
1741
1759
|
*
|
|
@@ -1746,6 +1764,7 @@ class WebDriver extends Helper {
|
|
|
1746
1764
|
}
|
|
1747
1765
|
|
|
1748
1766
|
/**
|
|
1767
|
+
* Appium: not tested
|
|
1749
1768
|
* Verifies that the specified checkbox is checked.
|
|
1750
1769
|
*
|
|
1751
1770
|
* ```js
|
|
@@ -1754,16 +1773,16 @@ class WebDriver extends Helper {
|
|
|
1754
1773
|
* I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
1755
1774
|
* ```
|
|
1756
1775
|
*
|
|
1757
|
-
* @param {
|
|
1776
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator.
|
|
1758
1777
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1759
1778
|
*
|
|
1760
|
-
* Appium: not tested
|
|
1761
1779
|
*/
|
|
1762
1780
|
async seeCheckboxIsChecked(field) {
|
|
1763
1781
|
return proceedSeeCheckbox.call(this, 'assert', field);
|
|
1764
1782
|
}
|
|
1765
1783
|
|
|
1766
1784
|
/**
|
|
1785
|
+
* Appium: not tested
|
|
1767
1786
|
* Verifies that the specified checkbox is not checked.
|
|
1768
1787
|
*
|
|
1769
1788
|
* ```js
|
|
@@ -1772,10 +1791,9 @@ class WebDriver extends Helper {
|
|
|
1772
1791
|
* I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
1773
1792
|
* ```
|
|
1774
1793
|
*
|
|
1775
|
-
* @param {
|
|
1794
|
+
* @param {string | object} field located by label|name|CSS|XPath|strict locator.
|
|
1776
1795
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1777
1796
|
*
|
|
1778
|
-
* Appium: not tested
|
|
1779
1797
|
*/
|
|
1780
1798
|
async dontSeeCheckboxIsChecked(field) {
|
|
1781
1799
|
return proceedSeeCheckbox.call(this, 'negate', field);
|
|
@@ -1788,7 +1806,7 @@ class WebDriver extends Helper {
|
|
|
1788
1806
|
* ```js
|
|
1789
1807
|
* I.seeElement('#modal');
|
|
1790
1808
|
* ```
|
|
1791
|
-
* @param {
|
|
1809
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
1792
1810
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1793
1811
|
*
|
|
1794
1812
|
* {{ react }}
|
|
@@ -1808,7 +1826,7 @@ class WebDriver extends Helper {
|
|
|
1808
1826
|
* I.dontSeeElement('.modal'); // modal is not shown
|
|
1809
1827
|
* ```
|
|
1810
1828
|
*
|
|
1811
|
-
* @param {
|
|
1829
|
+
* @param {string | object} locator located by CSS|XPath|Strict locator.
|
|
1812
1830
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1813
1831
|
*
|
|
1814
1832
|
* {{ react }}
|
|
@@ -1829,7 +1847,7 @@ class WebDriver extends Helper {
|
|
|
1829
1847
|
* ```js
|
|
1830
1848
|
* I.seeElementInDOM('#modal');
|
|
1831
1849
|
* ```
|
|
1832
|
-
* @param {
|
|
1850
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1833
1851
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1834
1852
|
*
|
|
1835
1853
|
*
|
|
@@ -1846,7 +1864,7 @@ class WebDriver extends Helper {
|
|
|
1846
1864
|
* I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
|
|
1847
1865
|
* ```
|
|
1848
1866
|
*
|
|
1849
|
-
* @param {
|
|
1867
|
+
* @param {string | object} locator located by CSS|XPath|Strict locator.
|
|
1850
1868
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1851
1869
|
*
|
|
1852
1870
|
*
|
|
@@ -1949,7 +1967,7 @@ class WebDriver extends Helper {
|
|
|
1949
1967
|
* I.seeNumberOfElements('#submitBtn', 1);
|
|
1950
1968
|
* ```
|
|
1951
1969
|
*
|
|
1952
|
-
* @param {
|
|
1970
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1953
1971
|
* @param {number} num number of elements.
|
|
1954
1972
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1955
1973
|
*
|
|
@@ -1968,7 +1986,7 @@ class WebDriver extends Helper {
|
|
|
1968
1986
|
* I.seeNumberOfVisibleElements('.buttons', 3);
|
|
1969
1987
|
* ```
|
|
1970
1988
|
*
|
|
1971
|
-
* @param {
|
|
1989
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
1972
1990
|
* @param {number} num number of elements.
|
|
1973
1991
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1974
1992
|
*
|
|
@@ -1986,7 +2004,7 @@ class WebDriver extends Helper {
|
|
|
1986
2004
|
* I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
1987
2005
|
* ```
|
|
1988
2006
|
*
|
|
1989
|
-
* @param {
|
|
2007
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
1990
2008
|
* @param {object} cssProperties object with CSS properties and their values to check.
|
|
1991
2009
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1992
2010
|
*
|
|
@@ -2013,7 +2031,9 @@ class WebDriver extends Helper {
|
|
|
2013
2031
|
let chunked = chunkArray(props, values.length);
|
|
2014
2032
|
chunked = chunked.filter((val) => {
|
|
2015
2033
|
for (let i = 0; i < val.length; ++i) {
|
|
2016
|
-
|
|
2034
|
+
const _acutal = Number.isNaN(val[i]) || (typeof values[i]) === 'string' ? val[i] : Number.parseInt(val[i], 10);
|
|
2035
|
+
const _expected = Number.isNaN(values[i]) || (typeof values[i]) === 'string' ? values[i] : Number.parseInt(values[i], 10);
|
|
2036
|
+
if (_acutal !== _expected) return false;
|
|
2017
2037
|
}
|
|
2018
2038
|
return true;
|
|
2019
2039
|
});
|
|
@@ -2030,7 +2050,7 @@ class WebDriver extends Helper {
|
|
|
2030
2050
|
* I.seeAttributesOnElements('//form', { method: "post"});
|
|
2031
2051
|
* ```
|
|
2032
2052
|
*
|
|
2033
|
-
* @param {
|
|
2053
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
2034
2054
|
* @param {object} attributes attributes and their values to check.
|
|
2035
2055
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2036
2056
|
*
|
|
@@ -2049,7 +2069,9 @@ class WebDriver extends Helper {
|
|
|
2049
2069
|
let chunked = chunkArray(attrs, values.length);
|
|
2050
2070
|
chunked = chunked.filter((val) => {
|
|
2051
2071
|
for (let i = 0; i < val.length; ++i) {
|
|
2052
|
-
|
|
2072
|
+
const _acutal = Number.isNaN(val[i]) || (typeof values[i]) === 'string' ? val[i] : Number.parseInt(val[i], 10);
|
|
2073
|
+
const _expected = Number.isNaN(values[i]) || (typeof values[i]) === 'string' ? values[i] : Number.parseInt(values[i], 10);
|
|
2074
|
+
if (_acutal !== _expected) return false;
|
|
2053
2075
|
}
|
|
2054
2076
|
return true;
|
|
2055
2077
|
});
|
|
@@ -2067,7 +2089,7 @@ class WebDriver extends Helper {
|
|
|
2067
2089
|
* let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
2068
2090
|
* ```
|
|
2069
2091
|
*
|
|
2070
|
-
* @param {
|
|
2092
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
2071
2093
|
* @returns {Promise<number>} number of visible elements
|
|
2072
2094
|
*/
|
|
2073
2095
|
async grabNumberOfVisibleElements(locator) {
|
|
@@ -2149,6 +2171,8 @@ class WebDriver extends Helper {
|
|
|
2149
2171
|
}
|
|
2150
2172
|
|
|
2151
2173
|
/**
|
|
2174
|
+
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
2175
|
+
*
|
|
2152
2176
|
* Executes sync script on a page.
|
|
2153
2177
|
* Pass arguments to function as additional parameters.
|
|
2154
2178
|
* Will return execution result to a test.
|
|
@@ -2176,9 +2200,6 @@ class WebDriver extends Helper {
|
|
|
2176
2200
|
* @param {...any} args to be passed to function.
|
|
2177
2201
|
* @returns {Promise<any>} script return value
|
|
2178
2202
|
*
|
|
2179
|
-
*
|
|
2180
|
-
*
|
|
2181
|
-
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
2182
2203
|
*/
|
|
2183
2204
|
executeScript(...args) {
|
|
2184
2205
|
return this.browser.execute.apply(this.browser, args);
|
|
@@ -2225,8 +2246,8 @@ class WebDriver extends Helper {
|
|
|
2225
2246
|
* I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
|
|
2226
2247
|
* ```
|
|
2227
2248
|
*
|
|
2228
|
-
* @param {
|
|
2229
|
-
* @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.
|
|
2230
2251
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2231
2252
|
*
|
|
2232
2253
|
*
|
|
@@ -2247,7 +2268,7 @@ class WebDriver extends Helper {
|
|
|
2247
2268
|
* I.scrollTo('#submit', 5, 5);
|
|
2248
2269
|
* ```
|
|
2249
2270
|
*
|
|
2250
|
-
* @param {
|
|
2271
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
2251
2272
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2252
2273
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2253
2274
|
* @returns {void} automatically synchronized promise through #recorder
|
|
@@ -2290,7 +2311,7 @@ class WebDriver extends Helper {
|
|
|
2290
2311
|
* I.moveCursorTo('#submit', 5,5);
|
|
2291
2312
|
* ```
|
|
2292
2313
|
*
|
|
2293
|
-
* @param {
|
|
2314
|
+
* @param {string | object} locator located by CSS|XPath|strict locator.
|
|
2294
2315
|
* @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
2295
2316
|
* @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
2296
2317
|
* @returns {void} automatically synchronized promise through #recorder
|
|
@@ -2311,7 +2332,7 @@ class WebDriver extends Helper {
|
|
|
2311
2332
|
* I.saveElementScreenshot(`#submit`,'debug.png');
|
|
2312
2333
|
* ```
|
|
2313
2334
|
*
|
|
2314
|
-
* @param {
|
|
2335
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
2315
2336
|
* @param {string} fileName file name to save.
|
|
2316
2337
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2317
2338
|
*
|
|
@@ -2381,6 +2402,7 @@ class WebDriver extends Helper {
|
|
|
2381
2402
|
}
|
|
2382
2403
|
|
|
2383
2404
|
/**
|
|
2405
|
+
* Uses Selenium's JSON [cookie format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
|
|
2384
2406
|
* Sets cookie(s).
|
|
2385
2407
|
*
|
|
2386
2408
|
* Can be a single cookie object or an array of cookies:
|
|
@@ -2398,10 +2420,6 @@ class WebDriver extends Helper {
|
|
|
2398
2420
|
* @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
|
|
2399
2421
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2400
2422
|
*
|
|
2401
|
-
*
|
|
2402
|
-
*
|
|
2403
|
-
* Uses Selenium's JSON [cookie
|
|
2404
|
-
* format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
|
|
2405
2423
|
*/
|
|
2406
2424
|
async setCookie(cookie) {
|
|
2407
2425
|
return this.browser.setCookies(cookie);
|
|
@@ -2490,7 +2508,7 @@ class WebDriver extends Helper {
|
|
|
2490
2508
|
}
|
|
2491
2509
|
|
|
2492
2510
|
/**
|
|
2493
|
-
* 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`.
|
|
2494
2512
|
*
|
|
2495
2513
|
*/
|
|
2496
2514
|
async cancelPopup() {
|
|
@@ -2593,6 +2611,8 @@ class WebDriver extends Helper {
|
|
|
2593
2611
|
}
|
|
2594
2612
|
|
|
2595
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
|
+
*
|
|
2596
2616
|
* Presses a key in the browser (on a focused element).
|
|
2597
2617
|
*
|
|
2598
2618
|
* _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
|
|
@@ -2654,8 +2674,6 @@ class WebDriver extends Helper {
|
|
|
2654
2674
|
* @param {string|string[]} key key or array of keys to press.
|
|
2655
2675
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2656
2676
|
*
|
|
2657
|
-
*
|
|
2658
|
-
* _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.
|
|
2659
2677
|
*/
|
|
2660
2678
|
async pressKey(key) {
|
|
2661
2679
|
const modifiers = [];
|
|
@@ -2735,6 +2753,8 @@ class WebDriver extends Helper {
|
|
|
2735
2753
|
}
|
|
2736
2754
|
|
|
2737
2755
|
/**
|
|
2756
|
+
* Appium: not tested in web, in apps doesn't work
|
|
2757
|
+
*
|
|
2738
2758
|
* Resize the current window to provided width and height.
|
|
2739
2759
|
* First parameter can be set to `maximize`.
|
|
2740
2760
|
*
|
|
@@ -2742,7 +2762,6 @@ class WebDriver extends Helper {
|
|
|
2742
2762
|
* @param {number} height height in pixels.
|
|
2743
2763
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2744
2764
|
*
|
|
2745
|
-
* Appium: not tested in web, in apps doesn't work
|
|
2746
2765
|
*/
|
|
2747
2766
|
async resizeWindow(width, height) {
|
|
2748
2767
|
return this._resizeBrowserWindow(this.browser, width, height);
|
|
@@ -2780,7 +2799,7 @@ class WebDriver extends Helper {
|
|
|
2780
2799
|
* I.see('#add-to-cart-bnt');
|
|
2781
2800
|
* ```
|
|
2782
2801
|
*
|
|
2783
|
-
* @param {
|
|
2802
|
+
* @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
|
|
2784
2803
|
* @param {any} [options] Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
|
|
2785
2804
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2786
2805
|
*
|
|
@@ -2810,7 +2829,7 @@ class WebDriver extends Helper {
|
|
|
2810
2829
|
* I.dontSee('#add-to-cart-btn');
|
|
2811
2830
|
* ```
|
|
2812
2831
|
*
|
|
2813
|
-
* @param {
|
|
2832
|
+
* @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
|
|
2814
2833
|
* @param {any} [options] Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
|
|
2815
2834
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2816
2835
|
*
|
|
@@ -2825,17 +2844,17 @@ class WebDriver extends Helper {
|
|
|
2825
2844
|
}
|
|
2826
2845
|
|
|
2827
2846
|
/**
|
|
2847
|
+
* Appium: not tested
|
|
2828
2848
|
* Drag an item to a destination element.
|
|
2829
2849
|
*
|
|
2830
2850
|
* ```js
|
|
2831
2851
|
* I.dragAndDrop('#dragHandle', '#container');
|
|
2832
2852
|
* ```
|
|
2833
2853
|
*
|
|
2834
|
-
* @param {
|
|
2835
|
-
* @param {
|
|
2854
|
+
* @param {string | object} srcElement located by CSS|XPath|strict locator.
|
|
2855
|
+
* @param {string | object} destElement located by CSS|XPath|strict locator.
|
|
2836
2856
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2837
2857
|
*
|
|
2838
|
-
* Appium: not tested
|
|
2839
2858
|
*/
|
|
2840
2859
|
async dragAndDrop(srcElement, destElement) {
|
|
2841
2860
|
let sourceEl = await this._locate(srcElement);
|
|
@@ -2858,7 +2877,7 @@ class WebDriver extends Helper {
|
|
|
2858
2877
|
* I.dragSlider('#slider', -70);
|
|
2859
2878
|
* ```
|
|
2860
2879
|
*
|
|
2861
|
-
* @param {
|
|
2880
|
+
* @param {string | object} locator located by label|name|CSS|XPath|strict locator.
|
|
2862
2881
|
* @param {number} offsetX position to drag.
|
|
2863
2882
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2864
2883
|
*
|
|
@@ -2984,7 +3003,7 @@ class WebDriver extends Helper {
|
|
|
2984
3003
|
* Waits for element to become enabled (by default waits for 1sec).
|
|
2985
3004
|
* Element can be located by CSS or XPath.
|
|
2986
3005
|
*
|
|
2987
|
-
* @param {
|
|
3006
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
2988
3007
|
* @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
|
|
2989
3008
|
* @returns {void} automatically synchronized promise through #recorder
|
|
2990
3009
|
*
|
|
@@ -3017,7 +3036,7 @@ class WebDriver extends Helper {
|
|
|
3017
3036
|
* I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
3018
3037
|
* ```
|
|
3019
3038
|
*
|
|
3020
|
-
* @param {
|
|
3039
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3021
3040
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3022
3041
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3023
3042
|
*
|
|
@@ -3040,7 +3059,7 @@ class WebDriver extends Helper {
|
|
|
3040
3059
|
* I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
3041
3060
|
* ```
|
|
3042
3061
|
*
|
|
3043
|
-
* @param {
|
|
3062
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3044
3063
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
3045
3064
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3046
3065
|
*
|
|
@@ -3133,7 +3152,7 @@ class WebDriver extends Helper {
|
|
|
3133
3152
|
*
|
|
3134
3153
|
* @param {string }text to wait for.
|
|
3135
3154
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3136
|
-
* @param {
|
|
3155
|
+
* @param {string | object} [context] (optional) element located by CSS|XPath|strict locator.
|
|
3137
3156
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3138
3157
|
*
|
|
3139
3158
|
*
|
|
@@ -3163,7 +3182,7 @@ class WebDriver extends Helper {
|
|
|
3163
3182
|
* I.waitForValue('//input', "GoodValue");
|
|
3164
3183
|
* ```
|
|
3165
3184
|
*
|
|
3166
|
-
* @param {
|
|
3185
|
+
* @param {string | object} field input field.
|
|
3167
3186
|
* @param {string }value expected value.
|
|
3168
3187
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3169
3188
|
* @returns {void} automatically synchronized promise through #recorder
|
|
@@ -3195,7 +3214,7 @@ class WebDriver extends Helper {
|
|
|
3195
3214
|
* I.waitForVisible('#popup');
|
|
3196
3215
|
* ```
|
|
3197
3216
|
*
|
|
3198
|
-
* @param {
|
|
3217
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3199
3218
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3200
3219
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3201
3220
|
*
|
|
@@ -3222,7 +3241,7 @@ class WebDriver extends Helper {
|
|
|
3222
3241
|
* I.waitNumberOfVisibleElements('a', 3);
|
|
3223
3242
|
* ```
|
|
3224
3243
|
*
|
|
3225
|
-
* @param {
|
|
3244
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3226
3245
|
* @param {number} num number of elements.
|
|
3227
3246
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3228
3247
|
* @returns {void} automatically synchronized promise through #recorder
|
|
@@ -3250,7 +3269,7 @@ class WebDriver extends Helper {
|
|
|
3250
3269
|
* I.waitForInvisible('#popup');
|
|
3251
3270
|
* ```
|
|
3252
3271
|
*
|
|
3253
|
-
* @param {
|
|
3272
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3254
3273
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3255
3274
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3256
3275
|
*
|
|
@@ -3274,7 +3293,7 @@ class WebDriver extends Helper {
|
|
|
3274
3293
|
* I.waitToHide('#popup');
|
|
3275
3294
|
* ```
|
|
3276
3295
|
*
|
|
3277
|
-
* @param {
|
|
3296
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3278
3297
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3279
3298
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3280
3299
|
*
|
|
@@ -3291,7 +3310,7 @@ class WebDriver extends Helper {
|
|
|
3291
3310
|
* I.waitForDetached('#popup');
|
|
3292
3311
|
* ```
|
|
3293
3312
|
*
|
|
3294
|
-
* @param {
|
|
3313
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3295
3314
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
3296
3315
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3297
3316
|
*
|
|
@@ -3351,7 +3370,7 @@ class WebDriver extends Helper {
|
|
|
3351
3370
|
* I.switchTo(); // switch back to main page
|
|
3352
3371
|
* ```
|
|
3353
3372
|
*
|
|
3354
|
-
* @param {?
|
|
3373
|
+
* @param {?string | object} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
3355
3374
|
* @returns {void} automatically synchronized promise through #recorder
|
|
3356
3375
|
*
|
|
3357
3376
|
*/
|
|
@@ -3616,7 +3635,7 @@ class WebDriver extends Helper {
|
|
|
3616
3635
|
* const width = await I.grabElementBoundingRect('h3', 'width');
|
|
3617
3636
|
* // width == 527
|
|
3618
3637
|
* ```
|
|
3619
|
-
* @param {
|
|
3638
|
+
* @param {string | object} locator element located by CSS|XPath|strict locator.
|
|
3620
3639
|
* @param {string=} elementSize x, y, width or height of the given element.
|
|
3621
3640
|
* @returns {Promise<DOMRect>|Promise<number>} Element bounding rectangle
|
|
3622
3641
|
*
|