codeceptjs 3.4.1 → 3.5.1-2.beta.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 (281) hide show
  1. package/README.md +31 -30
  2. package/bin/codecept.js +1 -1
  3. package/lib/actor.js +6 -3
  4. package/lib/ai.js +180 -0
  5. package/lib/cli.js +13 -3
  6. package/lib/codecept.js +8 -0
  7. package/lib/colorUtils.js +10 -0
  8. package/lib/command/definitions.js +2 -7
  9. package/lib/command/dryRun.js +11 -2
  10. package/lib/command/generate.js +46 -3
  11. package/lib/command/info.js +24 -0
  12. package/lib/command/init.js +64 -6
  13. package/lib/command/interactive.js +15 -1
  14. package/lib/command/run-multiple/collection.js +17 -5
  15. package/lib/command/run-multiple.js +4 -2
  16. package/lib/command/run-workers.js +68 -5
  17. package/lib/command/run.js +7 -0
  18. package/lib/command/workers/runTests.js +39 -0
  19. package/lib/container.js +13 -3
  20. package/lib/data/context.js +14 -6
  21. package/lib/event.js +4 -0
  22. package/lib/helper/ApiDataFactory.js +2 -1
  23. package/lib/helper/Appium.js +116 -29
  24. package/lib/helper/Expect.js +422 -0
  25. package/lib/helper/FileSystem.js +1 -1
  26. package/lib/helper/GraphQL.js +25 -0
  27. package/lib/helper/JSONResponse.js +4 -4
  28. package/lib/helper/Nightmare.js +10 -5
  29. package/lib/helper/OpenAI.js +126 -0
  30. package/lib/helper/Playwright.js +1298 -229
  31. package/lib/helper/Protractor.js +12 -7
  32. package/lib/helper/Puppeteer.js +204 -64
  33. package/lib/helper/REST.js +15 -5
  34. package/lib/helper/TestCafe.js +45 -10
  35. package/lib/helper/WebDriver.js +252 -83
  36. package/lib/helper/errors/ElementNotFound.js +2 -1
  37. package/lib/helper/extras/PlaywrightReactVueLocator.js +38 -0
  38. package/lib/helper/scripts/blurElement.js +17 -0
  39. package/lib/helper/scripts/focusElement.js +17 -0
  40. package/lib/helper/scripts/highlightElement.js +20 -0
  41. package/lib/html.js +258 -0
  42. package/lib/interfaces/bdd.js +1 -1
  43. package/lib/interfaces/gherkin.js +37 -3
  44. package/lib/interfaces/scenarioConfig.js +1 -0
  45. package/lib/listener/retry.js +2 -1
  46. package/lib/locator.js +17 -4
  47. package/lib/mochaFactory.js +2 -1
  48. package/lib/output.js +1 -1
  49. package/lib/pause.js +78 -19
  50. package/lib/plugin/autoLogin.js +45 -10
  51. package/lib/plugin/debugErrors.js +67 -0
  52. package/lib/plugin/fakerTransform.js +4 -6
  53. package/lib/plugin/heal.js +209 -0
  54. package/lib/plugin/retryFailedStep.js +10 -1
  55. package/lib/plugin/retryTo.js +2 -4
  56. package/lib/plugin/screenshotOnFail.js +11 -2
  57. package/lib/plugin/selenoid.js +6 -1
  58. package/lib/plugin/standardActingHelpers.js +0 -2
  59. package/lib/plugin/stepByStepReport.js +2 -2
  60. package/lib/plugin/tryTo.js +5 -7
  61. package/lib/plugin/wdio.js +0 -1
  62. package/lib/recorder.js +22 -11
  63. package/lib/secret.js +5 -4
  64. package/lib/session.js +1 -1
  65. package/lib/step.js +36 -12
  66. package/lib/ui.js +5 -3
  67. package/lib/utils.js +22 -1
  68. package/lib/workers.js +83 -10
  69. package/package.json +117 -95
  70. package/translations/de-DE.js +5 -0
  71. package/translations/fr-FR.js +14 -1
  72. package/translations/it-IT.js +1 -0
  73. package/translations/ja-JP.js +14 -9
  74. package/translations/pl-PL.js +5 -0
  75. package/translations/pt-BR.js +1 -0
  76. package/translations/ru-RU.js +1 -0
  77. package/translations/zh-CN.js +5 -0
  78. package/translations/zh-TW.js +5 -0
  79. package/typings/index.d.ts +51 -15
  80. package/typings/promiseBasedTypes.d.ts +864 -802
  81. package/typings/types.d.ts +1339 -744
  82. package/CHANGELOG.md +0 -2427
  83. package/docs/advanced.md +0 -351
  84. package/docs/api.md +0 -323
  85. package/docs/basics.md +0 -980
  86. package/docs/bdd.md +0 -535
  87. package/docs/best.md +0 -237
  88. package/docs/books.md +0 -37
  89. package/docs/bootstrap.md +0 -135
  90. package/docs/build/ApiDataFactory.js +0 -409
  91. package/docs/build/Appium.js +0 -1938
  92. package/docs/build/FileSystem.js +0 -228
  93. package/docs/build/GraphQL.js +0 -204
  94. package/docs/build/GraphQLDataFactory.js +0 -309
  95. package/docs/build/JSONResponse.js +0 -338
  96. package/docs/build/Mochawesome.js +0 -71
  97. package/docs/build/Nightmare.js +0 -2145
  98. package/docs/build/Playwright.js +0 -3986
  99. package/docs/build/Polly.js +0 -42
  100. package/docs/build/Protractor.js +0 -2699
  101. package/docs/build/Puppeteer.js +0 -3710
  102. package/docs/build/REST.js +0 -334
  103. package/docs/build/SeleniumWebdriver.js +0 -76
  104. package/docs/build/TestCafe.js +0 -2057
  105. package/docs/build/WebDriver.js +0 -4017
  106. package/docs/changelog.md +0 -2436
  107. package/docs/commands.md +0 -254
  108. package/docs/community-helpers.md +0 -58
  109. package/docs/configuration.md +0 -157
  110. package/docs/continuous-integration.md +0 -22
  111. package/docs/custom-helpers.md +0 -306
  112. package/docs/data.md +0 -375
  113. package/docs/detox.md +0 -235
  114. package/docs/docker.md +0 -137
  115. package/docs/email.md +0 -183
  116. package/docs/examples.md +0 -149
  117. package/docs/helpers/ApiDataFactory.md +0 -266
  118. package/docs/helpers/Appium.md +0 -1312
  119. package/docs/helpers/Detox.md +0 -586
  120. package/docs/helpers/FileSystem.md +0 -152
  121. package/docs/helpers/GraphQL.md +0 -130
  122. package/docs/helpers/GraphQLDataFactory.md +0 -226
  123. package/docs/helpers/JSONResponse.md +0 -254
  124. package/docs/helpers/Mochawesome.md +0 -8
  125. package/docs/helpers/MockRequest.md +0 -377
  126. package/docs/helpers/Nightmare.md +0 -1256
  127. package/docs/helpers/Playwright.md +0 -2208
  128. package/docs/helpers/Polly.md +0 -44
  129. package/docs/helpers/Puppeteer-firefox.md +0 -86
  130. package/docs/helpers/Puppeteer.md +0 -2141
  131. package/docs/helpers/REST.md +0 -217
  132. package/docs/helpers/TestCafe.md +0 -1222
  133. package/docs/helpers/WebDriver.md +0 -2319
  134. package/docs/hooks.md +0 -340
  135. package/docs/index.md +0 -111
  136. package/docs/installation.md +0 -75
  137. package/docs/internal-api.md +0 -265
  138. package/docs/locators.md +0 -331
  139. package/docs/mobile-react-native-locators.md +0 -67
  140. package/docs/mobile.md +0 -297
  141. package/docs/nightmare.md +0 -223
  142. package/docs/pageobjects.md +0 -291
  143. package/docs/parallel.md +0 -232
  144. package/docs/playwright.md +0 -609
  145. package/docs/plugins.md +0 -1171
  146. package/docs/puppeteer.md +0 -316
  147. package/docs/quickstart.md +0 -163
  148. package/docs/react.md +0 -69
  149. package/docs/reports.md +0 -392
  150. package/docs/secrets.md +0 -30
  151. package/docs/shadow.md +0 -68
  152. package/docs/shared/keys.mustache +0 -31
  153. package/docs/shared/react.mustache +0 -1
  154. package/docs/testcafe.md +0 -174
  155. package/docs/translation.md +0 -247
  156. package/docs/tutorial.md +0 -271
  157. package/docs/typescript.md +0 -180
  158. package/docs/ui.md +0 -59
  159. package/docs/videos.md +0 -28
  160. package/docs/visual.md +0 -202
  161. package/docs/vue.md +0 -121
  162. package/docs/webapi/amOnPage.mustache +0 -11
  163. package/docs/webapi/appendField.mustache +0 -9
  164. package/docs/webapi/attachFile.mustache +0 -12
  165. package/docs/webapi/checkOption.mustache +0 -13
  166. package/docs/webapi/clearCookie.mustache +0 -10
  167. package/docs/webapi/clearField.mustache +0 -9
  168. package/docs/webapi/click.mustache +0 -25
  169. package/docs/webapi/clickLink.mustache +0 -8
  170. package/docs/webapi/closeCurrentTab.mustache +0 -7
  171. package/docs/webapi/closeOtherTabs.mustache +0 -8
  172. package/docs/webapi/dontSee.mustache +0 -11
  173. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +0 -10
  174. package/docs/webapi/dontSeeCookie.mustache +0 -8
  175. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +0 -10
  176. package/docs/webapi/dontSeeElement.mustache +0 -8
  177. package/docs/webapi/dontSeeElementInDOM.mustache +0 -8
  178. package/docs/webapi/dontSeeInCurrentUrl.mustache +0 -4
  179. package/docs/webapi/dontSeeInField.mustache +0 -11
  180. package/docs/webapi/dontSeeInSource.mustache +0 -8
  181. package/docs/webapi/dontSeeInTitle.mustache +0 -8
  182. package/docs/webapi/doubleClick.mustache +0 -13
  183. package/docs/webapi/downloadFile.mustache +0 -12
  184. package/docs/webapi/dragAndDrop.mustache +0 -9
  185. package/docs/webapi/dragSlider.mustache +0 -11
  186. package/docs/webapi/executeAsyncScript.mustache +0 -24
  187. package/docs/webapi/executeScript.mustache +0 -26
  188. package/docs/webapi/fillField.mustache +0 -16
  189. package/docs/webapi/forceClick.mustache +0 -28
  190. package/docs/webapi/forceRightClick.mustache +0 -18
  191. package/docs/webapi/grabAllWindowHandles.mustache +0 -7
  192. package/docs/webapi/grabAttributeFrom.mustache +0 -10
  193. package/docs/webapi/grabAttributeFromAll.mustache +0 -9
  194. package/docs/webapi/grabBrowserLogs.mustache +0 -9
  195. package/docs/webapi/grabCookie.mustache +0 -11
  196. package/docs/webapi/grabCssPropertyFrom.mustache +0 -11
  197. package/docs/webapi/grabCssPropertyFromAll.mustache +0 -10
  198. package/docs/webapi/grabCurrentUrl.mustache +0 -9
  199. package/docs/webapi/grabCurrentWindowHandle.mustache +0 -6
  200. package/docs/webapi/grabDataFromPerformanceTiming.mustache +0 -20
  201. package/docs/webapi/grabElementBoundingRect.mustache +0 -20
  202. package/docs/webapi/grabGeoLocation.mustache +0 -8
  203. package/docs/webapi/grabHTMLFrom.mustache +0 -10
  204. package/docs/webapi/grabHTMLFromAll.mustache +0 -9
  205. package/docs/webapi/grabNumberOfOpenTabs.mustache +0 -8
  206. package/docs/webapi/grabNumberOfVisibleElements.mustache +0 -9
  207. package/docs/webapi/grabPageScrollPosition.mustache +0 -8
  208. package/docs/webapi/grabPopupText.mustache +0 -5
  209. package/docs/webapi/grabSource.mustache +0 -8
  210. package/docs/webapi/grabTextFrom.mustache +0 -10
  211. package/docs/webapi/grabTextFromAll.mustache +0 -9
  212. package/docs/webapi/grabTitle.mustache +0 -8
  213. package/docs/webapi/grabValueFrom.mustache +0 -9
  214. package/docs/webapi/grabValueFromAll.mustache +0 -8
  215. package/docs/webapi/moveCursorTo.mustache +0 -12
  216. package/docs/webapi/openNewTab.mustache +0 -7
  217. package/docs/webapi/pressKey.mustache +0 -12
  218. package/docs/webapi/pressKeyDown.mustache +0 -12
  219. package/docs/webapi/pressKeyUp.mustache +0 -12
  220. package/docs/webapi/pressKeyWithKeyNormalization.mustache +0 -60
  221. package/docs/webapi/refreshPage.mustache +0 -6
  222. package/docs/webapi/resizeWindow.mustache +0 -6
  223. package/docs/webapi/rightClick.mustache +0 -14
  224. package/docs/webapi/saveElementScreenshot.mustache +0 -10
  225. package/docs/webapi/saveScreenshot.mustache +0 -12
  226. package/docs/webapi/say.mustache +0 -10
  227. package/docs/webapi/scrollIntoView.mustache +0 -11
  228. package/docs/webapi/scrollPageToBottom.mustache +0 -6
  229. package/docs/webapi/scrollPageToTop.mustache +0 -6
  230. package/docs/webapi/scrollTo.mustache +0 -12
  231. package/docs/webapi/see.mustache +0 -11
  232. package/docs/webapi/seeAttributesOnElements.mustache +0 -9
  233. package/docs/webapi/seeCheckboxIsChecked.mustache +0 -10
  234. package/docs/webapi/seeCookie.mustache +0 -8
  235. package/docs/webapi/seeCssPropertiesOnElements.mustache +0 -9
  236. package/docs/webapi/seeCurrentUrlEquals.mustache +0 -11
  237. package/docs/webapi/seeElement.mustache +0 -8
  238. package/docs/webapi/seeElementInDOM.mustache +0 -8
  239. package/docs/webapi/seeInCurrentUrl.mustache +0 -8
  240. package/docs/webapi/seeInField.mustache +0 -12
  241. package/docs/webapi/seeInPopup.mustache +0 -8
  242. package/docs/webapi/seeInSource.mustache +0 -7
  243. package/docs/webapi/seeInTitle.mustache +0 -8
  244. package/docs/webapi/seeNumberOfElements.mustache +0 -11
  245. package/docs/webapi/seeNumberOfVisibleElements.mustache +0 -10
  246. package/docs/webapi/seeTextEquals.mustache +0 -9
  247. package/docs/webapi/seeTitleEquals.mustache +0 -8
  248. package/docs/webapi/selectOption.mustache +0 -21
  249. package/docs/webapi/setCookie.mustache +0 -16
  250. package/docs/webapi/setGeoLocation.mustache +0 -12
  251. package/docs/webapi/switchTo.mustache +0 -9
  252. package/docs/webapi/switchToNextTab.mustache +0 -10
  253. package/docs/webapi/switchToPreviousTab.mustache +0 -10
  254. package/docs/webapi/type.mustache +0 -18
  255. package/docs/webapi/uncheckOption.mustache +0 -13
  256. package/docs/webapi/wait.mustache +0 -8
  257. package/docs/webapi/waitForClickable.mustache +0 -11
  258. package/docs/webapi/waitForDetached.mustache +0 -10
  259. package/docs/webapi/waitForElement.mustache +0 -11
  260. package/docs/webapi/waitForEnabled.mustache +0 -6
  261. package/docs/webapi/waitForFunction.mustache +0 -17
  262. package/docs/webapi/waitForInvisible.mustache +0 -10
  263. package/docs/webapi/waitForText.mustache +0 -13
  264. package/docs/webapi/waitForValue.mustache +0 -10
  265. package/docs/webapi/waitForVisible.mustache +0 -10
  266. package/docs/webapi/waitInUrl.mustache +0 -9
  267. package/docs/webapi/waitNumberOfVisibleElements.mustache +0 -10
  268. package/docs/webapi/waitToHide.mustache +0 -10
  269. package/docs/webapi/waitUrlEquals.mustache +0 -10
  270. package/docs/webdriver.md +0 -657
  271. package/docs/wiki/Books-&-Posts.md +0 -27
  272. package/docs/wiki/Community-Helpers-&-Plugins.md +0 -49
  273. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +0 -29
  274. package/docs/wiki/Examples.md +0 -139
  275. package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +0 -68
  276. package/docs/wiki/Home.md +0 -16
  277. package/docs/wiki/Release-Process.md +0 -24
  278. package/docs/wiki/Roadmap.md +0 -23
  279. package/docs/wiki/Tests.md +0 -1393
  280. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +0 -153
  281. package/docs/wiki/Videos.md +0 -19
@@ -458,7 +458,7 @@ declare namespace CodeceptJS {
458
458
  * Switch to the specified context.
459
459
  * @param context - the context to switch to
460
460
  */
461
- _switchToContext(context: any): Promise<any>;
461
+ switchToContext(context: any): Promise<any>;
462
462
  /**
463
463
  * Switches to web context.
464
464
  * If no context is provided switches to the first detected web context
@@ -508,10 +508,12 @@ declare namespace CodeceptJS {
508
508
  * I.setNetworkConnection(4) // airplane mode off, wifi off, data on
509
509
  * I.setNetworkConnection(6) // airplane mode off, wifi on, data on
510
510
  * ```
511
- * See corresponding [webdriverio reference](http://webdriver.io/api/mobile/setNetworkConnection.html).
512
- * @returns Appium: support only Android
511
+ * See corresponding [webdriverio reference](https://webdriver.io/docs/api/chromium/#setnetworkconnection).
512
+ *
513
+ * Appium: support only Android
514
+ * @param value - The network connection mode bitmask
513
515
  */
514
- setNetworkConnection(): Promise<{}>;
516
+ setNetworkConnection(value: number): Promise<number>;
515
517
  /**
516
518
  * Update the current setting on the device
517
519
  *
@@ -747,7 +749,7 @@ declare namespace CodeceptJS {
747
749
  * ```js
748
750
  * I.closeApp();
749
751
  * ```
750
- * @returns Appium: support only iOS
752
+ * @returns Appium: support both Android and iOS
751
753
  */
752
754
  closeApp(): Promise<void>;
753
755
  /**
@@ -756,10 +758,11 @@ declare namespace CodeceptJS {
756
758
  *
757
759
  * ```js
758
760
  * I.appendField('#myTextField', 'appended');
761
+ * // typing secret
762
+ * I.appendField('password', secret('123456'));
759
763
  * ```
760
764
  * @param field - located by label|name|CSS|XPath|strict locator
761
765
  * @param value - text value to append.
762
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
763
766
  */
764
767
  appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
765
768
  /**
@@ -775,7 +778,6 @@ declare namespace CodeceptJS {
775
778
  * ```
776
779
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
777
780
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
778
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
779
781
  */
780
782
  checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
781
783
  /**
@@ -802,7 +804,6 @@ declare namespace CodeceptJS {
802
804
  * ```
803
805
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
804
806
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
805
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
806
807
  */
807
808
  click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
808
809
  /**
@@ -814,7 +815,6 @@ declare namespace CodeceptJS {
814
815
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
815
816
  * ```
816
817
  * @param field - located by label|name|CSS|XPath|strict locator.
817
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
818
818
  */
819
819
  dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
820
820
  /**
@@ -824,7 +824,6 @@ declare namespace CodeceptJS {
824
824
  * I.dontSeeElement('.modal'); // modal is not shown
825
825
  * ```
826
826
  * @param locator - located by CSS|XPath|Strict locator.
827
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
828
827
  */
829
828
  dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
830
829
  /**
@@ -837,9 +836,8 @@ declare namespace CodeceptJS {
837
836
  * ```
838
837
  * @param field - located by label|name|CSS|XPath|strict locator.
839
838
  * @param value - value to check.
840
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
841
839
  */
842
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
840
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
843
841
  /**
844
842
  * Opposite to `see`. Checks that a text is not present on a page.
845
843
  * Use context parameter to narrow down the search.
@@ -850,7 +848,6 @@ declare namespace CodeceptJS {
850
848
  * ```
851
849
  * @param text - which is not present.
852
850
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
853
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
854
851
  */
855
852
  dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
856
853
  /**
@@ -869,7 +866,6 @@ declare namespace CodeceptJS {
869
866
  * ```
870
867
  * @param field - located by label|name|CSS|XPath|strict locator.
871
868
  * @param value - text value to fill.
872
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
873
869
  */
874
870
  fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
875
871
  /**
@@ -976,13 +972,9 @@ declare namespace CodeceptJS {
976
972
  * I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
977
973
  * ```
978
974
  * @param locator - located by CSS|XPath|strict locator.
979
- * @param scrollIntoViewOptions - see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
980
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
981
- *
982
- *
983
- * Supported only for web testing
975
+ * @param scrollIntoViewOptions - either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
984
976
  */
985
- scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): Promise<any>;
977
+ scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions | boolean): Promise<any>;
986
978
  /**
987
979
  * Verifies that the specified checkbox is checked.
988
980
  *
@@ -992,7 +984,6 @@ declare namespace CodeceptJS {
992
984
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
993
985
  * ```
994
986
  * @param field - located by label|name|CSS|XPath|strict locator.
995
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
996
987
  */
997
988
  seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
998
989
  /**
@@ -1003,7 +994,6 @@ declare namespace CodeceptJS {
1003
994
  * I.seeElement('#modal');
1004
995
  * ```
1005
996
  * @param locator - located by CSS|XPath|strict locator.
1006
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1007
997
  */
1008
998
  seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
1009
999
  /**
@@ -1018,9 +1008,8 @@ declare namespace CodeceptJS {
1018
1008
  * ```
1019
1009
  * @param field - located by label|name|CSS|XPath|strict locator.
1020
1010
  * @param value - value to check.
1021
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1022
1011
  */
1023
- seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
1012
+ seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
1024
1013
  /**
1025
1014
  * Checks that a page contains a visible text.
1026
1015
  * Use context parameter to narrow down the search.
@@ -1032,7 +1021,6 @@ declare namespace CodeceptJS {
1032
1021
  * ```
1033
1022
  * @param text - expected on page.
1034
1023
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
1035
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1036
1024
  */
1037
1025
  see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
1038
1026
  /**
@@ -1056,10 +1044,6 @@ declare namespace CodeceptJS {
1056
1044
  * ```
1057
1045
  * @param select - field located by label|name|CSS|XPath|strict locator.
1058
1046
  * @param option - visible text or value of option.
1059
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1060
- *
1061
- *
1062
- * Supported only for web testing
1063
1047
  */
1064
1048
  selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
1065
1049
  /**
@@ -1072,7 +1056,6 @@ declare namespace CodeceptJS {
1072
1056
  * ```
1073
1057
  * @param locator - element located by CSS|XPath|strict locator.
1074
1058
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
1075
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1076
1059
  */
1077
1060
  waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
1078
1061
  /**
@@ -1084,7 +1067,6 @@ declare namespace CodeceptJS {
1084
1067
  * ```
1085
1068
  * @param locator - element located by CSS|XPath|strict locator.
1086
1069
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
1087
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1088
1070
  */
1089
1071
  waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
1090
1072
  /**
@@ -1096,7 +1078,6 @@ declare namespace CodeceptJS {
1096
1078
  * ```
1097
1079
  * @param locator - element located by CSS|XPath|strict locator.
1098
1080
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
1099
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1100
1081
  */
1101
1082
  waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
1102
1083
  /**
@@ -1111,10 +1092,75 @@ declare namespace CodeceptJS {
1111
1092
  * @param text - to wait for.
1112
1093
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
1113
1094
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
1114
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1115
1095
  */
1116
1096
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
1117
1097
  }
1098
+ /**
1099
+ * This helper allows performing assertions based on Chai.
1100
+ *
1101
+ * ### Examples
1102
+ *
1103
+ * Zero-configuration when paired with other helpers like REST, Playwright:
1104
+ *
1105
+ * ```js
1106
+ * // inside codecept.conf.js
1107
+ * {
1108
+ * helpers: {
1109
+ * Playwright: {...},
1110
+ * Expect: {},
1111
+ * }
1112
+ * }
1113
+ * ```
1114
+ *
1115
+ * ## Methods
1116
+ */
1117
+ class ExpectHelper {
1118
+ expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1119
+ expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1120
+ expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1121
+ expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1122
+ expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1123
+ expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1124
+ expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1125
+ expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1126
+ expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1127
+ expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1128
+ expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1129
+ /**
1130
+ * @param ajvOptions - Pass AJV options
1131
+ */
1132
+ expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions: any): Promise<any>;
1133
+ expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1134
+ expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1135
+ expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1136
+ expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1137
+ expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1138
+ expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1139
+ expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1140
+ expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1141
+ expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1142
+ expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1143
+ expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1144
+ expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1145
+ expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1146
+ expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1147
+ /**
1148
+ * expects members of two arrays are deeply equal
1149
+ */
1150
+ expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1151
+ /**
1152
+ * expects an array to be a superset of another array
1153
+ */
1154
+ expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1155
+ /**
1156
+ * expects members of two JSON objects are deeply equal excluding some properties
1157
+ */
1158
+ expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1159
+ /**
1160
+ * expects a JSON object matches a provided pattern
1161
+ */
1162
+ expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1163
+ }
1118
1164
  /**
1119
1165
  * Helper for testing filesystem.
1120
1166
  * Can be easily used to check file structures:
@@ -1145,7 +1191,7 @@ declare namespace CodeceptJS {
1145
1191
  */
1146
1192
  amInPath(openPath: string): Promise<any>;
1147
1193
  /**
1148
- * Writes test to file
1194
+ * Writes text to file
1149
1195
  */
1150
1196
  writeToFile(name: string, text: string): Promise<any>;
1151
1197
  /**
@@ -1293,6 +1339,21 @@ declare namespace CodeceptJS {
1293
1339
  * @param [options] - are additional query options
1294
1340
  */
1295
1341
  sendMutation(mutation: string, variables?: any, options?: any, headers?: any): Promise<any>;
