codeceptjs 3.2.2 → 3.3.0-beta.3

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/docs/advanced.md +2 -2
  3. package/docs/api.md +227 -188
  4. package/docs/build/ApiDataFactory.js +13 -6
  5. package/docs/build/Appium.js +98 -36
  6. package/docs/build/FileSystem.js +11 -1
  7. package/docs/build/GraphQL.js +11 -0
  8. package/docs/build/JSONResponse.js +297 -0
  9. package/docs/build/Nightmare.js +48 -48
  10. package/docs/build/Playwright.js +271 -151
  11. package/docs/build/Puppeteer.js +76 -67
  12. package/docs/build/REST.js +36 -0
  13. package/docs/build/TestCafe.js +44 -44
  14. package/docs/build/WebDriver.js +69 -69
  15. package/docs/changelog.md +7 -0
  16. package/docs/configuration.md +8 -8
  17. package/docs/custom-helpers.md +1 -1
  18. package/docs/data.md +9 -9
  19. package/docs/helpers/ApiDataFactory.md +7 -0
  20. package/docs/helpers/Appium.md +240 -198
  21. package/docs/helpers/FileSystem.md +11 -1
  22. package/docs/helpers/JSONResponse.md +230 -0
  23. package/docs/helpers/Playwright.md +283 -216
  24. package/docs/helpers/Puppeteer.md +9 -1
  25. package/docs/helpers/REST.md +30 -9
  26. package/docs/installation.md +3 -1
  27. package/docs/internal-api.md +265 -0
  28. package/docs/mobile.md +11 -11
  29. package/docs/nightmare.md +3 -3
  30. package/docs/playwright.md +73 -18
  31. package/docs/plugins.md +136 -36
  32. package/docs/puppeteer.md +28 -12
  33. package/docs/quickstart.md +2 -3
  34. package/docs/reports.md +44 -3
  35. package/docs/testcafe.md +1 -1
  36. package/docs/translation.md +2 -2
  37. package/docs/videos.md +2 -2
  38. package/docs/visual.md +2 -2
  39. package/docs/vue.md +1 -1
  40. package/docs/webdriver.md +92 -4
  41. package/lib/cli.js +25 -20
  42. package/lib/command/init.js +5 -15
  43. package/lib/command/workers/runTests.js +25 -7
  44. package/lib/config.js +17 -13
  45. package/lib/helper/ApiDataFactory.js +13 -6
  46. package/lib/helper/Appium.js +65 -3
  47. package/lib/helper/FileSystem.js +11 -1
  48. package/lib/helper/GraphQL.js +11 -0
  49. package/lib/helper/JSONResponse.js +297 -0
  50. package/lib/helper/Playwright.js +209 -89
  51. package/lib/helper/Puppeteer.js +12 -3
  52. package/lib/helper/REST.js +36 -0
  53. package/lib/helper/extras/Console.js +8 -0
  54. package/lib/helper/extras/PlaywrightRestartOpts.js +35 -0
  55. package/lib/interfaces/bdd.js +3 -1
  56. package/lib/plugin/allure.js +12 -0
  57. package/lib/plugin/autoLogin.js +1 -1
  58. package/lib/plugin/eachElement.js +127 -0
  59. package/lib/plugin/tryTo.js +6 -0
  60. package/lib/utils.js +20 -0
  61. package/package.json +25 -23
  62. package/translations/pt-BR.js +8 -0
  63. package/typings/index.d.ts +4 -0
  64. package/typings/types.d.ts +318 -109
