codeceptjs 3.2.3 → 3.3.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/docs/advanced.md +0 -4
  3. package/docs/api.md +227 -188
  4. package/docs/build/ApiDataFactory.js +13 -6
  5. package/docs/build/Appium.js +36 -36
  6. package/docs/build/GraphQL.js +11 -0
  7. package/docs/build/JSONResponse.js +297 -0
  8. package/docs/build/Nightmare.js +48 -48
  9. package/docs/build/Playwright.js +261 -146
  10. package/docs/build/Puppeteer.js +76 -67
  11. package/docs/build/REST.js +36 -0
  12. package/docs/build/TestCafe.js +44 -44
  13. package/docs/build/WebDriver.js +69 -69
  14. package/docs/helpers/ApiDataFactory.md +7 -0
  15. package/docs/helpers/Appium.md +3 -3
  16. package/docs/helpers/JSONResponse.md +230 -0
  17. package/docs/helpers/Playwright.md +282 -218
  18. package/docs/helpers/Puppeteer.md +9 -1
  19. package/docs/helpers/REST.md +30 -9
  20. package/docs/installation.md +2 -0
  21. package/docs/internal-api.md +265 -0
  22. package/docs/playwright.md +70 -15
  23. package/docs/plugins.md +125 -29
  24. package/docs/puppeteer.md +24 -8
  25. package/docs/quickstart.md +2 -3
  26. package/docs/reports.md +43 -2
  27. package/docs/translation.md +1 -1
  28. package/docs/videos.md +2 -2
  29. package/docs/webdriver.md +90 -2
  30. package/lib/command/init.js +5 -15
  31. package/lib/config.js +17 -13
  32. package/lib/helper/ApiDataFactory.js +13 -6
  33. package/lib/helper/Appium.js +3 -3
  34. package/lib/helper/GraphQL.js +11 -0
  35. package/lib/helper/JSONResponse.js +297 -0
  36. package/lib/helper/Playwright.js +199 -84
  37. package/lib/helper/Puppeteer.js +12 -3
  38. package/lib/helper/REST.js +36 -0
  39. package/lib/helper/extras/Console.js +8 -0
  40. package/lib/helper/extras/PlaywrightRestartOpts.js +35 -0
  41. package/lib/interfaces/bdd.js +3 -1
  42. package/lib/plugin/allure.js +12 -0
  43. package/lib/plugin/eachElement.js +127 -0
  44. package/lib/utils.js +20 -0
  45. package/package.json +24 -23
  46. package/translations/pt-BR.js +8 -0
  47. package/typings/index.d.ts +2 -0
  48. package/typings/types.d.ts +237 -11