1342
+ /**
1343
+ * Sets request headers for all requests of this test
1344
+ * @param headers - headers list
1345
+ */
1346
+ haveRequestHeaders(headers: any): Promise<any>;
1347
+ /**
1348
+ * Adds a header for Bearer authentication
1349
+ *
1350
+ * ```js
1351
+ * // we use secret function to hide token from logs
1352
+ * I.amBearerAuthenticated(secret('heregoestoken'))
1353
+ * ```
1354
+ * @param accessToken - Bearer access token
1355
+ */
1356
+ amBearerAuthenticated(accessToken: string | CodeceptJS.Secret): Promise<any>;
1296
1357
  }
1297
1358
  /**
1298
1359
  * Helper for managing remote data using GraphQL queries.
@@ -1655,16 +1716,16 @@ declare namespace CodeceptJS {
1655
1716
  *
1656
1717
  * I.seeResponseMatchesJsonSchema(joi => {
1657
1718
  * return joi.object({
1658
- * name: joi.string();
1659
- * id: joi.number();
1719
+ * name: joi.string(),
1720
+ * id: joi.number()
1660
1721
  * })
1661
1722
  * });
1662
1723
  *
1663
1724
  * // or pass a valid schema
1664
- * const joi = require('joi);
1725
+ * const joi = require('joi');
1665
1726
  *
1666
1727
  * I.seeResponseMatchesJsonSchema(joi.object({
1667
- * name: joi.string();
1728
+ * name: joi.string(),
1668
1729
  * id: joi.number();
1669
1730
  * });
1670
1731
  * ```
@@ -1757,7 +1818,6 @@ declare namespace CodeceptJS {
1757
1818
  * I.seeInTitle('Home Page');
1758
1819
  * ```
1759
1820
  * @param text - text value to check.
1760
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1761
1821
  */
1762
1822
  seeInTitle(text: string): Promise<any>;
1763
1823
  /**
@@ -1767,7 +1827,6 @@ declare namespace CodeceptJS {
1767
1827
  * I.dontSeeInTitle('Error');
1768
1828
  * ```
1769
1829
  * @param text - value to check.
1770
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1771
1830
  */
1772
1831
  dontSeeInTitle(text: string): Promise<any>;
1773
1832
  /**
@@ -1798,13 +1857,11 @@ declare namespace CodeceptJS {
1798
1857
  * I.seeInCurrentUrl('/register'); // we are on registration page
1799
1858
  * ```
1800
1859
  * @param url - a fragment to check
1801
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1802
1860
  */
1803
1861
  seeInCurrentUrl(url: string): Promise<any>;
1804
1862
  /**
1805
1863
  * Checks that current url does not contain a provided fragment.
1806
1864
  * @param url - value to check.
1807
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1808
1865
  */
1809
1866
  dontSeeInCurrentUrl(url: string): Promise<any>;
1810
1867
  /**
@@ -1817,7 +1874,6 @@ declare namespace CodeceptJS {
1817
1874
  * I.seeCurrentUrlEquals('http://my.site.com/register');
1818
1875
  * ```
1819
1876
  * @param url - value to check.
1820
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1821
1877
  */
1822
1878
  seeCurrentUrlEquals(url: string): Promise<any>;
1823
1879
  /**
@@ -1829,7 +1885,6 @@ declare namespace CodeceptJS {
1829
1885
  * I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also ok
1830
1886
  * ```
1831
1887
  * @param url - value to check.
1832
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1833
1888
  */
1834
1889
  dontSeeCurrentUrlEquals(url: string): Promise<any>;
1835
1890
  /**
@@ -1843,7 +1898,6 @@ declare namespace CodeceptJS {
1843
1898
  * ```
1844
1899
  * @param text - expected on page.
1845
1900
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
1846
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1847
1901
  */
1848
1902
  see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
1849
1903
  /**
@@ -1856,7 +1910,6 @@ declare namespace CodeceptJS {
1856
1910
  * ```
1857
1911
  * @param text - which is not present.
1858
1912
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
1859
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1860
1913
  */
1861
1914
  dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
1862
1915
  /**
@@ -1867,7 +1920,6 @@ declare namespace CodeceptJS {
1867
1920
  * I.seeElement('#modal');
1868
1921
  * ```
1869
1922
  * @param locator - located by CSS|XPath|strict locator.
1870
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1871
1923
  */
1872
1924
  seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
1873
1925
  /**
@@ -1877,7 +1929,6 @@ declare namespace CodeceptJS {
1877
1929
  * I.dontSeeElement('.modal'); // modal is not shown
1878
1930
  * ```
1879
1931
  * @param locator - located by CSS|XPath|Strict locator.
1880
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1881
1932
  */
1882
1933
  dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
1883
1934
  /**
@@ -1888,7 +1939,6 @@ declare namespace CodeceptJS {
1888
1939
  * I.seeElementInDOM('#modal');
1889
1940
  * ```
1890
1941
  * @param locator - element located by CSS|XPath|strict locator.
1891
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1892
1942
  */
1893
1943
  seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
1894
1944
  /**
@@ -1898,7 +1948,6 @@ declare namespace CodeceptJS {
1898
1948
  * I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
1899
1949
  * ```
1900
1950
  * @param locator - located by CSS|XPath|Strict locator.
1901
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1902
1951
  */
1903
1952
  dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
1904
1953
  /**
@@ -1908,7 +1957,6 @@ declare namespace CodeceptJS {
1908
1957
  * I.seeInSource('<h1>Green eggs &amp; ham</h1>');
1909
1958
  * ```
1910
1959
  * @param text - value to check.
1911
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1912
1960
  */
1913
1961
  seeInSource(text: string): Promise<any>;
1914
1962
  /**
@@ -1918,7 +1966,6 @@ declare namespace CodeceptJS {
1918
1966
  * I.dontSeeInSource('<!--'); // no comments in source
1919
1967
  * ```
1920
1968
  * @param value - to check.
1921
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1922
1969
  */
1923
1970
  dontSeeInSource(value: string): Promise<any>;
1924
1971
  /**
@@ -1931,7 +1978,6 @@ declare namespace CodeceptJS {
1931
1978
  * ```
1932
1979
  * @param locator - element located by CSS|XPath|strict locator.
1933
1980
  * @param num - number of elements.
1934
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1935
1981
  */
1936
1982
  seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
1937
1983
  /**
@@ -1943,7 +1989,6 @@ declare namespace CodeceptJS {
1943
1989
  * ```
1944
1990
  * @param locator - element located by CSS|XPath|strict locator.
1945
1991
  * @param num - number of elements.
1946
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1947
1992
  */
1948
1993
  seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
1949
1994
  /**
@@ -1981,7 +2026,6 @@ declare namespace CodeceptJS {
1981
2026
  * ```
1982
2027
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1983
2028
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1984
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
1985
2029
  */
1986
2030
  click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
1987
2031
  /**
@@ -1996,7 +2040,6 @@ declare namespace CodeceptJS {
1996
2040
  * ```
1997
2041
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1998
2042
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1999
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2000
2043
  */
2001
2044
  doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
2002
2045
  /**
@@ -2012,7 +2055,6 @@ declare namespace CodeceptJS {
2012
2055
  * ```
2013
2056
  * @param locator - clickable element located by CSS|XPath|strict locator.
2014
2057
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
2015
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2016
2058
  */
2017
2059
  rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
2018
2060
  /**
@@ -2026,7 +2068,6 @@ declare namespace CodeceptJS {
2026
2068
  * @param locator - located by CSS|XPath|strict locator.
2027
2069
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
2028
2070
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
2029
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2030
2071
  */
2031
2072
  moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
2032
2073
  /**
@@ -2054,7 +2095,7 @@ declare namespace CodeceptJS {
2054
2095
  * ```
2055
2096
  * @param fn - function to be executed in browser context.
2056
2097
  * @param args - to be passed to function.
2057
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2098
+ * @returns script return value
2058
2099
  *
2059
2100
  *
2060
2101
  * Wrapper for synchronous [evaluate](https://github.com/segmentio/nightmare#evaluatefn-arg1-arg2)
@@ -2083,7 +2124,7 @@ declare namespace CodeceptJS {
2083
2124
  * ```
2084
2125
  * @param fn - function to be executed in browser context.
2085
2126
  * @param args - to be passed to function.
2086
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2127
+ * @returns script return value
2087
2128
  *
2088
2129
  *
2089
2130
  * Wrapper for asynchronous [evaluate](https://github.com/segmentio/nightmare#evaluatefn-arg1-arg2).
@@ -2095,7 +2136,6 @@ declare namespace CodeceptJS {
2095
2136
  * First parameter can be set to `maximize`.
2096
2137
  * @param width - width in pixels or `maximize`.
2097
2138
  * @param height - height in pixels.
2098
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2099
2139
  */
2100
2140
  resizeWindow(width: number, height: number): Promise<any>;
2101
2141
  /**
@@ -2111,7 +2151,6 @@ declare namespace CodeceptJS {
2111
2151
  * ```
2112
2152
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
2113
2153
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
2114
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2115
2154
  */
2116
2155
  checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
2117
2156
  /**
@@ -2127,7 +2166,6 @@ declare namespace CodeceptJS {
2127
2166
  * ```
2128
2167
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
2129
2168
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
2130
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2131
2169
  */
2132
2170
  uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
2133
2171
  /**
@@ -2146,7 +2184,6 @@ declare namespace CodeceptJS {
2146
2184
  * ```
2147
2185
  * @param field - located by label|name|CSS|XPath|strict locator.
2148
2186
  * @param value - text value to fill.
2149
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2150
2187
  */
2151
2188
  fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
2152
2189
  /**
@@ -2158,7 +2195,6 @@ declare namespace CodeceptJS {
2158
2195
  * I.clearField('#email');
2159
2196
  * ```
2160
2197
  * @param editable - field located by label|name|CSS|XPath|strict locator.
2161
- * ⚠️ returns a _promise_ which is synchronized internally by recorder.
2162
2198
  */
2163
2199
  clearField(editable: LocatorOrString): Promise<any>;
2164
2200
  /**
@@ -2167,10 +2203,11 @@ declare namespace CodeceptJS {
2167
2203
  *
2168
2204
  * ```js
2169
2205
  * I.appendField('#myTextField', 'appended');
2206
+ * // typing secret
2207
+ * I.appendField('password', secret('123456'));
2170
2208
  * ```
2171
2209
  * @param field - located by label|name|CSS|XPath|strict locator
2172
2210
  * @param value - text value to append.
2173
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2174
2211
  */
2175
2212
  appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
2176
2213
  /**
@@ -2185,9 +2222,8 @@ declare namespace CodeceptJS {
2185
2222
  * ```
2186
2223
  * @param field - located by label|name|CSS|XPath|strict locator.
2187
2224
  * @param value - value to check.
2188
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2189
2225
  */
2190
- seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
2226
+ seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
2191
2227
  /**
2192
2228
  * Checks that value of input field or textarea doesn't equal to given value
2193
2229
  * Opposite to `seeInField`.
@@ -2198,9 +2234,8 @@ declare namespace CodeceptJS {
2198
2234
  * ```
2199
2235
  * @param field - located by label|name|CSS|XPath|strict locator.
2200
2236
  * @param value - value to check.
2201
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2202
2237
  */
2203
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
2238
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
2204
2239
  /**
2205
2240
  * Sends [input event](http://electron.atom.io/docs/api/web-contents/#webcontentssendinputeventevent) on a page.
2206
2241
  * Can submit special keys like 'Enter', 'Backspace', etc
@@ -2226,7 +2261,6 @@ declare namespace CodeceptJS {
2226
2261
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
2227
2262
  * ```
2228
2263
  * @param field - located by label|name|CSS|XPath|strict locator.
2229
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2230
2264
  */
2231
2265
  seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
2232
2266
  /**
@@ -2238,7 +2272,6 @@ declare namespace CodeceptJS {
2238
2272
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
2239
2273
  * ```
2240
2274
  * @param field - located by label|name|CSS|XPath|strict locator.
2241
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2242
2275
  */
2243
2276
  dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
2244
2277
  /**
@@ -2252,10 +2285,6 @@ declare namespace CodeceptJS {
2252
2285
  * ```
2253
2286
  * @param locator - field located by label|name|CSS|XPath|strict locator.
2254
2287
  * @param pathToFile - local file path relative to codecept.conf.ts or codecept.conf.js config file.
2255
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2256
- *
2257
- *
2258
- * 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))
2259
2288
  */
2260
2289
  attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
2261
2290
  /**
@@ -2386,7 +2415,6 @@ declare namespace CodeceptJS {
2386
2415
  * ```
2387
2416
  * @param select - field located by label|name|CSS|XPath|strict locator.
2388
2417
  * @param option - visible text or value of option.
2389
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2390
2418
  */
2391
2419
  selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
2392
2420
  /**
@@ -2404,11 +2432,6 @@ declare namespace CodeceptJS {
2404
2432
  * ]);
2405
2433
  * ```
2406
2434
  * @param cookie - a cookie object or array of cookie objects.
2407
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2408
- *
2409
- *
2410
- * Wrapper for `.cookies.set(cookie)`.
2411
- * [See more](https://github.com/segmentio/nightmare/blob/master/Readme.md#cookiessetcookie)
2412
2435
  */
2413
2436
  setCookie(cookie: Cookie | Cookie[]): Promise<any>;
2414
2437
  /**
@@ -2418,7 +2441,6 @@ declare namespace CodeceptJS {
2418
2441
  * I.seeCookie('Auth');
2419
2442
  * ```
2420
2443
  * @param name - cookie name.
2421
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2422
2444
  */
2423
2445
  seeCookie(name: string): Promise<any>;
2424
2446
  /**
@@ -2428,7 +2450,6 @@ declare namespace CodeceptJS {
2428
2450
  * I.dontSeeCookie('auth'); // no auth cookie
2429
2451
  * ```
2430
2452
  * @param name - cookie name.
2431
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2432
2453
  */
2433
2454
  dontSeeCookie(name: string): Promise<any>;
2434
2455
  /**
@@ -2441,24 +2462,17 @@ declare namespace CodeceptJS {
2441
2462
  * assert(cookie.value, '123456');
2442
2463
  * ```
2443
2464
  * @param [name = null] - cookie name.
2444
- * @returns attribute value
2445
- *
2446
- *
2447
- * Cookie in JSON format. If name not passed returns all cookies for this domain.
2448
- *
2449
- * Multiple cookies can be received by passing query object `I.grabCookie({ secure: true});`. If you'd like get all cookies for all urls, use: `.grabCookie({ url: null }).`
2450
2465
  */
2451
- grabCookie(name?: string): Promise<string> | Promise<string[]>;
2466
+ grabCookie(name?: string): Promise<any>;
2452
2467
  /**
2453
2468
  * Clears a cookie by name,
2454
2469
  * if none provided clears all cookies.
2455
2470
  *
2456
2471
  * ```js
2457
2472
  * I.clearCookie();
2458
- * I.clearCookie('test');
2473
+ * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
2459
2474
  * ```
2460
2475
  * @param [cookie = null] - (optional, `null` by default) cookie name
2461
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2462
2476
  */
2463
2477
  clearCookie(cookie?: string): Promise<any>;
2464
2478
  /**
@@ -2477,7 +2491,6 @@ declare namespace CodeceptJS {
2477
2491
  * @param fn - to be executed in browser context.
2478
2492
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
2479
2493
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
2480
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2481
2494
  */
2482
2495
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
2483
2496
  /**
@@ -2487,7 +2500,6 @@ declare namespace CodeceptJS {
2487
2500
  * I.wait(2); // wait 2 secs
2488
2501
  * ```
2489
2502
  * @param sec - number of second to wait.
2490
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2491
2503
  */
2492
2504
  wait(sec: number): Promise<any>;
2493
2505
  /**
@@ -2502,7 +2514,6 @@ declare namespace CodeceptJS {
2502
2514
  * @param text - to wait for.
2503
2515
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
2504
2516
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
2505
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2506
2517
  */
2507
2518
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
2508
2519
  /**
@@ -2514,7 +2525,6 @@ declare namespace CodeceptJS {
2514
2525
  * ```
2515
2526
  * @param locator - element located by CSS|XPath|strict locator.
2516
2527
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
2517
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2518
2528
  */
2519
2529
  waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
2520
2530
  /**
@@ -2526,7 +2536,6 @@ declare namespace CodeceptJS {
2526
2536
  * ```
2527
2537
  * @param locator - element located by CSS|XPath|strict locator.
2528
2538
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
2529
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2530
2539
  */
2531
2540
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
2532
2541
  /**
@@ -2538,7 +2547,6 @@ declare namespace CodeceptJS {
2538
2547
  * ```
2539
2548
  * @param locator - element located by CSS|XPath|strict locator.
2540
2549
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
2541
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2542
2550
  */
2543
2551
  waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
2544
2552
  /**
@@ -2551,7 +2559,6 @@ declare namespace CodeceptJS {
2551
2559
  * ```
2552
2560
  * @param locator - element located by CSS|XPath|strict locator.
2553
2561
  * @param [sec] - (optional, `1` by default) time in seconds to wait
2554
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2555
2562
  */
2556
2563
  waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
2557
2564
  /**
@@ -2563,7 +2570,6 @@ declare namespace CodeceptJS {
2563
2570
  * ```
2564
2571
  * @param locator - element located by CSS|XPath|strict locator.
2565
2572
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
2566
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2567
2573
  */
2568
2574
  waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
2569
2575
  /**
@@ -2572,7 +2578,6 @@ declare namespace CodeceptJS {
2572
2578
  * ```js
2573
2579
  * I.refreshPage();
2574
2580
  * ```
2575
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2576
2581
  */
2577
2582
  refreshPage(): Promise<any>;
2578
2583
  /**
@@ -2588,7 +2593,6 @@ declare namespace CodeceptJS {
2588
2593
  * ```
2589
2594
  * @param locator - element located by CSS|XPath|strict locator.
2590
2595
  * @param fileName - file name to save.
2591
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2592
2596
  */
2593
2597
  saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
2594
2598
  /**
@@ -2625,7 +2629,6 @@ declare namespace CodeceptJS {
2625
2629
  * ```
2626
2630
  * @param fileName - file name to save.
2627
2631
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
2628
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2629
2632
  */
2630
2633
  saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
2631
2634
  /**
@@ -2639,7 +2642,6 @@ declare namespace CodeceptJS {
2639
2642
  * @param locator - located by CSS|XPath|strict locator.
2640
2643
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
2641
2644
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
2642
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2643
2645
  */
2644
2646
  scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
2645
2647
  /**
@@ -2648,7 +2650,6 @@ declare namespace CodeceptJS {
2648
2650
  * ```js
2649
2651
  * I.scrollPageToTop();
2650
2652
  * ```
2651
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2652
2653
  */
2653
2654
  scrollPageToTop(): Promise<any>;
2654
2655
  /**
@@ -2657,7 +2658,6 @@ declare namespace CodeceptJS {
2657
2658
  * ```js
2658
2659
  * I.scrollPageToBottom();
2659
2660
  * ```
2660
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2661
2661
  */
2662
2662
  scrollPageToBottom(): Promise<any>;
2663
2663
  /**
@@ -2671,6 +2671,46 @@ declare namespace CodeceptJS {
2671
2671
  */
2672
2672
  grabPageScrollPosition(): Promise<PageScrollPosition>;
2673
2673
  }
2674
+ /**
2675
+ * OpenAI Helper for CodeceptJS.
2676
+ *
2677
+ * This helper class provides integration with the OpenAI GPT-3.5 or 4 language model for generating responses to questions or prompts within the context of web pages. It allows you to interact with the GPT-3.5 model to obtain intelligent responses based on HTML fragments or general prompts.
2678
+ * This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
2679
+ *
2680
+ * ## Configuration
2681
+ *
2682
+ * This helper should be configured in codecept.json or codecept.conf.js
2683
+ *
2684
+ * * `chunkSize`: (optional, default: 80000) - The maximum number of characters to send to the OpenAI API at once. We split HTML fragments by 8000 chars to not exceed token limit. Increase this value if you use GPT-4.
2685
+ */
2686
+ class OpenAITs {
2687
+ /**
2688
+ * Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
2689
+ *
2690
+ * ```js
2691
+ * I.askGptOnPage('what does this page do?');
2692
+ * ```
2693
+ * @param prompt - The question or prompt to ask the GPT model.
2694
+ * @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
2695
+ */
2696
+ askGptOnPage(prompt: string): Promise<string>;
2697
+ /**
2698
+ * Asks the OpenAI GPT-3.5 language model a question based on the provided prompt within the context of a specific HTML fragment on the current page.
2699
+ *
2700
+ * ```js
2701
+ * I.askGptOnPageFragment('describe features of this screen', '.screen');
2702
+ * ```
2703
+ * @param prompt - The question or prompt to ask the GPT-3.5 model.
2704
+ * @param locator - The locator or selector used to identify the HTML fragment on the page.
2705
+ * @returns - A Promise that resolves to the generated response from the GPT model.
2706
+ */
2707
+ askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
2708
+ /**
2709
+ * Send a general request to ChatGPT and return response.
2710
+ * @returns - A Promise that resolves to the generated response from the GPT model.
2711
+ */
2712
+ askGptGeneralPrompt(prompt: string): Promise<string>;
2713
+ }
2674
2714
  /**
2675
2715
  * Uses [Playwright](https://github.com/microsoft/playwright) library to run tests inside:
2676
2716
  *
@@ -2690,6 +2730,10 @@ declare namespace CodeceptJS {
2690
2730
  * npm i playwright-core@^1.18 --save
2691
2731
  * ```
2692
2732
  *
2733
+ * Breaking Changes: if you use Playwright v1.38 and later, it will no longer download browsers automatically.
2734
+ *
2735
+ * Run `npx playwright install` to download browsers after `npm install`.
2736
+ *
2693
2737
  * Using playwright-core package, will prevent the download of browser binaries and allow connecting to an existing browser installation or for connecting to a remote one.
2694
2738
  *
2695
2739
  *
@@ -2705,12 +2749,27 @@ declare namespace CodeceptJS {
2705
2749
  *
2706
2750
  * #### Trace Recording Customization
2707
2751
  *
2708
- * Trace recording provides a complete information on test execution and includes DOM snapshots, screenshots, and network requests logged during run.
2752
+ * Trace recording provides complete information on test execution and includes DOM snapshots, screenshots, and network requests logged during run.
2709
2753
  * Traces will be saved to `output/trace`
2710
2754
  *
2711
2755
  * * `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder
2712
2756
  * * `keepTraceForPassedTests`: - save trace for passed tests
2713
2757
  *
2758
+ * #### HAR Recording Customization
2759
+ *
2760
+ * A HAR file is an HTTP Archive file that contains a record of all the network requests that are made when a page is loaded.
2761
+ * It contains information about the request and response headers, cookies, content, timings, and more. You can use HAR files to mock network requests in your tests.
2762
+ * HAR will be saved to `output/har`. More info could be found here https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har.
2763
+ *
2764
+ * ```
2765
+ * ...
2766
+ * recordHar: {
2767
+ * mode: 'minimal', // possible values: 'minimal'|'full'.
2768
+ * content: 'embed' // possible values: "omit"|"embed"|"attach".
2769
+ * }
2770
+ * ...
2771
+ * ```
2772
+ *
2714
2773
  * #### Example #1: Wait for 0 network connections.
2715
2774
  *
2716
2775
  * ```js
@@ -2781,6 +2840,7 @@ declare namespace CodeceptJS {
2781
2840
  * url: "http://localhost",
2782
2841
  * show: true // headless mode not supported for extensions
2783
2842
  * chromium: {
2843
+ * // Note: due to this would launch persistent context, so to avoid the error when running tests with run-workers a timestamp would be appended to the defined folder name. For instance: playwright-tmp_1692715649511
2784
2844
  * userDataDir: '/tmp/playwright-tmp', // necessary to launch the browser in normal mode instead of incognito,
2785
2845
  * args: [
2786
2846
  * `--disable-extensions-except=${pathToExtension}`,
@@ -2835,6 +2895,22 @@ declare namespace CodeceptJS {
2835
2895
  * }
2836
2896
  * ```
2837
2897
  *
2898
+ * * #### Example #9: Launch electron test
2899
+ *
2900
+ * ```js
2901
+ * {
2902
+ * helpers: {
2903
+ * Playwright: {
2904
+ * browser: 'electron',
2905
+ * electron: {
2906
+ * executablePath: require("electron"),
2907
+ * args: [path.join('../', "main.js")],
2908
+ * },
2909
+ * }
2910
+ * },
2911
+ * }
2912
+ * ```
2913
+ *
2838
2914
  * Note: When connecting to remote browser `show` and specific `chrome` options (e.g. `headless` or `devtools`) are ignored.
2839
2915
  *
2840
2916
  * ## Access From Helpers
@@ -2868,7 +2944,7 @@ declare namespace CodeceptJS {
2868
2944
  * });
2869
2945
  * ```
2870
2946
  * @param description - used to show in logs.
2871
- * @param fn - async function that executed with Playwright helper as argumen
2947
+ * @param fn - async function that executed with Playwright helper as arguments
2872
2948
  */
2873
2949
  usePlaywrightTo(description: string, fn: (...params: any[]) => any): Promise<any>;
2874
2950
  /**
@@ -2911,7 +2987,6 @@ declare namespace CodeceptJS {
2911
2987
  * I.seeInPopup('Popup text');
2912
2988
  * ```
2913
2989
  * @param text - value to check.
2914
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2915
2990
  */
2916
2991
  seeInPopup(text: string): Promise<any>;
2917
2992
  /**
@@ -2954,15 +3029,8 @@ declare namespace CodeceptJS {
2954
3029
  */
2955
3030
  amOnPage(url: string): Promise<any>;
2956
3031
  /**
2957
- * Resize the current window to provided width and height.
2958
- * First parameter can be set to `maximize`.
2959
- * @param width - width in pixels or `maximize`.
2960
- * @param height - height in pixels.
2961
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
2962
- *
2963
- *
2964
3032
  * Unlike other drivers Playwright changes the size of a viewport, not the window!
2965
- * Playwright does not control the window of a browser so it can't adjust its real size.
3033
+ * Playwright does not control the window of a browser, so it can't adjust its real size.
2966
3034
  * It also can't maximize a window.
2967
3035
  *
2968
3036
  * Update configuration to change real window size on start:
@@ -2972,19 +3040,24 @@ declare namespace CodeceptJS {
2972
3040
  * // @codeceptjs/configure package must be installed
2973
3041
  * { setWindowSize } = require('@codeceptjs/configure');
2974
3042
  * ````
3043
+ *
3044
+ * Resize the current window to provided width and height.
3045
+ * First parameter can be set to `maximize`.
3046
+ * @param width - width in pixels or `maximize`.
3047
+ * @param height - height in pixels.
2975
3048
  */
