codeceptjs 3.5.6 → 3.5.7

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/README.md +5 -1
  2. package/docs/advanced.md +1 -1
  3. package/docs/bdd.md +11 -7
  4. package/docs/build/ApiDataFactory.js +2 -1
  5. package/docs/build/Appium.js +26 -23
  6. package/docs/build/Expect.js +422 -0
  7. package/docs/build/Nightmare.js +53 -56
  8. package/docs/build/Playwright.js +202 -103
  9. package/docs/build/Protractor.js +66 -69
  10. package/docs/build/Puppeteer.js +124 -81
  11. package/docs/build/TestCafe.js +56 -55
  12. package/docs/build/WebDriver.js +81 -82
  13. package/docs/changelog.md +562 -1
  14. package/docs/commands.md +12 -0
  15. package/docs/community-helpers.md +8 -4
  16. package/docs/examples.md +8 -2
  17. package/docs/helpers/Appium.md +50 -32
  18. package/docs/helpers/Expect.md +275 -0
  19. package/docs/helpers/Nightmare.md +141 -94
  20. package/docs/helpers/Playwright.md +360 -261
  21. package/docs/helpers/Protractor.md +229 -169
  22. package/docs/helpers/Puppeteer.md +270 -187
  23. package/docs/helpers/TestCafe.md +201 -149
  24. package/docs/helpers/WebDriver.md +252 -178
  25. package/docs/mobile.md +17 -21
  26. package/docs/plugins.md +35 -1
  27. package/docs/webapi/amOnPage.mustache +1 -1
  28. package/docs/webapi/appendField.mustache +1 -1
  29. package/docs/webapi/attachFile.mustache +1 -1
  30. package/docs/webapi/blur.mustache +1 -0
  31. package/docs/webapi/checkOption.mustache +1 -1
  32. package/docs/webapi/clearCookie.mustache +1 -1
  33. package/docs/webapi/clearField.mustache +1 -1
  34. package/docs/webapi/click.mustache +1 -1
  35. package/docs/webapi/clickLink.mustache +1 -1
  36. package/docs/webapi/closeCurrentTab.mustache +1 -1
  37. package/docs/webapi/closeOtherTabs.mustache +1 -1
  38. package/docs/webapi/dontSee.mustache +1 -1
  39. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
  40. package/docs/webapi/dontSeeCookie.mustache +1 -1
  41. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
  42. package/docs/webapi/dontSeeElement.mustache +1 -1
  43. package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
  44. package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
  45. package/docs/webapi/dontSeeInField.mustache +1 -1
  46. package/docs/webapi/dontSeeInSource.mustache +1 -1
  47. package/docs/webapi/dontSeeInTitle.mustache +1 -1
  48. package/docs/webapi/doubleClick.mustache +1 -1
  49. package/docs/webapi/downloadFile.mustache +1 -1
  50. package/docs/webapi/dragAndDrop.mustache +1 -1
  51. package/docs/webapi/dragSlider.mustache +1 -1
  52. package/docs/webapi/executeAsyncScript.mustache +0 -2
  53. package/docs/webapi/executeScript.mustache +0 -2
  54. package/docs/webapi/fillField.mustache +1 -1
  55. package/docs/webapi/focus.mustache +1 -0
  56. package/docs/webapi/forceClick.mustache +1 -1
  57. package/docs/webapi/forceRightClick.mustache +1 -1
  58. package/docs/webapi/grabCookie.mustache +1 -1
  59. package/docs/webapi/grabDataFromPerformanceTiming.mustache +1 -1
  60. package/docs/webapi/moveCursorTo.mustache +1 -1
  61. package/docs/webapi/openNewTab.mustache +1 -1
  62. package/docs/webapi/pressKey.mustache +1 -1
  63. package/docs/webapi/pressKeyDown.mustache +1 -1
  64. package/docs/webapi/pressKeyUp.mustache +1 -1
  65. package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
  66. package/docs/webapi/refreshPage.mustache +1 -1
  67. package/docs/webapi/resizeWindow.mustache +1 -1
  68. package/docs/webapi/rightClick.mustache +1 -1
  69. package/docs/webapi/saveElementScreenshot.mustache +1 -1
  70. package/docs/webapi/saveScreenshot.mustache +1 -1
  71. package/docs/webapi/say.mustache +1 -1
  72. package/docs/webapi/scrollIntoView.mustache +1 -1
  73. package/docs/webapi/scrollPageToBottom.mustache +1 -1
  74. package/docs/webapi/scrollPageToTop.mustache +1 -1
  75. package/docs/webapi/scrollTo.mustache +1 -1
  76. package/docs/webapi/see.mustache +1 -1
  77. package/docs/webapi/seeAttributesOnElements.mustache +1 -1
  78. package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
  79. package/docs/webapi/seeCookie.mustache +1 -1
  80. package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
  81. package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
  82. package/docs/webapi/seeElement.mustache +1 -1
  83. package/docs/webapi/seeElementInDOM.mustache +1 -1
  84. package/docs/webapi/seeInCurrentUrl.mustache +1 -1
  85. package/docs/webapi/seeInField.mustache +1 -1
  86. package/docs/webapi/seeInPopup.mustache +1 -1
  87. package/docs/webapi/seeInSource.mustache +1 -1
  88. package/docs/webapi/seeInTitle.mustache +1 -1
  89. package/docs/webapi/seeNumberOfElements.mustache +1 -1
  90. package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
  91. package/docs/webapi/seeTextEquals.mustache +1 -1
  92. package/docs/webapi/seeTitleEquals.mustache +1 -1
  93. package/docs/webapi/selectOption.mustache +1 -1
  94. package/docs/webapi/setCookie.mustache +1 -1
  95. package/docs/webapi/setGeoLocation.mustache +1 -1
  96. package/docs/webapi/switchTo.mustache +1 -1
  97. package/docs/webapi/switchToNextTab.mustache +1 -1
  98. package/docs/webapi/switchToPreviousTab.mustache +1 -1
  99. package/docs/webapi/type.mustache +1 -1
  100. package/docs/webapi/uncheckOption.mustache +1 -1
  101. package/docs/webapi/wait.mustache +1 -1
  102. package/docs/webapi/waitForClickable.mustache +1 -1
  103. package/docs/webapi/waitForDetached.mustache +1 -1
  104. package/docs/webapi/waitForElement.mustache +1 -1
  105. package/docs/webapi/waitForEnabled.mustache +1 -1
  106. package/docs/webapi/waitForFunction.mustache +1 -1
  107. package/docs/webapi/waitForInvisible.mustache +1 -1
  108. package/docs/webapi/waitForText.mustache +1 -1
  109. package/docs/webapi/waitForValue.mustache +1 -1
  110. package/docs/webapi/waitForVisible.mustache +1 -1
  111. package/docs/webapi/waitInUrl.mustache +1 -1
  112. package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
  113. package/docs/webapi/waitToHide.mustache +1 -1
  114. package/docs/webapi/waitUrlEquals.mustache +1 -1
  115. package/docs/webdriver.md +1 -1
  116. package/lib/cli.js +3 -1
  117. package/lib/command/dryRun.js +2 -1
  118. package/lib/helper/ApiDataFactory.js +2 -1
  119. package/lib/helper/Appium.js +8 -5
  120. package/lib/helper/Expect.js +422 -0
  121. package/lib/helper/Playwright.js +127 -32
  122. package/lib/helper/Puppeteer.js +47 -4
  123. package/lib/interfaces/gherkin.js +21 -2
  124. package/lib/output.js +1 -1
  125. package/lib/plugin/autoLogin.js +41 -3
  126. package/lib/utils.js +1 -1
  127. package/lib/workers.js +23 -2
  128. package/package.json +25 -16
  129. package/translations/de-DE.js +5 -0
  130. package/translations/fr-FR.js +1 -0
  131. package/translations/it-IT.js +1 -0
  132. package/translations/ja-JP.js +5 -0
  133. package/translations/pl-PL.js +5 -0
  134. package/translations/pt-BR.js +1 -0
  135. package/translations/ru-RU.js +1 -0
  136. package/translations/zh-CN.js +5 -0
  137. package/translations/zh-TW.js +5 -0
  138. package/typings/promiseBasedTypes.d.ts +928 -862
  139. package/typings/types.d.ts +932 -845