@@ -772,7 +772,7 @@ class WebDriver extends Helper {
772
772
  * ```
773
773
  *
774
774
  *
775
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
775
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
776
776
  */
777
777
  async _locate(locator, smartWait = false) {
778
778
  if (require('../store').debugMode) smartWait = false;
@@ -831,7 +831,7 @@ class WebDriver extends Helper {
831
831
  * this.helpers['WebDriver']._locateCheckable('I agree with terms and conditions').then // ...
832
832
  * ```
833
833
  *
834
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
834
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
835
835
  */
836
836
  async _locateCheckable(locator) {
837
837
  return findCheckable.call(this, locator, this.$$.bind(this)).then(res => res);
@@ -845,7 +845,7 @@ class WebDriver extends Helper {
845
845
  * const els = await this.helpers.WebDriver._locateClickable('Next page', '.pages');
846
846
  * ```
847
847
  *
848
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
848
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
849
849
  */
850
850
  async _locateClickable(locator, context) {
851
851
  const locateFn = prepareLocateFn.call(this, context);
@@ -859,7 +859,7 @@ class WebDriver extends Helper {
859
859
  * this.helpers['WebDriver']._locateFields('Your email').then // ...
860
860
  * ```
861
861
  *
862
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
862
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
863
863
  */
864
864
  async _locateFields(locator) {
865
865
  return findFields.call(this, locator).then(res => res);
@@ -933,8 +933,8 @@ class WebDriver extends Helper {
933
933
  * I.click({css: 'nav a.login'});
934
934
  * ```
935
935
  *
936
- * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
937
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
936
+ * @param {string | object} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
937
+ * @param {?string | object} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
938
938
  *
939
939
  *
940
940
  * {{ react }}
@@ -979,8 +979,8 @@ class WebDriver extends Helper {
979
979
  * I.forceClick({css: 'nav a.login'});
980
980
  * ```
981
981
  *
982
- * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
983
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
982
+ * @param {string | object} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
983
+ * @param {?string | object} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
984
984
  *
985
985
  *
986
986
  * {{ react }}
@@ -1017,8 +1017,8 @@ class WebDriver extends Helper {
1017
1017
  * I.doubleClick('.btn.edit');
1018
1018
  * ```
1019
1019
  *
1020
- * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1021
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1020
+ * @param {string | object} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1021
+ * @param {?string | object} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1022
1022
  *
1023
1023
  *
1024
1024
  * {{ react }}
@@ -1049,8 +1049,8 @@ class WebDriver extends Helper {
1049
1049
  * I.rightClick('Click me', '.context');
1050
1050
  * ```
1051
1051
  *
1052
- * @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
1053
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
1052
+ * @param {string | object} locator clickable element located by CSS|XPath|strict locator.
1053
+ * @param {?string | object} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
1054
1054
  *
1055
1055
  *
1056
1056
  * {{ react }}
@@ -1092,8 +1092,8 @@ class WebDriver extends Helper {
1092
1092
  * I.forceRightClick('Menu');
1093
1093
  * ```
1094
1094
  *
1095
- * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1096
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1095
+ * @param {string | object} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1096
+ * @param {?string | object} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1097
1097
  *
1098
1098
  *
1099
1099
  * {{ react }}
@@ -1133,8 +1133,8 @@ class WebDriver extends Helper {
1133
1133
  * // or by strict locator
1134
1134
  * I.fillField({css: 'form#login input[name=username]'}, 'John');
1135
1135
  * ```
1136
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1137
- * @param {CodeceptJS.StringOrSecret} value text value to fill.
1136
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator.
1137
+ * @param {string | object} value text value to fill.
1138
1138
  *
1139
1139
  * {{ react }}
1140
1140
  * {{ custom }}
@@ -1154,7 +1154,7 @@ class WebDriver extends Helper {
1154
1154
  * ```js
1155
1155
  * I.appendField('#myTextField', 'appended');
1156
1156
  * ```
1157
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
1157
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator
1158
1158
  * @param {string} value text value to append.
1159
1159
  * {{ react }}
1160
1160
  */
@@ -1173,7 +1173,7 @@ class WebDriver extends Helper {
1173
1173
  * I.clearField('user[email]');
1174
1174
  * I.clearField('#email');
1175
1175
  * ```
1176
- * @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
1176
+ * @param {string | object} editable field located by label|name|CSS|XPath|strict locator.
1177
1177
  *
1178
1178
  *
1179
1179
  */
@@ -1203,7 +1203,7 @@ class WebDriver extends Helper {
1203
1203
  * ```js
1204
1204
  * I.selectOption('Which OS do you use?', ['Android', 'iOS']);
1205
1205
  * ```
1206
- * @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
1206
+ * @param {string | object} select field located by label|name|CSS|XPath|strict locator.
1207
1207
  * @param {string|Array<*>} option visible text or value of option.
1208
1208
  *
1209
1209
  */
@@ -1246,7 +1246,7 @@ class WebDriver extends Helper {
1246
1246
  * I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
1247
1247
  * ```
1248
1248
  *
1249
- * @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
1249
+ * @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
1250
1250
  * @param {string} pathToFile local file path relative to codecept.json config file.
1251
1251
  * Appium: not tested
1252
1252
  */
@@ -1285,8 +1285,8 @@ class WebDriver extends Helper {
1285
1285
  * I.checkOption('I Agree to Terms and Conditions');
1286
1286
  * I.checkOption('agree', '//form');
1287
1287
  * ```
1288
- * @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
1289
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
1288
+ * @param {string | object} field checkbox located by label | name | CSS | XPath | strict locator.
1289
+ * @param {?string | object} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
1290
1290
  * Appium: not tested
1291
1291
  */
1292
1292
  async checkOption(field, context = null) {
@@ -1315,8 +1315,8 @@ class WebDriver extends Helper {
1315
1315
  * I.uncheckOption('I Agree to Terms and Conditions');
1316
1316
  * I.uncheckOption('agree', '//form');
1317
1317
  * ```
1318
- * @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
1319
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
1318
+ * @param {string | object} field checkbox located by label | name | CSS | XPath | strict locator.
1319
+ * @param {?string | object} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
1320
1320
  * Appium: not tested
1321
1321
  */
1322
1322
  async uncheckOption(field, context = null) {
@@ -1342,7 +1342,7 @@ class WebDriver extends Helper {
1342
1342
  * let pins = await I.grabTextFromAll('#pin li');
1343
1343
  * ```
1344
1344
  *
1345
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1345
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1346
1346
  * @returns {Promise<string[]>} attribute value
1347
1347
  *
1348
1348
  *
@@ -1363,7 +1363,7 @@ class WebDriver extends Helper {
1363
1363
  * ```
1364
1364
  * If multiple elements found returns first element.
1365
1365
  *
1366
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1366
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1367
1367
  * @returns {Promise<string>} attribute value
1368
1368
  *
1369
1369
  *
@@ -1386,7 +1386,7 @@ class WebDriver extends Helper {
1386
1386
  * let postHTMLs = await I.grabHTMLFromAll('.post');
1387
1387
  * ```
1388
1388
  *
1389
- * @param {CodeceptJS.LocatorOrString} element located by CSS|XPath|strict locator.
1389
+ * @param {string | object} element located by CSS|XPath|strict locator.
1390
1390
  * @returns {Promise<string[]>} HTML code for an element
1391
1391
  *
1392
1392
  *
@@ -1407,7 +1407,7 @@ class WebDriver extends Helper {
1407
1407
  * let postHTML = await I.grabHTMLFrom('#post');
1408
1408
  * ```
1409
1409
  *
1410
- * @param {CodeceptJS.LocatorOrString} element located by CSS|XPath|strict locator.
1410
+ * @param {string | object} element located by CSS|XPath|strict locator.
1411
1411
  * @returns {Promise<string>} HTML code for an element
1412
1412
  *
1413
1413
  *
@@ -1429,7 +1429,7 @@ class WebDriver extends Helper {
1429
1429
  * ```js
1430
1430
  * let inputs = await I.grabValueFromAll('//form/input');
1431
1431
  * ```
1432
- * @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
1432
+ * @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
1433
1433
  * @returns {Promise<string[]>} attribute value
1434
1434
  *
1435
1435
  *
@@ -1450,7 +1450,7 @@ class WebDriver extends Helper {
1450
1450
  * ```js
1451
1451
  * let email = await I.grabValueFrom('input[name=email]');
1452
1452
  * ```
1453
- * @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
1453
+ * @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
1454
1454
  * @returns {Promise<string>} attribute value
1455
1455
  *
1456
1456
  *
@@ -1473,7 +1473,7 @@ class WebDriver extends Helper {
1473
1473
  * const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
1474
1474
  * ```
1475
1475
  *
1476
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1476
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1477
1477
  * @param {string} cssProperty CSS property name.
1478
1478
  * @returns {Promise<string[]>} CSS value
1479
1479
  *
@@ -1494,7 +1494,7 @@ class WebDriver extends Helper {
1494
1494
  * const value = await I.grabCssPropertyFrom('h3', 'font-weight');
1495
1495
  * ```
1496
1496
  *
1497
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1497
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1498
1498
  * @param {string} cssProperty CSS property name.
1499
1499
  * @returns {Promise<string>} CSS value
1500
1500
  *
@@ -1517,7 +1517,7 @@ class WebDriver extends Helper {
1517
1517
  * ```js
1518
1518
  * let hints = await I.grabAttributeFromAll('.tooltip', 'title');
1519
1519
  * ```
1520
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1520
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1521
1521
  * @param {string} attr attribute name.
1522
1522
  * @returns {Promise<string[]>} attribute value
1523
1523
  *
@@ -1537,7 +1537,7 @@ class WebDriver extends Helper {
1537
1537
  * ```js
1538
1538
  * let hint = await I.grabAttributeFrom('#tooltip', 'title');
1539
1539
  * ```
1540
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1540
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1541
1541
  * @param {string} attr attribute name.
1542
1542
  * @returns {Promise<string>} attribute value
1543
1543
  *
@@ -1620,7 +1620,7 @@ class WebDriver extends Helper {
1620
1620
  * I.see('Register', {css: 'form.register'}); // use strict locator
1621
1621
  * ```
1622
1622
  * @param {string} text expected on page.
1623
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
1623
+ * @param {?string | object} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
1624
1624
  *
1625
1625
  * {{ react }}
1626
1626
  */
@@ -1636,7 +1636,7 @@ class WebDriver extends Helper {
1636
1636
  * ```
1637
1637
  *
1638
1638
  * @param {string} text element value to check.
1639
- * @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
1639
+ * @param {(string | object)?} [context=null] element located by CSS|XPath|strict locator.
1640
1640
  */
1641
1641
  async seeTextEquals(text, context = null) {
1642
1642
  return proceedSee.call(this, 'assert', text, context, true);
@@ -1652,7 +1652,7 @@ class WebDriver extends Helper {
1652
1652
  * ```
1653
1653
  *
1654
1654
  * @param {string} text which is not present.
1655
- * @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
1655
+ * @param {string | object} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
1656
1656
  *
1657
1657
  *
1658
1658
  * {{ react }}
@@ -1671,7 +1671,7 @@ class WebDriver extends Helper {
1671
1671
  * I.seeInField('form input[type=hidden]','hidden_value');
1672
1672
  * I.seeInField('#searchform input','Search');
1673
1673
  * ```
1674
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1674
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator.
1675
1675
  * @param {string} value value to check.
1676
1676
  *
1677
1677
  *
@@ -1689,7 +1689,7 @@ class WebDriver extends Helper {
1689
1689
  * I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
1690
1690
  * ```
1691
1691
  *
1692
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1692
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator.
1693
1693
  * @param {string} value value to check.
1694
1694
  *
1695
1695
  */
@@ -1706,7 +1706,7 @@ class WebDriver extends Helper {
1706
1706
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
1707
1707
  * ```
1708
1708
  *
1709
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1709
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator.
1710
1710
  *
1711
1711
  * Appium: not tested
1712
1712
  */
@@ -1723,7 +1723,7 @@ class WebDriver extends Helper {
1723
1723
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
1724
1724
  * ```
1725
1725
  *
1726
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1726
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator.
1727
1727
  *
1728
1728
  * Appium: not tested
1729
1729
  */
@@ -1738,7 +1738,7 @@ class WebDriver extends Helper {
1738
1738
  * ```js
1739
1739
  * I.seeElement('#modal');
1740
1740
  * ```
1741
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
1741
+ * @param {string | object} locator located by CSS|XPath|strict locator.
1742
1742
  * {{ react }}
1743
1743
  *
1744
1744
  */
@@ -1756,7 +1756,7 @@ class WebDriver extends Helper {
1756
1756
  * I.dontSeeElement('.modal'); // modal is not shown
1757
1757
  * ```
1758
1758
  *
1759
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
1759
+ * @param {string | object} locator located by CSS|XPath|Strict locator.
1760
1760
  * {{ react }}
1761
1761
  */
1762
1762
  async dontSeeElement(locator) {
@@ -1775,7 +1775,7 @@ class WebDriver extends Helper {
1775
1775
  * ```js
1776
1776
  * I.seeElementInDOM('#modal');
1777
1777
  * ```
1778
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1778
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1779
1779
  *
1780
1780
  *
1781
1781
  */
@@ -1791,7 +1791,7 @@ class WebDriver extends Helper {
1791
1791
  * I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
1792
1792
  * ```
1793
1793
  *
1794
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
1794
+ * @param {string | object} locator located by CSS|XPath|Strict locator.
1795
1795
  *
1796
1796
  */
1797
1797
  async dontSeeElementInDOM(locator) {
@@ -1889,7 +1889,7 @@ class WebDriver extends Helper {
1889
1889
  * I.seeNumberOfElements('#submitBtn', 1);
1890
1890
  * ```
1891
1891
  *
1892
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1892
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1893
1893
  * @param {number} num number of elements.
1894
1894
  *
1895
1895
  * {{ react }}
@@ -1907,7 +1907,7 @@ class WebDriver extends Helper {
1907
1907
  * I.seeNumberOfVisibleElements('.buttons', 3);
1908
1908
  * ```
1909
1909
  *
1910
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1910
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1911
1911
  * @param {number} num number of elements.
1912
1912
  *
1913
1913
  * {{ react }}
@@ -1924,7 +1924,7 @@ class WebDriver extends Helper {
1924
1924
  * I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
1925
1925
  * ```
1926
1926
  *
1927
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
1927
+ * @param {string | object} locator located by CSS|XPath|strict locator.
1928
1928
  * @param {object} cssProperties object with CSS properties and their values to check.
1929
1929
  */
1930
1930
  async seeCssPropertiesOnElements(locator, cssProperties) {
@@ -1966,7 +1966,7 @@ class WebDriver extends Helper {
1966
1966
  * I.seeAttributesOnElements('//form', { method: "post"});
1967
1967
  * ```
1968
1968
  *
1969
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
1969
+ * @param {string | object} locator located by CSS|XPath|strict locator.
1970
1970
  * @param {object} attributes attributes and their values to check.
1971
1971
  */
1972
1972
  async seeAttributesOnElements(locator, attributes) {
@@ -2001,7 +2001,7 @@ class WebDriver extends Helper {
2001
2001
  * let numOfElements = await I.grabNumberOfVisibleElements('p');
2002
2002
  * ```
2003
2003
  *
2004
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
2004
+ * @param {string | object} locator located by CSS|XPath|strict locator.
2005
2005
  * @returns {Promise<number>} number of visible elements
2006
2006
  */
2007
2007
  async grabNumberOfVisibleElements(locator) {
@@ -2151,7 +2151,7 @@ class WebDriver extends Helper {
2151
2151
  * I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
2152
2152
  * ```
2153
2153
  *
2154
- * @param {LocatorOrString} locator located by CSS|XPath|strict locator.
2154
+ * @param {string | object} locator located by CSS|XPath|strict locator.
2155
2155
  * @param {ScrollIntoViewOptions} scrollIntoViewOptions see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
2156
2156
  *
2157
2157
  *
@@ -2172,7 +2172,7 @@ class WebDriver extends Helper {
2172
2172
  * I.scrollTo('#submit', 5, 5);
2173
2173
  * ```
2174
2174
  *
2175
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
2175
+ * @param {string | object} locator located by CSS|XPath|strict locator.
2176
2176
  * @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
2177
2177
  * @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
2178
2178
  *
@@ -2213,7 +2213,7 @@ class WebDriver extends Helper {
2213
2213
  * I.moveCursorTo('#submit', 5,5);
2214
2214
  * ```
2215
2215
  *
2216
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
2216
+ * @param {string | object} locator located by CSS|XPath|strict locator.
2217
2217
  * @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
2218
2218
  * @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
2219
2219
  *
@@ -2234,7 +2234,7 @@ class WebDriver extends Helper {
2234
2234
  * I.saveElementScreenshot(`#submit`,'debug.png');
2235
2235
  * ```
2236
2236
  *
2237
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2237
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
2238
2238
  * @param {string} fileName file name to save.
2239
2239
  *
2240
2240
  *
@@ -2681,8 +2681,8 @@ class WebDriver extends Helper {
2681
2681
  * I.dragAndDrop('#dragHandle', '#container');
2682
2682
  * ```
2683
2683
  *
2684
- * @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
2685
- * @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
2684
+ * @param {string | object} srcElement located by CSS|XPath|strict locator.
2685
+ * @param {string | object} destElement located by CSS|XPath|strict locator.
2686
2686
  *
2687
2687
  * Appium: not tested
2688
2688
  */
@@ -2707,7 +2707,7 @@ class WebDriver extends Helper {
2707
2707
  * I.dragSlider('#slider', -70);
2708
2708
  * ```
2709
2709
  *
2710
- * @param {CodeceptJS.LocatorOrString} locator located by label|name|CSS|XPath|strict locator.
2710
+ * @param {string | object} locator located by label|name|CSS|XPath|strict locator.
2711
2711
  * @param {number} offsetX position to drag.
2712
2712
  */
2713
2713
  async dragSlider(locator, offsetX = 0) {
@@ -2825,7 +2825,7 @@ class WebDriver extends Helper {
2825
2825
  * Waits for element to become enabled (by default waits for 1sec).
2826
2826
  * Element can be located by CSS or XPath.
2827
2827
  *
2828
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2828
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
2829
2829
  * @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
2830
2830
  */
2831
2831
  async waitForEnabled(locator, sec = null) {
@@ -2868,7 +2868,7 @@ class WebDriver extends Helper {
2868
2868
  * I.waitForElement('.btn.continue', 5); // wait for 5 secs
2869
2869
  * ```
2870
2870
  *
2871
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2871
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
2872
2872
  * @param {number} [sec] (optional, `1` by default) time in seconds to wait
2873
2873
  */
2874
2874
  async waitForElement(locator, sec = null) {
@@ -2894,7 +2894,7 @@ class WebDriver extends Helper {
2894
2894
  * I.waitForClickable('.btn.continue', 5); // wait for 5 secs
2895
2895
  * ```
2896
2896
  *
2897
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2897
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
2898
2898
  * @param {number} [sec] (optional, `1` by default) time in seconds to wait
2899
2899
  */
2900
2900
  async waitForClickable(locator, waitTimeout) {
@@ -2994,7 +2994,7 @@ class WebDriver extends Helper {
2994
2994
  *
2995
2995
  * @param {string }text to wait for.
2996
2996
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
2997
- * @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
2997
+ * @param {string | object} [context] (optional) element located by CSS|XPath|strict locator.
2998
2998
  *
2999
2999
  */
3000
3000
  async waitForText(text, sec = null, context = null) {
@@ -3038,7 +3038,7 @@ class WebDriver extends Helper {
3038
3038
  * I.waitForValue('//input', "GoodValue");
3039
3039
  * ```
3040
3040
  *
3041
- * @param {LocatorOrString} field input field.
3041
+ * @param {string | object} field input field.
3042
3042
  * @param {string }value expected value.
3043
3043
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3044
3044
  *
@@ -3084,7 +3084,7 @@ class WebDriver extends Helper {
3084
3084
  * I.waitForVisible('#popup');
3085
3085
  * ```
3086
3086
  *
3087
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
3087
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
3088
3088
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3089
3089
  *
3090
3090
  *
@@ -3120,7 +3120,7 @@ class WebDriver extends Helper {
3120
3120
  * I.waitNumberOfVisibleElements('a', 3);
3121
3121
  * ```
3122
3122
  *
3123
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
3123
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
3124
3124
  * @param {number} num number of elements.
3125
3125
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3126
3126
  */
@@ -3156,7 +3156,7 @@ class WebDriver extends Helper {
3156
3156
  * I.waitForInvisible('#popup');
3157
3157
  * ```
3158
3158
  *
3159
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
3159
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
3160
3160
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3161
3161
  */
3162
3162
  async waitForInvisible(locator, sec = null) {
@@ -3185,7 +3185,7 @@ class WebDriver extends Helper {
3185
3185
  * I.waitToHide('#popup');
3186
3186
  * ```
3187
3187
  *
3188
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
3188
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
3189
3189
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3190
3190
  */
3191
3191
  async waitToHide(locator, sec = null) {
@@ -3200,7 +3200,7 @@ class WebDriver extends Helper {
3200
3200
  * I.waitForDetached('#popup');
3201
3201
  * ```
3202
3202
  *
3203
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
3203
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
3204
3204
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3205
3205
  */
3206
3206
  async waitForDetached(locator, sec = null) {
@@ -3267,7 +3267,7 @@ class WebDriver extends Helper {
3267
3267
  * I.switchTo(); // switch back to main page
3268
3268
  * ```
3269
3269
  *
3270
- * @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
3270
+ * @param {?string | object} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
3271
3271
  */
3272
3272
  async switchTo(locator) {
3273
3273
  this.browser.isInsideFrame = true;
@@ -3541,7 +3541,7 @@ class WebDriver extends Helper {
3541
3541
  * const width = await I.grabElementBoundingRect('h3', 'width');
3542
3542
  * // width == 527
3543
3543
  * ```
3544
- * @param {LocatorOrString} locator element located by CSS|XPath|strict locator.
3544
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
3545
3545
  * @param {string=} elementSize x, y, width or height of the given element.
3546
3546
  * @returns {Promise<DOMRect>|Promise<number>} Element bounding rectangle
3547
3547
  *
package/docs/changelog.md CHANGED
@@ -7,6 +7,13 @@ layout: Section
7
7
 
8
8
  # Releases
9
9
 
10
+ ## 3.2.3
11
+
12
+ * Documentation improvements by **[maojunxyz](https://github.com/maojunxyz)**
13
+ * Guard mocha cli reporter from registering step logger multiple times [#3180](https://github.com/codeceptjs/CodeceptJS/issues/3180) by **[nikocanvacom](https://github.com/nikocanvacom)**
14
+ * **[Playwright]** Fixed "tracing.stop: tracing.stop: ENAMETOOLONG: name too long" by **[hatufacci](https://github.com/hatufacci)**
15
+ * Fixed [#2889](https://github.com/codeceptjs/CodeceptJS/issues/2889): return always the same error contract from simplifyTest. See [#3168](https://github.com/codeceptjs/CodeceptJS/issues/3168) by **[andremoah](https://github.com/andremoah)**
16
+
10
17
  ## 3.2.2
11
18
 
12
19
  * **[Playwright]** Reverted removal of retry on context errors. Fixes [#3130](https://github.com/codeceptjs/CodeceptJS/issues/3130)
@@ -17,15 +17,15 @@ Here is an overview of available options with their defaults:
17
17
  * **timeout**: `10000` - default tests timeout
18
18
  * **output**: `"./output"` - where to store failure screenshots, etc
19
19
  * **helpers**: `{}` - list of enabled helpers
20
- * **mocha**: `{}` - mocha options, [reporters](http://codecept.io/reports/) can be configured here
21
- * **multiple**: `{}` - multiple options, see [Multiple Execution](http://codecept.io/parallel#multiple-browsers-execution)
22
- * **bootstrap**: `"./bootstrap.js"` - an option to run code _before_ tests are run. See [Hooks](http://codecept.io/hooks/#bootstrap-teardown)).
23
- * **bootstrapAll**: `"./bootstrap.js"` - an option to run code _before_ all test suites are run when using the run-multiple mode. See [Hooks](http://codecept.io/hooks/#bootstrap-teardown)).
24
- * **teardown**: - an option to run code _after_ all test suites are run when using the run-multiple mode. See [Hooks](http://codecept.io/hooks/#bootstrap-teardown).
25
- * **teardownAll**: - an option to run code _after_ tests are run. See [Hooks](http://codecept.io/hooks/#bootstrap-teardown).
20
+ * **mocha**: `{}` - mocha options, [reporters](https://codecept.io/reports/) can be configured here
21
+ * **multiple**: `{}` - multiple options, see [Multiple Execution](https://codecept.io/parallel#multiple-browsers-execution)
22
+ * **bootstrap**: `"./bootstrap.js"` - an option to run code _before_ tests are run. See [Hooks](https://codecept.io/hooks/#bootstrap-teardown)).
23
+ * **bootstrapAll**: `"./bootstrap.js"` - an option to run code _before_ all test suites are run when using the run-multiple mode. See [Hooks](https://codecept.io/hooks/#bootstrap-teardown)).
24
+ * **teardown**: - an option to run code _after_ all test suites are run when using the run-multiple mode. See [Hooks](https://codecept.io/hooks/#bootstrap-teardown).
25
+ * **teardownAll**: - an option to run code _after_ tests are run. See [Hooks](https://codecept.io/hooks/#bootstrap-teardown).
26
26
  * **noGlobals**: `false` - disable registering global variables like `Actor`, `Helper`, `pause`, `within`, `DataTable`
27
- * **hooks**: - include custom listeners to plug into execution workflow. See [Custom Hooks](http://codecept.io/hooks/#custom-hooks)
28
- * **translation**: - [locale](http://codecept.io/translation/) to be used to print s teps output, as well as used in source code.
27
+ * **hooks**: - include custom listeners to plug into execution workflow. See [Custom Hooks](https://codecept.io/hooks/#custom-hooks)
28
+ * **translation**: - [locale](https://codecept.io/translation/) to be used to print s teps output, as well as used in source code.
29
29
  * **require**: `[]` - array of module names to be required before codecept starts. See [Require](#require)
30
30
 
31
31
 
@@ -264,7 +264,7 @@ class MyHelper extends Helper {
264
264
  const { WebDriver } = this.helpers
265
265
  const { browser } = WebDriver;
266
266
 
267
- // get all cookies according to http://webdriver.io/api/protocol/cookie.html
267
+ // get all cookies according to https://webdriver.io/api/protocol/cookie.html
268
268
  // any helper method should return a value in order to be added to promise chain
269
269
  const res = await browser.cookie();
270
270
  // get values
package/docs/data.md CHANGED
@@ -5,7 +5,7 @@ title: Data Management
5
5
 
6
6
  # Data Management
7
7
 
8
- > This chapter describes data management for external sources. If you are looking for using Data Sets in tests, see [Data Driven Tests](http://codecept.io/advanced/#data-drivern-tests) section*
8
+ > This chapter describes data management for external sources. If you are looking for using Data Sets in tests, see [Data Driven Tests](https://codecept.io/advanced/#data-drivern-tests) section*
9
9
 
10
10
  Managing data for tests is always a tricky issue. How isolate data between tests, how to prepare data for different tests, etc.
11
11
  There are different approaches to solve it:
@@ -22,7 +22,7 @@ API is supposed to be a stable interface and it can be used by acceptance tests.
22
22
 
23
23
  ## REST
24
24
 
25
- [REST helper](http://codecept.io/helpers/REST/) allows sending raw HTTP requests to application.
25
+ [REST helper](https://codecept.io/helpers/REST/) allows sending raw HTTP requests to application.
26
26
  This is a tool to make shortcuts and create your data pragmatically via API. However, it doesn't provide tools for testing APIs, so it should be paired with WebDriver, Nightmare or Protractor helpers for browser testing.
27
27
 
28
28
  Enable REST helper in the config. It is recommended to set `endpoint`, a base URL for all API requests. If you need some authorization you can optionally set default headers too.
@@ -87,11 +87,11 @@ This can also be used to emulate Ajax requests:
87
87
  I.sendPostRequest('/update-status', {}, { http_x_requested_with: 'xmlhttprequest' });
88
88
  ```
89
89
 
90
- > See complete reference on [REST](http://codecept.io/helpers/REST) helper
90
+ > See complete reference on [REST](https://codecept.io/helpers/REST) helper
91
91
 
92
92
  ## GraphQL
93
93
 
94
- [GraphQL helper](http://codecept.io/helpers/GraphQL/) allows sending GraphQL queries and mutations to application, over Http.
94
+ [GraphQL helper](https://codecept.io/helpers/GraphQL/) allows sending GraphQL queries and mutations to application, over Http.
95
95
  This is a tool to make shortcuts and create your data pragmatically via GraphQL endpoint. However, it doesn't provide tools for testing the endpoint, so it should be paired with WebDriver, Nightmare or Protractor helpers for browser testing.
96
96
 
97
97
  Enable GraphQL helper in the config. It is recommended to set `endpoint`, the URL to which the requests go to. If you need some authorization you can optionally set default headers too.
@@ -160,13 +160,13 @@ After(({ I }) => {
160
160
  });
161
161
  ```
162
162
 
163
- > See complete reference on [GraphQL](http://codecept.io/helpers/GraphQL) helper
163
+ > See complete reference on [GraphQL](https://codecept.io/helpers/GraphQL) helper
164
164
 
165
165
  ## Data Generation with Factories
166
166
 
167
167
  This concept is extended by:
168
- - [ApiDataFactory](http://codecept.io/helpers/ApiDataFactory/) helper, and,
169
- - [GraphQLDataFactory](http://codecept.io/helpers/GraphQLDataFactory/) helper.
168
+ - [ApiDataFactory](https://codecept.io/helpers/ApiDataFactory/) helper, and,
169
+ - [GraphQLDataFactory](https://codecept.io/helpers/GraphQLDataFactory/) helper.
170
170
 
171
171
  These helpers build data according to defined rules and use REST API or GraphQL mutations to store them and automatically clean them up after a test.
172
172
 
@@ -238,7 +238,7 @@ At the end of a test ApiDataFactory will clean up created record for you. This i
238
238
  ids from crated records and running `DELETE /api/users/{id}` requests at the end of a test.
239
239
  This rules can be customized in helper configuration.
240
240
 
241
- > See complete reference on [ApiDataFactory](http://codecept.io/helpers/ApiDataFactory) helper
241
+ > See complete reference on [ApiDataFactory](https://codecept.io/helpers/ApiDataFactory) helper
242
242
 
243
243
  ### GraphQL Data Factory
244
244
 
@@ -303,7 +303,7 @@ data from crated records, creating deletion mutation objects by passing the data
303
303
  This behavior is according the `revert` function be customized in helper configuration.
304
304
  The revert function returns an object, that contains the query for deletion, and the variables object to go along with it.
305
305
 
306
- > See complete reference on [GraphQLDataFactory](http://codecept.io/helpers/GraphQLDataFactory) helper
306
+ > See complete reference on [GraphQLDataFactory](https://codecept.io/helpers/GraphQLDataFactory) helper
307
307
 
308
308
  ## Requests Using Browser Session
309
309