2976
3049
  resizeWindow(width: number, height: number): Promise<any>;
2977
3050
  /**
2978
3051
  * Set headers for all next requests
2979
3052
  *
2980
3053
  * ```js
2981
- * I.haveRequestHeaders({
3054
+ * I.setPlaywrightRequestHeaders({
2982
3055
  * 'X-Sent-By': 'CodeceptJS',
2983
3056
  * });
2984
3057
  * ```
2985
3058
  * @param customHeaders - headers to set
2986
3059
  */
2987
- haveRequestHeaders(customHeaders: any): Promise<any>;
3060
+ setPlaywrightRequestHeaders(customHeaders: any): Promise<any>;
2988
3061
  /**
2989
3062
  * Moves cursor to element matched by locator.
2990
3063
  * Extra shift can be set with offsetX and offsetY options.
@@ -2996,26 +3069,69 @@ declare namespace CodeceptJS {
2996
3069
  * @param locator - located by CSS|XPath|strict locator.
2997
3070
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
2998
3071
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
2999
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3000
3072
  */
3001
3073
  moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
3002
3074
  /**
3003
- * Drag an item to a destination element.
3075
+ * Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.
3076
+ *
3077
+ * Examples:
3004
3078
  *
3005
3079
  * ```js
3006
- * I.dragAndDrop('#dragHandle', '#container');
3080
+ * I.dontSee('#add-to-cart-btn');
3081
+ * I.focus('#product-tile')
3082
+ * I.see('#add-to-cart-bnt');
3007
3083
  * ```
3008
- * @param srcElement - located by CSS|XPath|strict locator.
3009
- * @param destElement - located by CSS|XPath|strict locator.
3010
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3011
- * @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
3084
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
3085
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
3086
+ */
3087
+ focus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
3088
+ /**
3089
+ * Remove focus from a text input, button, etc.
3090
+ * Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
3091
+ *
3092
+ * Examples:
3012
3093
  *
3094
+ * ```js
3095
+ * I.blur('.text-area')
3096
+ * ```
3097
+ * ```js
3098
+ * //element `#product-tile` is focused
3099
+ * I.see('#add-to-cart-btn');
3100
+ * I.blur('#product-tile')
3101
+ * I.dontSee('#add-to-cart-btn');
3102
+ * ```
3103
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
3104
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
3105
+ */
3106
+ blur(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
3107
+ /**
3108
+ * Return the checked status of given element.
3109
+ * @param locator - element located by CSS|XPath|strict locator.
3110
+ * @param [options] - See https://playwright.dev/docs/api/class-locator#locator-is-checked
3111
+ */
3112
+ grabCheckedElementStatus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<boolean>;
3113
+ /**
3114
+ * Return the disabled status of given element.
3115
+ * @param locator - element located by CSS|XPath|strict locator.
3116
+ * @param [options] - See https://playwright.dev/docs/api/class-locator#locator-is-disabled
3117
+ */
3118
+ grabDisabledElementStatus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<boolean>;
3119
+ /**
3013
3120
  * ```js
3014
3121
  * // specify coordinates for source position
3015
3122
  * I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
3016
3123
  * ```
3017
3124
  *
3018
- * > By default option `force: true` is set
3125
+ * > When no option is set, custom drag and drop would be used, to use the dragAndDrop API from Playwright, please set options, for example `force: true`
3126
+ *
3127
+ * Drag an item to a destination element.
3128
+ *
3129
+ * ```js
3130
+ * I.dragAndDrop('#dragHandle', '#container');
3131
+ * ```
3132
+ * @param srcElement - located by CSS|XPath|strict locator.
3133
+ * @param destElement - located by CSS|XPath|strict locator.
3134
+ * @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
3019
3135
  */
3020
3136
  dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString, options?: any): Promise<any>;
3021
3137
  /**
@@ -3038,16 +3154,29 @@ declare namespace CodeceptJS {
3038
3154
  * ```js
3039
3155
  * I.refreshPage();
3040
3156
  * ```
3041
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3042
3157
  */
3043
3158
  refreshPage(): Promise<any>;
3159
+ /**
3160
+ * Replaying from HAR
3161
+ *
3162
+ * ```js
3163
+ * // Replay API requests from HAR.
3164
+ * // Either use a matching response from the HAR,
3165
+ * // or abort the request if nothing matches.
3166
+ * I.replayFromHar('./output/har/something.har', { url: "*\/**\/api/v1/fruits" });
3167
+ * I.amOnPage('https://demo.playwright.dev/api-mocking');
3168
+ * I.see('CodeceptJS');
3169
+ * ```
3170
+ * @param harFilePath - Path to recorded HAR file
3171
+ * @param [opts] - [Options for replaying from HAR](https://playwright.dev/docs/api/class-page#page-route-from-har)
3172
+ */
3173
+ replayFromHar(harFilePath: string, opts?: any): Promise<any>;
3044
3174
  /**
3045
3175
  * Scroll page to the top.
3046
3176
  *
3047
3177
  * ```js
3048
3178
  * I.scrollPageToTop();
3049
3179
  * ```
3050
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3051
3180
  */
3052
3181
  scrollPageToTop(): Promise<any>;
3053
3182
  /**
@@ -3056,7 +3185,6 @@ declare namespace CodeceptJS {
3056
3185
  * ```js
3057
3186
  * I.scrollPageToBottom();
3058
3187
  * ```
3059
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3060
3188
  */
3061
3189
  scrollPageToBottom(): Promise<any>;
3062
3190
  /**
@@ -3070,7 +3198,6 @@ declare namespace CodeceptJS {
3070
3198
  * @param locator - located by CSS|XPath|strict locator.
3071
3199
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
3072
3200
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
3073
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3074
3201
  */
3075
3202
  scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
3076
3203
  /**
@@ -3080,7 +3207,6 @@ declare namespace CodeceptJS {
3080
3207
  * I.seeInTitle('Home Page');
3081
3208
  * ```
3082
3209
  * @param text - text value to check.
3083
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3084
3210
  */
3085
3211
  seeInTitle(text: string): Promise<any>;
3086
3212
  /**
@@ -3100,7 +3226,6 @@ declare namespace CodeceptJS {
3100
3226
  * I.seeTitleEquals('Test title.');
3101
3227
  * ```
3102
3228
  * @param text - value to check.
3103
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3104
3229
  */
3105
3230
  seeTitleEquals(text: string): Promise<any>;
3106
3231
  /**
@@ -3110,7 +3235,6 @@ declare namespace CodeceptJS {
3110
3235
  * I.dontSeeInTitle('Error');
3111
3236
  * ```
3112
3237
  * @param text - value to check.
3113
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3114
3238
  */
3115
3239
  dontSeeInTitle(text: string): Promise<any>;
3116
3240
  /**
@@ -3133,7 +3257,16 @@ declare namespace CodeceptJS {
3133
3257
  */
3134
3258
  _locate(): Promise<any>;
3135
3259
  /**
3136
- * Find a checkbox by providing human readable text:
3260
+ * Get the first element by different locator types, including strict locator
3261
+ * Should be used in custom helpers:
3262
+ *
3263
+ * ```js
3264
+ * const element = await this.helpers['Playwright']._locateElement({name: 'password'});
3265
+ * ```
3266
+ */
3267
+ _locateElement(): Promise<any>;
3268
+ /**
3269
+ * Find a checkbox by providing human-readable text:
3137
3270
  * NOTE: Assumes the checkable element exists
3138
3271
  *
3139
3272
  * ```js
@@ -3142,7 +3275,7 @@ declare namespace CodeceptJS {
3142
3275
  */
3143
3276
  _locateCheckable(): Promise<any>;
3144
3277
  /**
3145
- * Find a clickable element by providing human readable text:
3278
+ * Find a clickable element by providing human-readable text:
3146
3279
  *
3147
3280
  * ```js
3148
3281
  * this.helpers['Playwright']._locateClickable('Next page').then // ...
@@ -3150,13 +3283,35 @@ declare namespace CodeceptJS {
3150
3283
  */
3151
3284
  _locateClickable(): Promise<any>;
3152
3285
  /**
3153
- * Find field elements by providing human readable text:
3286
+ * Find field elements by providing human-readable text:
3154
3287
  *
3155
3288
  * ```js
3156
3289
  * this.helpers['Playwright']._locateFields('Your email').then // ...
3157
3290
  * ```
3158
3291
  */
3159
3292
  _locateFields(): Promise<any>;
3293
+ /**
3294
+ * Grab WebElements for given locator
3295
+ * Resumes test execution, so **should be used inside an async function with `await`** operator.
3296
+ *
3297
+ * ```js
3298
+ * const webElements = await I.grabWebElements('#button');
3299
+ * ```
3300
+ * @param locator - element located by CSS|XPath|strict locator.
3301
+ * @returns WebElement of being used Web helper
3302
+ */
3303
+ grabWebElements(locator: CodeceptJS.LocatorOrString): Promise<any>;
3304
+ /**
3305
+ * Grab WebElement for given locator
3306
+ * Resumes test execution, so **should be used inside an async function with `await`** operator.
3307
+ *
3308
+ * ```js
3309
+ * const webElement = await I.grabWebElement('#button');
3310
+ * ```
3311
+ * @param locator - element located by CSS|XPath|strict locator.
3312
+ * @returns WebElement of being used Web helper
3313
+ */
3314
+ grabWebElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
3160
3315
  /**
3161
3316
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab
3162
3317
  *
@@ -3224,7 +3379,6 @@ declare namespace CodeceptJS {
3224
3379
  * I.seeElement('#modal');
3225
3380
  * ```
3226
3381
  * @param locator - located by CSS|XPath|strict locator.
3227
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3228
3382
  */
3229
3383
  seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
3230
3384
  /**
@@ -3234,7 +3388,6 @@ declare namespace CodeceptJS {
3234
3388
  * I.dontSeeElement('.modal'); // modal is not shown
3235
3389
  * ```
3236
3390
  * @param locator - located by CSS|XPath|Strict locator.
3237
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3238
3391
  */
3239
3392
  dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
3240
3393
  /**
@@ -3245,7 +3398,6 @@ declare namespace CodeceptJS {
3245
3398
  * I.seeElementInDOM('#modal');
3246
3399
  * ```
3247
3400
  * @param locator - element located by CSS|XPath|strict locator.
3248
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3249
3401
  */
3250
3402
  seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
3251
3403
  /**
@@ -3255,7 +3407,6 @@ declare namespace CodeceptJS {
3255
3407
  * I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
3256
3408
  * ```
3257
3409
  * @param locator - located by CSS|XPath|Strict locator.
3258
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3259
3410
  */
3260
3411
  dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
3261
3412
  /**
@@ -3296,13 +3447,7 @@ declare namespace CodeceptJS {
3296
3447
  * // using strict locator
3297
3448
  * I.click({css: 'nav a.login'});
3298
3449
  * ```
3299
- * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3300
- * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3301
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3302
- * @param [opts] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
3303
- *
3304
- * Examples:
3305
- *
3450
+ * @example
3306
3451
  * ```js
3307
3452
  * // click on element at position
3308
3453
  * I.click('canvas', '.model', { position: { x: 20, y: 40 } })
@@ -3310,8 +3455,11 @@ declare namespace CodeceptJS {
3310
3455
  * // make ctrl-click
3311
3456
  * I.click('.edit', null, { modifiers: ['Ctrl'] } )
3312
3457
  * ```
3458
+ * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3459
+ * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3460
+ * @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
3313
3461
  */
3314
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, opts?: any): Promise<any>;
3462
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, options?: any): Promise<any>;
3315
3463
  /**
3316
3464
  * Clicks link and waits for navigation (deprecated)
3317
3465
  */
