codeceptjs 3.3.0 → 3.3.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 (139) hide show
  1. package/CHANGELOG.md +50 -1
  2. package/README.md +6 -1
  3. package/docs/api.md +1 -1
  4. package/docs/bdd.md +1 -0
  5. package/docs/best.md +1 -1
  6. package/docs/build/ApiDataFactory.js +4 -3
  7. package/docs/build/Appium.js +21 -16
  8. package/docs/build/GraphQL.js +4 -2
  9. package/docs/build/GraphQLDataFactory.js +3 -3
  10. package/docs/build/JSONResponse.js +1 -1
  11. package/docs/build/Nightmare.js +54 -25
  12. package/docs/build/Playwright.js +105 -52
  13. package/docs/build/Protractor.js +72 -34
  14. package/docs/build/Puppeteer.js +80 -37
  15. package/docs/build/REST.js +5 -2
  16. package/docs/build/TestCafe.js +54 -23
  17. package/docs/build/WebDriver.js +115 -67
  18. package/docs/changelog.md +50 -1
  19. package/docs/custom-helpers.md +1 -1
  20. package/docs/data.md +2 -2
  21. package/docs/helpers/ApiDataFactory.md +7 -3
  22. package/docs/helpers/Appium.md +217 -175
  23. package/docs/helpers/GraphQL.md +6 -0
  24. package/docs/helpers/GraphQLDataFactory.md +3 -3
  25. package/docs/helpers/JSONResponse.md +1 -1
  26. package/docs/helpers/Nightmare.md +98 -45
  27. package/docs/helpers/Playwright.md +151 -59
  28. package/docs/helpers/Puppeteer.md +103 -26
  29. package/docs/helpers/REST.md +1 -1
  30. package/docs/helpers/TestCafe.md +77 -22
  31. package/docs/helpers/WebDriver.md +150 -62
  32. package/docs/index.md +1 -1
  33. package/docs/locators.md +1 -1
  34. package/docs/webapi/amOnPage.mustache +2 -1
  35. package/docs/webapi/appendField.mustache +2 -1
  36. package/docs/webapi/attachFile.mustache +2 -1
  37. package/docs/webapi/checkOption.mustache +2 -1
  38. package/docs/webapi/clearCookie.mustache +2 -1
  39. package/docs/webapi/clearField.mustache +1 -0
  40. package/docs/webapi/click.mustache +2 -1
  41. package/docs/webapi/clickLink.mustache +2 -1
  42. package/docs/webapi/closeCurrentTab.mustache +6 -4
  43. package/docs/webapi/closeOtherTabs.mustache +6 -4
  44. package/docs/webapi/dontSee.mustache +1 -0
  45. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -0
  46. package/docs/webapi/dontSeeCookie.mustache +2 -1
  47. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +2 -1
  48. package/docs/webapi/dontSeeElement.mustache +2 -1
  49. package/docs/webapi/dontSeeElementInDOM.mustache +2 -1
  50. package/docs/webapi/dontSeeInCurrentUrl.mustache +2 -1
  51. package/docs/webapi/dontSeeInField.mustache +2 -1
  52. package/docs/webapi/dontSeeInSource.mustache +1 -0
  53. package/docs/webapi/dontSeeInTitle.mustache +2 -1
  54. package/docs/webapi/doubleClick.mustache +1 -0
  55. package/docs/webapi/downloadFile.mustache +2 -1
  56. package/docs/webapi/dragAndDrop.mustache +1 -0
  57. package/docs/webapi/dragSlider.mustache +2 -1
  58. package/docs/webapi/executeAsyncScript.mustache +1 -1
  59. package/docs/webapi/executeScript.mustache +1 -1
  60. package/docs/webapi/fillField.mustache +1 -0
  61. package/docs/webapi/forceClick.mustache +1 -0
  62. package/docs/webapi/forceRightClick.mustache +1 -0
  63. package/docs/webapi/grabDataFromPerformanceTiming.mustache +2 -1
  64. package/docs/webapi/moveCursorTo.mustache +1 -0
  65. package/docs/webapi/openNewTab.mustache +6 -4
  66. package/docs/webapi/pressKey.mustache +2 -1
  67. package/docs/webapi/pressKeyDown.mustache +1 -0
  68. package/docs/webapi/pressKeyUp.mustache +1 -0
  69. package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -0
  70. package/docs/webapi/refreshPage.mustache +1 -0
  71. package/docs/webapi/resizeWindow.mustache +2 -1
  72. package/docs/webapi/rightClick.mustache +1 -0
  73. package/docs/webapi/saveElementScreenshot.mustache +1 -0
  74. package/docs/webapi/saveScreenshot.mustache +2 -1
  75. package/docs/webapi/say.mustache +2 -1
  76. package/docs/webapi/scrollIntoView.mustache +1 -0
  77. package/docs/webapi/scrollPageToBottom.mustache +1 -0
  78. package/docs/webapi/scrollPageToTop.mustache +1 -0
  79. package/docs/webapi/scrollTo.mustache +2 -1
  80. package/docs/webapi/see.mustache +2 -1
  81. package/docs/webapi/seeAttributesOnElements.mustache +2 -1
  82. package/docs/webapi/seeCheckboxIsChecked.mustache +1 -0
  83. package/docs/webapi/seeCookie.mustache +1 -0
  84. package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -1
  85. package/docs/webapi/seeCurrentUrlEquals.mustache +2 -1
  86. package/docs/webapi/seeElement.mustache +2 -1
  87. package/docs/webapi/seeElementInDOM.mustache +1 -0
  88. package/docs/webapi/seeInCurrentUrl.mustache +2 -1
  89. package/docs/webapi/seeInField.mustache +1 -0
  90. package/docs/webapi/seeInPopup.mustache +1 -0
  91. package/docs/webapi/seeInSource.mustache +2 -1
  92. package/docs/webapi/seeInTitle.mustache +2 -1
  93. package/docs/webapi/seeNumberOfElements.mustache +1 -0
  94. package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -0
  95. package/docs/webapi/seeTextEquals.mustache +2 -1
  96. package/docs/webapi/seeTitleEquals.mustache +6 -5
  97. package/docs/webapi/selectOption.mustache +1 -0
  98. package/docs/webapi/setCookie.mustache +1 -0
  99. package/docs/webapi/setGeoLocation.mustache +1 -0
  100. package/docs/webapi/switchTo.mustache +2 -1
  101. package/docs/webapi/switchToNextTab.mustache +8 -7
  102. package/docs/webapi/switchToPreviousTab.mustache +8 -7
  103. package/docs/webapi/type.mustache +1 -0
  104. package/docs/webapi/uncheckOption.mustache +2 -1
  105. package/docs/webapi/wait.mustache +2 -1
  106. package/docs/webapi/waitForClickable.mustache +2 -1
  107. package/docs/webapi/waitForDetached.mustache +2 -1
  108. package/docs/webapi/waitForElement.mustache +2 -1
  109. package/docs/webapi/waitForEnabled.mustache +2 -1
  110. package/docs/webapi/waitForFunction.mustache +1 -0
  111. package/docs/webapi/waitForInvisible.mustache +2 -1
  112. package/docs/webapi/waitForText.mustache +2 -1
  113. package/docs/webapi/waitForValue.mustache +1 -0
  114. package/docs/webapi/waitForVisible.mustache +1 -0
  115. package/docs/webapi/waitInUrl.mustache +2 -1
  116. package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -1
  117. package/docs/webapi/waitToHide.mustache +2 -1
  118. package/docs/webapi/waitUrlEquals.mustache +2 -1
  119. package/lib/cli.js +1 -1
  120. package/lib/command/definitions.js +9 -0
  121. package/lib/command/run-workers.js +1 -1
  122. package/lib/command/run.js +2 -2
  123. package/lib/command/workers/runTests.js +55 -0
  124. package/lib/helper/ApiDataFactory.js +4 -3
  125. package/lib/helper/Appium.js +2 -7
  126. package/lib/helper/GraphQL.js +4 -2
  127. package/lib/helper/GraphQLDataFactory.js +3 -3
  128. package/lib/helper/JSONResponse.js +1 -1
  129. package/lib/helper/Playwright.js +28 -17
  130. package/lib/helper/REST.js +5 -2
  131. package/lib/helper/WebDriver.js +4 -0
  132. package/lib/interfaces/bdd.js +5 -0
  133. package/lib/listener/steps.js +1 -0
  134. package/lib/output.js +4 -0
  135. package/lib/plugin/fakerTransform.js +1 -1
  136. package/lib/plugin/stepByStepReport.js +8 -6
  137. package/lib/workers.js +12 -0
  138. package/package.json +3 -3
  139. package/typings/types.d.ts +534 -112