@@ -4,6 +4,7 @@ const fsExtra = require('fs-extra');
4
4
  const path = require('path');
5
5
 
6
6
  const Helper = require('@codeceptjs/helper');
7
+ const { v4: uuidv4 } = require('uuid');
7
8
  const Locator = require('../locator');
8
9
  const recorder = require('../recorder');
9
10
  const store = require('../store');
@@ -19,6 +20,7 @@ const {
19
20
  fileExists,
20
21
  chunkArray,
21
22
  toCamelCase,
23
+ clearString,
22
24
  convertCssPropertiesToCamelCase,
23
25
  screenshotOutputFolder,
24
26
  getNormalizedKeyAttributeValue,
@@ -57,6 +59,8 @@ const consoleLogStore = new Console();
57
59
  * @prop {boolean} [disableScreenshots=false] - don't save screenshot on failure.
58
60
  * @prop {boolean} [fullPageScreenshots=false] - make full page screenshots on failure.
59
61
  * @prop {boolean} [uniqueScreenshotNames=false] - option to prevent screenshot override if you have scenarios with the same name in different suites.
62
+ * @prop {boolean} [trace=false] - record [tracing information](https://pptr.dev/api/puppeteer.tracing) with screenshots.
63
+ * @prop {boolean} [keepTraceForPassedTests=false] - save trace for passed tests.
60
64
  * @prop {boolean} [keepBrowserState=false] - keep browser state between tests when `restart` is set to false.
61
65
  * @prop {boolean} [keepCookies=false] - keep cookies between tests when `restart` is set to false.
62
66
  * @prop {number} [waitForAction=100] - how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
@@ -92,6 +96,14 @@ const config = {};
92
96
  *
93
97
  * <!-- configuration -->
94
98
  *
99
+ * #### Trace Recording Customization
100
+ *
101
+ * Trace recording provides complete information on test execution and includes screenshots, and network requests logged during run.
102
+ * Traces will be saved to `output/trace`
103
+ *
104
+ * * `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder
105
+ * * `keepTraceForPassedTests`: - save trace for passed tests
106
+ *
95
107
  * #### Example #1: Wait for 0 network connections.
96
108
  *
97
109
  * ```js
@@ -281,8 +293,9 @@ class Puppeteer extends Helper {
281
293
  }
282
294
  }
283
295
 
284
- async _before() {
296
+ async _before(test) {
285
297
  this.sessionPages = {};
298
+ this.currentRunningTest = test;
286
299
  recorder.retry({
287
300
  retries: 3,
288
301
  when: err => {
@@ -455,7 +468,7 @@ class Puppeteer extends Helper {
455
468
  * I.seeInPopup('Popup text');
456
469
  * ```
457
470
  * @param {string} text value to check.
458
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
471
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
459
472
  *
460
473
  */
461
474
  async seeInPopup(text) {
@@ -651,7 +664,8 @@ class Puppeteer extends Helper {
651
664
  * ```
652
665
  *
653
666
  * @param {string} url url path or global url.
654
- * @return {void} automatically synchronized promise with recorder #!
667
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
668
+ *
655
669
  */
656
670
  async amOnPage(url) {
657
671
  if (!(/^\w+\:\/\//.test(url))) {
@@ -665,6 +679,14 @@ class Puppeteer extends Helper {
665
679
  }
666
680
  }
667
681
 
682
+ if (this.options.trace) {
683
+ const fileName = `${`${global.output_dir}${path.sep}trace${path.sep}${uuidv4()}_${clearString(this.currentRunningTest.title)}`.slice(0, 245)}.json`;
684
+ const dir = path.dirname(fileName);
685
+ if (!fileExists(dir)) fs.mkdirSync(dir);
686
+ await this.page.tracing.start({ screenshots: true, path: fileName });
687
+ this.currentRunningTest.artifacts.trace = fileName;
688
+ }
689
+
668
690
  await this.page.goto(url, { waitUntil: this.options.waitForNavigation });
669
691
 
670
692
  const performanceTiming = JSON.parse(await this.page.evaluate(() => JSON.stringify(window.performance.timing)));
@@ -686,7 +708,7 @@ class Puppeteer extends Helper {
686
708
  *
687
709
  * @param {number} width width in pixels or `maximize`.
688
710
  * @param {number} height height in pixels.
689
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
711
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
690
712
  *
691
713
  *
692
714
  * Unlike other drivers Puppeteer changes the size of a viewport, not the window!
@@ -706,14 +728,14 @@ class Puppeteer extends Helper {
706
728
  * Set headers for all next requests
707
729
  *
708
730
  * ```js
709
- * I.haveRequestHeaders({
731
+ * I.setPuppeteerRequestHeaders({
710
732
  * 'X-Sent-By': 'CodeceptJS',
711
733
  * });
712
734
  * ```
713
735
  *
714
736
  * @param {object} customHeaders headers to set
715
737
  */
716
- async haveRequestHeaders(customHeaders) {
738
+ async setPuppeteerRequestHeaders(customHeaders) {
717
739
  if (!customHeaders) {
718
740
  throw new Error('Cannot send empty headers.');
719
741
  }
@@ -732,7 +754,7 @@ class Puppeteer extends Helper {
732
754
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
733
755
  * @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
734
756
  * @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
735
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
757
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
736
758
  *
737
759
  * {{ react }}
738
760
  */
@@ -759,6 +781,7 @@ class Puppeteer extends Helper {
759
781
  *
760
782
  * @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
761
783
  * @param {any} [options] Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
784
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
762
785
  *
763
786
  *
764
787
  */
@@ -789,6 +812,7 @@ class Puppeteer extends Helper {
789
812
  *
790
813
  * @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
791
814
  * @param {any} [options] Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
815
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
792
816
  *
793
817
  *
794
818
  */
@@ -809,7 +833,7 @@ class Puppeteer extends Helper {
809
833
  *
810
834
  * @param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
811
835
  * @param {LocatorOrString} destElement located by CSS|XPath|strict locator.
812
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
836
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
813
837
  *
814
838
  */
815
839
  async dragAndDrop(srcElement, destElement) {
@@ -822,7 +846,7 @@ class Puppeteer extends Helper {
822
846
  * ```js
823
847
  * I.refreshPage();
824
848
  * ```
825
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
849
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
826
850
  *
827
851
  */
828
852
  async refreshPage() {
@@ -835,7 +859,7 @@ class Puppeteer extends Helper {
835
859
  * ```js
836
860
  * I.scrollPageToTop();
837
861
  * ```
838
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
862
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
839
863
  *
840
864
  */
841
865
  scrollPageToTop() {
@@ -850,7 +874,7 @@ class Puppeteer extends Helper {
850
874
  * ```js
851
875
  * I.scrollPageToBottom();
852
876
  * ```
853
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
877
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
854
878
  *
855
879
  */
856
880
  scrollPageToBottom() {
@@ -879,7 +903,7 @@ class Puppeteer extends Helper {
879
903
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
880
904
  * @param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
881
905
  * @param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
882
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
906
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
883
907
  *
884
908
  */
885
909
  async scrollTo(locator, offsetX = 0, offsetY = 0) {
@@ -910,7 +934,7 @@ class Puppeteer extends Helper {
910
934
  * ```
911
935
  *
912
936
  * @param {string} text text value to check.
913
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
937
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
914
938
  *
915
939
  */
916
940
  async seeInTitle(text) {
@@ -949,7 +973,7 @@ class Puppeteer extends Helper {
949
973
  * ```
950
974
  *
951
975
  * @param {string} text value to check.
952
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
976
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
953
977
  *
954
978
  */
955
979
  async seeTitleEquals(text) {
@@ -965,7 +989,7 @@ class Puppeteer extends Helper {
965
989
  * ```
966
990
  *
967
991
  * @param {string} text value to check.
968
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
992
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
969
993
  *
970
994
  */
971
995
  async dontSeeInTitle(text) {
@@ -1155,7 +1179,7 @@ class Puppeteer extends Helper {
1155
1179
  * I.seeElement('#modal');
1156
1180
  * ```
1157
1181
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
1158
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1182
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1159
1183
  *
1160
1184
  * {{ react }}
1161
1185
  */
@@ -1176,7 +1200,7 @@ class Puppeteer extends Helper {
1176
1200
  * ```
1177
1201
  *
1178
1202
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
1179
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1203
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1180
1204
  *
1181
1205
  * {{ react }}
1182
1206
  */
@@ -1197,7 +1221,7 @@ class Puppeteer extends Helper {
1197
1221
  * I.seeElementInDOM('#modal');
1198
1222
  * ```
1199
1223
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
1200
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1224
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1201
1225
  *
1202
1226
  */
1203
1227
  async seeElementInDOM(locator) {
@@ -1213,7 +1237,7 @@ class Puppeteer extends Helper {
1213
1237
  * ```
1214
1238
  *
1215
1239
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
1216
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1240
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1217
1241
  *
1218
1242
  */
1219
1243
  async dontSeeElementInDOM(locator) {
@@ -1246,7 +1270,7 @@ class Puppeteer extends Helper {
1246
1270
  *
1247
1271
  * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1248
1272
  * @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1249
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1273
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1250
1274
  *
1251
1275
  *
1252
1276
  * {{ react }}
@@ -1283,7 +1307,7 @@ class Puppeteer extends Helper {
1283
1307
  *
1284
1308
  * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1285
1309
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1286
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1310
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1287
1311
  *
1288
1312
  *
1289
1313
  * {{ react }}
@@ -1321,7 +1345,7 @@ class Puppeteer extends Helper {
1321
1345
  * ```
1322
1346
  * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator
1323
1347
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator
1324
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1348
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1325
1349
  *
1326
1350
  *
1327
1351
  * {{ react }}
@@ -1440,7 +1464,7 @@ class Puppeteer extends Helper {
1440
1464
  *
1441
1465
  * @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1442
1466
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1443
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1467
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1444
1468
  *
1445
1469
  *
1446
1470
  * {{ react }}
@@ -1463,7 +1487,7 @@ class Puppeteer extends Helper {
1463
1487
  *
1464
1488
  * @param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
1465
1489
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
1466
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1490
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1467
1491
  *
1468
1492
  *
1469
1493
  * {{ react }}
@@ -1485,7 +1509,7 @@ class Puppeteer extends Helper {
1485
1509
  * ```
1486
1510
  * @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
1487
1511
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
1488
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1512
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1489
1513
  *
1490
1514
  */
1491
1515
  async checkOption(field, context = null) {
@@ -1512,7 +1536,7 @@ class Puppeteer extends Helper {
1512
1536
  * ```
1513
1537
  * @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
1514
1538
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
1515
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1539
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1516
1540
  *
1517
1541
  */
1518
1542
  async uncheckOption(field, context = null) {
@@ -1536,7 +1560,7 @@ class Puppeteer extends Helper {
1536
1560
  * ```
1537
1561
  *
1538
1562
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1539
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1563
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1540
1564
  *
1541
1565
  */
1542
1566
  async seeCheckboxIsChecked(field) {
@@ -1553,7 +1577,7 @@ class Puppeteer extends Helper {
1553
1577
  * ```
1554
1578
  *
1555
1579
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1556
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1580
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1557
1581
  *
1558
1582
  */
1559
1583
  async dontSeeCheckboxIsChecked(field) {
@@ -1572,7 +1596,7 @@ class Puppeteer extends Helper {
1572
1596
  * ```
1573
1597
  *
1574
1598
  * @param {string} key name of key to press down.
1575
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1599
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1576
1600
  *
1577
1601
  */
1578
1602
  async pressKeyDown(key) {
@@ -1593,7 +1617,7 @@ class Puppeteer extends Helper {
1593
1617
  * ```
1594
1618
  *
1595
1619
  * @param {string} key name of key to release.
1596
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1620
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1597
1621
  *
1598
1622
  */
1599
1623
  async pressKeyUp(key) {
@@ -1662,7 +1686,7 @@ class Puppeteer extends Helper {
1662
1686
  * - `'Tab'`
1663
1687
  *
1664
1688
  * @param {string|string[]} key key or array of keys to press.
1665
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1689
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1666
1690
  *
1667
1691
  *
1668
1692
  * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
@@ -1713,7 +1737,7 @@ class Puppeteer extends Helper {
1713
1737
  *
1714
1738
  * @param {string|string[]} key or array of keys to type.
1715
1739
  * @param {?number} [delay=null] (optional) delay in ms between key presses
1716
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1740
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1717
1741
  *
1718
1742
  */
1719
1743
  async type(keys, delay = null) {
@@ -1744,7 +1768,7 @@ class Puppeteer extends Helper {
1744
1768
  * ```
1745
1769
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1746
1770
  * @param {CodeceptJS.StringOrSecret} value text value to fill.
1747
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1771
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1748
1772
  *
1749
1773
  * {{ react }}
1750
1774
  */
@@ -1775,7 +1799,7 @@ class Puppeteer extends Helper {
1775
1799
  * I.clearField('#email');
1776
1800
  * ```
1777
1801
  * @param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
1778
- * ⚠️ returns a _promise_ which is synchronized internally by recorder.
1802
+ * @returns {Promise<void>} automatically synchronized promise through #recorder.
1779
1803
  *
1780
1804
  */
1781
1805
  async clearField(field) {
@@ -1793,7 +1817,7 @@ class Puppeteer extends Helper {
1793
1817
  * ```
1794
1818
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
1795
1819
  * @param {string} value text value to append.
1796
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1820
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1797
1821
  *
1798
1822
  *
1799
1823
  * {{ react }}
@@ -1819,7 +1843,7 @@ class Puppeteer extends Helper {
1819
1843
  * ```
1820
1844
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1821
1845
  * @param {CodeceptJS.StringOrSecret} value value to check.
1822
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1846
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1823
1847
  *
1824
1848
  */
1825
1849
  async seeInField(field, value) {
@@ -1838,7 +1862,7 @@ class Puppeteer extends Helper {
1838
1862
  *
1839
1863
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1840
1864
  * @param {CodeceptJS.StringOrSecret} value value to check.
1841
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1865
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1842
1866
  *
1843
1867
  */
1844
1868
  async dontSeeInField(field, value) {
@@ -1858,7 +1882,7 @@ class Puppeteer extends Helper {
1858
1882
  *
1859
1883
  * @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
1860
1884
  * @param {string} pathToFile local file path relative to codecept.conf.ts or codecept.conf.js config file.
1861
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1885
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1862
1886
  *
1863
1887
  *
1864
1888
  * > ⚠ There is an [issue with file upload in Puppeteer 2.1.0 & 2.1.1](https://github.com/puppeteer/puppeteer/issues/5420), downgrade to 2.0.0 if you face it.
@@ -1896,7 +1920,7 @@ class Puppeteer extends Helper {
1896
1920
  * ```
1897
1921
  * @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
1898
1922
  * @param {string|Array<*>} option visible text or value of option.
1899
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1923
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1900
1924
  *
1901
1925
  */
1902
1926
  async selectOption(select, option) {
@@ -1958,7 +1982,7 @@ class Puppeteer extends Helper {
1958
1982
  * ```
1959
1983
  *
1960
1984
  * @param {string} url a fragment to check
1961
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1985
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1962
1986
  *
1963
1987
  */
1964
1988
  async seeInCurrentUrl(url) {
@@ -1969,7 +1993,7 @@ class Puppeteer extends Helper {
1969
1993
  * Checks that current url does not contain a provided fragment.
1970
1994
  *
1971
1995
  * @param {string} url value to check.
1972
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1996
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1973
1997
  *
1974
1998
  */
1975
1999
  async dontSeeInCurrentUrl(url) {
@@ -1987,7 +2011,7 @@ class Puppeteer extends Helper {
1987
2011
  * ```
1988
2012
  *
1989
2013
  * @param {string} url value to check.
1990
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2014
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
1991
2015
  *
1992
2016
  */
1993
2017
  async seeCurrentUrlEquals(url) {
@@ -2004,7 +2028,7 @@ class Puppeteer extends Helper {
2004
2028
  * ```
2005
2029
  *
2006
2030
  * @param {string} url value to check.
2007
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2031
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2008
2032
  *
2009
2033
  */
2010
2034
  async dontSeeCurrentUrlEquals(url) {
@@ -2022,7 +2046,7 @@ class Puppeteer extends Helper {
2022
2046
  * ```
2023
2047
  * @param {string} text expected on page.
2024
2048
  * @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
2025
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2049
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2026
2050
  *
2027
2051
  *
2028
2052
  * {{ react }}
@@ -2040,7 +2064,7 @@ class Puppeteer extends Helper {
2040
2064
  *
2041
2065
  * @param {string} text element value to check.
2042
2066
  * @param {CodeceptJS.LocatorOrString?} [context=null] element located by CSS|XPath|strict locator.
2043
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2067
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2044
2068
  *
2045
2069
  */
2046
2070
  async seeTextEquals(text, context = null) {
@@ -2058,7 +2082,7 @@ class Puppeteer extends Helper {
2058
2082
  *
2059
2083
  * @param {string} text which is not present.
2060
2084
  * @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
2061
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2085
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2062
2086
  *
2063
2087
  *
2064
2088
  * {{ react }}
@@ -2118,7 +2142,7 @@ class Puppeteer extends Helper {
2118
2142
  * I.seeInSource('<h1>Green eggs &amp; ham</h1>');
2119
2143
  * ```
2120
2144
  * @param {string} text value to check.
2121
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2145
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2122
2146
  *
2123
2147
  */
2124
2148
  async seeInSource(text) {
@@ -2134,7 +2158,7 @@ class Puppeteer extends Helper {
2134
2158
  * ```
2135
2159
  *
2136
2160
  * @param {string} value to check.
2137
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2161
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2138
2162
  *
2139
2163
  */
2140
2164
  async dontSeeInSource(text) {
@@ -2153,7 +2177,7 @@ class Puppeteer extends Helper {
2153
2177
  *
2154
2178
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2155
2179
  * @param {number} num number of elements.
2156
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2180
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2157
2181
  *
2158
2182
  *
2159
2183
  * {{ react }}
@@ -2173,7 +2197,7 @@ class Puppeteer extends Helper {
2173
2197
  *
2174
2198
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2175
2199
  * @param {number} num number of elements.
2176
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2200
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2177
2201
  *
2178
2202
  *
2179
2203
  * {{ react }}
@@ -2199,7 +2223,7 @@ class Puppeteer extends Helper {
2199
2223
  * ```
2200
2224
  *
2201
2225
  * @param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
2202
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2226
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2203
2227
  *
2204
2228
  */
2205
2229
  async setCookie(cookie) {
@@ -2217,7 +2241,7 @@ class Puppeteer extends Helper {
2217
2241
  * ```
2218
2242
  *
2219
2243
  * @param {string} name cookie name.
2220
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2244
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2221
2245
  *
2222
2246
  *
2223
2247
  */
@@ -2234,7 +2258,7 @@ class Puppeteer extends Helper {
2234
2258
  * ```
2235
2259
  *
2236
2260
  * @param {string} name cookie name.
2237
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2261
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2238
2262
  *
2239
2263
  */
2240
2264
  async dontSeeCookie(name) {
@@ -2253,7 +2277,7 @@ class Puppeteer extends Helper {
2253
2277
  * ```
2254
2278
  *
2255
2279
  * @param {?string} [name=null] cookie name.
2256
- * @returns {Promise<string>|Promise<string[]>} attribute value
2280
+ * @returns {any} attribute value
2257
2281
  *
2258
2282
  *
2259
2283
  * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
@@ -2275,7 +2299,7 @@ class Puppeteer extends Helper {
2275
2299
  * ```
2276
2300
  *
2277
2301
  * @param {?string} [cookie=null] (optional, `null` by default) cookie name
2278
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2302
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2279
2303
  *
2280
2304
  */
2281
2305
  async clearCookie(name) {
@@ -2316,8 +2340,6 @@ class Puppeteer extends Helper {
2316
2340
  * @param {...any} args to be passed to function.
2317
2341
  * @returns {Promise<any>} script return value
2318
2342
  *
2319
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2320
- *
2321
2343
  *
2322
2344
  * If a function returns a Promise It will wait for it resolution.
2323
2345
  */
@@ -2355,8 +2377,6 @@ class Puppeteer extends Helper {
2355
2377
  * @param {...any} args to be passed to function.
2356
2378
  * @returns {Promise<any>} script return value
2357
2379
  *
2358
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2359
- *
2360
2380
  *
2361
2381
  * Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
2362
2382
  */
@@ -2560,7 +2580,7 @@ class Puppeteer extends Helper {
2560
2580
  *
2561
2581
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
2562
2582
  * @param {object} cssProperties object with CSS properties and their values to check.
2563
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2583
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2564
2584
  *
2565
2585
  * {{ react }}
2566
2586
  */
@@ -2608,7 +2628,7 @@ class Puppeteer extends Helper {
2608
2628
  *
2609
2629
  * @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
2610
2630
  * @param {object} attributes attributes and their values to check.
2611
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2631
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2612
2632
  *
2613
2633
  * {{ react }}
2614
2634
  */
@@ -2650,7 +2670,7 @@ class Puppeteer extends Helper {
2650
2670
  *
2651
2671
  * @param {CodeceptJS.LocatorOrString} locator located by label|name|CSS|XPath|strict locator.
2652
2672
  * @param {number} offsetX position to drag.
2653
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2673
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2654
2674
  *
2655
2675
  * {{ react }}
2656
2676
  */
@@ -2729,7 +2749,7 @@ class Puppeteer extends Helper {
2729
2749
  *
2730
2750
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2731
2751
  * @param {string} fileName file name to save.
2732
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2752
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2733
2753
  *
2734
2754
  */
2735
2755
  async saveElementScreenshot(locator, fileName) {
@@ -2755,7 +2775,7 @@ class Puppeteer extends Helper {
2755
2775
  *
2756
2776
  * @param {string} fileName file name to save.
2757
2777
  * @param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
2758
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2778
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2759
2779
  *
2760
2780
  */
2761
2781
  async saveScreenshot(fileName, fullPage) {
@@ -2788,8 +2808,30 @@ class Puppeteer extends Helper {
2788
2808
  }
2789
2809
  }
2790
2810
 
2791
- async _failed() {
2811
+ async _failed(test) {
2812
+ await this._withinEnd();
2813
+
2814
+ if (this.options.trace) {
2815
+ await this.page.tracing.stop();
2816
+ const _traceName = this.currentRunningTest.artifacts.trace.replace('.json', '.failed.json');
2817
+ fs.renameSync(this.currentRunningTest.artifacts.trace, _traceName);
2818
+ test.artifacts.trace = _traceName;
2819
+ }
2820
+ }
2821
+
2822
+ async _passed(test) {
2792
2823
  await this._withinEnd();
2824
+
2825
+ if (this.options.trace) {
2826
+ await this.page.tracing.stop();
2827
+ if (this.options.keepTraceForPassedTests) {
2828
+ const _traceName = this.currentRunningTest.artifacts.trace.replace('.json', '.passed.json');
2829
+ fs.renameSync(this.currentRunningTest.artifacts.trace, _traceName);
2830
+ test.artifacts.trace = _traceName;
2831
+ } else {
2832
+ fs.unlinkSync(this.currentRunningTest.artifacts.trace);
2833
+ }
2834
+ }
2793
2835
  }
2794
2836
 
2795
2837
  /**
@@ -2800,7 +2842,7 @@ class Puppeteer extends Helper {
2800
2842
  * ```
2801
2843
  *
2802
2844
  * @param {number} sec number of second to wait.
2803
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2845
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2804
2846
  *
2805
2847
  */
2806
2848
  async wait(sec) {
@@ -2815,7 +2857,7 @@ class Puppeteer extends Helper {
2815
2857
  *
2816
2858
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2817
2859
  * @param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
2818
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2860
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2819
2861
  *
2820
2862
  */
2821
2863
  async waitForEnabled(locator, sec) {
@@ -2855,7 +2897,7 @@ class Puppeteer extends Helper {
2855
2897
  * @param {LocatorOrString} field input field.
2856
2898
  * @param {string }value expected value.
2857
2899
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
2858
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2900
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2859
2901
  *
2860
2902
  */
2861
2903
  async waitForValue(field, value, sec) {
@@ -2896,7 +2938,7 @@ class Puppeteer extends Helper {
2896
2938
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2897
2939
  * @param {number} num number of elements.
2898
2940
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
2899
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2941
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2900
2942
  *
2901
2943
  * {{ react }}
2902
2944
  */
@@ -2938,7 +2980,7 @@ class Puppeteer extends Helper {
2938
2980
  *
2939
2981
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2940
2982
  * @param {number} [sec] (optional, `1` by default) time in seconds to wait
2941
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2983
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2942
2984
  *
2943
2985
  */
2944
2986
  async waitForClickable(locator, waitTimeout) {
@@ -2965,7 +3007,7 @@ class Puppeteer extends Helper {
2965
3007
  *
2966
3008
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2967
3009
  * @param {number} [sec] (optional, `1` by default) time in seconds to wait
2968
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3010
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2969
3011
  *
2970
3012
  * {{ react }}
2971
3013
  */
@@ -2995,7 +3037,7 @@ class Puppeteer extends Helper {
2995
3037
  *
2996
3038
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
2997
3039
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
2998
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3040
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
2999
3041
  *
3000
3042
  *
3001
3043
  * This method accepts [React selectors](https://codecept.io/react).
@@ -3026,7 +3068,7 @@ class Puppeteer extends Helper {
3026
3068
  *
3027
3069
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
3028
3070
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3029
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3071
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
3030
3072
  *
3031
3073
  */
3032
3074
  async waitForInvisible(locator, sec) {
@@ -3055,7 +3097,7 @@ class Puppeteer extends Helper {
3055
3097
  *
3056
3098
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
3057
3099
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3058
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3100
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
3059
3101
  *
3060
3102
  */
3061
3103
  async waitToHide(locator, sec) {
@@ -3089,7 +3131,7 @@ class Puppeteer extends Helper {
3089
3131
  *
3090
3132
  * @param {string} urlPart value to check.
3091
3133
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3092
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3134
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
3093
3135
  *
3094
3136
  */
3095
3137
  async waitInUrl(urlPart, sec = null) {
@@ -3118,7 +3160,7 @@ class Puppeteer extends Helper {
3118
3160
  *
3119
3161
  * @param {string} urlPart value to check.
3120
3162
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3121
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3163
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
3122
3164
  *
3123
3165
  */
3124
3166
  async waitUrlEquals(urlPart, sec = null) {
@@ -3155,7 +3197,7 @@ class Puppeteer extends Helper {
3155
3197
  * @param {string }text to wait for.
3156
3198
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3157
3199
  * @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
3158
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3200
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
3159
3201
  *
3160
3202
  */
3161
3203
  async waitForText(text, sec = null, context = null) {
@@ -3232,7 +3274,7 @@ class Puppeteer extends Helper {
3232
3274
  * ```
3233
3275
  *
3234
3276
  * @param {?CodeceptJS.LocatorOrString} [locator=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
3235
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3277
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
3236
3278
  *
3237
3279
  */
3238
3280
  async switchTo(locator) {
@@ -3287,7 +3329,7 @@ class Puppeteer extends Helper {
3287
3329
  * @param {string|function} fn to be executed in browser context.
3288
3330
  * @param {any[]|number} [argsOrSec] (optional, `1` by default) arguments for function or seconds.
3289
3331
  * @param {number} [sec] (optional, `1` by default) time in seconds to wait
3290
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3332
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
3291
3333
  *
3292
3334
  */
3293
3335
  async waitForFunction(fn, argsOrSec = null, sec = null) {
@@ -3337,7 +3379,7 @@ class Puppeteer extends Helper {
3337
3379
  *
3338
3380
  * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
3339
3381
  * @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
3340
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3382
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
3341
3383
  *
3342
3384
  */
3343
3385
  async waitForDetached(locator, sec) {
@@ -3387,7 +3429,8 @@ class Puppeteer extends Helper {
3387
3429
  * loadEventEnd: 241
3388
3430
  * }
3389
3431
  * ```
3390
- * @return {Promise<any>} automatically synchronized promise through #recorder
3432
+ * @returns {Promise<void>} automatically synchronized promise through #recorder
3433
+ *
3391
3434
  */
3392
3435
  async grabDataFromPerformanceTiming() {
3393
3436
  return perfTiming;