@@ -3343,7 +3491,6 @@ declare namespace CodeceptJS {
3343
3491
  * ```
3344
3492
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3345
3493
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3346
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3347
3494
  */
3348
3495
  forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3349
3496
  /**
@@ -3358,7 +3505,6 @@ declare namespace CodeceptJS {
3358
3505
  * ```
3359
3506
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3360
3507
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3361
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3362
3508
  */
3363
3509
  doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3364
3510
  /**
@@ -3374,10 +3520,19 @@ declare namespace CodeceptJS {
3374
3520
  * ```
3375
3521
  * @param locator - clickable element located by CSS|XPath|strict locator.
3376
3522
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
3377
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3378
3523
  */
3379
3524
  rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3380
3525
  /**
3526
+ * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
3527
+ *
3528
+ * Examples:
3529
+ *
3530
+ * ```js
3531
+ * // click on element at position
3532
+ * I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3533
+ * ```
3534
+ * > ⚠️ To avoid flakiness, option `force: true` is set by default
3535
+ *
3381
3536
  * Selects a checkbox or radio button.
3382
3537
  * Element is located by label or name or CSS or XPath.
3383
3538
  *
@@ -3390,21 +3545,19 @@ declare namespace CodeceptJS {
3390
3545
  * ```
3391
3546
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
3392
3547
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
3393
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3394
- *
3395
- *
3396
- * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
3548
+ */
3549
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3550
+ /**
3551
+ * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
3397
3552
  *
3398
3553
  * Examples:
3399
3554
  *
3400
3555
  * ```js
3401
3556
  * // click on element at position
3402
- * I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3557
+ * I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3403
3558
  * ```
3404
3559
  * > ⚠️ To avoid flakiness, option `force: true` is set by default
3405
- */
3406
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3407
- /**
3560
+ *
3408
3561
  * Unselects a checkbox or radio button.
3409
3562
  * Element is located by label or name or CSS or XPath.
3410
3563
  *
@@ -3417,18 +3570,6 @@ declare namespace CodeceptJS {
3417
3570
  * ```
3418
3571
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
3419
3572
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
3420
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3421
- *
3422
- *
3423
- * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
3424
- *
3425
- * Examples:
3426
- *
3427
- * ```js
3428
- * // click on element at position
3429
- * I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3430
- * ```
3431
- * > ⚠️ To avoid flakiness, option `force: true` is set by default
3432
3573
  */
3433
3574
  uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3434
3575
  /**
@@ -3440,7 +3581,6 @@ declare namespace CodeceptJS {
3440
3581
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
3441
3582
  * ```
3442
3583
  * @param field - located by label|name|CSS|XPath|strict locator.
3443
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3444
3584
  */
3445
3585
  seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
3446
3586
  /**
@@ -3452,7 +3592,6 @@ declare namespace CodeceptJS {
3452
3592
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
3453
3593
  * ```
3454
3594
  * @param field - located by label|name|CSS|XPath|strict locator.
3455
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3456
3595
  */
3457
3596
  dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
3458
3597
  /**
@@ -3466,7 +3605,6 @@ declare namespace CodeceptJS {
3466
3605
  * I.pressKeyUp('Control');
3467
3606
  * ```
3468
3607
  * @param key - name of key to press down.
3469
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3470
3608
  */
3471
3609
  pressKeyDown(key: string): Promise<any>;
3472
3610
  /**
@@ -3480,10 +3618,11 @@ declare namespace CodeceptJS {
3480
3618
  * I.pressKeyUp('Control');
3481
3619
  * ```
3482
3620
  * @param key - name of key to release.
3483
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3484
3621
  */
3485
3622
  pressKeyUp(key: string): Promise<any>;
3486
3623
  /**
3624
+ * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
3625
+ *
3487
3626
  * Presses a key in the browser (on a focused element).
3488
3627
  *
3489
3628
  * _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
@@ -3542,10 +3681,6 @@ declare namespace CodeceptJS {
3542
3681
  * - `'Space'`
3543
3682
  * - `'Tab'`
3544
3683
  * @param key - key or array of keys to press.
3545
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3546
- *
3547
- *
3548
- * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
3549
3684
  */
3550
3685
  pressKey(key: string | string[]): Promise<any>;
3551
3686
  /**
@@ -3562,10 +3697,12 @@ declare namespace CodeceptJS {
3562
3697
  *
3563
3698
  * // passing in an array
3564
3699
  * I.type(['T', 'E', 'X', 'T']);
3700
+ *
3701
+ * // passing a secret
3702
+ * I.type(secret('123456'));
3565
3703
  * ```
3566
3704
  * @param key - or array of keys to type.
3567
3705
  * @param [delay = null] - (optional) delay in ms between key presses
3568
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3569
3706
  */
3570
3707
  type(key: string | string[], delay?: number): Promise<any>;
3571
3708
  /**
@@ -3584,31 +3721,36 @@ declare namespace CodeceptJS {
3584
3721
  * ```
3585
3722
  * @param field - located by label|name|CSS|XPath|strict locator.
3586
3723
  * @param value - text value to fill.
3587
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3588
3724
  */
3589
3725
  fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
3590
3726
  /**
3591
- * Clears a `<textarea>` or text `<input>` element's value.
3727
+ * Clears the text input element: `<input>`, `<textarea>` or `[contenteditable]` .
3728
+ *
3729
+ *
3730
+ * Examples:
3592
3731
  *
3593
3732
  * ```js
3594
- * I.clearField('Email');
3595
- * I.clearField('user[email]');
3596
- * I.clearField('#email');
3733
+ * I.clearField('.text-area')
3734
+ *
3735
+ * // if this doesn't work use force option
3736
+ * I.clearField('#submit', { force: true })
3597
3737
  * ```
3598
- * @param editable - field located by label|name|CSS|XPath|strict locator.
3599
- * ⚠️ returns a _promise_ which is synchronized internally by recorder.
3738
+ * Use `force` to bypass the [actionability](https://playwright.dev/docs/actionability) checks.
3739
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
3740
+ * @param [options] - [Additional options](https://playwright.dev/docs/api/class-locator#locator-clear) for available options object as 2nd argument.
3600
3741
  */
3601
- clearField(editable: LocatorOrString): Promise<any>;
3742
+ clearField(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
3602
3743
  /**
3603
3744
  * Appends text to a input field or textarea.
3604
3745
  * Field is located by name, label, CSS or XPath
3605
3746
  *
3606
3747
  * ```js
3607
3748
  * I.appendField('#myTextField', 'appended');
3749
+ * // typing secret
3750
+ * I.appendField('password', secret('123456'));
3608
3751
  * ```
3609
3752
  * @param field - located by label|name|CSS|XPath|strict locator
3610
3753
  * @param value - text value to append.
3611
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3612
3754
  */
3613
3755
  appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
3614
3756
  /**
@@ -3623,9 +3765,8 @@ declare namespace CodeceptJS {
3623
3765
  * ```
3624
3766
  * @param field - located by label|name|CSS|XPath|strict locator.
3625
3767
  * @param value - value to check.
3626
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3627
3768
  */
3628
- seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
3769
+ seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
3629
3770
  /**
3630
3771
  * Checks that value of input field or textarea doesn't equal to given value
3631
3772
  * Opposite to `seeInField`.
@@ -3636,9 +3777,8 @@ declare namespace CodeceptJS {
3636
3777
  * ```
3637
3778
  * @param field - located by label|name|CSS|XPath|strict locator.
3638
3779
  * @param value - value to check.
3639
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3640
3780
  */
3641
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
3781
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
3642
3782
  /**
3643
3783
  * Attaches a file to element located by label, name, CSS or XPath
3644
3784
  * Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
@@ -3650,7 +3790,6 @@ declare namespace CodeceptJS {
3650
3790
  * ```
3651
3791
  * @param locator - field located by label|name|CSS|XPath|strict locator.
3652
3792
  * @param pathToFile - local file path relative to codecept.conf.ts or codecept.conf.js config file.
3653
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3654
3793
  */
3655
3794
  attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
3656
3795
  /**
@@ -3674,7 +3813,6 @@ declare namespace CodeceptJS {
3674
3813
  * ```
3675
3814
  * @param select - field located by label|name|CSS|XPath|strict locator.
3676
3815
  * @param option - visible text or value of option.
3677
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3678
3816
  */
3679
3817
  selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
3680
3818
  /**
@@ -3695,13 +3833,11 @@ declare namespace CodeceptJS {
3695
3833
  * I.seeInCurrentUrl('/register'); // we are on registration page
3696
3834
  * ```
3697
3835
  * @param url - a fragment to check
3698
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3699
3836
  */
3700
3837
  seeInCurrentUrl(url: string): Promise<any>;
3701
3838
  /**
3702
3839
  * Checks that current url does not contain a provided fragment.
3703
3840
  * @param url - value to check.
3704
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3705
3841
  */
3706
3842
  dontSeeInCurrentUrl(url: string): Promise<any>;
3707
3843
  /**
@@ -3714,7 +3850,6 @@ declare namespace CodeceptJS {
3714
3850
  * I.seeCurrentUrlEquals('http://my.site.com/register');
3715
3851
  * ```
3716
3852
  * @param url - value to check.
3717
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3718
3853
  */
3719
3854
  seeCurrentUrlEquals(url: string): Promise<any>;
3720
3855
  /**
@@ -3726,7 +3861,6 @@ declare namespace CodeceptJS {
3726
3861
  * I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also ok
3727
3862
  * ```
3728
3863
  * @param url - value to check.
3729
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3730
3864
  */
3731
3865
  dontSeeCurrentUrlEquals(url: string): Promise<any>;
3732
3866
  /**
@@ -3740,7 +3874,6 @@ declare namespace CodeceptJS {
3740
3874
  * ```
3741
3875
  * @param text - expected on page.
3742
3876
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
3743
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3744
3877
  */
3745
3878
  see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
3746
3879
  /**
@@ -3751,7 +3884,6 @@ declare namespace CodeceptJS {
3751
3884
  * ```
3752
3885
  * @param text - element value to check.
3753
3886
  * @param [context = null] - element located by CSS|XPath|strict locator.
3754
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3755
3887
  */
3756
3888
  seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
3757
3889
  /**
@@ -3764,7 +3896,6 @@ declare namespace CodeceptJS {
3764
3896
  * ```
3765
3897
  * @param text - which is not present.
3766
3898
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
3767
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3768
3899
  */
3769
3900
  dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
3770
3901
  /**
@@ -3806,7 +3937,6 @@ declare namespace CodeceptJS {
3806
3937
  * I.seeInSource('<h1>Green eggs &amp; ham</h1>');
3807
3938
  * ```
3808
3939
  * @param text - value to check.
3809
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3810
3940
  */
3811
3941
  seeInSource(text: string): Promise<any>;
3812
3942
  /**
@@ -3816,7 +3946,6 @@ declare namespace CodeceptJS {
3816
3946
  * I.dontSeeInSource('<!--'); // no comments in source
3817
3947
  * ```
3818
3948
  * @param value - to check.
3819
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3820
3949
  */
3821
3950
  dontSeeInSource(value: string): Promise<any>;
3822
3951
  /**
@@ -3829,7 +3958,6 @@ declare namespace CodeceptJS {
3829
3958
  * ```
3830
3959
  * @param locator - element located by CSS|XPath|strict locator.
3831
3960
  * @param num - number of elements.
3832
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3833
3961
  */
3834
3962
  seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
3835
3963
  /**
@@ -3841,7 +3969,6 @@ declare namespace CodeceptJS {
3841
3969
  * ```
3842
3970
  * @param locator - element located by CSS|XPath|strict locator.
3843
3971
  * @param num - number of elements.
3844
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3845
3972
  */
3846
3973
  seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
3847
3974
  /**
@@ -3859,7 +3986,6 @@ declare namespace CodeceptJS {
3859
3986
  * ]);
3860
3987
  * ```
3861
3988
  * @param cookie - a cookie object or array of cookie objects.
3862
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3863
3989
  */
3864
3990
  setCookie(cookie: Cookie | Cookie[]): Promise<any>;
3865
3991
  /**
@@ -3869,7 +3995,6 @@ declare namespace CodeceptJS {
3869
3995
  * I.seeCookie('Auth');
3870
3996
  * ```
3871
3997
  * @param name - cookie name.
3872
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3873
3998
  */
3874
3999
  seeCookie(name: string): Promise<any>;
3875
4000
  /**
@@ -3879,10 +4004,11 @@ declare namespace CodeceptJS {
3879
4004
  * I.dontSeeCookie('auth'); // no auth cookie
3880
4005
  * ```
3881
4006
  * @param name - cookie name.
3882
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3883
4007
  */
3884
4008
  dontSeeCookie(name: string): Promise<any>;
3885
4009
  /**
4010
+ * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
4011
+ *
3886
4012
  * Gets a cookie object by name.
3887
4013
  * If none provided gets all cookies.
3888
4014
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -3892,22 +4018,17 @@ declare namespace CodeceptJS {
3892
4018
  * assert(cookie.value, '123456');
3893
4019
  * ```
3894
4020
  * @param [name = null] - cookie name.
3895
- * @returns attribute value
3896
- *
3897
- *
3898
- * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
3899
4021
  */
3900
- grabCookie(name?: string): Promise<string> | Promise<string[]>;
4022
+ grabCookie(name?: string): Promise<any>;
3901
4023
  /**
3902
4024
  * Clears a cookie by name,
3903
4025
  * if none provided clears all cookies.
3904
4026
  *
3905
4027
  * ```js
3906
4028
  * I.clearCookie();
3907
- * I.clearCookie('test');
4029
+ * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
3908
4030
  * ```
3909
4031
  * @param [cookie = null] - (optional, `null` by default) cookie name
3910
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
3911
4032
  */
3912
4033
  clearCookie(cookie?: string): Promise<any>;
3913
4034
  /**
@@ -3922,8 +4043,8 @@ declare namespace CodeceptJS {
3922
4043
  * ```js
3923
4044
  * I.executeScript(({x, y}) => x + y, {x, y});
3924
4045
  * ```
3925
- * You can pass only one parameter into a function
3926
- * but you can pass in array or object.
4046
+ * You can pass only one parameter into a function,
4047
+ * or you can pass in array or object.
3927
4048
  *
3928
4049
  * ```js
3929
4050
  * I.executeScript(([x, y]) => x + y, [x, y]);
@@ -4039,7 +4160,6 @@ declare namespace CodeceptJS {
4039
4160
  * ```
4040
4161
  * @param locator - located by CSS|XPath|strict locator.
4041
4162
  * @param cssProperties - object with CSS properties and their values to check.
4042
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4043
4163
  */
4044
4164
  seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
4045
4165
  /**
@@ -4050,7 +4170,6 @@ declare namespace CodeceptJS {
4050
4170
  * ```
4051
4171
  * @param locator - located by CSS|XPath|strict locator.
4052
4172
  * @param attributes - attributes and their values to check.
4053
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4054
4173
  */
4055
4174
  seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
4056
4175
  /**
@@ -4063,7 +4182,6 @@ declare namespace CodeceptJS {
4063
4182
  * ```
4064
4183
  * @param locator - located by label|name|CSS|XPath|strict locator.
4065
4184
  * @param offsetX - position to drag.
4066
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4067
4185
  */
4068
4186
  dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): Promise<any>;
4069
4187
  /**
@@ -4100,7 +4218,6 @@ declare namespace CodeceptJS {
4100
4218
  * ```
4101
4219
  * @param locator - element located by CSS|XPath|strict locator.
4102
4220
  * @param fileName - file name to save.
4103
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4104
4221
  */
4105
4222
  saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
4106
4223
  /**
@@ -4114,7 +4231,6 @@ declare namespace CodeceptJS {
4114
4231
  * ```
4115
4232
  * @param fileName - file name to save.
4116
4233
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
4117
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4118
4234
  */
4119
4235
  saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
4120
4236
  /**
@@ -4141,7 +4257,6 @@ declare namespace CodeceptJS {
4141
4257
  * I.wait(2); // wait 2 secs
4142
4258
  * ```
4143
4259
  * @param sec - number of second to wait.
4144
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4145
4260
  */
4146
4261
  wait(sec: number): Promise<any>;
4147
4262
  /**
@@ -4149,7 +4264,6 @@ declare namespace CodeceptJS {
4149
4264
  * Element can be located by CSS or XPath.
4150
4265
  * @param locator - element located by CSS|XPath|strict locator.
4151
4266
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
4152
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4153
4267
  */
4154
4268
  waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4155
4269
  /**
@@ -4161,7 +4275,6 @@ declare namespace CodeceptJS {
4161
4275
  * @param field - input field.
4162
4276
  * @param value - expected value.
4163
4277
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4164
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4165
4278
  */
4166
4279
  waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
4167
4280
  /**
@@ -4173,7 +4286,6 @@ declare namespace CodeceptJS {
4173
4286
  * @param locator - element located by CSS|XPath|strict locator.
4174
4287
  * @param num - number of elements.
4175
4288
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4176
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4177
4289
  */
4178
4290
  waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
4179
4291
  /**
@@ -4186,7 +4298,6 @@ declare namespace CodeceptJS {
4186
4298
  * ```
4187
4299
  * @param locator - element located by CSS|XPath|strict locator.
4188
4300
  * @param [sec] - (optional, `1` by default) time in seconds to wait
4189
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4190
4301
  */
4191
4302
  waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4192
4303
  /**
@@ -4199,10 +4310,11 @@ declare namespace CodeceptJS {
4199
4310
  * ```
4200
4311
  * @param locator - element located by CSS|XPath|strict locator.
4201
4312
  * @param [sec] - (optional, `1` by default) time in seconds to wait
4202
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4203
4313
  */
4204
4314
  waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4205
4315
  /**
4316
+ * This method accepts [React selectors](https://codecept.io/react).
4317
+ *
4206
4318
  * Waits for an element to become visible on a page (by default waits for 1sec).
4207
4319
  * Element can be located by CSS or XPath.
4208
4320
  *
@@ -4211,10 +4323,6 @@ declare namespace CodeceptJS {
4211
4323
  * ```
4212
4324
  * @param locator - element located by CSS|XPath|strict locator.
4213
4325
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4214
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4215
- *
4216
- *
4217
- * This method accepts [React selectors](https://codecept.io/react).
4218
4326
  */
4219
4327
  waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4220
4328
  /**
@@ -4226,7 +4334,6 @@ declare namespace CodeceptJS {
4226
4334
  * ```
4227
4335
  * @param locator - element located by CSS|XPath|strict locator.
4228
4336
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4229
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4230
4337
  */
4231
4338
  waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4232
4339
  /**
@@ -4238,9 +4345,18 @@ declare namespace CodeceptJS {
4238
4345
  * ```
4239
4346
  * @param locator - element located by CSS|XPath|strict locator.
4240
4347
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4241
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4242
4348
  */
4243
4349
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4350
+ /**
4351
+ * Waits for number of tabs.
4352
+ *
4353
+ * ```js
4354
+ * I.waitForNumberOfTabs(2);
4355
+ * ```
4356
+ * @param expectedTabs - expecting the number of tabs.
4357
+ * @param sec - number of secs to wait.
4358
+ */
4359
+ waitForNumberOfTabs(expectedTabs: number, sec: number): Promise<any>;
4244
4360
  /**
4245
4361
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
4246
4362
  *
@@ -4249,7 +4365,6 @@ declare namespace CodeceptJS {
4249
4365
  * ```
4250
4366
  * @param urlPart - value to check.
4251
4367
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4252
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4253
4368
  */
4254
4369
  waitInUrl(urlPart: string, sec?: number): Promise<any>;
4255
4370
  /**
@@ -4261,7 +4376,6 @@ declare namespace CodeceptJS {
4261
4376
  * ```
4262
4377
  * @param urlPart - value to check.
4263
4378
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4264
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4265
4379
  */
4266
4380
  waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
4267
4381
  /**
@@ -4276,7 +4390,6 @@ declare namespace CodeceptJS {
4276
4390
  * @param text - to wait for.
4277
4391
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4278
4392
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
4279
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4280
4393
  */
4281
4394
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
4282
4395
  /**
@@ -4307,7 +4420,6 @@ declare namespace CodeceptJS {
4307
4420
  * I.switchTo(); // switch back to main page
4308
4421
  * ```
4309
4422
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
4310
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4311
4423
  */
4312
4424
  switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
4313
4425
  /**
@@ -4326,15 +4438,21 @@ declare namespace CodeceptJS {
4326
4438
  * @param fn - to be executed in browser context.
4327
4439
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
4328
4440
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
4329
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4330
4441
  */
4331
4442
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
4332
4443
  /**
4333
- * Waits for navigation to finish. By default takes configured `waitForNavigation` option.
4444
+ * Waits for navigation to finish. By default, it takes configured `waitForNavigation` option.
4334
4445
  *
4335
4446
  * See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions)
4336
4447
  */
4337
- waitForNavigation(opts: any): Promise<any>;
4448
+ waitForNavigation(options: any): Promise<any>;
4449
+ /**
4450
+ * Waits for page navigates to a new URL or reloads. By default, it takes configured `waitForNavigation` option.
4451
+ *
4452
+ * See [Playwright's reference](https://playwright.dev/docs/api/class-page#page-wait-for-url)
4453
+ * @param url - A glob pattern, regex pattern or predicate receiving URL to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string.
4454
+ */
4455
+ waitForURL(url: string | RegExp, options: any): Promise<any>;
4338
4456
  /**
4339
4457
  * Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
4340
4458
  * Element can be located by CSS or XPath.
@@ -4344,7 +4462,6 @@ declare namespace CodeceptJS {
4344
4462
  * ```
4345
4463
  * @param locator - element located by CSS|XPath|strict locator.
4346
4464
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4347
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4348
4465
  */
4349
4466
  waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4350
4467
  /**
@@ -4367,7 +4484,6 @@ declare namespace CodeceptJS {
4367
4484
  * loadEventEnd: 241
4368
4485
  * }
4369
4486
  * ```
4370
- * @returns automatically synchronized promise through #recorder
4371
4487
  */
4372
4488
  grabDataFromPerformanceTiming(): Promise<any>;
4373
4489
  /**
@@ -4416,42 +4532,222 @@ declare namespace CodeceptJS {
4416
4532
  * @param [handler] - a function to process reques
4417
4533
  */
4418
4534
  stopMockingRoute(url?: string | RegExp, handler?: (...params: any[]) => any): Promise<any>;
4419
- }
4420
- /**
4421
- * This helper works the same as MockRequest helper. It has been included for backwards compatibility
4422
- * reasons. So use MockRequest helper instead of this.
4423
- *
4424
- * Please refer to MockRequest helper documentation for details.
4425
- *
4426
- * ### Installations
4427
- *
4428
- * Requires [Polly.js](https://netflix.github.io/pollyjs/#/) library by Netflix installed
4429
- *
4430
- * ```
4431
- * npm i @pollyjs/core @pollyjs/adapter-puppeteer --save-dev
4432
- * ```
4433
- *
4434
- * Requires Puppeteer helper or WebDriver helper enabled
4435
- *
4436
- * ### Configuration
4437
- *
4438
- * Just enable helper in config file:
4439
- *
4440
- * ```js
4441
- * helpers: {
4442
- * Puppeteer: {
4443
- * // regular Puppeteer config here
4444
- * },
4445
- * Polly: {}
4446
- * }
4447
- * ```
4448
- * The same can be done when using WebDriver helper..
4449
- *
4450
- * ### Usage
4451
- *
4452
- * Use `I.mockRequest` to intercept and mock requests.
4453
- */
4454
- class PollyTs {
4535
+ /**
4536
+ * Starts recording the network traffics.
4537
+ * This also resets recorded network requests.
4538
+ *
4539
+ * ```js
4540
+ * I.startRecordingTraffic();
4541
+ * ```
4542
+ */
4543
+ startRecordingTraffic(): Promise<any>;
4544
+ /**
4545
+ * Grab the recording network traffics
4546
+ *
4547
+ * ```js
4548
+ * const traffics = await I.grabRecordedNetworkTraffics();
4549
+ * expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
4550
+ * expect(traffics[0].response.status).to.equal(200);
4551
+ * expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
4552
+ * ```
4553
+ */
4554
+ grabRecordedNetworkTraffics(): Promise<any[]>;
4555
+ /**
4556
+ * Blocks traffic of a given URL or a list of URLs.
4557
+ *
4558
+ * Examples:
4559
+ *
4560
+ * ```js
4561
+ * I.blockTraffic('http://example.com/css/style.css');
4562
+ * I.blockTraffic('http://example.com/css/*.css');
4563
+ * I.blockTraffic('http://example.com/**');
4564
+ * I.blockTraffic(/\.css$/);
4565
+ * ```
4566
+ *
4567
+ * ```js
4568
+ * I.blockTraffic(['http://example.com/css/style.css', 'http://example.com/css/*.css']);
4569
+ * ```
4570
+ * @param urls - URL or a list of URLs to block . URL can contain * for wildcards. Example: https://www.example.com** to block all traffic for that domain. Regexp are also supported.
4571
+ */
4572
+ blockTraffic(urls: string | any[] | RegExp): Promise<any>;
4573
+ /**
4574
+ * Mocks traffic for URL(s).
4575
+ * This is a powerful feature to manipulate network traffic. Can be used e.g. to stabilize your tests, speed up your tests or as a last resort to make some test scenarios even possible.
4576
+ *
4577
+ * Examples:
4578
+ *
4579
+ * ```js
4580
+ * I.mockTraffic('/api/users/1', '{ id: 1, name: 'John Doe' }');
4581
+ * I.mockTraffic('/api/users/*', JSON.stringify({ id: 1, name: 'John Doe' }));
4582
+ * I.mockTraffic([/^https://api.example.com/v1/, 'https://api.example.com/v2/**'], 'Internal Server Error', 'text/html');
4583
+ * ```
4584
+ * @param urls - string|Array These are the URL(s) to mock, e.g. "/fooapi/*" or "['/fooapi_1/*', '/barapi_2/*']". Regular expressions are also supported.
4585
+ * @param responseString - string The string to return in fake response's body.
4586
+ * @param contentType - Content type of fake response. If not specified default value 'application/json' is used.
4587
+ */
4588
+ mockTraffic(urls: any, responseString: any, contentType?: any): Promise<any>;
4589
+ /**
4590
+ * Resets all recorded network requests.
4591
+ */
4592
+ flushNetworkTraffics(): Promise<any>;
4593
+ /**
4594
+ * Stops recording of network traffic. Recorded traffic is not flashed.
4595
+ *
4596
+ * ```js
4597
+ * I.stopRecordingTraffic();
4598
+ * ```
4599
+ */
4600
+ stopRecordingTraffic(): Promise<any>;
4601
+ /**
4602
+ * Verifies that a certain request is part of network traffic.
4603
+ *
4604
+ * ```js
4605
+ * // checking the request url contains certain query strings
4606
+ * I.amOnPage('https://openai.com/blog/chatgpt');
4607
+ * I.startRecordingTraffic();
4608
+ * await I.seeTraffic({
4609
+ * name: 'sentry event',
4610
+ * url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
4611
+ * parameters: {
4612
+ * width: '1919',
4613
+ * height: '1138',
4614
+ * },
4615
+ * });
4616
+ * ```
4617
+ *
4618
+ * ```js
4619
+ * // checking the request url contains certain post data
4620
+ * I.amOnPage('https://openai.com/blog/chatgpt');
4621
+ * I.startRecordingTraffic();
4622
+ * await I.seeTraffic({
4623
+ * name: 'event',
4624
+ * url: 'https://cloudflareinsights.com/cdn-cgi/rum',
4625
+ * requestPostData: {
4626
+ * st: 2,
4627
+ * },
4628
+ * });
4629
+ * ```
4630
+ * @param opts - options when checking the traffic network.
4631
+ * @param opts.name - A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
4632
+ * @param opts.url - Expected URL of request in network traffic
4633
+ * @param [opts.parameters] - Expected parameters of that request in network traffic
4634
+ * @param [opts.requestPostData] - Expected that request contains post data in network traffic
4635
+ * @param [opts.timeout] - Timeout to wait for request in seconds. Default is 10 seconds.
4636
+ */
4637
+ seeTraffic(opts: {
4638
+ name: string;
4639
+ url: string;
4640
+ parameters?: any;
4641
+ requestPostData?: any;
4642
+ timeout?: number;
4643
+ }): Promise<any>;
4644
+ /**
4645
+ * Returns full URL of request matching parameter "urlMatch".
4646
+ * @param urlMatch - Expected URL of request in network traffic. Can be a string or a regular expression.
4647
+ *
4648
+ * Examples:
4649
+ *
4650
+ * ```js
4651
+ * I.grabTrafficUrl('https://api.example.com/session');
4652
+ * I.grabTrafficUrl(/session.*start/);
4653
+ * ```
4654
+ */
4655
+ grabTrafficUrl(urlMatch: string | RegExp): Promise<any>;
4656
+ /**
4657
+ * Verifies that a certain request is not part of network traffic.
4658
+ *
4659
+ * Examples:
4660
+ *
4661
+ * ```js
4662
+ * I.dontSeeTraffic({ name: 'Unexpected API Call', url: 'https://api.example.com' });
4663
+ * I.dontSeeTraffic({ name: 'Unexpected API Call of "user" endpoint', url: /api.example.com.*user/ });
4664
+ * ```
4665
+ * @param opts - options when checking the traffic network.
4666
+ * @param opts.name - A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
4667
+ * @param opts.url - Expected URL of request in network traffic. Can be a string or a regular expression.
4668
+ */
4669
+ dontSeeTraffic(opts: {
4670
+ name: string;
4671
+ url: string | RegExp;
4672
+ }): Promise<any>;
4673
+ /**
4674
+ * Starts recording of websocket messages.
4675
+ * This also resets recorded websocket messages.
4676
+ *
4677
+ * ```js
4678
+ * await I.startRecordingWebSocketMessages();
4679
+ * ```
4680
+ */
4681
+ startRecordingWebSocketMessages(): Promise<any>;
4682
+ /**
4683
+ * Stops recording WS messages. Recorded WS messages is not flashed.
4684
+ *
4685
+ * ```js
4686
+ * await I.stopRecordingWebSocketMessages();
4687
+ * ```
4688
+ */
4689
+ stopRecordingWebSocketMessages(): Promise<any>;
4690
+ /**
4691
+ * Grab the recording WS messages
4692
+ */
4693
+ grabWebSocketMessages(): Promise<any>;
4694
+ /**
4695
+ * Resets all recorded WS messages.
4696
+ */
4697
+ flushWebSocketMessages(): Promise<any>;
4698
+ /**
4699
+ * Return a performance metric from the chrome cdp session.
4700
+ * Note: Chrome-only
4701
+ *
4702
+ * Examples:
4703
+ *
4704
+ * ```js
4705
+ * const metrics = await I.grabMetrics();
4706
+ *
4707
+ * // returned metrics
4708
+ *
4709
+ * [
4710
+ * { name: 'Timestamp', value: 1584904.203473 },
4711
+ * { name: 'AudioHandlers', value: 0 },
4712
+ * { name: 'AudioWorkletProcessors', value: 0 },
4713
+ * { name: 'Documents', value: 22 },
4714
+ * { name: 'Frames', value: 10 },
4715
+ * { name: 'JSEventListeners', value: 366 },
4716
+ * { name: 'LayoutObjects', value: 1240 },
4717
+ * { name: 'MediaKeySessions', value: 0 },
4718
+ * { name: 'MediaKeys', value: 0 },
4719
+ * { name: 'Nodes', value: 4505 },
4720
+ * { name: 'Resources', value: 141 },
4721
+ * { name: 'ContextLifecycleStateObservers', value: 34 },
4722
+ * { name: 'V8PerContextDatas', value: 4 },
4723
+ * { name: 'WorkerGlobalScopes', value: 0 },
4724
+ * { name: 'UACSSResources', value: 0 },
4725
+ * { name: 'RTCPeerConnections', value: 0 },
4726
+ * { name: 'ResourceFetchers', value: 22 },
4727
+ * { name: 'AdSubframes', value: 0 },
4728
+ * { name: 'DetachedScriptStates', value: 2 },
4729
+ * { name: 'ArrayBufferContents', value: 1 },
4730
+ * { name: 'LayoutCount', value: 0 },
4731
+ * { name: 'RecalcStyleCount', value: 0 },
4732
+ * { name: 'LayoutDuration', value: 0 },
4733
+ * { name: 'RecalcStyleDuration', value: 0 },
4734
+ * { name: 'DevToolsCommandDuration', value: 0.000013 },
4735
+ * { name: 'ScriptDuration', value: 0 },
4736
+ * { name: 'V8CompileDuration', value: 0 },
4737
+ * { name: 'TaskDuration', value: 0.000014 },
4738
+ * { name: 'TaskOtherDuration', value: 0.000001 },
4739
+ * { name: 'ThreadTime', value: 0.000046 },
4740
+ * { name: 'ProcessTime', value: 0.616852 },
4741
+ * { name: 'JSHeapUsedSize', value: 19004908 },
4742
+ * { name: 'JSHeapTotalSize', value: 26820608 },
4743
+ * { name: 'FirstMeaningfulPaint', value: 0 },
4744
+ * { name: 'DomContentLoaded', value: 1584903.690491 },
4745
+ * { name: 'NavigationStart', value: 1584902.841845 }
4746
+ * ]
4747
+ *
4748
+ * ```
4749
+ */
4750
+ grabMetrics(): Promise<object[]>;
4455
4751
  }
4456
4752
  /**
4457
4753
  * Protractor helper is based on [Protractor library](http://www.protractortest.org) and used for testing web applications.
@@ -4644,7 +4940,6 @@ declare namespace CodeceptJS {
4644
4940
  * ```
4645
4941
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
4646
4942
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
4647
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4648
4943
  */
4649
4944
  click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
4650
4945
  /**
@@ -4659,7 +4954,6 @@ declare namespace CodeceptJS {
4659
4954
  * ```
4660
4955
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
4661
4956
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
4662
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4663
4957
  */
4664
4958
  doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4665
4959
  /**
@@ -4675,7 +4969,6 @@ declare namespace CodeceptJS {
4675
4969
  * ```
4676
4970
  * @param locator - clickable element located by CSS|XPath|strict locator.
4677
4971
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
4678
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4679
4972
  */
4680
4973
  rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4681
4974
  /**
@@ -4689,7 +4982,6 @@ declare namespace CodeceptJS {
4689
4982
  * @param locator - located by CSS|XPath|strict locator.
4690
4983
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
4691
4984
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
4692
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4693
4985
  */
4694
4986
  moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
4695
4987
  /**
@@ -4703,7 +4995,6 @@ declare namespace CodeceptJS {
4703
4995
  * ```
4704
4996
  * @param text - expected on page.
4705
4997
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
4706
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4707
4998
  */
4708
4999
  see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
4709
5000
  /**
@@ -4714,7 +5005,6 @@ declare namespace CodeceptJS {
4714
5005
  * ```
4715
5006
  * @param text - element value to check.
4716
5007
  * @param [context = null] - element located by CSS|XPath|strict locator.
4717
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4718
5008
  */
4719
5009
  seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
4720
5010
  /**
@@ -4727,7 +5017,6 @@ declare namespace CodeceptJS {
4727
5017
  * ```
4728
5018
  * @param text - which is not present.
4729
5019
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
4730
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4731
5020
  */
4732
5021
  dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
4733
5022
  /**
@@ -4773,7 +5062,6 @@ declare namespace CodeceptJS {
4773
5062
  * ```
4774
5063
  * @param select - field located by label|name|CSS|XPath|strict locator.
4775
5064
  * @param option - visible text or value of option.
4776
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4777
5065
  */
4778
5066
  selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
4779
5067
  /**
@@ -4792,7 +5080,6 @@ declare namespace CodeceptJS {
4792
5080
  * ```
4793
5081
  * @param field - located by label|name|CSS|XPath|strict locator.
4794
5082
  * @param value - text value to fill.
4795
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4796
5083
  */
4797
5084
  fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
4798
5085
  /**
@@ -4806,9 +5093,6 @@ declare namespace CodeceptJS {
4806
5093
  * I.pressKey(['Control','a']);
4807
5094
  * ```
4808
5095
  * @param key - key or array of keys to press.
4809
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4810
- *
4811
- * {{ keys }}
4812
5096
  */
4813
5097
  pressKey(key: string | string[]): Promise<any>;
4814
5098
  /**
@@ -4822,7 +5106,6 @@ declare namespace CodeceptJS {
4822
5106
  * ```
4823
5107
  * @param locator - field located by label|name|CSS|XPath|strict locator.
4824
5108
  * @param pathToFile - local file path relative to codecept.conf.ts or codecept.conf.js config file.
4825
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4826
5109
  */
4827
5110
  attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
4828
5111
  /**
@@ -4837,9 +5120,8 @@ declare namespace CodeceptJS {
4837
5120
  * ```
4838
5121
  * @param field - located by label|name|CSS|XPath|strict locator.
4839
5122
  * @param value - value to check.
4840
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4841
5123
  */
4842
- seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
5124
+ seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
4843
5125
  /**
4844
5126
  * Checks that value of input field or textarea doesn't equal to given value
4845
5127
  * Opposite to `seeInField`.
@@ -4850,19 +5132,19 @@ declare namespace CodeceptJS {
4850
5132
  * ```
4851
5133
  * @param field - located by label|name|CSS|XPath|strict locator.
4852
5134
  * @param value - value to check.
4853
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4854
5135
  */
4855
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
5136
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
4856
5137
  /**
4857
5138
  * Appends text to a input field or textarea.
4858
5139
  * Field is located by name, label, CSS or XPath
4859
5140
  *
4860
5141
  * ```js
4861
5142
  * I.appendField('#myTextField', 'appended');
5143
+ * // typing secret
5144
+ * I.appendField('password', secret('123456'));
4862
5145
  * ```
4863
5146
  * @param field - located by label|name|CSS|XPath|strict locator
4864
5147
  * @param value - text value to append.
4865
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4866
5148
  */
4867
5149
  appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
4868
5150
  /**
@@ -4874,7 +5156,6 @@ declare namespace CodeceptJS {
4874
5156
  * I.clearField('#email');
4875
5157
  * ```
4876
5158
  * @param editable - field located by label|name|CSS|XPath|strict locator.
4877
- * ⚠️ returns a _promise_ which is synchronized internally by recorder.
4878
5159
  */
4879
5160
  clearField(editable: LocatorOrString): Promise<any>;
4880
5161
  /**
@@ -4890,7 +5171,6 @@ declare namespace CodeceptJS {
4890
5171
  * ```
4891
5172
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
4892
5173
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
4893
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4894
5174
  */
4895
5175
  checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4896
5176
  /**
@@ -4906,7 +5186,6 @@ declare namespace CodeceptJS {
4906
5186
  * ```
4907
5187
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
4908
5188
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
4909
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4910
5189
  */
4911
5190
  uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4912
5191
  /**
@@ -4918,7 +5197,6 @@ declare namespace CodeceptJS {
4918
5197
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
4919
5198
  * ```
4920
5199
  * @param field - located by label|name|CSS|XPath|strict locator.
4921
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4922
5200
  */
4923
5201
  seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
4924
5202
  /**
@@ -4930,7 +5208,6 @@ declare namespace CodeceptJS {
4930
5208
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
4931
5209
  * ```
4932
5210
  * @param field - located by label|name|CSS|XPath|strict locator.
4933
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
4934
5211
  */
4935
5212
  dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
4936
5213
  /**
@@ -5059,7 +5336,6 @@ declare namespace CodeceptJS {
5059
5336
  * I.seeInTitle('Home Page');
5060
5337
  * ```
5061
5338
  * @param text - text value to check.
5062
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5063
5339
  */
5064
5340
  seeInTitle(text: string): Promise<any>;
5065
5341
  /**
@@ -5069,7 +5345,6 @@ declare namespace CodeceptJS {
5069
5345
  * I.seeTitleEquals('Test title.');
5070
5346
  * ```
5071
5347
  * @param text - value to check.
5072
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5073
5348
  */
5074
5349
  seeTitleEquals(text: string): Promise<any>;
5075
5350
  /**
@@ -5079,7 +5354,6 @@ declare namespace CodeceptJS {
5079
5354
  * I.dontSeeInTitle('Error');
5080
5355
  * ```
5081
5356
  * @param text - value to check.
5082
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5083
5357
  */
5084
5358
  dontSeeInTitle(text: string): Promise<any>;
5085
5359
  /**
@@ -5100,7 +5374,6 @@ declare namespace CodeceptJS {
5100
5374
  * I.seeElement('#modal');
5101
5375
  * ```
5102
5376
  * @param locator - located by CSS|XPath|strict locator.
5103
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5104
5377
  */