@@ -549,7 +549,7 @@ class Nightmare extends Helper {
549
549
  * I.see('Register', {css: 'form.register'}); // use strict locator
550
550
  * ```
551
551
  * @param {string} text expected on page.
552
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
552
+ * @param {?string | object} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
553
553
  */
554
554
  async see(text, context = null) {
555
555
  return proceedSee.call(this, 'assert', text, context);
@@ -565,7 +565,7 @@ class Nightmare extends Helper {
565
565
  * ```
566
566
  *
567
567
  * @param {string} text which is not present.
568
- * @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
568
+ * @param {string | object} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
569
569
  *
570
570
  */
571
571
  dontSee(text, context = null) {
@@ -579,7 +579,7 @@ class Nightmare extends Helper {
579
579
  * ```js
580
580
  * I.seeElement('#modal');
581
581
  * ```
582
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
582
+ * @param {string | object} locator located by CSS|XPath|strict locator.
583
583
  */
584
584
  async seeElement(locator) {
585
585
  locator = new Locator(locator, 'css');
@@ -596,7 +596,7 @@ class Nightmare extends Helper {
596
596
  * I.dontSeeElement('.modal'); // modal is not shown
597
597
  * ```
598
598
  *
599
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
599
+ * @param {string | object} locator located by CSS|XPath|Strict locator.
600
600
  */
601
601
  async dontSeeElement(locator) {
602
602
  locator = new Locator(locator, 'css');
@@ -614,7 +614,7 @@ class Nightmare extends Helper {
614
614
  * ```js
615
615
  * I.seeElementInDOM('#modal');
616
616
  * ```
617
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
617
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
618
618
  *
619
619
  */
620
620
  async seeElementInDOM(locator) {
@@ -630,7 +630,7 @@ class Nightmare extends Helper {
630
630
  * I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
631
631
  * ```
632
632
  *
633
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
633
+ * @param {string | object} locator located by CSS|XPath|Strict locator.
634
634
  */
635
635
  async dontSeeElementInDOM(locator) {
636
636
  locator = new Locator(locator, 'css');
@@ -675,7 +675,7 @@ class Nightmare extends Helper {
675
675
  * I.seeNumberOfElements('#submitBtn', 1);
676
676
  * ```
677
677
  *
678
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
678
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
679
679
  * @param {number} num number of elements.
680
680
  *
681
681
  */
@@ -692,7 +692,7 @@ class Nightmare extends Helper {
692
692
  * I.seeNumberOfVisibleElements('.buttons', 3);
693
693
  * ```
694
694
  *
695
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
695
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
696
696
  * @param {number} num number of elements.
697
697
  *
698
698
  */
@@ -709,7 +709,7 @@ class Nightmare extends Helper {
709
709
  * let numOfElements = await I.grabNumberOfVisibleElements('p');
710
710
  * ```
711
711
  *
712
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
712
+ * @param {string | object} locator located by CSS|XPath|strict locator.
713
713
  * @returns {Promise<number>} number of visible elements
714
714
  */
715
715
  async grabNumberOfVisibleElements(locator) {
@@ -746,8 +746,8 @@ class Nightmare extends Helper {
746
746
  * I.click({css: 'nav a.login'});
747
747
  * ```
748
748
  *
749
- * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
750
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
749
+ * @param {string | object} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
750
+ * @param {?string | object} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
751
751
  *
752
752
  */
753
753
  async click(locator, context = null) {
@@ -768,8 +768,8 @@ class Nightmare extends Helper {
768
768
  * I.doubleClick('.btn.edit');
769
769
  * ```
770
770
  *
771
- * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
772
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
771
+ * @param {string | object} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
772
+ * @param {?string | object} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
773
773
  *
774
774
  */
775
775
  async doubleClick(locator, context = null) {
@@ -791,8 +791,8 @@ class Nightmare extends Helper {
791
791
  * I.rightClick('Click me', '.context');
792
792
  * ```
793
793
  *
794
- * @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
795
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
794
+ * @param {string | object} locator clickable element located by CSS|XPath|strict locator.
795
+ * @param {?string | object} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
796
796
  *
797
797
  */
798
798
  async rightClick(locator, context = null) {
@@ -811,7 +811,7 @@ class Nightmare extends Helper {
811
811
  * I.moveCursorTo('#submit', 5,5);
812
812
  * ```
813
813
  *
814
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
814
+ * @param {string | object} locator located by CSS|XPath|strict locator.
815
815
  * @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
816
816
  * @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
817
817
  *
@@ -920,8 +920,8 @@ class Nightmare extends Helper {
920
920
  * I.checkOption('I Agree to Terms and Conditions');
921
921
  * I.checkOption('agree', '//form');
922
922
  * ```
923
- * @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
924
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
923
+ * @param {string | object} field checkbox located by label | name | CSS | XPath | strict locator.
924
+ * @param {?string | object} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
925
925
  */
926
926
  async checkOption(field, context = null) {
927
927
  const els = await findCheckable.call(this, field, context);
@@ -941,8 +941,8 @@ class Nightmare extends Helper {
941
941
  * I.uncheckOption('I Agree to Terms and Conditions');
942
942
  * I.uncheckOption('agree', '//form');
943
943
  * ```
944
- * @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
945
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
944
+ * @param {string | object} field checkbox located by label | name | CSS | XPath | strict locator.
945
+ * @param {?string | object} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
946
946
  */
947
947
  async uncheckOption(field, context = null) {
948
948
  const els = await findCheckable.call(this, field, context);
@@ -965,8 +965,8 @@ class Nightmare extends Helper {
965
965
  * // or by strict locator
966
966
  * I.fillField({css: 'form#login input[name=username]'}, 'John');
967
967
  * ```
968
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
969
- * @param {CodeceptJS.StringOrSecret} value text value to fill.
968
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator.
969
+ * @param {string | object} value text value to fill.
970
970
  *
971
971
  */
972
972
  async fillField(field, value) {
@@ -984,7 +984,7 @@ class Nightmare extends Helper {
984
984
  * I.clearField('user[email]');
985
985
  * I.clearField('#email');
986
986
  * ```
987
- * @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
987
+ * @param {string | object} editable field located by label|name|CSS|XPath|strict locator.
988
988
  *
989
989
  */
990
990
  async clearField(field) {
@@ -998,7 +998,7 @@ class Nightmare extends Helper {
998
998
  * ```js
999
999
  * I.appendField('#myTextField', 'appended');
1000
1000
  * ```
1001
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
1001
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator
1002
1002
  * @param {string} value text value to append.
1003
1003
  */
1004
1004
  async appendField(field, value) {
@@ -1018,7 +1018,7 @@ class Nightmare extends Helper {
1018
1018
  * I.seeInField('form input[type=hidden]','hidden_value');
1019
1019
  * I.seeInField('#searchform input','Search');
1020
1020
  * ```
1021
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1021
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator.
1022
1022
  * @param {string} value value to check.
1023
1023
  *
1024
1024
  */
@@ -1035,7 +1035,7 @@ class Nightmare extends Helper {
1035
1035
  * I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
1036
1036
  * ```
1037
1037
  *
1038
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1038
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator.
1039
1039
  * @param {string} value value to check.
1040
1040
  */
1041
1041
  async dontSeeInField(field, value) {
@@ -1079,7 +1079,7 @@ class Nightmare extends Helper {
1079
1079
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
1080
1080
  * ```
1081
1081
  *
1082
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1082
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator.
1083
1083
  *
1084
1084
  */
1085
1085
  async seeCheckboxIsChecked(field) {
@@ -1095,7 +1095,7 @@ class Nightmare extends Helper {
1095
1095
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
1096
1096
  * ```
1097
1097
  *
1098
- * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1098
+ * @param {string | object} field located by label|name|CSS|XPath|strict locator.
1099
1099
  *
1100
1100
  */
1101
1101
  async dontSeeCheckboxIsChecked(field) {
@@ -1112,7 +1112,7 @@ class Nightmare extends Helper {
1112
1112
  * I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
1113
1113
  * ```
1114
1114
  *
1115
- * @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
1115
+ * @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
1116
1116
  * @param {string} pathToFile local file path relative to codecept.json config file.
1117
1117
  *
1118
1118
  * Doesn't work if the Chromium DevTools panel is open (as Chromium allows only one attachment to the debugger at a time. [See more](https://github.com/rosshinkley/nightmare-upload#important-note-about-setting-file-upload-inputs))
@@ -1139,7 +1139,7 @@ class Nightmare extends Helper {
1139
1139
  * let pins = await I.grabTextFromAll('#pin li');
1140
1140
  * ```
1141
1141
  *
1142
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1142
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1143
1143
  * @returns {Promise<string[]>} attribute value
1144
1144
  *
1145
1145
  */
@@ -1163,7 +1163,7 @@ class Nightmare extends Helper {
1163
1163
  * ```
1164
1164
  * If multiple elements found returns first element.
1165
1165
  *
1166
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1166
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1167
1167
  * @returns {Promise<string>} attribute value
1168
1168
  *
1169
1169
  */
@@ -1186,7 +1186,7 @@ class Nightmare extends Helper {
1186
1186
  * ```js
1187
1187
  * let inputs = await I.grabValueFromAll('//form/input');
1188
1188
  * ```
1189
- * @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
1189
+ * @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
1190
1190
  * @returns {Promise<string[]>} attribute value
1191
1191
  *
1192
1192
  */
@@ -1210,7 +1210,7 @@ class Nightmare extends Helper {
1210
1210
  * ```js
1211
1211
  * let email = await I.grabValueFrom('input[name=email]');
1212
1212
  * ```
1213
- * @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
1213
+ * @param {string | object} locator field located by label|name|CSS|XPath|strict locator.
1214
1214
  * @returns {Promise<string>} attribute value
1215
1215
  *
1216
1216
  */
@@ -1232,7 +1232,7 @@ class Nightmare extends Helper {
1232
1232
  * ```js
1233
1233
  * let hints = await I.grabAttributeFromAll('.tooltip', 'title');
1234
1234
  * ```
1235
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1235
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1236
1236
  * @param {string} attr attribute name.
1237
1237
  * @returns {Promise<string[]>} attribute value
1238
1238
  *
@@ -1258,7 +1258,7 @@ class Nightmare extends Helper {
1258
1258
  * ```js
1259
1259
  * let hint = await I.grabAttributeFrom('#tooltip', 'title');
1260
1260
  * ```
1261
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1261
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1262
1262
  * @param {string} attr attribute name.
1263
1263
  * @returns {Promise<string>} attribute value
1264
1264
  *
@@ -1284,7 +1284,7 @@ class Nightmare extends Helper {
1284
1284
  * let postHTMLs = await I.grabHTMLFromAll('.post');
1285
1285
  * ```
1286
1286
  *
1287
- * @param {CodeceptJS.LocatorOrString} element located by CSS|XPath|strict locator.
1287
+ * @param {string | object} element located by CSS|XPath|strict locator.
1288
1288
  * @returns {Promise<string[]>} HTML code for an element
1289
1289
  *
1290
1290
  */
@@ -1311,7 +1311,7 @@ class Nightmare extends Helper {
1311
1311
  * let postHTML = await I.grabHTMLFrom('#post');
1312
1312
  * ```
1313
1313
  *
1314
- * @param {CodeceptJS.LocatorOrString} element located by CSS|XPath|strict locator.
1314
+ * @param {string | object} element located by CSS|XPath|strict locator.
1315
1315
  * @returns {Promise<string>} HTML code for an element
1316
1316
  *
1317
1317
  */
@@ -1336,7 +1336,7 @@ class Nightmare extends Helper {
1336
1336
  * const value = await I.grabCssPropertyFrom('h3', 'font-weight');
1337
1337
  * ```
1338
1338
  *
1339
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1339
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1340
1340
  * @param {string} cssProperty CSS property name.
1341
1341
  * @returns {Promise<string>} CSS value
1342
1342
  *
@@ -1385,7 +1385,7 @@ class Nightmare extends Helper {
1385
1385
  * ```js
1386
1386
  * I.selectOption('Which OS do you use?', ['Android', 'iOS']);
1387
1387
  * ```
1388
- * @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
1388
+ * @param {string | object} select field located by label|name|CSS|XPath|strict locator.
1389
1389
  * @param {string|Array<*>} option visible text or value of option.
1390
1390
  *
1391
1391
  */
@@ -1582,7 +1582,7 @@ class Nightmare extends Helper {
1582
1582
  *
1583
1583
  * @param {string }text to wait for.
1584
1584
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1585
- * @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
1585
+ * @param {string | object} [context] (optional) element located by CSS|XPath|strict locator.
1586
1586
  */
1587
1587
  async waitForText(text, sec, context = null) {
1588
1588
  if (!context) {
@@ -1609,7 +1609,7 @@ class Nightmare extends Helper {
1609
1609
  * I.waitForVisible('#popup');
1610
1610
  * ```
1611
1611
  *
1612
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1612
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1613
1613
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1614
1614
  *
1615
1615
  */
@@ -1636,7 +1636,7 @@ class Nightmare extends Helper {
1636
1636
  * I.waitToHide('#popup');
1637
1637
  * ```
1638
1638
  *
1639
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1639
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1640
1640
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1641
1641
  */
1642
1642
  async waitToHide(locator, sec = null) {
@@ -1651,7 +1651,7 @@ class Nightmare extends Helper {
1651
1651
  * I.waitForInvisible('#popup');
1652
1652
  * ```
1653
1653
  *
1654
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1654
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1655
1655
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1656
1656
  */
1657
1657
  waitForInvisible(locator, sec) {
@@ -1678,7 +1678,7 @@ class Nightmare extends Helper {
1678
1678
  * I.waitForElement('.btn.continue', 5); // wait for 5 secs
1679
1679
  * ```
1680
1680
  *
1681
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1681
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1682
1682
  * @param {number} [sec] (optional, `1` by default) time in seconds to wait
1683
1683
  */
1684
1684
  async waitForElement(locator, sec) {
@@ -1707,7 +1707,7 @@ class Nightmare extends Helper {
1707
1707
  * I.waitForDetached('#popup');
1708
1708
  * ```
1709
1709
  *
1710
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1710
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1711
1711
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1712
1712
  */
1713
1713
  async waitForDetached(locator, sec) {
@@ -1750,7 +1750,7 @@ class Nightmare extends Helper {
1750
1750
  * I.saveElementScreenshot(`#submit`,'debug.png');
1751
1751
  * ```
1752
1752
  *
1753
- * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1753
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1754
1754
  * @param {string} fileName file name to save.
1755
1755
  *
1756
1756
  *
@@ -1790,7 +1790,7 @@ class Nightmare extends Helper {
1790
1790
  * const width = await I.grabElementBoundingRect('h3', 'width');
1791
1791
  * // width == 527
1792
1792
  * ```
1793
- * @param {LocatorOrString} locator element located by CSS|XPath|strict locator.
1793
+ * @param {string | object} locator element located by CSS|XPath|strict locator.
1794
1794
  * @param {string=} elementSize x, y, width or height of the given element.
1795
1795
  * @returns {Promise<DOMRect>|Promise<number>} Element bounding rectangle
1796
1796
  *
@@ -1861,7 +1861,7 @@ class Nightmare extends Helper {
1861
1861
  * I.scrollTo('#submit', 5, 5);
1862
1862
  * ```
1863
1863
  *
1864
- * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
1864
+ * @param {string | object} locator located by CSS|XPath|strict locator.
1865
1865
  * @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
1866
1866
  * @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
1867
1867
  */