@@ -334,6 +334,7 @@ class TestCafe extends Helper {
334
334
  * ```
335
335
  *
336
336
  * @param {string} url url path or global url.
337
+ * @return {void} automatically synchronized promise with recorder #!
337
338
  */
338
339
  async amOnPage(url) {
339
340
  if (!(/^\w+\:\/\//.test(url))) {
@@ -350,6 +351,7 @@ class TestCafe extends Helper {
350
351
  *
351
352
  * @param {number} width width in pixels or `maximize`.
352
353
  * @param {number} height height in pixels.
354
+ * [!] returns a _promise_ which is synchronized internally by recorder
353
355
  */
354
356
  async resizeWindow(width, height) {
355
357
  if (width === 'maximize') {
@@ -383,7 +385,8 @@ class TestCafe extends Helper {
383
385
  * ```
384
386
  *
385
387
  * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
386
- * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
388
+ * @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
389
+ * [!] returns a _promise_ which is synchronized internally by recorder
387
390
  *
388
391
  *
389
392
  */
@@ -397,7 +400,7 @@ class TestCafe extends Helper {
397
400
  * ```js
398
401
  * I.refreshPage();
399
402
  * ```
400
- *
403
+ * [!] returns a _promise_ which is synchronized internally by recorder
401
404
  */
402
405
  async refreshPage() {
403
406
  // eslint-disable-next-line no-restricted-globals
@@ -414,7 +417,7 @@ class TestCafe extends Helper {
414
417
  *
415
418
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
416
419
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
417
- *
420
+ * [!] returns a _promise_ which is synchronized internally by recorder
418
421
  *
419
422
  */
420
423
  async waitForVisible(locator, sec) {
@@ -441,7 +444,7 @@ class TestCafe extends Helper {
441
444
  * ```
442
445
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
443
446
  * @param {CodeceptJS.StringOrSecret} value text value to fill.
444
- *
447
+ * [!] returns a _promise_ which is synchronized internally by recorder
445
448
  */
446
449
  async fillField(field, value) {
447
450
  const els = await findFields.call(this, field);
@@ -461,7 +464,7 @@ class TestCafe extends Helper {
461
464
  * I.clearField('#email');
462
465
  * ```
463
466
  * @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
464
- *
467
+ * [!] returns a _promise_ which is synchronized internally by recorder
465
468
  */
466
469
  async clearField(field) {
467
470
  const els = await findFields.call(this, field);
@@ -483,6 +486,7 @@ class TestCafe extends Helper {
483
486
  * ```
484
487
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
485
488
  * @param {string} value text value to append.
489
+ * [!] returns a _promise_ which is synchronized internally by recorder
486
490
  *
487
491
  */
488
492
  async appendField(field, value) {
@@ -507,6 +511,7 @@ class TestCafe extends Helper {
507
511
  *
508
512
  * @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
509
513
  * @param {string} pathToFile local file path relative to codecept.json config file.
514
+ * [!] returns a _promise_ which is synchronized internally by recorder
510
515
  *
511
516
  */
512
517
  async attachFile(field, pathToFile) {
@@ -532,6 +537,7 @@ class TestCafe extends Helper {
532
537
  * ```
533
538
  *
534
539
  * @param {string|string[]} key key or array of keys to press.
540
+ * [!] returns a _promise_ which is synchronized internally by recorder
535
541
  *
536
542
  * {{ keys }}
537
543
  */
@@ -555,7 +561,7 @@ class TestCafe extends Helper {
555
561
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
556
562
  * @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
557
563
  * @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
558
- *
564
+ * [!] returns a _promise_ which is synchronized internally by recorder
559
565
  *
560
566
  */
561
567
  async moveCursorTo(locator, offsetX = 0, offsetY = 0) {
@@ -580,7 +586,7 @@ class TestCafe extends Helper {
580
586
  *
581
587
  * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
582
588
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
583
- *
589
+ * [!] returns a _promise_ which is synchronized internally by recorder
584
590
  *
585
591
  */
586
592
  async doubleClick(locator, context = null) {
@@ -611,7 +617,7 @@ class TestCafe extends Helper {
611
617
  *
612
618
  * @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
613
619
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
614
- *
620
+ * [!] returns a _promise_ which is synchronized internally by recorder
615
621
  *
616
622
  */
617
623
  async rightClick(locator, context = null) {
@@ -641,6 +647,7 @@ class TestCafe extends Helper {
641
647
  * ```
642
648
  * @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
643
649
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
650
+ * [!] returns a _promise_ which is synchronized internally by recorder
644
651
  */
645
652
  async checkOption(field, context = null) {
646
653
  const el = await findCheckable.call(this, field, context);
@@ -663,6 +670,7 @@ class TestCafe extends Helper {
663
670
  * ```
664
671
  * @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
665
672
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
673
+ * [!] returns a _promise_ which is synchronized internally by recorder
666
674
  */
667
675
  async uncheckOption(field, context = null) {
668
676
  const el = await findCheckable.call(this, field, context);
@@ -684,7 +692,7 @@ class TestCafe extends Helper {
684
692
  * ```
685
693
  *
686
694
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
687
- *
695
+ * [!] returns a _promise_ which is synchronized internally by recorder
688
696
  */
689
697
  async seeCheckboxIsChecked(field) {
690
698
  return proceedIsChecked.call(this, 'assert', field);
@@ -700,7 +708,7 @@ class TestCafe extends Helper {
700
708
  * ```
701
709
  *
702
710
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
703
- *
711
+ * [!] returns a _promise_ which is synchronized internally by recorder
704
712
  */
705
713
  async dontSeeCheckboxIsChecked(field) {
706
714
  return proceedIsChecked.call(this, 'negate', field);
@@ -727,7 +735,7 @@ class TestCafe extends Helper {
727
735
  * ```
728
736
  * @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
729
737
  * @param {string|Array<*>} option visible text or value of option.
730
- *
738
+ * [!] returns a _promise_ which is synchronized internally by recorder
731
739
  */
732
740
  async selectOption(select, option) {
733
741
  const els = await findFields.call(this, select);
@@ -779,6 +787,7 @@ class TestCafe extends Helper {
779
787
  * ```
780
788
  *
781
789
  * @param {string} url a fragment to check
790
+ * [!] returns a _promise_ which is synchronized internally by recorder
782
791
  */
783
792
  async seeInCurrentUrl(url) {
784
793
  stringIncludes('url').assert(url, await getPageUrl(this.t)().catch(mapError));
@@ -788,6 +797,7 @@ class TestCafe extends Helper {
788
797
  * Checks that current url does not contain a provided fragment.
789
798
  *
790
799
  * @param {string} url value to check.
800
+ * [!] returns a _promise_ which is synchronized internally by recorder
791
801
  */
792
802
  async dontSeeInCurrentUrl(url) {
793
803
  stringIncludes('url').negate(url, await getPageUrl(this.t)().catch(mapError));
@@ -804,6 +814,7 @@ class TestCafe extends Helper {
804
814
  * ```
805
815
  *
806
816
  * @param {string} url value to check.
817
+ * [!] returns a _promise_ which is synchronized internally by recorder
807
818
  */
808
819
  async seeCurrentUrlEquals(url) {
809
820
  urlEquals(this.options.url).assert(url, await getPageUrl(this.t)().catch(mapError));
@@ -819,6 +830,7 @@ class TestCafe extends Helper {
819
830
  * ```
820
831
  *
821
832
  * @param {string} url value to check.
833
+ * [!] returns a _promise_ which is synchronized internally by recorder
822
834
  */
823
835
  async dontSeeCurrentUrlEquals(url) {
824
836
  urlEquals(this.options.url).negate(url, await getPageUrl(this.t)().catch(mapError));
@@ -835,6 +847,7 @@ class TestCafe extends Helper {
835
847
  * ```
836
848
  * @param {string} text expected on page.
837
849
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
850
+ * [!] returns a _promise_ which is synchronized internally by recorder
838
851
  *
839
852
  */
840
853
  async see(text, context = null) {
@@ -861,7 +874,7 @@ class TestCafe extends Helper {
861
874
  *
862
875
  * @param {string} text which is not present.
863
876
  * @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
864
- *
877
+ * [!] returns a _promise_ which is synchronized internally by recorder
865
878
  *
866
879
  */
867
880
  async dontSee(text, context = null) {
@@ -885,6 +898,7 @@ class TestCafe extends Helper {
885
898
  * I.seeElement('#modal');
886
899
  * ```
887
900
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
901
+ * [!] returns a _promise_ which is synchronized internally by recorder
888
902
  */
889
903
  async seeElement(locator) {
890
904
  const exists = (await findElements.call(this, this.context, locator)).filterVisible().exists;
@@ -901,6 +915,7 @@ class TestCafe extends Helper {
901
915
  * ```
902
916
  *
903
917
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
918
+ * [!] returns a _promise_ which is synchronized internally by recorder
904
919
  */
905
920
  async dontSeeElement(locator) {
906
921
  const exists = (await findElements.call(this, this.context, locator)).filterVisible().exists;
@@ -917,7 +932,7 @@ class TestCafe extends Helper {
917
932
  * I.seeElementInDOM('#modal');
918
933
  * ```
919
934
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
920
- *
935
+ * [!] returns a _promise_ which is synchronized internally by recorder
921
936
  */
922
937
  async seeElementInDOM(locator) {
923
938
  const exists = (await findElements.call(this, this.context, locator)).exists;
@@ -934,6 +949,7 @@ class TestCafe extends Helper {
934
949
  * ```
935
950
  *
936
951
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
952
+ * [!] returns a _promise_ which is synchronized internally by recorder
937
953
  */
938
954
  async dontSeeElementInDOM(locator) {
939
955
  const exists = (await findElements.call(this, this.context, locator)).exists;
@@ -952,7 +968,7 @@ class TestCafe extends Helper {
952
968
  *
953
969
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
954
970
  * @param {number} num number of elements.
955
- *
971
+ * [!] returns a _promise_ which is synchronized internally by recorder
956
972
  *
957
973
  */
958
974
  async seeNumberOfVisibleElements(locator, num) {
@@ -990,7 +1006,7 @@ class TestCafe extends Helper {
990
1006
  * ```
991
1007
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
992
1008
  * @param {string} value value to check.
993
- *
1009
+ * [!] returns a _promise_ which is synchronized internally by recorder
994
1010
  */
995
1011
  async seeInField(field, value) {
996
1012
  // const expectedValue = findElements.call(this, this.context, field).value;
@@ -1014,6 +1030,7 @@ class TestCafe extends Helper {
1014
1030
  *
1015
1031
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1016
1032
  * @param {string} value value to check.
1033
+ * [!] returns a _promise_ which is synchronized internally by recorder
1017
1034
  */
1018
1035
  async dontSeeInField(field, value) {
1019
1036
  // const expectedValue = findElements.call(this, this.context, field).value;
@@ -1047,6 +1064,7 @@ class TestCafe extends Helper {
1047
1064
  * I.seeInSource('<h1>Green eggs &amp; ham</h1>');
1048
1065
  * ```
1049
1066
  * @param {string} text value to check.
1067
+ * [!] returns a _promise_ which is synchronized internally by recorder
1050
1068
  */
1051
1069
  async seeInSource(text) {
1052
1070
  const source = await getHtmlSource(this.t)();
@@ -1061,7 +1079,7 @@ class TestCafe extends Helper {
1061
1079
  * ```
1062
1080
  *
1063
1081
  * @param {string} value to check.
1064
- *
1082
+ * [!] returns a _promise_ which is synchronized internally by recorder
1065
1083
  */
1066
1084
  async dontSeeInSource(text) {
1067
1085
  const source = await getHtmlSource(this.t)();
@@ -1078,7 +1096,7 @@ class TestCafe extends Helper {
1078
1096
  *
1079
1097
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1080
1098
  * @param {string} fileName file name to save.
1081
- *
1099
+ * [!] returns a _promise_ which is synchronized internally by recorder
1082
1100
  *
1083
1101
  */
1084
1102
  async saveElementScreenshot(locator, fileName) {
@@ -1104,6 +1122,7 @@ class TestCafe extends Helper {
1104
1122
  *
1105
1123
  * @param {string} fileName file name to save.
1106
1124
  * @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
1125
+ * [!] returns a _promise_ which is synchronized internally by recorder
1107
1126
  */
1108
1127
  // TODO Implement full page screenshots
1109
1128
  async saveScreenshot(fileName) {
@@ -1122,6 +1141,7 @@ class TestCafe extends Helper {
1122
1141
  * ```
1123
1142
  *
1124
1143
  * @param {number} sec number of second to wait.
1144
+ * [!] returns a _promise_ which is synchronized internally by recorder
1125
1145
  */
1126
1146
  async wait(sec) {
1127
1147
  return new Promise(((done) => {
@@ -1155,7 +1175,7 @@ class TestCafe extends Helper {
1155
1175
  *
1156
1176
  * @param {string|function} fn function to be executed in browser context.
1157
1177
  * @param {...any} args to be passed to function.
1158
- * @return {Promise<any>}
1178
+ * [!] returns a _promise_ which is synchronized internally by recorder
1159
1179
  *
1160
1180
  *
1161
1181
  * If a function returns a Promise It will wait for it resolution.
@@ -1368,7 +1388,7 @@ class TestCafe extends Helper {
1368
1388
  * ```js
1369
1389
  * I.scrollPageToTop();
1370
1390
  * ```
1371
- *
1391
+ * [!] returns a _promise_ which is synchronized internally by recorder
1372
1392
  */
1373
1393
  scrollPageToTop() {
1374
1394
  return ClientFunction(() => window.scrollTo(0, 0)).with({ boundTestRun: this.t })().catch(mapError);
@@ -1380,7 +1400,7 @@ class TestCafe extends Helper {
1380
1400
  * ```js
1381
1401
  * I.scrollPageToBottom();
1382
1402
  * ```
1383
- *
1403
+ * [!] returns a _promise_ which is synchronized internally by recorder
1384
1404
  */
1385
1405
  scrollPageToBottom() {
1386
1406
  return ClientFunction(() => {
@@ -1405,6 +1425,7 @@ class TestCafe extends Helper {
1405
1425
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
1406
1426
  * @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
1407
1427
  * @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
1428
+ * [!] returns a _promise_ which is synchronized internally by recorder
1408
1429
  */
1409
1430
  async scrollTo(locator, offsetX = 0, offsetY = 0) {
1410
1431
  if (typeof locator === 'number' && typeof offsetX === 'number') {
@@ -1443,6 +1464,7 @@ class TestCafe extends Helper {
1443
1464
  * ```
1444
1465
  *
1445
1466
  * @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
1467
+ * [!] returns a _promise_ which is synchronized internally by recorder
1446
1468
  */
1447
1469
  async switchTo(locator) {
1448
1470
  if (Number.isInteger(locator)) {
@@ -1475,7 +1497,7 @@ class TestCafe extends Helper {
1475
1497
  * ```
1476
1498
  *
1477
1499
  * @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
1478
- *
1500
+ * [!] returns a _promise_ which is synchronized internally by recorder
1479
1501
  */
1480
1502
  async setCookie(cookie) {
1481
1503
  if (Array.isArray(cookie)) {
@@ -1500,7 +1522,7 @@ class TestCafe extends Helper {
1500
1522
  * ```
1501
1523
  *
1502
1524
  * @param {string} name cookie name.
1503
- *
1525
+ * [!] returns a _promise_ which is synchronized internally by recorder
1504
1526
  *
1505
1527
  */
1506
1528
  async seeCookie(name) {
@@ -1516,6 +1538,7 @@ class TestCafe extends Helper {
1516
1538
  * ```
1517
1539
  *
1518
1540
  * @param {string} name cookie name.
1541
+ * [!] returns a _promise_ which is synchronized internally by recorder
1519
1542
  */
1520
1543
  async dontSeeCookie(name) {
1521
1544
  const cookie = await this.grabCookie(name);
@@ -1565,6 +1588,7 @@ class TestCafe extends Helper {
1565
1588
  * ```
1566
1589
  *
1567
1590
  * @param {?string} [cookie=null] (optional, `null` by default) cookie name
1591
+ * [!] returns a _promise_ which is synchronized internally by recorder
1568
1592
  */
1569
1593
  async clearCookie(cookieName) {
1570
1594
  const clearCookies = ClientFunction(() => {
@@ -1592,6 +1616,7 @@ class TestCafe extends Helper {
1592
1616
  *
1593
1617
  * @param {string} urlPart value to check.
1594
1618
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1619
+ * [!] returns a _promise_ which is synchronized internally by recorder
1595
1620
  */
1596
1621
  async waitInUrl(urlPart, sec = null) {
1597
1622
  const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -1617,6 +1642,7 @@ class TestCafe extends Helper {
1617
1642
  *
1618
1643
  * @param {string} urlPart value to check.
1619
1644
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1645
+ * [!] returns a _promise_ which is synchronized internally by recorder
1620
1646
  */
1621
1647
  async waitUrlEquals(urlPart, sec = null) {
1622
1648
  const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -1654,7 +1680,7 @@ class TestCafe extends Helper {
1654
1680
  * @param {string|function} fn to be executed in browser context.
1655
1681
  * @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
1656
1682
  * @param {number} [sec] (optional, `1` by default) time in seconds to wait
1657
- *
1683
+ * [!] returns a _promise_ which is synchronized internally by recorder
1658
1684
  */
1659
1685
  async waitForFunction(fn, argsOrSec = null, sec = null) {
1660
1686
  let args = [];
@@ -1682,6 +1708,7 @@ class TestCafe extends Helper {
1682
1708
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1683
1709
  * @param {number} num number of elements.
1684
1710
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1711
+ * [!] returns a _promise_ which is synchronized internally by recorder
1685
1712
  */
1686
1713
  async waitNumberOfVisibleElements(locator, num, sec) {
1687
1714
  const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -1703,6 +1730,7 @@ class TestCafe extends Helper {
1703
1730
  *
1704
1731
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1705
1732
  * @param {number} [sec] (optional, `1` by default) time in seconds to wait
1733
+ * [!] returns a _promise_ which is synchronized internally by recorder
1706
1734
  */
1707
1735
  async waitForElement(locator, sec) {
1708
1736
  const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -1722,6 +1750,7 @@ class TestCafe extends Helper {
1722
1750
  *
1723
1751
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1724
1752
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1753
+ * [!] returns a _promise_ which is synchronized internally by recorder
1725
1754
  */
1726
1755
  async waitToHide(locator, sec) {
1727
1756
  const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -1741,6 +1770,7 @@ class TestCafe extends Helper {
1741
1770
  *
1742
1771
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1743
1772
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1773
+ * [!] returns a _promise_ which is synchronized internally by recorder
1744
1774
  */
1745
1775
  async waitForInvisible(locator, sec) {
1746
1776
  const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -1763,6 +1793,7 @@ class TestCafe extends Helper {
1763
1793
  * @param {string }text to wait for.
1764
1794
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
1765
1795
  * @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
1796
+ * [!] returns a _promise_ which is synchronized internally by recorder
1766
1797
  *
1767
1798
  */
1768
1799
  async waitForText(text, sec = null, context = null) {