5105
5378
  seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
5106
5379
  /**
@@ -5110,7 +5383,6 @@ declare namespace CodeceptJS {
5110
5383
  * I.dontSeeElement('.modal'); // modal is not shown
5111
5384
  * ```
5112
5385
  * @param locator - located by CSS|XPath|Strict locator.
5113
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5114
5386
  */
5115
5387
  dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
5116
5388
  /**
@@ -5121,7 +5393,6 @@ declare namespace CodeceptJS {
5121
5393
  * I.seeElementInDOM('#modal');
5122
5394
  * ```
5123
5395
  * @param locator - element located by CSS|XPath|strict locator.
5124
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5125
5396
  */
5126
5397
  seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
5127
5398
  /**
@@ -5131,7 +5402,6 @@ declare namespace CodeceptJS {
5131
5402
  * I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
5132
5403
  * ```
5133
5404
  * @param locator - located by CSS|XPath|Strict locator.
5134
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5135
5405
  */
5136
5406
  dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
5137
5407
  /**
@@ -5141,7 +5411,6 @@ declare namespace CodeceptJS {
5141
5411
  * I.seeInSource('<h1>Green eggs &amp; ham</h1>');
5142
5412
  * ```
5143
5413
  * @param text - value to check.
5144
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5145
5414
  */
5146
5415
  seeInSource(text: string): Promise<any>;
5147
5416
  /**
@@ -5161,7 +5430,6 @@ declare namespace CodeceptJS {
5161
5430
  * I.dontSeeInSource('<!--'); // no comments in source
5162
5431
  * ```
5163
5432
  * @param value - to check.
5164
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5165
5433
  */
5166
5434
  dontSeeInSource(value: string): Promise<any>;
5167
5435
  /**
@@ -5174,7 +5442,6 @@ declare namespace CodeceptJS {
5174
5442
  * ```
5175
5443
  * @param locator - element located by CSS|XPath|strict locator.
5176
5444
  * @param num - number of elements.
5177
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5178
5445
  */
5179
5446
  seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
5180
5447
  /**
@@ -5186,7 +5453,6 @@ declare namespace CodeceptJS {
5186
5453
  * ```
5187
5454
  * @param locator - element located by CSS|XPath|strict locator.
5188
5455
  * @param num - number of elements.
5189
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5190
5456
  */
5191
5457
  seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
5192
5458
  /**
@@ -5208,7 +5474,6 @@ declare namespace CodeceptJS {
5208
5474
  * ```
5209
5475
  * @param locator - located by CSS|XPath|strict locator.
5210
5476
  * @param cssProperties - object with CSS properties and their values to check.
5211
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5212
5477
  */
5213
5478
  seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
5214
5479
  /**
@@ -5219,7 +5484,6 @@ declare namespace CodeceptJS {
5219
5484
  * ```
5220
5485
  * @param locator - located by CSS|XPath|strict locator.
5221
5486
  * @param attributes - attributes and their values to check.
5222
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5223
5487
  */
5224
5488
  seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
5225
5489
  /**
@@ -5247,7 +5511,7 @@ declare namespace CodeceptJS {
5247
5511
  * ```
5248
5512
  * @param fn - function to be executed in browser context.
5249
5513
  * @param args - to be passed to function.
5250
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5514
+ * @returns script return value
5251
5515
  */
5252
5516
  executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
5253
5517
  /**
@@ -5273,7 +5537,7 @@ declare namespace CodeceptJS {
5273
5537
  * ```
5274
5538
  * @param fn - function to be executed in browser context.
5275
5539
  * @param args - to be passed to function.
5276
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5540
+ * @returns script return value
5277
5541
  */
5278
5542
  executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
5279
5543
  /**
@@ -5283,13 +5547,11 @@ declare namespace CodeceptJS {
5283
5547
  * I.seeInCurrentUrl('/register'); // we are on registration page
5284
5548
  * ```
5285
5549
  * @param url - a fragment to check
5286
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5287
5550
  */
5288
5551
  seeInCurrentUrl(url: string): Promise<any>;
5289
5552
  /**
5290
5553
  * Checks that current url does not contain a provided fragment.
5291
5554
  * @param url - value to check.
5292
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5293
5555
  */
5294
5556
  dontSeeInCurrentUrl(url: string): Promise<any>;
5295
5557
  /**
@@ -5302,7 +5564,6 @@ declare namespace CodeceptJS {
5302
5564
  * I.seeCurrentUrlEquals('http://my.site.com/register');
5303
5565
  * ```
5304
5566
  * @param url - value to check.
5305
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5306
5567
  */
5307
5568
  seeCurrentUrlEquals(url: string): Promise<any>;
5308
5569
  /**
@@ -5314,7 +5575,6 @@ declare namespace CodeceptJS {
5314
5575
  * I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also ok
5315
5576
  * ```
5316
5577
  * @param url - value to check.
5317
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5318
5578
  */
5319
5579
  dontSeeCurrentUrlEquals(url: string): Promise<any>;
5320
5580
  /**
@@ -5326,7 +5586,6 @@ declare namespace CodeceptJS {
5326
5586
  * ```
5327
5587
  * @param locator - element located by CSS|XPath|strict locator.
5328
5588
  * @param fileName - file name to save.
5329
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5330
5589
  */
5331
5590
  saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
5332
5591
  /**
@@ -5340,7 +5599,6 @@ declare namespace CodeceptJS {
5340
5599
  * ```
5341
5600
  * @param fileName - file name to save.
5342
5601
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
5343
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5344
5602
  */
5345
5603
  saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
5346
5604
  /**
@@ -5349,10 +5607,9 @@ declare namespace CodeceptJS {
5349
5607
  *
5350
5608
  * ```js
5351
5609
  * I.clearCookie();
5352
- * I.clearCookie('test');
5610
+ * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
5353
5611
  * ```
5354
5612
  * @param [cookie = null] - (optional, `null` by default) cookie name
5355
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5356
5613
  */
5357
5614
  clearCookie(cookie?: string): Promise<any>;
5358
5615
  /**
@@ -5362,7 +5619,6 @@ declare namespace CodeceptJS {
5362
5619
  * I.seeCookie('Auth');
5363
5620
  * ```
5364
5621
  * @param name - cookie name.
5365
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5366
5622
  */
5367
5623
  seeCookie(name: string): Promise<any>;
5368
5624
  /**
@@ -5372,7 +5628,6 @@ declare namespace CodeceptJS {
5372
5628
  * I.dontSeeCookie('auth'); // no auth cookie
5373
5629
  * ```
5374
5630
  * @param name - cookie name.
5375
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5376
5631
  */
5377
5632
  dontSeeCookie(name: string): Promise<any>;
5378
5633
  /**
@@ -5385,12 +5640,8 @@ declare namespace CodeceptJS {
5385
5640
  * assert(cookie.value, '123456');
5386
5641
  * ```
5387
5642
  * @param [name = null] - cookie name.
5388
- * @returns attribute value
5389
- *
5390
- *
5391
- * Returns cookie in JSON [format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
5392
5643
  */
5393
- grabCookie(name?: string): Promise<string> | Promise<string[]>;
5644
+ grabCookie(name?: string): Promise<any>;
5394
5645
  /**
5395
5646
  * Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
5396
5647
  * Don't confuse popups with modal windows, as created by [various
@@ -5409,7 +5660,6 @@ declare namespace CodeceptJS {
5409
5660
  * I.seeInPopup('Popup text');
5410
5661
  * ```
5411
5662
  * @param text - value to check.
5412
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5413
5663
  */
5414
5664
  seeInPopup(text: string): Promise<any>;
5415
5665
  /**
@@ -5425,7 +5675,6 @@ declare namespace CodeceptJS {
5425
5675
  * First parameter can be set to `maximize`.
5426
5676
  * @param width - width in pixels or `maximize`.
5427
5677
  * @param height - height in pixels.
5428
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5429
5678
  */
5430
5679
  resizeWindow(width: number, height: number): Promise<any>;
5431
5680
  /**
@@ -5436,7 +5685,6 @@ declare namespace CodeceptJS {
5436
5685
  * ```
5437
5686
  * @param srcElement - located by CSS|XPath|strict locator.
5438
5687
  * @param destElement - located by CSS|XPath|strict locator.
5439
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5440
5688
  */
5441
5689
  dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): Promise<any>;
5442
5690
  /**
@@ -5504,7 +5752,6 @@ declare namespace CodeceptJS {
5504
5752
  * I.switchTo(); // switch back to main page
5505
5753
  * ```
5506
5754
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
5507
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5508
5755
  */
5509
5756
  switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
5510
5757
  /**
@@ -5514,7 +5761,6 @@ declare namespace CodeceptJS {
5514
5761
  * I.wait(2); // wait 2 secs
5515
5762
  * ```
5516
5763
  * @param sec - number of second to wait.
5517
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5518
5764
  */
5519
5765
  wait(sec: number): Promise<any>;
5520
5766
  /**
@@ -5527,7 +5773,6 @@ declare namespace CodeceptJS {
5527
5773
  * ```
5528
5774
  * @param locator - element located by CSS|XPath|strict locator.
5529
5775
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
5530
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5531
5776
  */
5532
5777
  waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5533
5778
  /**
@@ -5539,7 +5784,6 @@ declare namespace CodeceptJS {
5539
5784
  * ```
5540
5785
  * @param locator - element located by CSS|XPath|strict locator.
5541
5786
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5542
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5543
5787
  */
5544
5788
  waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5545
5789
  /**
@@ -5559,7 +5803,6 @@ declare namespace CodeceptJS {
5559
5803
  * ```
5560
5804
  * @param locator - element located by CSS|XPath|strict locator.
5561
5805
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5562
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5563
5806
  */
5564
5807
  waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5565
5808
  /**
@@ -5571,7 +5814,6 @@ declare namespace CodeceptJS {
5571
5814
  * ```
5572
5815
  * @param locator - element located by CSS|XPath|strict locator.
5573
5816
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5574
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5575
5817
  */
5576
5818
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5577
5819
  /**
@@ -5583,7 +5825,6 @@ declare namespace CodeceptJS {
5583
5825
  * ```
5584
5826
  * @param locator - element located by CSS|XPath|strict locator.
5585
5827
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5586
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5587
5828
  */
5588
5829
  waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5589
5830
  /**
@@ -5595,7 +5836,6 @@ declare namespace CodeceptJS {
5595
5836
  * @param locator - element located by CSS|XPath|strict locator.
5596
5837
  * @param num - number of elements.
5597
5838
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5598
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5599
5839
  */
5600
5840
  waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
5601
5841
  /**
@@ -5603,7 +5843,6 @@ declare namespace CodeceptJS {
5603
5843
  * Element can be located by CSS or XPath.
5604
5844
  * @param locator - element located by CSS|XPath|strict locator.
5605
5845
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
5606
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5607
5846
  */
5608
5847
  waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5609
5848
  /**
@@ -5615,7 +5854,6 @@ declare namespace CodeceptJS {
5615
5854
  * @param field - input field.
5616
5855
  * @param value - expected value.
5617
5856
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5618
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5619
5857
  */
5620
5858
  waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
5621
5859
  /**
@@ -5634,7 +5872,6 @@ declare namespace CodeceptJS {
5634
5872
  * @param fn - to be executed in browser context.
5635
5873
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
5636
5874
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
5637
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5638
5875
  */
5639
5876
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
5640
5877
  /**
@@ -5645,7 +5882,6 @@ declare namespace CodeceptJS {
5645
5882
  * ```
5646
5883
  * @param urlPart - value to check.
5647
5884
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5648
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5649
5885
  */
5650
5886
  waitInUrl(urlPart: string, sec?: number): Promise<any>;
5651
5887
  /**
@@ -5657,7 +5893,6 @@ declare namespace CodeceptJS {
5657
5893
  * ```
5658
5894
  * @param urlPart - value to check.
5659
5895
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5660
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5661
5896
  */
5662
5897
  waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
5663
5898
  /**
@@ -5672,7 +5907,6 @@ declare namespace CodeceptJS {
5672
5907
  * @param text - to wait for.
5673
5908
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5674
5909
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
5675
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5676
5910
  */
5677
5911
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
5678
5912
  /**
@@ -5685,7 +5919,6 @@ declare namespace CodeceptJS {
5685
5919
  * ```js
5686
5920
  * I.refreshPage();
5687
5921
  * ```
5688
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5689
5922
  */
5690
5923
  refreshPage(): Promise<any>;
5691
5924
  /**
@@ -5703,7 +5936,6 @@ declare namespace CodeceptJS {
5703
5936
  * @param locator - located by CSS|XPath|strict locator.
5704
5937
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
5705
5938
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
5706
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5707
5939
  */
5708
5940
  scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
5709
5941
  /**
@@ -5712,7 +5944,6 @@ declare namespace CodeceptJS {
5712
5944
  * ```js
5713
5945
  * I.scrollPageToTop();
5714
5946
  * ```
5715
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5716
5947
  */
5717
5948
  scrollPageToTop(): Promise<any>;
5718
5949
  /**
@@ -5721,7 +5952,6 @@ declare namespace CodeceptJS {
5721
5952
  * ```js
5722
5953
  * I.scrollPageToBottom();
5723
5954
  * ```
5724
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5725
5955
  */
5726
5956
  scrollPageToBottom(): Promise<any>;
5727
5957
  /**
@@ -5768,7 +5998,6 @@ declare namespace CodeceptJS {
5768
5998
  * ]);
5769
5999
  * ```
5770
6000
  * @param cookie - a cookie object or array of cookie objects.
5771
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5772
6001
  */
5773
6002
  setCookie(cookie: Cookie | Cookie[]): Promise<any>;
5774
6003
  }
@@ -5791,6 +6020,14 @@ declare namespace CodeceptJS {
5791
6020
  *
5792
6021
  * <!-- configuration -->
5793
6022
  *
6023
+ * #### Trace Recording Customization
6024
+ *
6025
+ * Trace recording provides complete information on test execution and includes screenshots, and network requests logged during run.
6026
+ * Traces will be saved to `output/trace`
6027
+ *
6028
+ * * `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder
6029
+ * * `keepTraceForPassedTests`: - save trace for passed tests
6030
+ *
5794
6031
  * #### Example #1: Wait for 0 network connections.
5795
6032
  *
5796
6033
  * ```js
@@ -5955,7 +6192,6 @@ declare namespace CodeceptJS {
5955
6192
  * I.seeInPopup('Popup text');
5956
6193
  * ```
5957
6194
  * @param text - value to check.
5958
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
5959
6195
  */
5960
6196
  seeInPopup(text: string): Promise<any>;
5961
6197
  /**
@@ -5992,29 +6228,27 @@ declare namespace CodeceptJS {
5992
6228
  */
5993
6229
  amOnPage(url: string): Promise<any>;
5994
6230
  /**
6231
+ * Unlike other drivers Puppeteer changes the size of a viewport, not the window!
6232
+ * Puppeteer does not control the window of a browser, so it can't adjust its real size.
6233
+ * It also can't maximize a window.
6234
+ *
5995
6235
  * Resize the current window to provided width and height.
5996
6236
  * First parameter can be set to `maximize`.
5997
6237
  * @param width - width in pixels or `maximize`.
5998
6238
  * @param height - height in pixels.
5999
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6000
- *
6001
- *
6002
- * Unlike other drivers Puppeteer changes the size of a viewport, not the window!
6003
- * Puppeteer does not control the window of a browser so it can't adjust its real size.
6004
- * It also can't maximize a window.
6005
6239
  */
6006
6240
  resizeWindow(width: number, height: number): Promise<any>;
6007
6241
  /**
6008
6242
  * Set headers for all next requests
6009
6243
  *
6010
6244
  * ```js
6011
- * I.haveRequestHeaders({
6245
+ * I.setPuppeteerRequestHeaders({
6012
6246
  * 'X-Sent-By': 'CodeceptJS',
6013
6247
  * });
6014
6248
  * ```
6015
6249
  * @param customHeaders - headers to set
6016
6250
  */
6017
- haveRequestHeaders(customHeaders: any): Promise<any>;
6251
+ setPuppeteerRequestHeaders(customHeaders: any): Promise<any>;
6018
6252
  /**
6019
6253
  * Moves cursor to element matched by locator.
6020
6254
  * Extra shift can be set with offsetX and offsetY options.
@@ -6026,11 +6260,41 @@ declare namespace CodeceptJS {
6026
6260
  * @param locator - located by CSS|XPath|strict locator.
6027
6261
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
6028
6262
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
6029
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6030
- *
6031
- * {{ react }}
6032
6263
  */
6033
6264
  moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
6265
+ /**
6266
+ * Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.
6267
+ *
6268
+ * Examples:
6269
+ *
6270
+ * ```js
6271
+ * I.dontSee('#add-to-cart-btn');
6272
+ * I.focus('#product-tile')
6273
+ * I.see('#add-to-cart-bnt');
6274
+ * ```
6275
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
6276
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
6277
+ */
6278
+ focus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
6279
+ /**
6280
+ * Remove focus from a text input, button, etc.
6281
+ * Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
6282
+ *
6283
+ * Examples:
6284
+ *
6285
+ * ```js
6286
+ * I.blur('.text-area')
6287
+ * ```
6288
+ * ```js
6289
+ * //element `#product-tile` is focused
6290
+ * I.see('#add-to-cart-btn');
6291
+ * I.blur('#product-tile')
6292
+ * I.dontSee('#add-to-cart-btn');
6293
+ * ```
6294
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
6295
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
6296
+ */
6297
+ blur(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
6034
6298
  /**
6035
6299
  * Drag an item to a destination element.
6036
6300
  *
@@ -6039,7 +6303,6 @@ declare namespace CodeceptJS {
6039
6303
  * ```
6040
6304
  * @param srcElement - located by CSS|XPath|strict locator.
6041
6305
  * @param destElement - located by CSS|XPath|strict locator.
6042
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6043
6306
  */
6044
6307
  dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): Promise<any>;
6045
6308
  /**
@@ -6048,7 +6311,6 @@ declare namespace CodeceptJS {
6048
6311
  * ```js
6049
6312
  * I.refreshPage();
6050
6313
  * ```
6051
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6052
6314
  */
6053
6315
  refreshPage(): Promise<any>;
6054
6316
  /**
@@ -6057,7 +6319,6 @@ declare namespace CodeceptJS {
6057
6319
  * ```js
6058
6320
  * I.scrollPageToTop();
6059
6321
  * ```
6060
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6061
6322
  */
6062
6323
  scrollPageToTop(): Promise<any>;
6063
6324
  /**
@@ -6066,7 +6327,6 @@ declare namespace CodeceptJS {
6066
6327
  * ```js
6067
6328
  * I.scrollPageToBottom();
6068
6329
  * ```
6069
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6070
6330
  */
6071
6331
  scrollPageToBottom(): Promise<any>;
6072
6332
  /**
@@ -6080,7 +6340,6 @@ declare namespace CodeceptJS {
6080
6340
  * @param locator - located by CSS|XPath|strict locator.
6081
6341
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
6082
6342
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
6083
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6084
6343
  */
6085
6344
  scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
6086
6345
  /**
@@ -6090,7 +6349,6 @@ declare namespace CodeceptJS {
6090
6349
  * I.seeInTitle('Home Page');
6091
6350
  * ```
6092
6351
  * @param text - text value to check.
6093
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6094
6352
  */
6095
6353
  seeInTitle(text: string): Promise<any>;
6096
6354
  /**
@@ -6110,7 +6368,6 @@ declare namespace CodeceptJS {
6110
6368
  * I.seeTitleEquals('Test title.');
6111
6369
  * ```
6112
6370
  * @param text - value to check.
6113
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6114
6371
  */
6115
6372
  seeTitleEquals(text: string): Promise<any>;
6116
6373
  /**
@@ -6120,7 +6377,6 @@ declare namespace CodeceptJS {
6120
6377
  * I.dontSeeInTitle('Error');
6121
6378
  * ```
6122
6379
  * @param text - value to check.
6123
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6124
6380
  */
6125
6381
  dontSeeInTitle(text: string): Promise<any>;
6126
6382
  /**
@@ -6145,7 +6401,7 @@ declare namespace CodeceptJS {
6145
6401
  */
6146
6402
  _locate(): Promise<any>;
6147
6403
  /**
6148
- * Find a checkbox by providing human readable text:
6404
+ * Find a checkbox by providing human-readable text:
6149
6405
  * NOTE: Assumes the checkable element exists
6150
6406
  *
6151
6407
  * ```js
@@ -6154,7 +6410,7 @@ declare namespace CodeceptJS {
6154
6410
  */
6155
6411
  _locateCheckable(): Promise<any>;
6156
6412
  /**
6157
- * Find a clickable element by providing human readable text:
6413
+ * Find a clickable element by providing human-readable text:
6158
6414
  *
6159
6415
  * ```js
6160
6416
  * this.helpers['Puppeteer']._locateClickable('Next page').then // ...
@@ -6162,13 +6418,24 @@ declare namespace CodeceptJS {
6162
6418
  */
6163
6419
  _locateClickable(): Promise<any>;
6164
6420
  /**
6165
- * Find field elements by providing human readable text:
6421
+ * Find field elements by providing human-readable text:
6166
6422
  *
6167
6423
  * ```js
6168
6424
  * this.helpers['Puppeteer']._locateFields('Your email').then // ...
6169
6425
  * ```
6170
6426
  */
6171
6427
  _locateFields(): Promise<any>;
6428
+ /**
6429
+ * Grab WebElements for given locator
6430
+ * Resumes test execution, so **should be used inside an async function with `await`** operator.
6431
+ *
6432
+ * ```js
6433
+ * const webElements = await I.grabWebElements('#button');
6434
+ * ```
6435
+ * @param locator - element located by CSS|XPath|strict locator.
6436
+ * @returns WebElement of being used Web helper
6437
+ */
6438
+ grabWebElements(locator: CodeceptJS.LocatorOrString): Promise<any>;
6172
6439
  /**
6173
6440
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab
6174
6441
  *
@@ -6229,9 +6496,6 @@ declare namespace CodeceptJS {
6229
6496
  * I.seeElement('#modal');
6230
6497
  * ```
6231
6498
  * @param locator - located by CSS|XPath|strict locator.
6232
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6233
- *
6234
- * {{ react }}
6235
6499
  */
6236
6500
  seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
6237
6501
  /**
@@ -6241,9 +6505,6 @@ declare namespace CodeceptJS {
6241
6505
  * I.dontSeeElement('.modal'); // modal is not shown
6242
6506
  * ```
6243
6507
  * @param locator - located by CSS|XPath|Strict locator.
6244
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6245
- *
6246
- * {{ react }}
6247
6508
  */
6248
6509
  dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
6249
6510
  /**
@@ -6254,7 +6515,6 @@ declare namespace CodeceptJS {
6254
6515
  * I.seeElementInDOM('#modal');
6255
6516
  * ```
6256
6517
  * @param locator - element located by CSS|XPath|strict locator.
6257
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6258
6518
  */
6259
6519
  seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
6260
6520
  /**
@@ -6264,7 +6524,6 @@ declare namespace CodeceptJS {
6264
6524
  * I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
6265
6525
  * ```
6266
6526
  * @param locator - located by CSS|XPath|Strict locator.
6267
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6268
6527
  */
6269
6528
  dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
6270
6529
  /**
@@ -6291,10 +6550,6 @@ declare namespace CodeceptJS {
6291
6550
  * ```
6292
6551
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
6293
6552
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
6294
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6295
- *
6296
- *
6297
- * {{ react }}
6298
6553
  */
6299
6554
  click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
6300
6555
  /**
@@ -6324,10 +6579,6 @@ declare namespace CodeceptJS {
6324
6579
  * ```
6325
6580
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
6326
6581
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
6327
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6328
- *
6329
- *
6330
- * {{ react }}
6331
6582
  */
6332
6583
  forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6333
6584
  /**
@@ -6338,17 +6589,13 @@ declare namespace CodeceptJS {
6338
6589
  * ```
6339
6590
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator
6340
6591
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator
6341
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6342
- *
6343
- *
6344
- * {{ react }}
6345
6592
  */
6346
6593
  clickLink(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6347
6594
  /**
6348
6595
  * Sets a directory to where save files. Allows to test file downloads.
6349
6596
  * Should be used with [FileSystem helper](https://codecept.io/helpers/FileSystem) to check that file were downloaded correctly.
6350
6597
  *
6351
- * By default files are saved to `output/downloads`.
6598
+ * By default, files are saved to `output/downloads`.
6352
6599
  * This directory is cleaned on every `handleDownloads` call, to ensure no old files are kept.
6353
6600
  *
6354
6601
  * ```js
@@ -6379,10 +6626,6 @@ declare namespace CodeceptJS {
6379
6626
  * ```
6380
6627
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
6381
6628
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
6382
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6383
- *
6384
- *
6385
- * {{ react }}
6386
6629
  */
6387
6630
  doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6388
6631
  /**
@@ -6398,10 +6641,6 @@ declare namespace CodeceptJS {
6398
6641
  * ```
6399
6642
  * @param locator - clickable element located by CSS|XPath|strict locator.
6400
6643
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
6401
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6402
- *
6403
- *
6404
- * {{ react }}
6405
6644
  */
6406
6645
  rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6407
6646
  /**
@@ -6417,7 +6656,6 @@ declare namespace CodeceptJS {
6417
6656
  * ```
6418
6657
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
6419
6658
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
6420
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6421
6659
  */
6422
6660
  checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6423
6661
  /**
@@ -6433,7 +6671,6 @@ declare namespace CodeceptJS {
6433
6671
  * ```
6434
6672
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
6435
6673
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
6436
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6437
6674
  */
6438
6675
  uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6439
6676
  /**
@@ -6445,7 +6682,6 @@ declare namespace CodeceptJS {
6445
6682
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
6446
6683
  * ```
6447
6684
  * @param field - located by label|name|CSS|XPath|strict locator.
6448
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6449
6685
  */
6450
6686
  seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
6451
6687
  /**
@@ -6457,7 +6693,6 @@ declare namespace CodeceptJS {
6457
6693
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
6458
6694
  * ```
6459
6695
  * @param field - located by label|name|CSS|XPath|strict locator.
6460
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6461
6696
  */
6462
6697
  dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
6463
6698
  /**
@@ -6471,7 +6706,6 @@ declare namespace CodeceptJS {
6471
6706
  * I.pressKeyUp('Control');
6472
6707
  * ```
6473
6708
  * @param key - name of key to press down.
6474
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6475
6709
  */
6476
6710
  pressKeyDown(key: string): Promise<any>;
6477
6711
  /**
@@ -6485,10 +6719,11 @@ declare namespace CodeceptJS {
6485
6719
  * I.pressKeyUp('Control');
6486
6720
  * ```
6487
6721
  * @param key - name of key to release.
6488
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6489
6722
  */
6490
6723
  pressKeyUp(key: string): Promise<any>;
6491
6724
  /**
6725
+ * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
6726
+ *
6492
6727
  * Presses a key in the browser (on a focused element).
6493
6728
  *
6494
6729
  * _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
@@ -6547,10 +6782,6 @@ declare namespace CodeceptJS {
6547
6782
  * - `'Space'`
6548
6783
  * - `'Tab'`
6549
6784
  * @param key - key or array of keys to press.
6550
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6551
- *
6552
- *
6553
- * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
6554
6785
  */
6555
6786
  pressKey(key: string | string[]): Promise<any>;
6556
6787
  /**
@@ -6567,10 +6798,12 @@ declare namespace CodeceptJS {
6567
6798
  *
6568
6799
  * // passing in an array
6569
6800
  * I.type(['T', 'E', 'X', 'T']);
6801
+ *
6802
+ * // passing a secret
6803
+ * I.type(secret('123456'));
6570
6804
  * ```
6571
6805
  * @param key - or array of keys to type.
6572
6806
  * @param [delay = null] - (optional) delay in ms between key presses
6573
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6574
6807
  */
6575
6808
  type(key: string | string[], delay?: number): Promise<any>;
6576
6809
  /**
@@ -6589,9 +6822,6 @@ declare namespace CodeceptJS {
6589
6822
  * ```
6590
6823
  * @param field - located by label|name|CSS|XPath|strict locator.
6591
6824
  * @param value - text value to fill.
6592
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6593
- *
6594
- * {{ react }}
6595
6825
  */
6596
6826
  fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
6597
6827
  /**
@@ -6603,7 +6833,6 @@ declare namespace CodeceptJS {
6603
6833
  * I.clearField('#email');
6604
6834
  * ```
6605
6835
  * @param editable - field located by label|name|CSS|XPath|strict locator.
6606
- * ⚠️ returns a _promise_ which is synchronized internally by recorder.
6607
6836
  */
6608
6837
  clearField(editable: LocatorOrString): Promise<any>;
6609
6838
  /**
@@ -6612,13 +6841,11 @@ declare namespace CodeceptJS {
6612
6841
  *
6613
6842
  * ```js
6614
6843
  * I.appendField('#myTextField', 'appended');
6844
+ * // typing secret
6845
+ * I.appendField('password', secret('123456'));
6615
6846
  * ```
6616
6847
  * @param field - located by label|name|CSS|XPath|strict locator
6617
6848
  * @param value - text value to append.
6618
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6619
- *
6620
- *
6621
- * {{ react }}
6622
6849
  */
6623
6850
  appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
6624
6851
  /**
@@ -6633,9 +6860,8 @@ declare namespace CodeceptJS {
6633
6860
  * ```
6634
6861
  * @param field - located by label|name|CSS|XPath|strict locator.
6635
6862
  * @param value - value to check.
6636
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6637
6863
  */
6638
- seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
6864
+ seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
6639
6865
  /**
6640
6866
  * Checks that value of input field or textarea doesn't equal to given value
6641
6867
  * Opposite to `seeInField`.
@@ -6646,10 +6872,11 @@ declare namespace CodeceptJS {
6646
6872
  * ```
6647
6873
  * @param field - located by label|name|CSS|XPath|strict locator.
6648
6874
  * @param value - value to check.
6649
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6650
6875
  */
6651
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
6876
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
6652
6877
  /**
6878
+ * > ⚠ 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.
6879
+ *
6653
6880
  * Attaches a file to element located by label, name, CSS or XPath
6654
6881
  * Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
6655
6882
  * File will be uploaded to remote system (if tests are running remotely).
@@ -6660,10 +6887,6 @@ declare namespace CodeceptJS {
6660
6887
  * ```
6661
6888
  * @param locator - field located by label|name|CSS|XPath|strict locator.
6662
6889
  * @param pathToFile - local file path relative to codecept.conf.ts or codecept.conf.js config file.
6663
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6664
- *
6665
- *
6666
- * > ⚠ 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.
6667
6890
  */
6668
6891
  attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
6669
6892
  /**
@@ -6687,7 +6910,6 @@ declare namespace CodeceptJS {
6687
6910
  * ```
6688
6911
  * @param select - field located by label|name|CSS|XPath|strict locator.
6689
6912
  * @param option - visible text or value of option.
6690
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6691
6913
  */
6692
6914
  selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
6693
6915
  /**
@@ -6709,13 +6931,11 @@ declare namespace CodeceptJS {
6709
6931
  * I.seeInCurrentUrl('/register'); // we are on registration page
6710
6932
  * ```
6711
6933
  * @param url - a fragment to check
6712
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6713
6934
  */
6714
6935
  seeInCurrentUrl(url: string): Promise<any>;
6715
6936
  /**
6716
6937
  * Checks that current url does not contain a provided fragment.
6717
6938
  * @param url - value to check.
6718
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6719
6939
  */
6720
6940
  dontSeeInCurrentUrl(url: string): Promise<any>;
6721
6941
  /**
@@ -6728,7 +6948,6 @@ declare namespace CodeceptJS {
6728
6948
  * I.seeCurrentUrlEquals('http://my.site.com/register');
6729
6949
  * ```
6730
6950
  * @param url - value to check.
6731
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6732
6951
  */
6733
6952
  seeCurrentUrlEquals(url: string): Promise<any>;
6734
6953
  /**
@@ -6740,7 +6959,6 @@ declare namespace CodeceptJS {
6740
6959
  * I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also ok
6741
6960
  * ```
6742
6961
  * @param url - value to check.
6743
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6744
6962
  */
6745
6963
  dontSeeCurrentUrlEquals(url: string): Promise<any>;
6746
6964
  /**
@@ -6754,10 +6972,6 @@ declare namespace CodeceptJS {
6754
6972
  * ```
6755
6973
  * @param text - expected on page.
6756
6974
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
6757
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6758
- *
6759
- *
6760
- * {{ react }}
6761
6975
  */
6762
6976
  see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
6763
6977
  /**
@@ -6768,7 +6982,6 @@ declare namespace CodeceptJS {
6768
6982
  * ```
6769
6983
  * @param text - element value to check.
6770
6984
  * @param [context = null] - element located by CSS|XPath|strict locator.
6771
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6772
6985
  */
6773
6986
  seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
6774
6987
  /**
@@ -6781,10 +6994,6 @@ declare namespace CodeceptJS {
6781
6994
  * ```
6782
6995
  * @param text - which is not present.
6783
6996
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
6784
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6785
- *
6786
- *
6787
- * {{ react }}
6788
6997
  */
6789
6998
  dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
6790
6999
  /**
@@ -6824,7 +7033,6 @@ declare namespace CodeceptJS {
6824
7033
  * I.seeInSource('<h1>Green eggs &amp; ham</h1>');
6825
7034
  * ```
6826
7035
  * @param text - value to check.
6827
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6828
7036
  */
6829
7037
  seeInSource(text: string): Promise<any>;
6830
7038
  /**
@@ -6834,7 +7042,6 @@ declare namespace CodeceptJS {
6834
7042
  * I.dontSeeInSource('<!--'); // no comments in source
6835
7043
  * ```
6836
7044
  * @param value - to check.
6837
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6838
7045
  */
6839
7046
  dontSeeInSource(value: string): Promise<any>;
6840
7047
  /**
@@ -6847,10 +7054,6 @@ declare namespace CodeceptJS {
6847
7054
  * ```
6848
7055
  * @param locator - element located by CSS|XPath|strict locator.
6849
7056
  * @param num - number of elements.
6850
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6851
- *
6852
- *
6853
- * {{ react }}
6854
7057
  */
6855
7058
  seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
6856
7059
  /**
@@ -6862,10 +7065,6 @@ declare namespace CodeceptJS {
6862
7065
  * ```
6863
7066
  * @param locator - element located by CSS|XPath|strict locator.
6864
7067
  * @param num - number of elements.
6865
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6866
- *
6867
- *
6868
- * {{ react }}
6869
7068
  */
6870
7069
  seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
6871
7070
  /**
@@ -6883,7 +7082,6 @@ declare namespace CodeceptJS {
6883
7082
  * ]);
6884
7083
  * ```
6885
7084
  * @param cookie - a cookie object or array of cookie objects.
6886
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6887
7085
  */
6888
7086
  setCookie(cookie: Cookie | Cookie[]): Promise<any>;
6889
7087
  /**
@@ -6893,7 +7091,6 @@ declare namespace CodeceptJS {
6893
7091
  * I.seeCookie('Auth');
6894
7092
  * ```
6895
7093
  * @param name - cookie name.
6896
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6897
7094
  */
6898
7095
  seeCookie(name: string): Promise<any>;
6899
7096
  /**
@@ -6903,7 +7100,6 @@ declare namespace CodeceptJS {
6903
7100
  * I.dontSeeCookie('auth'); // no auth cookie
6904
7101
  * ```
6905
7102
  * @param name - cookie name.
6906
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6907
7103
  */
6908
7104
  dontSeeCookie(name: string): Promise<any>;
6909
7105
  /**
@@ -6916,25 +7112,22 @@ declare namespace CodeceptJS {
6916
7112
  * assert(cookie.value, '123456');
6917
7113
  * ```
6918
7114
  * @param [name = null] - cookie name.
6919
- * @returns attribute value
6920
- *
6921
- *
6922
- * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
6923
7115
  */
6924
- grabCookie(name?: string): Promise<string> | Promise<string[]>;
7116
+ grabCookie(name?: string): Promise<any>;
6925
7117
  /**
6926
7118
  * Clears a cookie by name,
6927
7119
  * if none provided clears all cookies.
6928
7120
  *
6929
7121
  * ```js
6930
7122
  * I.clearCookie();
6931
- * I.clearCookie('test');
7123
+ * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
6932
7124
  * ```
6933
7125
  * @param [cookie = null] - (optional, `null` by default) cookie name
6934
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6935
7126
  */
6936
7127
  clearCookie(cookie?: string): Promise<any>;
6937
7128
  /**
7129
+ * If a function returns a Promise, tt will wait for its resolution.
7130
+ *
6938
7131
  * Executes sync script on a page.
6939
7132
  * Pass arguments to function as additional parameters.
6940
7133
  * Will return execution result to a test.
@@ -6959,13 +7152,11 @@ declare namespace CodeceptJS {
6959
7152
  * ```
6960
7153
  * @param fn - function to be executed in browser context.
6961
7154
  * @param args - to be passed to function.
6962
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6963
- *
6964
- *
6965
- * If a function returns a Promise It will wait for it resolution.
7155
+ * @returns script return value
6966
7156
  */
6967
7157
  executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
6968
7158
  /**
7159
+ * Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
6969
7160
  * Executes async script on page.
6970
7161
  * Provided function should execute a passed callback (as first argument) to signal it is finished.
6971
7162
  *
@@ -6988,10 +7179,7 @@ declare namespace CodeceptJS {
6988
7179
  * ```
6989
7180
  * @param fn - function to be executed in browser context.
6990
7181
  * @param args - to be passed to function.
6991
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
6992
- *
6993
- *
6994
- * Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
7182
+ * @returns script return value
6995
7183
  */
6996
7184
  executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
6997
7185
  /**
@@ -7104,9 +7292,6 @@ declare namespace CodeceptJS {
7104
7292
  * ```
7105
7293
  * @param locator - located by CSS|XPath|strict locator.
7106
7294
  * @param cssProperties - object with CSS properties and their values to check.
7107
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7108
- *
7109
- * {{ react }}
7110
7295
  */
7111
7296
  seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
7112
7297
  /**
@@ -7117,9 +7302,6 @@ declare namespace CodeceptJS {
7117
7302
  * ```
7118
7303
  * @param locator - located by CSS|XPath|strict locator.
7119
7304
  * @param attributes - attributes and their values to check.
7120
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7121
- *
7122
- * {{ react }}
7123
7305
  */
7124
7306
  seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
7125
7307
  /**
@@ -7132,9 +7314,6 @@ declare namespace CodeceptJS {
7132
7314
  * ```
7133
7315
  * @param locator - located by label|name|CSS|XPath|strict locator.
7134
7316
  * @param offsetX - position to drag.
7135
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7136
- *
7137
- * {{ react }}
7138
7317
  */
7139
7318
  dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): Promise<any>;
7140
7319
  /**
@@ -7175,7 +7354,6 @@ declare namespace CodeceptJS {
7175
7354
  * ```
7176
7355
  * @param locator - element located by CSS|XPath|strict locator.
7177
7356
  * @param fileName - file name to save.
7178
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7179
7357
  */
7180
7358
  saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
7181
7359
  /**
@@ -7189,7 +7367,6 @@ declare namespace CodeceptJS {
7189
7367
  * ```
7190
7368
  * @param fileName - file name to save.
7191
7369
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
7192
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7193
7370
  */
7194
7371
  saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
7195
7372
  /**
@@ -7199,7 +7376,6 @@ declare namespace CodeceptJS {
7199
7376
  * I.wait(2); // wait 2 secs
7200
7377
  * ```
7201
7378
  * @param sec - number of second to wait.
7202
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7203
7379
  */
7204
7380
  wait(sec: number): Promise<any>;
7205
7381
  /**
@@ -7207,7 +7383,6 @@ declare namespace CodeceptJS {
7207
7383
  * Element can be located by CSS or XPath.
7208
7384
  * @param locator - element located by CSS|XPath|strict locator.
7209
7385
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
7210
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7211
7386
  */
7212
7387
  waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7213
7388
  /**
@@ -7219,7 +7394,6 @@ declare namespace CodeceptJS {
7219
7394
  * @param field - input field.
7220
7395
  * @param value - expected value.
7221
7396
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7222
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7223
7397
  */
7224
7398
  waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
7225
7399
  /**
@@ -7231,9 +7405,6 @@ declare namespace CodeceptJS {
7231
7405
  * @param locator - element located by CSS|XPath|strict locator.
7232
7406
  * @param num - number of elements.
7233
7407
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7234
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7235
- *
7236
- * {{ react }}
7237
7408
  */
7238
7409
  waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
7239
7410
  /**
@@ -7246,7 +7417,6 @@ declare namespace CodeceptJS {
7246
7417
  * ```
7247
7418
  * @param locator - element located by CSS|XPath|strict locator.
7248
7419
  * @param [sec] - (optional, `1` by default) time in seconds to wait
7249
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7250
7420
  */
7251
7421
  waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7252
7422
  /**
@@ -7259,9 +7429,6 @@ declare namespace CodeceptJS {
7259
7429
  * ```
7260
7430
  * @param locator - element located by CSS|XPath|strict locator.
7261
7431
  * @param [sec] - (optional, `1` by default) time in seconds to wait
7262
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7263
- *
7264
- * {{ react }}
7265
7432
  */
7266
7433
  waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7267
7434
  /**
@@ -7273,10 +7440,6 @@ declare namespace CodeceptJS {
7273
7440
  * ```
7274
7441
  * @param locator - element located by CSS|XPath|strict locator.
7275
7442
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7276
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7277
- *
7278
- *
7279
- * This method accepts [React selectors](https://codecept.io/react).
7280
7443
  */
7281
7444
  waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7282
7445
  /**
@@ -7288,7 +7451,6 @@ declare namespace CodeceptJS {
7288
7451
  * ```
7289
7452
  * @param locator - element located by CSS|XPath|strict locator.
7290
7453
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7291
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7292
7454
  */
7293
7455
  waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7294
7456
  /**
@@ -7300,9 +7462,18 @@ declare namespace CodeceptJS {
7300
7462
  * ```
7301
7463
  * @param locator - element located by CSS|XPath|strict locator.
7302
7464
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7303
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7304
7465
  */
7305
7466
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7467
+ /**
7468
+ * Waits for number of tabs.
7469
+ *
7470
+ * ```js
7471
+ * I.waitForNumberOfTabs(2);
7472
+ * ```
7473
+ * @param expectedTabs - expecting the number of tabs.
7474
+ * @param sec - number of secs to wait.
7475
+ */
7476
+ waitForNumberOfTabs(expectedTabs: number, sec: number): Promise<any>;
7306
7477
  /**
7307
7478
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
7308
7479
  *
@@ -7311,7 +7482,6 @@ declare namespace CodeceptJS {
7311
7482
  * ```
7312
7483
  * @param urlPart - value to check.
7313
7484
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7314
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7315
7485
  */
7316
7486
  waitInUrl(urlPart: string, sec?: number): Promise<any>;
7317
7487
  /**
@@ -7323,7 +7493,6 @@ declare namespace CodeceptJS {
7323
7493
  * ```
7324
7494
  * @param urlPart - value to check.
7325
7495
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7326
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7327
7496
  */
7328
7497
  waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
7329
7498
  /**
@@ -7338,7 +7507,6 @@ declare namespace CodeceptJS {
7338
7507
  * @param text - to wait for.
7339
7508
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7340
7509
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
7341
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7342
7510
  */
7343
7511
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
7344
7512
  /**
@@ -7369,7 +7537,6 @@ declare namespace CodeceptJS {
7369
7537
  * I.switchTo(); // switch back to main page
7370
7538
  * ```
7371
7539
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
7372
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7373
7540
  */
7374
7541
  switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
7375
7542
  /**
@@ -7388,13 +7555,12 @@ declare namespace CodeceptJS {
7388
7555
  * @param fn - to be executed in browser context.
7389
7556
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
7390
7557
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
7391
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7392
7558
  */
7393
7559
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
7394
7560
  /**
7395
- * Waits for navigation to finish. By default takes configured `waitForNavigation` option.
7561
+ * Waits for navigation to finish. By default, takes configured `waitForNavigation` option.
7396
7562
  *
7397
- * See [Pupeteer's reference](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
7563
+ * See [Puppeteer's reference](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
7398
7564
  */
7399
7565
  waitForNavigation(opts: any): Promise<any>;
7400
7566
  /**
@@ -7406,7 +7572,6 @@ declare namespace CodeceptJS {
7406
7572
  * ```
7407
7573
  * @param locator - element located by CSS|XPath|strict locator.
7408
7574
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7409
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7410
7575
  */
7411
7576
  waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7412
7577
  /**
@@ -7429,7 +7594,6 @@ declare namespace CodeceptJS {
7429
7594
  * loadEventEnd: 241
7430
7595
  * }
7431
7596
  * ```
7432
- * @returns automatically synchronized promise through #recorder
7433
7597
  */
7434
7598
  grabDataFromPerformanceTiming(): Promise<any>;
7435
7599
  /**
@@ -7471,7 +7635,8 @@ declare namespace CodeceptJS {
7471
7635
  * endpoint: 'http://site.com/api',
7472
7636
  * prettyPrintJson: true,
7473
7637
  * onRequest: (request) => {
7474
- * request.headers.auth = '123';
7638
+ * request.headers.auth = '123';
7639
+ * }
7475
7640
  * }
7476
7641
  * }
7477
7642
  * }
@@ -7530,7 +7695,7 @@ declare namespace CodeceptJS {
7530
7695
  * ```js
7531
7696
  * I.sendGetRequest('/api/users.json');
7532
7697
  * ```
7533
- * @param [headers = {}] - the headers object to be sent. By default it is sent as an empty object
7698
+ * @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
7534
7699
  * @returns response
7535
7700
  */
7536
7701
  sendGetRequest(url: any, headers?: any): Promise<any>;
@@ -7544,8 +7709,8 @@ declare namespace CodeceptJS {
7544
7709
  * I.sendPostRequest('/api/users.json', secret({ "email": "user@user.com" }));
7545
7710
  *
7546
7711
  * ```
7547
- * @param [payload = {}] - the payload to be sent. By default it is sent as an empty object
7548
- * @param [headers = {}] - the headers object to be sent. By default it is sent as an empty object
7712
+ * @param [payload = {}] - the payload to be sent. By default, it is sent as an empty object
7713
+ * @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
7549
7714
  * @returns response
7550
7715
  */
7551
7716
  sendPostRequest(url: any, payload?: any, headers?: any): Promise<any>;
@@ -7585,77 +7750,11 @@ declare namespace CodeceptJS {
7585
7750
  * ```js
7586
7751
  * I.sendDeleteRequest('/api/users/1');
7587
7752
  * ```
7588
- * @param [headers = {}] - the headers object to be sent. By default it is sent as an empty object
7753
+ * @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
7589
7754
  * @returns response
7590
7755
  */
7591
7756
  sendDeleteRequest(url: any, headers?: any): Promise<any>;
7592
7757
  }
7593
- /**
7594
- * SeleniumWebdriver helper is based on the official [Selenium Webdriver JS](https://www.npmjs.com/package/selenium-webdriver)
7595
- * library. It implements common web api methods (amOnPage, click, see).
7596
- *
7597
- * ## Backends
7598
- *
7599
- * ### Selenium Installation
7600
- *
7601
- * 1. Download [Selenium Server](http://docs.seleniumhq.org/download/)
7602
- * 2. For Chrome browser install [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/getting-started), for Firefox browser install [GeckoDriver](https://github.com/mozilla/geckodriver).
7603
- * 3. Launch the server: `java -jar selenium-server-standalone-3.xx.xxx.jar`. To locate Chromedriver binary use `-Dwebdriver.chrome.driver=./chromedriver` option. For Geckodriver use `-Dwebdriver.gecko.driver=`.
7604
- *
7605
- *
7606
- * ### PhantomJS Installation
7607
- *
7608
- * PhantomJS is a headless alternative to Selenium Server that implements [the WebDriver protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol).
7609
- * It allows you to run Selenium tests on a server without a GUI installed.
7610
- *
7611
- * 1. Download [PhantomJS](http://phantomjs.org/download.html)
7612
- * 2. Run PhantomJS in WebDriver mode: `phantomjs --webdriver=4444`
7613
- *
7614
- * ## Configuration
7615
- *
7616
- * This helper should be configured in codecept.json or codecept.conf.js
7617
- *
7618
- * * `url` - base url of website to be tested
7619
- * * `browser` - browser in which perform testing
7620
- * * `driver` - which protractor driver to use (local, direct, session, hosted, sauce, browserstack). By default set to 'hosted' which requires selenium server to be started.
7621
- * * `restart` - restart browser between tests (default: true).
7622
- * * `smartWait`: (optional) **enables SmartWait**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000
7623
- * * `disableScreenshots` (optional, default: false) - don't save screenshot on failure
7624
- * * `uniqueScreenshotNames` (optional, default: false) - option to prevent screenshot override if you have scenarios with the same name in different suites
7625
- * * `keepBrowserState` (optional, default: false) - keep browser state between tests when `restart` set to false.
7626
- * * `keepCookies` (optional, default: false) - keep cookies between tests when `restart` set to false.*
7627
- * * `seleniumAddress` - Selenium address to connect (default: http://localhost:4444/wd/hub)
7628
- * * `waitForTimeout`: (optional) sets default wait time in _ms_ for all `wait*` functions. 1000 by default;
7629
- * * `scriptTimeout`: (optional) sets default timeout for scripts in `executeAsync`. 1000 by default.
7630
- * * `windowSize`: (optional) default window size. Set to `maximize` or a dimension in the format `640x480`.
7631
- * * `manualStart` (optional, default: false) - do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriverIO"]._startBrowser()`
7632
- * * `capabilities`: {} - list of [Desired Capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities)
7633
- *
7634
- * Example:
7635
- *
7636
- * ```json
7637
- * {
7638
- * "helpers": {
7639
- * "SeleniumWebdriver" : {
7640
- * "url": "http://localhost",
7641
- * "browser": "chrome",
7642
- * "smartWait": 5000,
7643
- * "restart": false
7644
- * }
7645
- * }
7646
- * }
7647
- * ```
7648
- *
7649
- * ## Access From Helpers
7650
- *
7651
- * Receive a WebDriverIO client from a custom helper by accessing `browser` property:
7652
- *
7653
- * ```js
7654
- * this.helpers['SeleniumWebdriver'].browser
7655
- * ```
7656
- */
7657
- class SeleniumWebdriverTs {
7658
- }
7659
7758
  /**
7660
7759
  * Client Functions
7661
7760
  */
@@ -7771,9 +7870,41 @@ declare namespace CodeceptJS {
7771
7870
  * First parameter can be set to `maximize`.
7772
7871
  * @param width - width in pixels or `maximize`.
7773
7872
  * @param height - height in pixels.
7774
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7775
7873
  */
7776
7874
  resizeWindow(width: number, height: number): Promise<any>;
7875
+ /**
7876
+ * Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.
7877
+ *
7878
+ * Examples:
7879
+ *
7880
+ * ```js
7881
+ * I.dontSee('#add-to-cart-btn');
7882
+ * I.focus('#product-tile')
7883
+ * I.see('#add-to-cart-bnt');
7884
+ * ```
7885
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
7886
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
7887
+ */
7888
+ focus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
7889
+ /**
7890
+ * Remove focus from a text input, button, etc.
7891
+ * Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
7892
+ *
7893
+ * Examples:
7894
+ *
7895
+ * ```js
7896
+ * I.blur('.text-area')
7897
+ * ```
7898
+ * ```js
7899
+ * //element `#product-tile` is focused
7900
+ * I.see('#add-to-cart-btn');
7901
+ * I.blur('#product-tile')
7902
+ * I.dontSee('#add-to-cart-btn');
7903
+ * ```
7904
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
7905
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
7906
+ */
7907
+ blur(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
7777
7908
  /**
7778
7909
  * Perform a click on a link or a button, given by a locator.
7779
7910
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -7798,7 +7929,6 @@ declare namespace CodeceptJS {
7798
7929
  * ```
7799
7930
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
7800
7931
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
7801
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7802
7932
  */
7803
7933
  click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
7804
7934
  /**
@@ -7807,7 +7937,6 @@ declare namespace CodeceptJS {
7807
7937
  * ```js
7808
7938
  * I.refreshPage();
7809
7939
  * ```
7810
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7811
7940
  */
7812
7941
  refreshPage(): Promise<any>;
7813
7942
  /**
@@ -7819,7 +7948,6 @@ declare namespace CodeceptJS {
7819
7948
  * ```
7820
7949
  * @param locator - element located by CSS|XPath|strict locator.
7821
7950
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7822
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7823
7951
  */
7824
7952
  waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7825
7953
  /**
@@ -7838,7 +7966,6 @@ declare namespace CodeceptJS {
7838
7966
  * ```
7839
7967
  * @param field - located by label|name|CSS|XPath|strict locator.
7840
7968
  * @param value - text value to fill.
7841
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7842
7969
  */
7843
7970
  fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
7844
7971
  /**
@@ -7850,7 +7977,6 @@ declare namespace CodeceptJS {
7850
7977
  * I.clearField('#email');
7851
7978
  * ```
7852
7979
  * @param editable - field located by label|name|CSS|XPath|strict locator.
7853
- * ⚠️ returns a _promise_ which is synchronized internally by recorder.
7854
7980
  */
7855
7981
  clearField(editable: LocatorOrString): Promise<any>;
7856
7982
  /**
@@ -7859,10 +7985,11 @@ declare namespace CodeceptJS {
7859
7985
  *
7860
7986
  * ```js
7861
7987
  * I.appendField('#myTextField', 'appended');
7988
+ * // typing secret
7989
+ * I.appendField('password', secret('123456'));
7862
7990
  * ```
7863
7991
  * @param field - located by label|name|CSS|XPath|strict locator
7864
7992
  * @param value - text value to append.
7865
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7866
7993
  */
7867
7994
  appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
7868
7995
  /**
@@ -7876,7 +8003,6 @@ declare namespace CodeceptJS {
7876
8003
  * ```
7877
8004
  * @param locator - field located by label|name|CSS|XPath|strict locator.
7878
8005
  * @param pathToFile - local file path relative to codecept.conf.ts or codecept.conf.js config file.
7879
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7880
8006
  */
7881
8007
  attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
7882
8008
  /**
@@ -7890,10 +8016,6 @@ declare namespace CodeceptJS {
7890
8016
  * I.pressKey(['Control','a']);
7891
8017
  * ```
7892
8018
  * @param key - key or array of keys to press.
7893
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7894
- *
7895
- *
7896
- * {{ keys }}
7897
8019
  */
7898
8020
  pressKey(key: string | string[]): Promise<any>;
7899
8021
  /**
@@ -7907,7 +8029,6 @@ declare namespace CodeceptJS {
7907
8029
  * @param locator - located by CSS|XPath|strict locator.
7908
8030
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
7909
8031
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
7910
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7911
8032
  */
7912
8033
  moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
7913
8034
  /**
@@ -7922,7 +8043,6 @@ declare namespace CodeceptJS {
7922
8043
  * ```
7923
8044
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
7924
8045
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
7925
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7926
8046
  */
7927
8047
  doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7928
8048
  /**
@@ -7938,7 +8058,6 @@ declare namespace CodeceptJS {
7938
8058
  * ```
7939
8059
  * @param locator - clickable element located by CSS|XPath|strict locator.
7940
8060
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
7941
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7942
8061
  */
7943
8062
  rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7944
8063
  /**
@@ -7954,7 +8073,6 @@ declare namespace CodeceptJS {
7954
8073
  * ```
7955
8074
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
7956
8075
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
7957
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7958
8076
  */
7959
8077
  checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7960
8078
  /**
@@ -7970,7 +8088,6 @@ declare namespace CodeceptJS {
7970
8088
  * ```
7971
8089
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
7972
8090
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
7973
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7974
8091
  */
7975
8092
  uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7976
8093
  /**
@@ -7982,7 +8099,6 @@ declare namespace CodeceptJS {
7982
8099
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
7983
8100
  * ```
7984
8101
  * @param field - located by label|name|CSS|XPath|strict locator.
7985
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7986
8102
  */
7987
8103
  seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
7988
8104
  /**
@@ -7994,7 +8110,6 @@ declare namespace CodeceptJS {
7994
8110
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
7995
8111
  * ```
7996
8112
  * @param field - located by label|name|CSS|XPath|strict locator.
7997
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
7998
8113
  */
7999
8114
  dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
8000
8115
  /**
@@ -8018,7 +8133,6 @@ declare namespace CodeceptJS {
8018
8133
  * ```
8019
8134
  * @param select - field located by label|name|CSS|XPath|strict locator.
8020
8135
  * @param option - visible text or value of option.
8021
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8022
8136
  */
8023
8137
  selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
8024
8138
  /**
@@ -8028,13 +8142,11 @@ declare namespace CodeceptJS {
8028
8142
  * I.seeInCurrentUrl('/register'); // we are on registration page
8029
8143
  * ```
8030
8144
  * @param url - a fragment to check
8031
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8032
8145
  */
8033
8146
  seeInCurrentUrl(url: string): Promise<any>;
8034
8147
  /**
8035
8148
  * Checks that current url does not contain a provided fragment.
8036
8149
  * @param url - value to check.
8037
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8038
8150
  */
8039
8151
  dontSeeInCurrentUrl(url: string): Promise<any>;
8040
8152
  /**
@@ -8047,7 +8159,6 @@ declare namespace CodeceptJS {
8047
8159
  * I.seeCurrentUrlEquals('http://my.site.com/register');
8048
8160
  * ```
8049
8161
  * @param url - value to check.
8050
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8051
8162
  */
8052
8163
  seeCurrentUrlEquals(url: string): Promise<any>;
8053
8164
  /**
@@ -8059,7 +8170,6 @@ declare namespace CodeceptJS {
8059
8170
  * I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also ok
8060
8171
  * ```
8061
8172
  * @param url - value to check.
8062
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8063
8173
  */
8064
8174
  dontSeeCurrentUrlEquals(url: string): Promise<any>;
8065
8175
  /**
@@ -8073,7 +8183,6 @@ declare namespace CodeceptJS {
8073
8183
  * ```
8074
8184
  * @param text - expected on page.
8075
8185
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
8076
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8077
8186
  */
8078
8187
  see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
8079
8188
  /**
@@ -8086,7 +8195,6 @@ declare namespace CodeceptJS {
8086
8195
  * ```
8087
8196
  * @param text - which is not present.
8088
8197
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
8089
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8090
8198
  */
8091
8199
  dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
8092
8200
  /**
@@ -8097,7 +8205,6 @@ declare namespace CodeceptJS {
8097
8205
  * I.seeElement('#modal');
8098
8206
  * ```
8099
8207
  * @param locator - located by CSS|XPath|strict locator.
8100
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8101
8208
  */
8102
8209
  seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
8103
8210
  /**
@@ -8107,7 +8214,6 @@ declare namespace CodeceptJS {
8107
8214
  * I.dontSeeElement('.modal'); // modal is not shown
8108
8215
  * ```
8109
8216
  * @param locator - located by CSS|XPath|Strict locator.
8110
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8111
8217
  */
8112
8218
  dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
8113
8219
  /**
@@ -8118,7 +8224,6 @@ declare namespace CodeceptJS {
8118
8224
  * I.seeElementInDOM('#modal');
8119
8225
  * ```
8120
8226
  * @param locator - element located by CSS|XPath|strict locator.
8121
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8122
8227
  */
8123
8228
  seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
8124
8229
  /**
@@ -8128,7 +8233,6 @@ declare namespace CodeceptJS {
8128
8233
  * I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
8129
8234
  * ```
8130
8235
  * @param locator - located by CSS|XPath|Strict locator.
8131
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8132
8236
  */
8133
8237
  dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
8134
8238
  /**
@@ -8140,7 +8244,6 @@ declare namespace CodeceptJS {
8140
8244
  * ```
8141
8245
  * @param locator - element located by CSS|XPath|strict locator.
8142
8246
  * @param num - number of elements.
8143
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8144
8247
  */
8145
8248
  seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
8146
8249
  /**
@@ -8166,9 +8269,8 @@ declare namespace CodeceptJS {
8166
8269
  * ```
8167
8270
  * @param field - located by label|name|CSS|XPath|strict locator.
8168
8271
  * @param value - value to check.
8169
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8170
8272
  */
8171
- seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
8273
+ seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
8172
8274
  /**
8173
8275
  * Checks that value of input field or textarea doesn't equal to given value
8174
8276
  * Opposite to `seeInField`.
@@ -8179,9 +8281,8 @@ declare namespace CodeceptJS {
8179
8281
  * ```
8180
8282
  * @param field - located by label|name|CSS|XPath|strict locator.
8181
8283
  * @param value - value to check.
8182
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8183
8284
  */
8184
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
8285
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
8185
8286
  /**
8186
8287
  * Checks that text is equal to provided one.
8187
8288
  *
@@ -8197,7 +8298,6 @@ declare namespace CodeceptJS {
8197
8298
  * I.seeInSource('<h1>Green eggs &amp; ham</h1>');
8198
8299
  * ```
8199
8300
  * @param text - value to check.
8200
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8201
8301
  */
8202
8302
  seeInSource(text: string): Promise<any>;
8203
8303
  /**
@@ -8207,7 +8307,6 @@ declare namespace CodeceptJS {
8207
8307
  * I.dontSeeInSource('<!--'); // no comments in source
8208
8308
  * ```
8209
8309
  * @param value - to check.
8210
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8211
8310
  */
8212
8311
  dontSeeInSource(value: string): Promise<any>;
8213
8312
  /**
@@ -8219,7 +8318,6 @@ declare namespace CodeceptJS {
8219
8318
  * ```
8220
8319
  * @param locator - element located by CSS|XPath|strict locator.
8221
8320
  * @param fileName - file name to save.
8222
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8223
8321
  */
8224
8322
  saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
8225
8323
  /**
@@ -8233,7 +8331,6 @@ declare namespace CodeceptJS {
8233
8331
  * ```
8234
8332
  * @param fileName - file name to save.
8235
8333
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
8236
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8237
8334
  */
8238
8335
  saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
8239
8336
  /**
@@ -8243,7 +8340,6 @@ declare namespace CodeceptJS {
8243
8340
  * I.wait(2); // wait 2 secs
8244
8341
  * ```
8245
8342
  * @param sec - number of second to wait.
8246
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8247
8343
  */
8248
8344
  wait(sec: number): Promise<any>;
8249
8345
  /**
@@ -8271,10 +8367,10 @@ declare namespace CodeceptJS {
8271
8367
  * ```
8272
8368
  * @param fn - function to be executed in browser context.
8273
8369
  * @param args - to be passed to function.
8274
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8370
+ * @returns script return value
8275
8371
  *
8276
8372
  *
8277
- * If a function returns a Promise It will wait for it resolution.
8373
+ * If a function returns a Promise It will wait for its resolution.
8278
8374
  */
8279
8375
  executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
8280
8376
  /**
@@ -8395,7 +8491,6 @@ declare namespace CodeceptJS {
8395
8491
  * ```js
8396
8492
  * I.scrollPageToTop();
8397
8493
  * ```
8398
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8399
8494
  */
8400
8495
  scrollPageToTop(): Promise<any>;
8401
8496
  /**
@@ -8404,7 +8499,6 @@ declare namespace CodeceptJS {
8404
8499
  * ```js
8405
8500
  * I.scrollPageToBottom();
8406
8501
  * ```
8407
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8408
8502
  */
8409
8503
  scrollPageToBottom(): Promise<any>;
8410
8504
  /**
@@ -8418,7 +8512,6 @@ declare namespace CodeceptJS {
8418
8512
  * @param locator - located by CSS|XPath|strict locator.
8419
8513
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
8420
8514
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
8421
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8422
8515
  */
8423
8516
  scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
8424
8517
  /**
@@ -8429,7 +8522,6 @@ declare namespace CodeceptJS {
8429
8522
  * I.switchTo(); // switch back to main page
8430
8523
  * ```
8431
8524
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
8432
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8433
8525
  */
8434
8526
  switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
8435
8527
  /**
@@ -8447,7 +8539,6 @@ declare namespace CodeceptJS {
8447
8539
  * ]);
8448
8540
  * ```
8449
8541
  * @param cookie - a cookie object or array of cookie objects.
8450
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8451
8542
  */
8452
8543
  setCookie(cookie: Cookie | Cookie[]): Promise<any>;
8453
8544
  /**
@@ -8457,7 +8548,6 @@ declare namespace CodeceptJS {
8457
8548
  * I.seeCookie('Auth');
8458
8549
  * ```
8459
8550
  * @param name - cookie name.
8460
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8461
8551
  */
8462
8552
  seeCookie(name: string): Promise<any>;
8463
8553
  /**
@@ -8467,7 +8557,6 @@ declare namespace CodeceptJS {
8467
8557
  * I.dontSeeCookie('auth'); // no auth cookie
8468
8558
  * ```
8469
8559
  * @param name - cookie name.
8470
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8471
8560
  */
8472
8561
  dontSeeCookie(name: string): Promise<any>;
8473
8562
  /**
@@ -8480,22 +8569,17 @@ declare namespace CodeceptJS {
8480
8569
  * assert(cookie.value, '123456');
8481
8570
  * ```
8482
8571
  * @param [name = null] - cookie name.
8483
- * @returns attribute value
8484
- *
8485
- *
8486
- * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
8487
8572
  */
8488
- grabCookie(name?: string): Promise<string> | Promise<string[]>;
8573
+ grabCookie(name?: string): Promise<any>;
8489
8574
  /**
8490
8575
  * Clears a cookie by name,
8491
8576
  * if none provided clears all cookies.
8492
8577
  *
8493
8578
  * ```js
8494
8579
  * I.clearCookie();
8495
- * I.clearCookie('test');
8580
+ * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
8496
8581
  * ```
8497
8582
  * @param [cookie = null] - (optional, `null` by default) cookie name
8498
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8499
8583
  */
8500
8584
  clearCookie(cookie?: string): Promise<any>;
8501
8585
  /**
@@ -8506,7 +8590,6 @@ declare namespace CodeceptJS {
8506
8590
  * ```
8507
8591
  * @param urlPart - value to check.
8508
8592
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8509
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8510
8593
  */
8511
8594
  waitInUrl(urlPart: string, sec?: number): Promise<any>;
8512
8595
  /**
@@ -8518,7 +8601,6 @@ declare namespace CodeceptJS {
8518
8601
  * ```
8519
8602
  * @param urlPart - value to check.
8520
8603
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8521
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8522
8604
  */
8523
8605
  waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
8524
8606
  /**
@@ -8537,7 +8619,6 @@ declare namespace CodeceptJS {
8537
8619
  * @param fn - to be executed in browser context.
8538
8620
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
8539
8621
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
8540
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8541
8622
  */
8542
8623
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
8543
8624
  /**
@@ -8549,7 +8630,6 @@ declare namespace CodeceptJS {
8549
8630
  * @param locator - element located by CSS|XPath|strict locator.
8550
8631
  * @param num - number of elements.
8551
8632
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8552
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8553
8633
  */
8554
8634
  waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
8555
8635
  /**
@@ -8562,7 +8642,6 @@ declare namespace CodeceptJS {
8562
8642
  * ```
8563
8643
  * @param locator - element located by CSS|XPath|strict locator.
8564
8644
  * @param [sec] - (optional, `1` by default) time in seconds to wait
8565
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8566
8645
  */
8567
8646
  waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
8568
8647
  /**
@@ -8574,7 +8653,6 @@ declare namespace CodeceptJS {
8574
8653
  * ```
8575
8654
  * @param locator - element located by CSS|XPath|strict locator.
8576
8655
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8577
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8578
8656
  */
8579
8657
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
8580
8658
  /**
@@ -8586,7 +8664,6 @@ declare namespace CodeceptJS {
8586
8664
  * ```
8587
8665
  * @param locator - element located by CSS|XPath|strict locator.
8588
8666
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8589
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8590
8667
  */
8591
8668
  waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
8592
8669
  /**
@@ -8601,7 +8678,6 @@ declare namespace CodeceptJS {
8601
8678
  * @param text - to wait for.
8602
8679
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8603
8680
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
8604
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
8605
8681
  */
8606
8682
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
8607
8683
  }
@@ -8611,6 +8687,13 @@ declare namespace CodeceptJS {
8611
8687
  *
8612
8688
  * WebDriver requires Selenium Server and ChromeDriver/GeckoDriver to be installed. Those tools can be easily installed via NPM. Please check [Testing with WebDriver](https://codecept.io/webdriver/#testing-with-webdriver) for more details.
8613
8689
  *
8690
+ * With the release of WebdriverIO version v8.14.0, and onwards, all driver management hassles are now a thing of the past 🙌. Read more [here](https://webdriver.io/blog/2023/07/31/driver-management/).
8691
+ * One of the significant advantages of this update is that you can now get rid of any driver services you previously had to manage, such as
8692
+ * `wdio-chromedriver-service`, `wdio-geckodriver-service`, `wdio-edgedriver-service`, `wdio-safaridriver-service`, and even `@wdio/selenium-standalone-service`.
8693
+ *
8694
+ * For those who require custom driver options, fear not; WebDriver Helper allows you to pass in driver options through custom WebDriver configuration.
8695
+ * If you have a custom grid, use a cloud service, or prefer to run your own driver, there's no need to worry since WebDriver Helper will only start a driver when there are no other connection information settings like hostname or port specified.
8696
+ *
8614
8697
  * <!-- configuration -->
8615
8698
  *
8616
8699
  * Example:
@@ -8632,6 +8715,28 @@ declare namespace CodeceptJS {
8632
8715
  * }
8633
8716
  * ```
8634
8717
  *
8718
+ * Testing Chrome locally is now more convenient than ever. You can define a browser channel, and WebDriver Helper will take care of downloading the specified browser version for you.
8719
+ * For example:
8720
+ *
8721
+ * ```js
8722
+ * {
8723
+ * helpers: {
8724
+ * WebDriver : {
8725
+ * smartWait: 5000,
8726
+ * browser: "chrome",
8727
+ * browserVersion: '116.0.5793.0', // or 'stable', 'beta', 'dev' or 'canary'
8728
+ * restart: false,
8729
+ * windowSize: "maximize",
8730
+ * timeouts: {
8731
+ * "script": 60000,
8732
+ * "page load": 10000
8733
+ * }
8734
+ * }
8735
+ * }
8736
+ * }
8737
+ * ```
8738
+ *
8739
+ *
8635
8740
  * Example with basic authentication
8636
8741
  * ```js
8637
8742
  * {
@@ -8672,6 +8777,25 @@ declare namespace CodeceptJS {
8672
8777
  * }
8673
8778
  * ```
8674
8779
  *
8780
+ * ### Running with devtools protocol
8781
+ *
8782
+ * ```js
8783
+ * {
8784
+ * helpers: {
8785
+ * WebDriver : {
8786
+ * url: "http://localhost",
8787
+ * browser: "chrome",
8788
+ * devtoolsProtocol: true,
8789
+ * desiredCapabilities: {
8790
+ * chromeOptions: {
8791
+ * args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
8792
+ * }
8793
+ * }
8794
+ * }
8795
+ * }
8796
+ * }
8797
+ * ```
8798
+ *
8675
8799
  * ### Internet Explorer
8676
8800
  *
8677
8801
  * Additional configuration params can be used from [IE options](https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/IE/Options.html)
@@ -8966,7 +9090,7 @@ declare namespace CodeceptJS {
8966
9090
  */
8967
9091
  _locate(locator: CodeceptJS.LocatorOrString): Promise<any>;
8968
9092
  /**
8969
- * Find a checkbox by providing human readable text:
9093
+ * Find a checkbox by providing human-readable text:
8970
9094
  *
8971
9095
  * ```js
8972
9096
  * this.helpers['WebDriver']._locateCheckable('I agree with terms and conditions').then // ...
@@ -8975,7 +9099,7 @@ declare namespace CodeceptJS {
8975
9099
  */
8976
9100
  _locateCheckable(locator: CodeceptJS.LocatorOrString): Promise<any>;
8977
9101
  /**
8978
- * Find a clickable element by providing human readable text:
9102
+ * Find a clickable element by providing human-readable text:
8979
9103
  *
8980
9104
  * ```js
8981
9105
  * const els = await this.helpers.WebDriver._locateClickable('Next page');
@@ -8985,7 +9109,7 @@ declare namespace CodeceptJS {
8985
9109
  */
8986
9110
  _locateClickable(locator: CodeceptJS.LocatorOrString): Promise<any>;
8987
9111
  /**
8988
- * Find field elements by providing human readable text:
9112
+ * Find field elements by providing human-readable text:
8989
9113
  *
8990
9114
  * ```js
8991
9115
  * this.helpers['WebDriver']._locateFields('Your email').then // ...
@@ -8993,6 +9117,17 @@ declare namespace CodeceptJS {
8993
9117
  * @param locator - element located by CSS|XPath|strict locator.
8994
9118
  */
8995
9119
  _locateFields(locator: CodeceptJS.LocatorOrString): Promise<any>;
9120
+ /**
9121
+ * Grab WebElements for given locator
9122
+ * Resumes test execution, so **should be used inside an async function with `await`** operator.
9123
+ *
9124
+ * ```js
9125
+ * const webElements = await I.grabWebElements('#button');
9126
+ * ```
9127
+ * @param locator - element located by CSS|XPath|strict locator.
9128
+ * @returns WebElement of being used Web helper
9129
+ */
9130
+ grabWebElements(locator: CodeceptJS.LocatorOrString): Promise<any>;
8996
9131
  /**
8997
9132
  * Set [WebDriver timeouts](https://webdriver.io/docs/timeouts.html) in realtime.
8998
9133
  *
@@ -9041,10 +9176,6 @@ declare namespace CodeceptJS {
9041
9176
  * ```
9042
9177
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
9043
9178
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
9044
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9045
- *
9046
- *
9047
- * {{ react }}
9048
9179
  */
9049
9180
  click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
9050
9181
  /**
@@ -9074,10 +9205,6 @@ declare namespace CodeceptJS {
9074
9205
  * ```
9075
9206
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
9076
9207
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
9077
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9078
- *
9079
- *
9080
- * {{ react }}
9081
9208
  */
9082
9209
  forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
9083
9210
  /**
@@ -9092,10 +9219,6 @@ declare namespace CodeceptJS {
9092
9219
  * ```
9093
9220
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
9094
9221
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
9095
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9096
- *
9097
- *
9098
- * {{ react }}
9099
9222
  */
9100
9223
  doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
9101
9224
  /**
@@ -9111,10 +9234,6 @@ declare namespace CodeceptJS {
9111
9234
  * ```
9112
9235
  * @param locator - clickable element located by CSS|XPath|strict locator.
9113
9236
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
9114
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9115
- *
9116
- *
9117
- * {{ react }}
9118
9237
  */
9119
9238
  rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
9120
9239
  /**
@@ -9134,10 +9253,6 @@ declare namespace CodeceptJS {
9134
9253
  * ```
9135
9254
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
9136
9255
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
9137
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9138
- *
9139
- *
9140
- * {{ react }}
9141
9256
  */
9142
9257
  forceRightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
9143
9258
  /**
@@ -9156,10 +9271,6 @@ declare namespace CodeceptJS {
9156
9271
  * ```
9157
9272
  * @param field - located by label|name|CSS|XPath|strict locator.
9158
9273
  * @param value - text value to fill.
9159
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9160
- *
9161
- * {{ react }}
9162
- * {{ custom }}
9163
9274
  */
9164
9275
  fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
9165
9276
  /**
@@ -9168,12 +9279,11 @@ declare namespace CodeceptJS {
9168
9279
  *
9169
9280
  * ```js
9170
9281
  * I.appendField('#myTextField', 'appended');
9282
+ * // typing secret
9283
+ * I.appendField('password', secret('123456'));
9171
9284
  * ```
9172
9285
  * @param field - located by label|name|CSS|XPath|strict locator
9173
9286
  * @param value - text value to append.
9174
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9175
- *
9176
- * {{ react }}
9177
9287
  */
9178
9288
  appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
9179
9289
  /**
@@ -9185,7 +9295,6 @@ declare namespace CodeceptJS {
9185
9295
  * I.clearField('#email');
9186
9296
  * ```
9187
9297
  * @param editable - field located by label|name|CSS|XPath|strict locator.
9188
- * ⚠️ returns a _promise_ which is synchronized internally by recorder.
9189
9298
  */
9190
9299
  clearField(editable: LocatorOrString): Promise<any>;
9191
9300
  /**
@@ -9209,10 +9318,11 @@ declare namespace CodeceptJS {
9209
9318
  * ```
9210
9319
  * @param select - field located by label|name|CSS|XPath|strict locator.
9211
9320
  * @param option - visible text or value of option.
9212
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9213
9321
  */
9214
9322
  selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
9215
9323
  /**
9324
+ * Appium: not tested
9325
+ *
9216
9326
  * Attaches a file to element located by label, name, CSS or XPath
9217
9327
  * Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
9218
9328
  * File will be uploaded to remote system (if tests are running remotely).
@@ -9223,12 +9333,10 @@ declare namespace CodeceptJS {
9223
9333
  * ```
9224
9334
  * @param locator - field located by label|name|CSS|XPath|strict locator.
9225
9335
  * @param pathToFile - local file path relative to codecept.conf.ts or codecept.conf.js config file.
9226
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9227
- *
9228
- * Appium: not tested
9229
9336
  */
9230
9337
  attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
9231
9338
  /**
9339
+ * Appium: not tested
9232
9340
  * Selects a checkbox or radio button.
9233
9341
  * Element is located by label or name or CSS or XPath.
9234
9342
  *
@@ -9241,12 +9349,10 @@ declare namespace CodeceptJS {
9241
9349
  * ```
9242
9350
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
9243
9351
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
9244
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9245
- *
9246
- * Appium: not tested
9247
9352
  */
9248
9353
  checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
9249
9354
  /**
9355
+ * Appium: not tested
9250
9356
  * Unselects a checkbox or radio button.
9251
9357
  * Element is located by label or name or CSS or XPath.
9252
9358
  *
@@ -9259,9 +9365,6 @@ declare namespace CodeceptJS {
9259
9365
  * ```
9260
9366
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
9261
9367
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
9262
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9263
- *
9264
- * Appium: not tested
9265
9368
  */
9266
9369
  uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
9267
9370
  /**
@@ -9390,7 +9493,6 @@ declare namespace CodeceptJS {
9390
9493
  * I.seeInTitle('Home Page');
9391
9494
  * ```
9392
9495
  * @param text - text value to check.
9393
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9394
9496
  */
9395
9497
  seeInTitle(text: string): Promise<any>;
9396
9498
  /**
@@ -9400,7 +9502,6 @@ declare namespace CodeceptJS {
9400
9502
  * I.seeTitleEquals('Test title.');
9401
9503
  * ```
9402
9504
  * @param text - value to check.
9403
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9404
9505
  */
9405
9506
  seeTitleEquals(text: string): Promise<any>;
9406
9507
  /**
@@ -9410,7 +9511,6 @@ declare namespace CodeceptJS {
9410
9511
  * I.dontSeeInTitle('Error');
9411
9512
  * ```
9412
9513
  * @param text - value to check.
9413
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9414
9514
  */
9415
9515
  dontSeeInTitle(text: string): Promise<any>;
9416
9516
  /**
@@ -9434,10 +9534,6 @@ declare namespace CodeceptJS {
9434
9534
  * ```
9435
9535
  * @param text - expected on page.
9436
9536
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
9437
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9438
- *
9439
- *
9440
- * {{ react }}
9441
9537
  */
9442
9538
  see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
9443
9539
  /**
@@ -9448,7 +9544,6 @@ declare namespace CodeceptJS {
9448
9544
  * ```
9449
9545
  * @param text - element value to check.
9450
9546
  * @param [context = null] - element located by CSS|XPath|strict locator.
9451
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9452
9547
  */
9453
9548
  seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
9454
9549
  /**
@@ -9461,10 +9556,6 @@ declare namespace CodeceptJS {
9461
9556
  * ```
9462
9557
  * @param text - which is not present.
9463
9558
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
9464
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9465
- *
9466
- *
9467
- * {{ react }}
9468
9559
  */
9469
9560
  dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
9470
9561
  /**
@@ -9479,9 +9570,8 @@ declare namespace CodeceptJS {
9479
9570
  * ```
9480
9571
  * @param field - located by label|name|CSS|XPath|strict locator.
9481
9572
  * @param value - value to check.
9482
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9483
9573
  */
9484
- seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
9574
+ seeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
9485
9575
  /**
9486
9576
  * Checks that value of input field or textarea doesn't equal to given value
9487
9577
  * Opposite to `seeInField`.
@@ -9492,10 +9582,10 @@ declare namespace CodeceptJS {
9492
9582
  * ```
9493
9583
  * @param field - located by label|name|CSS|XPath|strict locator.
9494
9584
  * @param value - value to check.
9495
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9496
9585
  */
9497
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
9586
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
9498
9587
  /**
9588
+ * Appium: not tested
9499
9589
  * Verifies that the specified checkbox is checked.
9500
9590
  *
9501
9591
  * ```js
@@ -9504,12 +9594,10 @@ declare namespace CodeceptJS {
9504
9594
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
9505
9595
  * ```
9506
9596
  * @param field - located by label|name|CSS|XPath|strict locator.
9507
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9508
- *
9509
- * Appium: not tested
9510
9597
  */
9511
9598
  seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
9512
9599
  /**
9600
+ * Appium: not tested
9513
9601
  * Verifies that the specified checkbox is not checked.
9514
9602
  *
9515
9603
  * ```js
@@ -9518,9 +9606,6 @@ declare namespace CodeceptJS {
9518
9606
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
9519
9607
  * ```
9520
9608
  * @param field - located by label|name|CSS|XPath|strict locator.
9521
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9522
- *
9523
- * Appium: not tested
9524
9609
  */
9525
9610
  dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
9526
9611
  /**
@@ -9531,9 +9616,6 @@ declare namespace CodeceptJS {
9531
9616
  * I.seeElement('#modal');
9532
9617
  * ```
9533
9618
  * @param locator - located by CSS|XPath|strict locator.
9534
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9535
- *
9536
- * {{ react }}
9537
9619
  */
9538
9620
  seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
9539
9621
  /**
@@ -9543,9 +9625,6 @@ declare namespace CodeceptJS {
9543
9625
  * I.dontSeeElement('.modal'); // modal is not shown
9544
9626
  * ```
9545
9627
  * @param locator - located by CSS|XPath|Strict locator.
9546
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9547
- *
9548
- * {{ react }}
9549
9628
  */
9550
9629
  dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
9551
9630
  /**
@@ -9556,7 +9635,6 @@ declare namespace CodeceptJS {
9556
9635
  * I.seeElementInDOM('#modal');
9557
9636
  * ```
9558
9637
  * @param locator - element located by CSS|XPath|strict locator.
9559
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9560
9638
  */
9561
9639
  seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
9562
9640
  /**
@@ -9566,7 +9644,6 @@ declare namespace CodeceptJS {
9566
9644
  * I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
9567
9645
  * ```
9568
9646
  * @param locator - located by CSS|XPath|Strict locator.
9569
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9570
9647
  */
9571
9648
  dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
9572
9649
  /**
@@ -9576,7 +9653,6 @@ declare namespace CodeceptJS {
9576
9653
  * I.seeInSource('<h1>Green eggs &amp; ham</h1>');
9577
9654
  * ```
9578
9655
  * @param text - value to check.
9579
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9580
9656
  */
9581
9657
  seeInSource(text: string): Promise<any>;
9582
9658
  /**
@@ -9618,7 +9694,6 @@ declare namespace CodeceptJS {
9618
9694
  * I.dontSeeInSource('<!--'); // no comments in source
9619
9695
  * ```
9620
9696
  * @param value - to check.
9621
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9622
9697
  */
9623
9698
  dontSeeInSource(value: string): Promise<any>;
9624
9699
  /**
@@ -9631,9 +9706,6 @@ declare namespace CodeceptJS {
9631
9706
  * ```
9632
9707
  * @param locator - element located by CSS|XPath|strict locator.
9633
9708
  * @param num - number of elements.
9634
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9635
- *
9636
- * {{ react }}
9637
9709
  */
9638
9710
  seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
9639
9711
  /**
@@ -9645,9 +9717,6 @@ declare namespace CodeceptJS {
9645
9717
  * ```
9646
9718
  * @param locator - element located by CSS|XPath|strict locator.
9647
9719
  * @param num - number of elements.
9648
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9649
- *
9650
- * {{ react }}
9651
9720
  */
9652
9721
  seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
9653
9722
  /**
@@ -9658,7 +9727,6 @@ declare namespace CodeceptJS {
9658
9727
  * ```
9659
9728
  * @param locator - located by CSS|XPath|strict locator.
9660
9729
  * @param cssProperties - object with CSS properties and their values to check.
9661
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9662
9730
  */
9663
9731
  seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
9664
9732
  /**
@@ -9669,7 +9737,6 @@ declare namespace CodeceptJS {
9669
9737
  * ```
9670
9738
  * @param locator - located by CSS|XPath|strict locator.
9671
9739
  * @param attributes - attributes and their values to check.
9672
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9673
9740
  */
9674
9741
  seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
9675
9742
  /**
@@ -9690,13 +9757,11 @@ declare namespace CodeceptJS {
9690
9757
  * I.seeInCurrentUrl('/register'); // we are on registration page
9691
9758
  * ```
9692
9759
  * @param url - a fragment to check
9693
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9694
9760
  */
9695
9761
  seeInCurrentUrl(url: string): Promise<any>;
9696
9762
  /**
9697
9763
  * Checks that current url does not contain a provided fragment.
9698
9764
  * @param url - value to check.
9699
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9700
9765
  */
9701
9766
  dontSeeInCurrentUrl(url: string): Promise<any>;
9702
9767
  /**
@@ -9709,7 +9774,6 @@ declare namespace CodeceptJS {
9709
9774
  * I.seeCurrentUrlEquals('http://my.site.com/register');
9710
9775
  * ```
9711
9776
  * @param url - value to check.
9712
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9713
9777
  */
9714
9778
  seeCurrentUrlEquals(url: string): Promise<any>;
9715
9779
  /**
@@ -9721,10 +9785,11 @@ declare namespace CodeceptJS {
9721
9785
  * I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also ok
9722
9786
  * ```
9723
9787
  * @param url - value to check.
9724
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9725
9788
  */
9726
9789
  dontSeeCurrentUrlEquals(url: string): Promise<any>;
9727
9790
  /**
9791
+ * Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
9792
+ *
9728
9793
  * Executes sync script on a page.
9729
9794
  * Pass arguments to function as additional parameters.
9730
9795
  * Will return execution result to a test.
@@ -9749,11 +9814,7 @@ declare namespace CodeceptJS {
9749
9814
  * ```
9750
9815
  * @param fn - function to be executed in browser context.
9751
9816
  * @param args - to be passed to function.
9752
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9753
- *
9754
- *
9755
- *
9756
- * Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
9817
+ * @returns script return value
9757
9818
  */
9758
9819
  executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
9759
9820
  /**
@@ -9779,7 +9840,7 @@ declare namespace CodeceptJS {
9779
9840
  * ```
9780
9841
  * @param fn - function to be executed in browser context.
9781
9842
  * @param args - to be passed to function.
9782
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9843
+ * @returns script return value
9783
9844
  */
9784
9845
  executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
9785
9846
  /**
@@ -9791,10 +9852,9 @@ declare namespace CodeceptJS {
9791
9852
  * I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
9792
9853
  * ```
9793
9854
  * @param locator - located by CSS|XPath|strict locator.
9794
- * @param scrollIntoViewOptions - see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
9795
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9855
+ * @param scrollIntoViewOptions - either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
9796
9856
  */
9797
- scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): Promise<any>;
9857
+ scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions | boolean): Promise<any>;
9798
9858
  /**
9799
9859
  * Scrolls to element matched by locator.
9800
9860
  * Extra shift can be set with offsetX and offsetY options.
@@ -9806,7 +9866,6 @@ declare namespace CodeceptJS {
9806
9866
  * @param locator - located by CSS|XPath|strict locator.
9807
9867
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
9808
9868
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
9809
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9810
9869
  */
9811
9870
  scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
9812
9871
  /**
@@ -9820,7 +9879,6 @@ declare namespace CodeceptJS {
9820
9879
  * @param locator - located by CSS|XPath|strict locator.
9821
9880
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
9822
9881
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
9823
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9824
9882
  */
9825
9883
  moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
9826
9884
  /**
@@ -9832,7 +9890,6 @@ declare namespace CodeceptJS {
9832
9890
  * ```
9833
9891
  * @param locator - element located by CSS|XPath|strict locator.
9834
9892
  * @param fileName - file name to save.
9835
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9836
9893
  */
9837
9894
  saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
9838
9895
  /**
@@ -9846,10 +9903,10 @@ declare namespace CodeceptJS {
9846
9903
  * ```
9847
9904
  * @param fileName - file name to save.
9848
9905
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
9849
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9850
9906
  */
9851
9907
  saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
9852
9908
  /**
9909
+ * Uses Selenium's JSON [cookie format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
9853
9910
  * Sets cookie(s).
9854
9911
  *
9855
9912
  * Can be a single cookie object or an array of cookies:
@@ -9864,12 +9921,6 @@ declare namespace CodeceptJS {
9864
9921
  * ]);
9865
9922
  * ```
9866
9923
  * @param cookie - a cookie object or array of cookie objects.
9867
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9868
- *
9869
- *
9870
- *
9871
- * Uses Selenium's JSON [cookie
9872
- * format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
9873
9924
  */
9874
9925
  setCookie(cookie: Cookie | Cookie[]): Promise<any>;
9875
9926
  /**
@@ -9878,10 +9929,9 @@ declare namespace CodeceptJS {
9878
9929
  *
9879
9930
  * ```js
9880
9931
  * I.clearCookie();
9881
- * I.clearCookie('test');
9932
+ * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
9882
9933
  * ```
9883
9934
  * @param [cookie = null] - (optional, `null` by default) cookie name
9884
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9885
9935
  */
9886
9936
  clearCookie(cookie?: string): Promise<any>;
9887
9937
  /**
@@ -9891,7 +9941,6 @@ declare namespace CodeceptJS {
9891
9941
  * I.seeCookie('Auth');
9892
9942
  * ```
9893
9943
  * @param name - cookie name.
9894
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9895
9944
  */
9896
9945
  seeCookie(name: string): Promise<any>;
9897
9946
  /**
@@ -9901,7 +9950,6 @@ declare namespace CodeceptJS {
9901
9950
  * I.dontSeeCookie('auth'); // no auth cookie
9902
9951
  * ```
9903
9952
  * @param name - cookie name.
9904
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9905
9953
  */
9906
9954
  dontSeeCookie(name: string): Promise<any>;
9907
9955
  /**
@@ -9914,9 +9962,8 @@ declare namespace CodeceptJS {
9914
9962
  * assert(cookie.value, '123456');
9915
9963
  * ```
9916
9964
  * @param [name = null] - cookie name.
9917
- * @returns attribute value
9918
9965
  */
9919
- grabCookie(name?: string): Promise<string> | Promise<string[]>;
9966
+ grabCookie(name?: string): Promise<any>;
9920
9967
  /**
9921
9968
  * Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
9922
9969
  * Don't confuse popups with modal windows, as created by [various
@@ -9924,7 +9971,7 @@ declare namespace CodeceptJS {
9924
9971
  */
9925
9972
  acceptPopup(): Promise<any>;
9926
9973
  /**
9927
- * Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt.
9974
+ * Dismisses the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`.
9928
9975
  */
9929
9976
  cancelPopup(): Promise<any>;
9930
9977
  /**
@@ -9951,7 +9998,6 @@ declare namespace CodeceptJS {
9951
9998
  * I.pressKeyUp('Control');
9952
9999
  * ```
9953
10000
  * @param key - name of key to press down.
9954
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9955
10001
  */
9956
10002
  pressKeyDown(key: string): Promise<any>;
9957
10003
  /**
@@ -9965,10 +10011,11 @@ declare namespace CodeceptJS {
9965
10011
  * I.pressKeyUp('Control');
9966
10012
  * ```
9967
10013
  * @param key - name of key to release.
9968
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
9969
10014
  */
9970
10015
  pressKeyUp(key: string): Promise<any>;
9971
10016
  /**
10017
+ * _Note:_ In case a text field or textarea is focused be aware that some browsers do not respect active modifier when combining modifier keys with other keys.
10018
+ *
9972
10019
  * Presses a key in the browser (on a focused element).
9973
10020
  *
9974
10021
  * _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
@@ -10027,10 +10074,6 @@ declare namespace CodeceptJS {
10027
10074
  * - `'Space'`
10028
10075
  * - `'Tab'`
10029
10076
  * @param key - key or array of keys to press.
10030
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10031
- *
10032
- *
10033
- * _Note:_ In case a text field or textarea is focused be aware that some browsers do not respect active modifier when combining modifier keys with other keys.
10034
10077
  */
10035
10078
  pressKey(key: string | string[]): Promise<any>;
10036
10079
  /**
@@ -10047,23 +10090,58 @@ declare namespace CodeceptJS {
10047
10090
  *
10048
10091
  * // passing in an array
10049
10092
  * I.type(['T', 'E', 'X', 'T']);
10093
+ *
10094
+ * // passing a secret
10095
+ * I.type(secret('123456'));
10050
10096
  * ```
10051
10097
  * @param key - or array of keys to type.
10052
10098
  * @param [delay = null] - (optional) delay in ms between key presses
10053
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10054
10099
  */
10055
10100
  type(key: string | string[], delay?: number): Promise<any>;
10056
10101
  /**
10102
+ * Appium: not tested in web, in apps doesn't work
10103
+ *
10057
10104
  * Resize the current window to provided width and height.
10058
10105
  * First parameter can be set to `maximize`.
10059
10106
  * @param width - width in pixels or `maximize`.
10060
10107
  * @param height - height in pixels.
10061
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10062
- *
10063
- * Appium: not tested in web, in apps doesn't work
10064
10108
  */
10065
10109
  resizeWindow(width: number, height: number): Promise<any>;
10066
10110
  /**
10111
+ * Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.
10112
+ *
10113
+ * Examples:
10114
+ *
10115
+ * ```js
10116
+ * I.dontSee('#add-to-cart-btn');
10117
+ * I.focus('#product-tile')
10118
+ * I.see('#add-to-cart-bnt');
10119
+ * ```
10120
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
10121
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
10122
+ */
10123
+ focus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
10124
+ /**
10125
+ * Remove focus from a text input, button, etc.
10126
+ * Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.
10127
+ *
10128
+ * Examples:
10129
+ *
10130
+ * ```js
10131
+ * I.blur('.text-area')
10132
+ * ```
10133
+ * ```js
10134
+ * //element `#product-tile` is focused
10135
+ * I.see('#add-to-cart-btn');
10136
+ * I.blur('#product-tile')
10137
+ * I.dontSee('#add-to-cart-btn');
10138
+ * ```
10139
+ * @param locator - field located by label|name|CSS|XPath|strict locator.
10140
+ * @param [options] - Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
10141
+ */
10142
+ blur(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
10143
+ /**
10144
+ * Appium: not tested
10067
10145
  * Drag an item to a destination element.
10068
10146
  *
10069
10147
  * ```js
@@ -10071,9 +10149,6 @@ declare namespace CodeceptJS {
10071
10149
  * ```
10072
10150
  * @param srcElement - located by CSS|XPath|strict locator.
10073
10151
  * @param destElement - located by CSS|XPath|strict locator.
10074
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10075
- *
10076
- * Appium: not tested
10077
10152
  */
10078
10153
  dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): Promise<any>;
10079
10154
  /**
@@ -10086,7 +10161,6 @@ declare namespace CodeceptJS {
10086
10161
  * ```
10087
10162
  * @param locator - located by label|name|CSS|XPath|strict locator.
10088
10163
  * @param offsetX - position to drag.
10089
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10090
10164
  */
10091
10165
  dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): Promise<any>;
10092
10166
  /**
@@ -10128,8 +10202,6 @@ declare namespace CodeceptJS {
10128
10202
  * ```js
10129
10203
  * I.closeOtherTabs();
10130
10204
  * ```
10131
- *
10132
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10133
10205
  */
10134
10206
  closeOtherTabs(): Promise<any>;
10135
10207
  /**
@@ -10139,7 +10211,6 @@ declare namespace CodeceptJS {
10139
10211
  * I.wait(2); // wait 2 secs
10140
10212
  * ```
10141
10213
  * @param sec - number of second to wait.
10142
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10143
10214
  */
10144
10215
  wait(sec: number): Promise<any>;
10145
10216
  /**
@@ -10147,7 +10218,6 @@ declare namespace CodeceptJS {
10147
10218
  * Element can be located by CSS or XPath.
10148
10219
  * @param locator - element located by CSS|XPath|strict locator.
10149
10220
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
10150
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10151
10221
  */
10152
10222
  waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
10153
10223
  /**
@@ -10160,7 +10230,6 @@ declare namespace CodeceptJS {
10160
10230
  * ```
10161
10231
  * @param locator - element located by CSS|XPath|strict locator.
10162
10232
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
10163
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10164
10233
  */
10165
10234
  waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
10166
10235
  /**
@@ -10173,7 +10242,6 @@ declare namespace CodeceptJS {
10173
10242
  * ```
10174
10243
  * @param locator - element located by CSS|XPath|strict locator.
10175
10244
  * @param [sec] - (optional, `1` by default) time in seconds to wait
10176
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10177
10245
  */
10178
10246
  waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
10179
10247
  /**
@@ -10184,7 +10252,6 @@ declare namespace CodeceptJS {
10184
10252
  * ```
10185
10253
  * @param urlPart - value to check.
10186
10254
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
10187
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10188
10255
  */
10189
10256
  waitInUrl(urlPart: string, sec?: number): Promise<any>;
10190
10257
  /**
@@ -10196,7 +10263,6 @@ declare namespace CodeceptJS {
10196
10263
  * ```
10197
10264
  * @param urlPart - value to check.
10198
10265
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
10199
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10200
10266
  */
10201
10267
  waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
10202
10268
  /**
@@ -10211,7 +10277,6 @@ declare namespace CodeceptJS {
10211
10277
  * @param text - to wait for.
10212
10278
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
10213
10279
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
10214
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10215
10280
  */
10216
10281
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
10217
10282
  /**
@@ -10223,7 +10288,6 @@ declare namespace CodeceptJS {
10223
10288
  * @param field - input field.
10224
10289
  * @param value - expected value.
10225
10290
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
10226
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10227
10291
  */
10228
10292
  waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
10229
10293
  /**
@@ -10235,7 +10299,6 @@ declare namespace CodeceptJS {
10235
10299
  * ```
10236
10300
  * @param locator - element located by CSS|XPath|strict locator.
10237
10301
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
10238
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10239
10302
  */
10240
10303
  waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
10241
10304
  /**
@@ -10247,7 +10310,6 @@ declare namespace CodeceptJS {
10247
10310
  * @param locator - element located by CSS|XPath|strict locator.
10248
10311
  * @param num - number of elements.
10249
10312
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
10250
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10251
10313
  */
10252
10314
  waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
10253
10315
  /**
@@ -10259,7 +10321,6 @@ declare namespace CodeceptJS {
10259
10321
  * ```
10260
10322
  * @param locator - element located by CSS|XPath|strict locator.
10261
10323
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
10262
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10263
10324
  */
10264
10325
  waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
10265
10326
  /**
@@ -10271,7 +10332,6 @@ declare namespace CodeceptJS {
10271
10332
  * ```
10272
10333
  * @param locator - element located by CSS|XPath|strict locator.
10273
10334
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
10274
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10275
10335
  */
10276
10336
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
10277
10337
  /**
@@ -10283,7 +10343,6 @@ declare namespace CodeceptJS {
10283
10343
  * ```
10284
10344
  * @param locator - element located by CSS|XPath|strict locator.
10285
10345
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
10286
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10287
10346
  */
10288
10347
  waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
10289
10348
  /**
@@ -10302,9 +10361,18 @@ declare namespace CodeceptJS {
10302
10361
  * @param fn - to be executed in browser context.
10303
10362
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
10304
10363
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
10305
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10306
10364
  */
10307
10365
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
10366
+ /**
10367
+ * Waits for number of tabs.
10368
+ *
10369
+ * ```js
10370
+ * I.waitForNumberOfTabs(2);
10371
+ * ```
10372
+ * @param expectedTabs - expecting the number of tabs.
10373
+ * @param sec - number of secs to wait.
10374
+ */
10375
+ waitForNumberOfTabs(expectedTabs: number, sec: number): Promise<any>;
10308
10376
  /**
10309
10377
  * Switches frame or in case of null locator reverts to parent.
10310
10378
  *
@@ -10313,7 +10381,6 @@ declare namespace CodeceptJS {
10313
10381
  * I.switchTo(); // switch back to main page
10314
10382
  * ```
10315
10383
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
10316
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10317
10384
  */
10318
10385
  switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
10319
10386
  /**
@@ -10325,7 +10392,6 @@ declare namespace CodeceptJS {
10325
10392
  * ```
10326
10393
  * @param [num = 1] - (optional) number of tabs to switch forward, default: 1.
10327
10394
  * @param [sec = null] - (optional) time in seconds to wait.
10328
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10329
10395
  */
10330
10396
  switchToNextTab(num?: number, sec?: number | null): Promise<any>;
10331
10397
  /**
@@ -10337,7 +10403,6 @@ declare namespace CodeceptJS {
10337
10403
  * ```
10338
10404
  * @param [num = 1] - (optional) number of tabs to switch backward, default: 1.
10339
10405
  * @param [sec = null] - (optional) time in seconds to wait.
10340
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10341
10406
  */
10342
10407
  switchToPreviousTab(num?: number, sec?: number): Promise<any>;
10343
10408
  /**
@@ -10346,8 +10411,6 @@ declare namespace CodeceptJS {
10346
10411
  * ```js
10347
10412
  * I.closeCurrentTab();
10348
10413
  * ```
10349
- *
10350
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10351
10414
  */
10352
10415
  closeCurrentTab(): Promise<any>;
10353
10416
  /**
@@ -10356,8 +10419,6 @@ declare namespace CodeceptJS {
10356
10419
  * ```js
10357
10420
  * I.openNewTab();
10358
10421
  * ```
10359
- *
10360
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10361
10422
  */
10362
10423
  openNewTab(): Promise<any>;
10363
10424
  /**
@@ -10376,7 +10437,6 @@ declare namespace CodeceptJS {
10376
10437
  * ```js
10377
10438
  * I.refreshPage();
10378
10439
  * ```
10379
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10380
10440
  */
10381
10441
  refreshPage(): Promise<any>;
10382
10442
  /**
@@ -10385,7 +10445,6 @@ declare namespace CodeceptJS {
10385
10445
  * ```js
10386
10446
  * I.scrollPageToTop();
10387
10447
  * ```
10388
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10389
10448
  */
10390
10449
  scrollPageToTop(): Promise<any>;
10391
10450
  /**
@@ -10394,7 +10453,6 @@ declare namespace CodeceptJS {
10394
10453
  * ```js
10395
10454
  * I.scrollPageToBottom();
10396
10455
  * ```
10397
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10398
10456
  */
10399
10457
  scrollPageToBottom(): Promise<any>;
10400
10458
  /**
@@ -10408,6 +10466,9 @@ declare namespace CodeceptJS {
10408
10466
  */
10409
10467
  grabPageScrollPosition(): Promise<PageScrollPosition>;
10410
10468
  /**
10469
+ * This method is **deprecated**.
10470
+ *
10471
+ *
10411
10472
  * Set the current geo location
10412
10473
  *
10413
10474
  *
@@ -10417,11 +10478,12 @@ declare namespace CodeceptJS {
10417
10478
  * ```
10418
10479
  * @param latitude - to set.
10419
10480
  * @param longitude - to set
10420
- * @param [altitude = null] - (optional, null by default) to set
10421
- * ⚠️ returns a _promise_ which is synchronized internally by recorder
10481
+ * @param [altitude] - (optional, null by default) to set
10422
10482
  */
10423
10483
  setGeoLocation(latitude: number, longitude: number, altitude?: number): Promise<any>;
10424
10484
  /**
10485
+ * This method is **deprecated**.
10486
+ *
10425
10487
  * Return the current geo location
10426
10488
  * Resumes test execution, so **should be used inside async function with `await`** operator.
10427
10489
  *