codeceptjs 3.3.0 → 3.3.1

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 (134) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/README.md +26 -0
  3. package/docs/api.md +1 -1
  4. package/docs/bdd.md +1 -0
  5. package/docs/best.md +1 -1
  6. package/docs/build/ApiDataFactory.js +4 -3
  7. package/docs/build/Appium.js +26 -11
  8. package/docs/build/GraphQL.js +4 -2
  9. package/docs/build/GraphQLDataFactory.js +3 -3
  10. package/docs/build/JSONResponse.js +1 -1
  11. package/docs/build/Nightmare.js +52 -23
  12. package/docs/build/Playwright.js +126 -48
  13. package/docs/build/Protractor.js +70 -32
  14. package/docs/build/Puppeteer.js +78 -35
  15. package/docs/build/REST.js +4 -1
  16. package/docs/build/TestCafe.js +53 -22
  17. package/docs/build/WebDriver.js +115 -65
  18. package/docs/changelog.md +39 -1
  19. package/docs/custom-helpers.md +1 -1
  20. package/docs/data.md +2 -2
  21. package/docs/helpers/ApiDataFactory.md +7 -3
  22. package/docs/helpers/Appium.md +113 -15
  23. package/docs/helpers/GraphQL.md +6 -0
  24. package/docs/helpers/GraphQLDataFactory.md +3 -3
  25. package/docs/helpers/JSONResponse.md +1 -1
  26. package/docs/helpers/Nightmare.md +131 -29
  27. package/docs/helpers/Playwright.md +424 -215
  28. package/docs/helpers/Puppeteer.md +229 -92
  29. package/docs/helpers/REST.md +1 -1
  30. package/docs/helpers/TestCafe.md +166 -62
  31. package/docs/helpers/WebDriver.md +254 -103
  32. package/docs/index.md +1 -1
  33. package/docs/locators.md +1 -1
  34. package/docs/webapi/amOnPage.mustache +2 -1
  35. package/docs/webapi/appendField.mustache +2 -1
  36. package/docs/webapi/attachFile.mustache +2 -1
  37. package/docs/webapi/checkOption.mustache +2 -1
  38. package/docs/webapi/clearCookie.mustache +2 -1
  39. package/docs/webapi/clearField.mustache +1 -0
  40. package/docs/webapi/click.mustache +2 -1
  41. package/docs/webapi/clickLink.mustache +2 -1
  42. package/docs/webapi/closeCurrentTab.mustache +6 -4
  43. package/docs/webapi/closeOtherTabs.mustache +6 -4
  44. package/docs/webapi/dontSee.mustache +1 -0
  45. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -0
  46. package/docs/webapi/dontSeeCookie.mustache +2 -1
  47. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +2 -1
  48. package/docs/webapi/dontSeeElement.mustache +2 -1
  49. package/docs/webapi/dontSeeElementInDOM.mustache +2 -1
  50. package/docs/webapi/dontSeeInCurrentUrl.mustache +2 -1
  51. package/docs/webapi/dontSeeInField.mustache +2 -1
  52. package/docs/webapi/dontSeeInSource.mustache +1 -0
  53. package/docs/webapi/dontSeeInTitle.mustache +2 -1
  54. package/docs/webapi/doubleClick.mustache +1 -0
  55. package/docs/webapi/downloadFile.mustache +2 -1
  56. package/docs/webapi/dragAndDrop.mustache +1 -0
  57. package/docs/webapi/dragSlider.mustache +2 -1
  58. package/docs/webapi/fillField.mustache +1 -0
  59. package/docs/webapi/forceClick.mustache +1 -0
  60. package/docs/webapi/forceRightClick.mustache +1 -0
  61. package/docs/webapi/grabDataFromPerformanceTiming.mustache +2 -1
  62. package/docs/webapi/moveCursorTo.mustache +1 -0
  63. package/docs/webapi/openNewTab.mustache +6 -4
  64. package/docs/webapi/pressKey.mustache +2 -1
  65. package/docs/webapi/pressKeyDown.mustache +1 -0
  66. package/docs/webapi/pressKeyUp.mustache +1 -0
  67. package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -0
  68. package/docs/webapi/refreshPage.mustache +1 -0
  69. package/docs/webapi/resizeWindow.mustache +2 -1
  70. package/docs/webapi/rightClick.mustache +1 -0
  71. package/docs/webapi/saveElementScreenshot.mustache +1 -0
  72. package/docs/webapi/saveScreenshot.mustache +2 -1
  73. package/docs/webapi/say.mustache +2 -1
  74. package/docs/webapi/scrollIntoView.mustache +1 -0
  75. package/docs/webapi/scrollPageToBottom.mustache +1 -0
  76. package/docs/webapi/scrollPageToTop.mustache +1 -0
  77. package/docs/webapi/scrollTo.mustache +2 -1
  78. package/docs/webapi/see.mustache +2 -1
  79. package/docs/webapi/seeAttributesOnElements.mustache +2 -1
  80. package/docs/webapi/seeCheckboxIsChecked.mustache +1 -0
  81. package/docs/webapi/seeCookie.mustache +1 -0
  82. package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -1
  83. package/docs/webapi/seeCurrentUrlEquals.mustache +2 -1
  84. package/docs/webapi/seeElement.mustache +2 -1
  85. package/docs/webapi/seeElementInDOM.mustache +1 -0
  86. package/docs/webapi/seeInCurrentUrl.mustache +2 -1
  87. package/docs/webapi/seeInField.mustache +1 -0
  88. package/docs/webapi/seeInPopup.mustache +1 -0
  89. package/docs/webapi/seeInSource.mustache +2 -1
  90. package/docs/webapi/seeInTitle.mustache +2 -1
  91. package/docs/webapi/seeNumberOfElements.mustache +1 -0
  92. package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -0
  93. package/docs/webapi/seeTextEquals.mustache +2 -1
  94. package/docs/webapi/seeTitleEquals.mustache +6 -5
  95. package/docs/webapi/selectOption.mustache +1 -0
  96. package/docs/webapi/setCookie.mustache +1 -0
  97. package/docs/webapi/setGeoLocation.mustache +1 -0
  98. package/docs/webapi/switchTo.mustache +2 -1
  99. package/docs/webapi/switchToNextTab.mustache +8 -7
  100. package/docs/webapi/switchToPreviousTab.mustache +8 -7
  101. package/docs/webapi/type.mustache +1 -0
  102. package/docs/webapi/uncheckOption.mustache +2 -1
  103. package/docs/webapi/wait.mustache +2 -1
  104. package/docs/webapi/waitForClickable.mustache +2 -1
  105. package/docs/webapi/waitForDetached.mustache +2 -1
  106. package/docs/webapi/waitForElement.mustache +2 -1
  107. package/docs/webapi/waitForEnabled.mustache +2 -1
  108. package/docs/webapi/waitForFunction.mustache +1 -0
  109. package/docs/webapi/waitForInvisible.mustache +2 -1
  110. package/docs/webapi/waitForText.mustache +2 -1
  111. package/docs/webapi/waitForValue.mustache +1 -0
  112. package/docs/webapi/waitForVisible.mustache +1 -0
  113. package/docs/webapi/waitInUrl.mustache +2 -1
  114. package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -1
  115. package/docs/webapi/waitToHide.mustache +2 -1
  116. package/docs/webapi/waitUrlEquals.mustache +2 -1
  117. package/lib/command/definitions.js +9 -0
  118. package/lib/command/run.js +2 -2
  119. package/lib/command/workers/runTests.js +40 -0
  120. package/lib/helper/ApiDataFactory.js +4 -3
  121. package/lib/helper/Appium.js +7 -2
  122. package/lib/helper/GraphQL.js +4 -2
  123. package/lib/helper/GraphQLDataFactory.js +3 -3
  124. package/lib/helper/JSONResponse.js +1 -1
  125. package/lib/helper/Playwright.js +49 -13
  126. package/lib/helper/REST.js +4 -1
  127. package/lib/helper/WebDriver.js +6 -0
  128. package/lib/interfaces/bdd.js +5 -0
  129. package/lib/listener/steps.js +1 -0
  130. package/lib/plugin/fakerTransform.js +1 -1
  131. package/lib/plugin/stepByStepReport.js +8 -6
  132. package/lib/workers.js +12 -0
  133. package/package.json +3 -3
  134. package/typings/types.d.ts +558 -607
@@ -32,7 +32,7 @@ declare namespace CodeceptJS {
32
32
  * Install [Rosie](https://github.com/rosiejs/rosie) and [Faker](https://www.npmjs.com/package/faker) libraries.
33
33
  *
34
34
  * ```sh
35
- * npm i rosie faker --save-dev
35
+ * npm i rosie @faker-js/faker --save-dev
36
36
  * ```
37
37
  *
38
38
  * Create a factory file for a resource.
@@ -42,8 +42,8 @@ declare namespace CodeceptJS {
42
42
  * ```js
43
43
  * // tests/factories/posts.js
44
44
  *
45
- * var Factory = require('rosie').Factory;
46
- * var faker = require('faker');
45
+ * const Factory = require('rosie').Factory;
46
+ * const faker = require('@faker-js/faker');
47
47
  *
48
48
  * module.exports = new Factory()
49
49
  * // no need to set id, it will be set by REST API
@@ -193,7 +193,7 @@ declare namespace CodeceptJS {
193
193
  * @param params - predefined parameters
194
194
  * @param options - options for programmatically generate the attributes
195
195
  */
196
- have(factory: any, params: any, options: any): void;
196
+ have(factory: any, params: any, options: any): Promise<any>;
197
197
  /**
198
198
  * Generates bunch of records and saves multiple API requests to store them.
199
199
  *
@@ -223,7 +223,7 @@ declare namespace CodeceptJS {
223
223
  /**
224
224
  * Appium Special Methods for Mobile only
225
225
  */
226
- class Appium {
226
+ class Appium extends WebDriver {
227
227
  /**
228
228
  * Execute code only on iOS
229
229
  *
@@ -328,7 +328,7 @@ declare namespace CodeceptJS {
328
328
  * Appium: support only Android
329
329
  * @param [bundleId] - ID of bundle
330
330
  */
331
- removeApp(appId: string, bundleId?: string): void;
331
+ removeApp(appId: string, bundleId?: string): Promise<any>;
332
332
  /**
333
333
  * Check current activity on an Android device.
334
334
  *
@@ -439,7 +439,7 @@ declare namespace CodeceptJS {
439
439
  * Switch to the specified context.
440
440
  * @param context - the context to switch to
441
441
  */
442
- _switchToContext(context: any): void;
442
+ _switchToContext(context: any): Promise<any>;
443
443
  /**
444
444
  * Switches to web context.
445
445
  * If no context is provided switches to the first detected web context
@@ -464,7 +464,7 @@ declare namespace CodeceptJS {
464
464
  * I.switchToNative('SOME_OTHER_CONTEXT');
465
465
  * ```
466
466
  */
467
- switchToNative(context: any): Promise<void>;
467
+ switchToNative(context?: any): Promise<void>;
468
468
  /**
469
469
  * Start an arbitrary Android activity during a session.
470
470
  *
@@ -518,7 +518,7 @@ declare namespace CodeceptJS {
518
518
  * @param [strategy] - Desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’)
519
519
  * @param [key] - Optional key
520
520
  */
521
- hideDeviceKeyboard(strategy?: 'tapOutside' | 'pressKey', key?: string): void;
521
+ hideDeviceKeyboard(strategy?: 'tapOutside' | 'pressKey', key?: string): Promise<any>;
522
522
  /**
523
523
  * Send a key event to the device.
524
524
  * List of keys: https://developer.android.com/reference/android/view/KeyEvent.html
@@ -568,9 +568,9 @@ declare namespace CodeceptJS {
568
568
  * ```js
569
569
  * I.performSwipe({ x: 300, y: 100 }, { x: 200, y: 100 });
570
570
  * ```
571
- * @param to - Appium: support Android and iOS
571
+ * @returns Appium: support Android and iOS
572
572
  */
573
- performSwipe(from: any, to: any): void;
573
+ performSwipe(from: any, to: any): Promise<any>;
574
574
  /**
575
575
  * Perform a swipe down on an element.
576
576
  *
@@ -669,7 +669,7 @@ declare namespace CodeceptJS {
669
669
  * Appium: support Android and iOS
670
670
  * @param actions - Array of touch actions
671
671
  */
672
- touchPerform(actions: any[]): void;
672
+ touchPerform(actions: any[]): Promise<any>;
673
673
  /**
674
674
  * Pulls a file from the device.
675
675
  *
@@ -739,7 +739,7 @@ declare namespace CodeceptJS {
739
739
  * @param field - located by label|name|CSS|XPath|strict locator
740
740
  * @param value - text value to append.
741
741
  */
742
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
742
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
743
743
  /**
744
744
  * Selects a checkbox or radio button.
745
745
  * Element is located by label or name or CSS or XPath.
@@ -754,7 +754,7 @@ declare namespace CodeceptJS {
754
754
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
755
755
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
756
756
  */
757
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
757
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
758
758
  /**
759
759
  * Perform a click on a link or a button, given by a locator.
760
760
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -780,7 +780,7 @@ declare namespace CodeceptJS {
780
780
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
781
781
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
782
782
  */
783
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
783
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
784
784
  /**
785
785
  * Verifies that the specified checkbox is not checked.
786
786
  *
@@ -791,7 +791,7 @@ declare namespace CodeceptJS {
791
791
  * ```
792
792
  * @param field - located by label|name|CSS|XPath|strict locator.
793
793
  */
794
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
794
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
795
795
  /**
796
796
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
797
797
  *
@@ -800,7 +800,7 @@ declare namespace CodeceptJS {
800
800
  * ```
801
801
  * @param locator - located by CSS|XPath|Strict locator.
802
802
  */
803
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
803
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
804
804
  /**
805
805
  * Checks that value of input field or textarea doesn't equal to given value
806
806
  * Opposite to `seeInField`.
@@ -812,7 +812,7 @@ declare namespace CodeceptJS {
812
812
  * @param field - located by label|name|CSS|XPath|strict locator.
813
813
  * @param value - value to check.
814
814
  */
815
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
815
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
816
816
  /**
817
817
  * Opposite to `see`. Checks that a text is not present on a page.
818
818
  * Use context parameter to narrow down the search.
@@ -824,7 +824,7 @@ declare namespace CodeceptJS {
824
824
  * @param text - which is not present.
825
825
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
826
826
  */
827
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
827
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
828
828
  /**
829
829
  * Fills a text field or textarea, after clearing its value, with the given string.
830
830
  * Field is located by name, label, CSS, or XPath.
@@ -842,7 +842,7 @@ declare namespace CodeceptJS {
842
842
  * @param field - located by label|name|CSS|XPath|strict locator.
843
843
  * @param value - text value to fill.
844
844
  */
845
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
845
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
846
846
  /**
847
847
  * Retrieves all texts from an element located by CSS or XPath and returns it to test.
848
848
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -948,11 +948,9 @@ declare namespace CodeceptJS {
948
948
  * ```
949
949
  * @param locator - located by CSS|XPath|strict locator.
950
950
  * @param scrollIntoViewOptions - see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
951
- *
952
- *
953
- * Supported only for web testing
951
+ * @returns Supported only for web testing
954
952
  */
955
- scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): void;
953
+ scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): Promise<any>;
956
954
  /**
957
955
  * Verifies that the specified checkbox is checked.
958
956
  *
@@ -963,7 +961,7 @@ declare namespace CodeceptJS {
963
961
  * ```
964
962
  * @param field - located by label|name|CSS|XPath|strict locator.
965
963
  */
966
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
964
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
967
965
  /**
968
966
  * Checks that a given Element is visible
969
967
  * Element is located by CSS or XPath.
@@ -973,7 +971,7 @@ declare namespace CodeceptJS {
973
971
  * ```
974
972
  * @param locator - located by CSS|XPath|strict locator.
975
973
  */
976
- seeElement(locator: CodeceptJS.LocatorOrString): void;
974
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
977
975
  /**
978
976
  * Checks that the given input field or textarea equals to given value.
979
977
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -987,7 +985,7 @@ declare namespace CodeceptJS {
987
985
  * @param field - located by label|name|CSS|XPath|strict locator.
988
986
  * @param value - value to check.
989
987
  */
990
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
988
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
991
989
  /**
992
990
  * Checks that a page contains a visible text.
993
991
  * Use context parameter to narrow down the search.
@@ -1000,7 +998,7 @@ declare namespace CodeceptJS {
1000
998
  * @param text - expected on page.
1001
999
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
1002
1000
  */
1003
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
1001
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
1004
1002
  /**
1005
1003
  * Selects an option in a drop-down select.
1006
1004
  * Field is searched by label | name | CSS | XPath.
@@ -1022,11 +1020,9 @@ declare namespace CodeceptJS {
1022
1020
  * ```
1023
1021
  * @param select - field located by label|name|CSS|XPath|strict locator.
1024
1022
  * @param option - visible text or value of option.
1025
- *
1026
- *
1027
- * Supported only for web testing
1023
+ * @returns Supported only for web testing
1028
1024
  */
1029
- selectOption(select: LocatorOrString, option: string | any[]): void;
1025
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
1030
1026
  /**
1031
1027
  * Waits for element to be present on page (by default waits for 1sec).
1032
1028
  * Element can be located by CSS or XPath.
@@ -1038,7 +1034,7 @@ declare namespace CodeceptJS {
1038
1034
  * @param locator - element located by CSS|XPath|strict locator.
1039
1035
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
1040
1036
  */
1041
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
1037
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
1042
1038
  /**
1043
1039
  * Waits for an element to become visible on a page (by default waits for 1sec).
1044
1040
  * Element can be located by CSS or XPath.
@@ -1049,7 +1045,7 @@ declare namespace CodeceptJS {
1049
1045
  * @param locator - element located by CSS|XPath|strict locator.
1050
1046
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
1051
1047
  */
1052
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
1048
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
1053
1049
  /**
1054
1050
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
1055
1051
  * Element can be located by CSS or XPath.
@@ -1060,7 +1056,7 @@ declare namespace CodeceptJS {
1060
1056
  * @param locator - element located by CSS|XPath|strict locator.
1061
1057
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
1062
1058
  */
1063
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
1059
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
1064
1060
  /**
1065
1061
  * Waits for a text to appear (by default waits for 1sec).
1066
1062
  * Element can be located by CSS or XPath.
@@ -1074,7 +1070,7 @@ declare namespace CodeceptJS {
1074
1070
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
1075
1071
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
1076
1072
  */
1077
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
1073
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
1078
1074
  }
1079
1075
  /**
1080
1076
  * Helper for testing filesystem.
@@ -1210,8 +1206,9 @@ declare namespace CodeceptJS {
1210
1206
  _executeQuery(request: any): void;
1211
1207
  /**
1212
1208
  * Prepares request for axios call
1209
+ * @returns graphQLRequest
1213
1210
  */
1214
- _prepareGraphQLRequest(operation: any, headers: any): void;
1211
+ _prepareGraphQLRequest(operation: any, headers: any): any;
1215
1212
  /**
1216
1213
  * Send query to GraphQL endpoint over http.
1217
1214
  * Returns a response as a promise.
@@ -1228,8 +1225,9 @@ declare namespace CodeceptJS {
1228
1225
  * ```
1229
1226
  * @param variables - that may go along with the query
1230
1227
  * @param options - are additional query options
1228
+ * @returns Promise<any>
1231
1229
  */
1232
- sendQuery(query: string, variables: any, options: any, headers: any): void;
1230
+ sendQuery(query: string, variables: any, options: any, headers: any): any;
1233
1231
  /**
1234
1232
  * Send query to GraphQL endpoint over http
1235
1233
  *
@@ -1252,8 +1250,9 @@ declare namespace CodeceptJS {
1252
1250
  * ```
1253
1251
  * @param variables - that may go along with the mutation
1254
1252
  * @param options - are additional query options
1253
+ * @returns Promise<any>
1255
1254
  */
1256
- sendMutation(mutation: string, variables: any, options: any, headers: any): void;
1255
+ sendMutation(mutation: string, variables: any, options: any, headers: any): any;
1257
1256
  }
1258
1257
  /**
1259
1258
  * Helper for managing remote data using GraphQL queries.
@@ -1288,7 +1287,7 @@ declare namespace CodeceptJS {
1288
1287
  * Install [Rosie](https://github.com/rosiejs/rosie) and [Faker](https://www.npmjs.com/package/faker) libraries.
1289
1288
  *
1290
1289
  * ```sh
1291
- * npm i rosie faker --save-dev
1290
+ * npm i rosie @faker-js/faker --save-dev
1292
1291
  * ```
1293
1292
  *
1294
1293
  * Create a factory file for a resource.
@@ -1298,8 +1297,8 @@ declare namespace CodeceptJS {
1298
1297
  * ```js
1299
1298
  * // tests/factories/users.js
1300
1299
  *
1301
- * var Factory = require('rosie').Factory;
1302
- * var faker = require('faker');
1300
+ * const Factory = require('rosie').Factory;
1301
+ * const faker = require('@faker-js/faker');
1303
1302
  *
1304
1303
  * // Used with a constructor function passed to Factory, so that the final build
1305
1304
  * // object matches the necessary pattern to be sent as the variables object.
@@ -1568,7 +1567,7 @@ declare namespace CodeceptJS {
1568
1567
  * Use it to perform custom checks of response data
1569
1568
  *
1570
1569
  * ```js
1571
- * I.seeResponseValidByCallback({ data, status, expect } => {
1570
+ * I.seeResponseValidByCallback(({ data, status, expect }) => {
1572
1571
  * expect(status).to.eql(200);
1573
1572
  * expect(data).keys.to.include(['user', 'company']);
1574
1573
  * });
@@ -1690,7 +1689,7 @@ declare namespace CodeceptJS {
1690
1689
  * @param url - url path or global url.
1691
1690
  * @param headers - list of request headers can be passed
1692
1691
  */
1693
- amOnPage(url: string, headers: any): void;
1692
+ amOnPage(url: string, headers: any): Promise<any>;
1694
1693
  /**
1695
1694
  * Checks that title contains text.
1696
1695
  *
@@ -1699,7 +1698,7 @@ declare namespace CodeceptJS {
1699
1698
  * ```
1700
1699
  * @param text - text value to check.
1701
1700
  */
1702
- seeInTitle(text: string): void;
1701
+ seeInTitle(text: string): Promise<any>;
1703
1702
  /**
1704
1703
  * Checks that title does not contain text.
1705
1704
  *
@@ -1708,7 +1707,7 @@ declare namespace CodeceptJS {
1708
1707
  * ```
1709
1708
  * @param text - value to check.
1710
1709
  */
1711
- dontSeeInTitle(text: string): void;
1710
+ dontSeeInTitle(text: string): Promise<any>;
1712
1711
  /**
1713
1712
  * Retrieves a page title and returns it to test.
1714
1713
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -1738,12 +1737,12 @@ declare namespace CodeceptJS {
1738
1737
  * ```
1739
1738
  * @param url - a fragment to check
1740
1739
  */
1741
- seeInCurrentUrl(url: string): void;
1740
+ seeInCurrentUrl(url: string): Promise<any>;
1742
1741
  /**
1743
1742
  * Checks that current url does not contain a provided fragment.
1744
1743
  * @param url - value to check.
1745
1744
  */
1746
- dontSeeInCurrentUrl(url: string): void;
1745
+ dontSeeInCurrentUrl(url: string): Promise<any>;
1747
1746
  /**
1748
1747
  * Checks that current url is equal to provided one.
1749
1748
  * If a relative url provided, a configured url will be prepended to it.
@@ -1755,7 +1754,7 @@ declare namespace CodeceptJS {
1755
1754
  * ```
1756
1755
  * @param url - value to check.
1757
1756
  */
1758
- seeCurrentUrlEquals(url: string): void;
1757
+ seeCurrentUrlEquals(url: string): Promise<any>;
1759
1758
  /**
1760
1759
  * Checks that current url is not equal to provided one.
1761
1760
  * If a relative url provided, a configured url will be prepended to it.
@@ -1766,7 +1765,7 @@ declare namespace CodeceptJS {
1766
1765
  * ```
1767
1766
  * @param url - value to check.
1768
1767
  */
1769
- dontSeeCurrentUrlEquals(url: string): void;
1768
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
1770
1769
  /**
1771
1770
  * Checks that a page contains a visible text.
1772
1771
  * Use context parameter to narrow down the search.
@@ -1779,7 +1778,7 @@ declare namespace CodeceptJS {
1779
1778
  * @param text - expected on page.
1780
1779
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
1781
1780
  */
1782
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
1781
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
1783
1782
  /**
1784
1783
  * Opposite to `see`. Checks that a text is not present on a page.
1785
1784
  * Use context parameter to narrow down the search.
@@ -1791,7 +1790,7 @@ declare namespace CodeceptJS {
1791
1790
  * @param text - which is not present.
1792
1791
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
1793
1792
  */
1794
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
1793
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
1795
1794
  /**
1796
1795
  * Checks that a given Element is visible
1797
1796
  * Element is located by CSS or XPath.
@@ -1801,7 +1800,7 @@ declare namespace CodeceptJS {
1801
1800
  * ```
1802
1801
  * @param locator - located by CSS|XPath|strict locator.
1803
1802
  */
1804
- seeElement(locator: CodeceptJS.LocatorOrString): void;
1803
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
1805
1804
  /**
1806
1805
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
1807
1806
  *
@@ -1810,7 +1809,7 @@ declare namespace CodeceptJS {
1810
1809
  * ```
1811
1810
  * @param locator - located by CSS|XPath|Strict locator.
1812
1811
  */
1813
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
1812
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
1814
1813
  /**
1815
1814
  * Checks that a given Element is present in the DOM
1816
1815
  * Element is located by CSS or XPath.
@@ -1820,7 +1819,7 @@ declare namespace CodeceptJS {
1820
1819
  * ```
1821
1820
  * @param locator - element located by CSS|XPath|strict locator.
1822
1821
  */
1823
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
1822
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
1824
1823
  /**
1825
1824
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
1826
1825
  *
@@ -1829,7 +1828,7 @@ declare namespace CodeceptJS {
1829
1828
  * ```
1830
1829
  * @param locator - located by CSS|XPath|Strict locator.
1831
1830
  */
1832
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
1831
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
1833
1832
  /**
1834
1833
  * Checks that the current page contains the given string in its raw source code.
1835
1834
  *
@@ -1838,7 +1837,7 @@ declare namespace CodeceptJS {
1838
1837
  * ```
1839
1838
  * @param text - value to check.
1840
1839
  */
1841
- seeInSource(text: string): void;
1840
+ seeInSource(text: string): Promise<any>;
1842
1841
  /**
1843
1842
  * Checks that the current page does not contains the given string in its raw source code.
1844
1843
  *
@@ -1847,7 +1846,7 @@ declare namespace CodeceptJS {
1847
1846
  * ```
1848
1847
  * @param value - to check.
1849
1848
  */
1850
- dontSeeInSource(value: string): void;
1849
+ dontSeeInSource(value: string): Promise<any>;
1851
1850
  /**
1852
1851
  * Asserts that an element appears a given number of times in the DOM.
1853
1852
  * Element is located by label or name or CSS or XPath.
@@ -1859,7 +1858,7 @@ declare namespace CodeceptJS {
1859
1858
  * @param locator - element located by CSS|XPath|strict locator.
1860
1859
  * @param num - number of elements.
1861
1860
  */
1862
- seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): void;
1861
+ seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
1863
1862
  /**
1864
1863
  * Asserts that an element is visible a given number of times.
1865
1864
  * Element is located by CSS or XPath.
@@ -1870,7 +1869,7 @@ declare namespace CodeceptJS {
1870
1869
  * @param locator - element located by CSS|XPath|strict locator.
1871
1870
  * @param num - number of elements.
1872
1871
  */
1873
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
1872
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
1874
1873
  /**
1875
1874
  * Grab number of visible elements by locator.
1876
1875
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -1907,7 +1906,7 @@ declare namespace CodeceptJS {
1907
1906
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1908
1907
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1909
1908
  */
1910
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
1909
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
1911
1910
  /**
1912
1911
  * Performs a double-click on an element matched by link|button|label|CSS or XPath.
1913
1912
  * Context can be specified as second parameter to narrow search.
@@ -1921,7 +1920,7 @@ declare namespace CodeceptJS {
1921
1920
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
1922
1921
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
1923
1922
  */
1924
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
1923
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
1925
1924
  /**
1926
1925
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
1927
1926
  *
@@ -1936,7 +1935,7 @@ declare namespace CodeceptJS {
1936
1935
  * @param locator - clickable element located by CSS|XPath|strict locator.
1937
1936
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
1938
1937
  */
1939
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
1938
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
1940
1939
  /**
1941
1940
  * Moves cursor to element matched by locator.
1942
1941
  * Extra shift can be set with offsetX and offsetY options.
@@ -1949,7 +1948,7 @@ declare namespace CodeceptJS {
1949
1948
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
1950
1949
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
1951
1950
  */
1952
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
1951
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
1953
1952
  /**
1954
1953
  * Executes sync script on a page.
1955
1954
  * Pass arguments to function as additional parameters.
@@ -2011,7 +2010,7 @@ declare namespace CodeceptJS {
2011
2010
  * @param width - width in pixels or `maximize`.
2012
2011
  * @param height - height in pixels.
2013
2012
  */
2014
- resizeWindow(width: number, height: number): void;
2013
+ resizeWindow(width: number, height: number): Promise<any>;
2015
2014
  /**
2016
2015
  * Selects a checkbox or radio button.
2017
2016
  * Element is located by label or name or CSS or XPath.
@@ -2026,7 +2025,7 @@ declare namespace CodeceptJS {
2026
2025
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
2027
2026
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
2028
2027
  */
2029
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
2028
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
2030
2029
  /**
2031
2030
  * Unselects a checkbox or radio button.
2032
2031
  * Element is located by label or name or CSS or XPath.
@@ -2041,7 +2040,7 @@ declare namespace CodeceptJS {
2041
2040
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
2042
2041
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
2043
2042
  */
2044
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
2043
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
2045
2044
  /**
2046
2045
  * Fills a text field or textarea, after clearing its value, with the given string.
2047
2046
  * Field is located by name, label, CSS, or XPath.
@@ -2059,7 +2058,7 @@ declare namespace CodeceptJS {
2059
2058
  * @param field - located by label|name|CSS|XPath|strict locator.
2060
2059
  * @param value - text value to fill.
2061
2060
  */
2062
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
2061
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
2063
2062
  /**
2064
2063
  * Clears a `<textarea>` or text `<input>` element's value.
2065
2064
  *
@@ -2070,7 +2069,7 @@ declare namespace CodeceptJS {
2070
2069
  * ```
2071
2070
  * @param editable - field located by label|name|CSS|XPath|strict locator.
2072
2071
  */
2073
- clearField(editable: LocatorOrString): void;
2072
+ clearField(editable: LocatorOrString): Promise<any>;
2074
2073
  /**
2075
2074
  * Appends text to a input field or textarea.
2076
2075
  * Field is located by name, label, CSS or XPath
@@ -2081,7 +2080,7 @@ declare namespace CodeceptJS {
2081
2080
  * @param field - located by label|name|CSS|XPath|strict locator
2082
2081
  * @param value - text value to append.
2083
2082
  */
2084
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
2083
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
2085
2084
  /**
2086
2085
  * Checks that the given input field or textarea equals to given value.
2087
2086
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -2095,7 +2094,7 @@ declare namespace CodeceptJS {
2095
2094
  * @param field - located by label|name|CSS|XPath|strict locator.
2096
2095
  * @param value - value to check.
2097
2096
  */
2098
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
2097
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
2099
2098
  /**
2100
2099
  * Checks that value of input field or textarea doesn't equal to given value
2101
2100
  * Opposite to `seeInField`.
@@ -2107,7 +2106,7 @@ declare namespace CodeceptJS {
2107
2106
  * @param field - located by label|name|CSS|XPath|strict locator.
2108
2107
  * @param value - value to check.
2109
2108
  */
2110
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
2109
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
2111
2110
  /**
2112
2111
  * Sends [input event](http://electron.atom.io/docs/api/web-contents/#webcontentssendinputeventevent) on a page.
2113
2112
  * Can submit special keys like 'Enter', 'Backspace', etc
@@ -2134,7 +2133,7 @@ declare namespace CodeceptJS {
2134
2133
  * ```
2135
2134
  * @param field - located by label|name|CSS|XPath|strict locator.
2136
2135
  */
2137
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
2136
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
2138
2137
  /**
2139
2138
  * Verifies that the specified checkbox is not checked.
2140
2139
  *
@@ -2145,7 +2144,7 @@ declare namespace CodeceptJS {
2145
2144
  * ```
2146
2145
  * @param field - located by label|name|CSS|XPath|strict locator.
2147
2146
  */
2148
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
2147
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
2149
2148
  /**
2150
2149
  * Attaches a file to element located by label, name, CSS or XPath
2151
2150
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -2157,10 +2156,9 @@ declare namespace CodeceptJS {
2157
2156
  * ```
2158
2157
  * @param locator - field located by label|name|CSS|XPath|strict locator.
2159
2158
  * @param pathToFile - local file path relative to codecept.json config file.
2160
- *
2161
- * 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))
2159
+ * @returns 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))
2162
2160
  */
2163
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
2161
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
2164
2162
  /**
2165
2163
  * Retrieves all texts from an element located by CSS or XPath and returns it to test.
2166
2164
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -2290,7 +2288,7 @@ declare namespace CodeceptJS {
2290
2288
  * @param select - field located by label|name|CSS|XPath|strict locator.
2291
2289
  * @param option - visible text or value of option.
2292
2290
  */
2293
- selectOption(select: LocatorOrString, option: string | any[]): void;
2291
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
2294
2292
  /**
2295
2293
  * Sets cookie(s).
2296
2294
  *
@@ -2306,12 +2304,10 @@ declare namespace CodeceptJS {
2306
2304
  * ]);
2307
2305
  * ```
2308
2306
  * @param cookie - a cookie object or array of cookie objects.
2309
- *
2310
- *
2311
- * Wrapper for `.cookies.set(cookie)`.
2307
+ * @returns Wrapper for `.cookies.set(cookie)`.
2312
2308
  * [See more](https://github.com/segmentio/nightmare/blob/master/Readme.md#cookiessetcookie)
2313
2309
  */
2314
- setCookie(cookie: Cookie | Cookie[]): void;
2310
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
2315
2311
  /**
2316
2312
  * Checks that cookie with given name exists.
2317
2313
  *
@@ -2320,7 +2316,7 @@ declare namespace CodeceptJS {
2320
2316
  * ```
2321
2317
  * @param name - cookie name.
2322
2318
  */
2323
- seeCookie(name: string): void;
2319
+ seeCookie(name: string): Promise<any>;
2324
2320
  /**
2325
2321
  * Checks that cookie with given name does not exist.
2326
2322
  *
@@ -2329,7 +2325,7 @@ declare namespace CodeceptJS {
2329
2325
  * ```
2330
2326
  * @param name - cookie name.
2331
2327
  */
2332
- dontSeeCookie(name: string): void;
2328
+ dontSeeCookie(name: string): Promise<any>;
2333
2329
  /**
2334
2330
  * Gets a cookie object by name.
2335
2331
  * If none provided gets all cookies.
@@ -2358,7 +2354,7 @@ declare namespace CodeceptJS {
2358
2354
  * ```
2359
2355
  * @param [cookie = null] - (optional, `null` by default) cookie name
2360
2356
  */
2361
- clearCookie(cookie?: string): void;
2357
+ clearCookie(cookie?: string): Promise<any>;
2362
2358
  /**
2363
2359
  * Waits for a function to return true (waits for 1 sec by default).
2364
2360
  * Running in browser context.
@@ -2376,7 +2372,7 @@ declare namespace CodeceptJS {
2376
2372
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
2377
2373
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
2378
2374
  */
2379
- waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
2375
+ waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
2380
2376
  /**
2381
2377
  * Pauses execution for a number of seconds.
2382
2378
  *
@@ -2385,7 +2381,7 @@ declare namespace CodeceptJS {
2385
2381
  * ```
2386
2382
  * @param sec - number of second to wait.
2387
2383
  */
2388
- wait(sec: number): void;
2384
+ wait(sec: number): Promise<any>;
2389
2385
  /**
2390
2386
  * Waits for a text to appear (by default waits for 1sec).
2391
2387
  * Element can be located by CSS or XPath.
@@ -2399,7 +2395,7 @@ declare namespace CodeceptJS {
2399
2395
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
2400
2396
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
2401
2397
  */
2402
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
2398
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
2403
2399
  /**
2404
2400
  * Waits for an element to become visible on a page (by default waits for 1sec).
2405
2401
  * Element can be located by CSS or XPath.
@@ -2410,7 +2406,7 @@ declare namespace CodeceptJS {
2410
2406
  * @param locator - element located by CSS|XPath|strict locator.
2411
2407
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
2412
2408
  */
2413
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
2409
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
2414
2410
  /**
2415
2411
  * Waits for an element to hide (by default waits for 1sec).
2416
2412
  * Element can be located by CSS or XPath.
@@ -2421,7 +2417,7 @@ declare namespace CodeceptJS {
2421
2417
  * @param locator - element located by CSS|XPath|strict locator.
2422
2418
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
2423
2419
  */
2424
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
2420
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
2425
2421
  /**
2426
2422
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
2427
2423
  * Element can be located by CSS or XPath.
@@ -2432,7 +2428,7 @@ declare namespace CodeceptJS {
2432
2428
  * @param locator - element located by CSS|XPath|strict locator.
2433
2429
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
2434
2430
  */
2435
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
2431
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
2436
2432
  /**
2437
2433
  * Waits for element to be present on page (by default waits for 1sec).
2438
2434
  * Element can be located by CSS or XPath.
@@ -2444,7 +2440,7 @@ declare namespace CodeceptJS {
2444
2440
  * @param locator - element located by CSS|XPath|strict locator.
2445
2441
  * @param [sec] - (optional, `1` by default) time in seconds to wait
2446
2442
  */
2447
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
2443
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
2448
2444
  /**
2449
2445
  * Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
2450
2446
  * Element can be located by CSS or XPath.
@@ -2455,7 +2451,7 @@ declare namespace CodeceptJS {
2455
2451
  * @param locator - element located by CSS|XPath|strict locator.
2456
2452
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
2457
2453
  */
2458
- waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): void;
2454
+ waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
2459
2455
  /**
2460
2456
  * Reload the current page.
2461
2457
  *
@@ -2463,7 +2459,7 @@ declare namespace CodeceptJS {
2463
2459
  * I.refreshPage();
2464
2460
  * ```
2465
2461
  */
2466
- refreshPage(): void;
2462
+ refreshPage(): Promise<any>;
2467
2463
  /**
2468
2464
  * Reload the page
2469
2465
  */
@@ -2478,7 +2474,7 @@ declare namespace CodeceptJS {
2478
2474
  * @param locator - element located by CSS|XPath|strict locator.
2479
2475
  * @param fileName - file name to save.
2480
2476
  */
2481
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
2477
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
2482
2478
  /**
2483
2479
  * Grab the width, height, location of given locator.
2484
2480
  * Provide `width` or `height`as second param to get your desired prop.
@@ -2514,7 +2510,7 @@ declare namespace CodeceptJS {
2514
2510
  * @param fileName - file name to save.
2515
2511
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
2516
2512
  */
2517
- saveScreenshot(fileName: string, fullPage?: boolean): void;
2513
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
2518
2514
  /**
2519
2515
  * Scrolls to element matched by locator.
2520
2516
  * Extra shift can be set with offsetX and offsetY options.
@@ -2527,7 +2523,7 @@ declare namespace CodeceptJS {
2527
2523
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
2528
2524
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
2529
2525
  */
2530
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
2526
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
2531
2527
  /**
2532
2528
  * Scroll page to the top.
2533
2529
  *
@@ -2535,7 +2531,7 @@ declare namespace CodeceptJS {
2535
2531
  * I.scrollPageToTop();
2536
2532
  * ```
2537
2533
  */
2538
- scrollPageToTop(): void;
2534
+ scrollPageToTop(): Promise<any>;
2539
2535
  /**
2540
2536
  * Scroll page to the bottom.
2541
2537
  *
@@ -2543,7 +2539,7 @@ declare namespace CodeceptJS {
2543
2539
  * I.scrollPageToBottom();
2544
2540
  * ```
2545
2541
  */
2546
- scrollPageToBottom(): void;
2542
+ scrollPageToBottom(): Promise<any>;
2547
2543
  /**
2548
2544
  * Retrieves a page scroll position and returns it to test.
2549
2545
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -2603,6 +2599,7 @@ declare namespace CodeceptJS {
2603
2599
  * * `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000.
2604
2600
  * * `basicAuth`: (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
2605
2601
  * * `windowSize`: (optional) default window size. Set a dimension like `640x480`.
2602
+ * * `colorScheme`: (optional) default color scheme. Possible values: `dark` | `light` | `no-preference`.
2606
2603
  * * `userAgent`: (optional) user-agent string.
2607
2604
  * * `locale`: (optional) locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
2608
2605
  * * `manualStart`: (optional, default: false) - do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
@@ -2723,7 +2720,7 @@ declare namespace CodeceptJS {
2723
2720
  * }
2724
2721
  * ```
2725
2722
  *
2726
- * #### Example #7: Launch test with a specifc user locale
2723
+ * #### Example #7: Launch test with a specific user locale
2727
2724
  *
2728
2725
  * ```js
2729
2726
  * {
@@ -2736,6 +2733,19 @@ declare namespace CodeceptJS {
2736
2733
  * }
2737
2734
  * ```
2738
2735
  *
2736
+ * * #### Example #8: Launch test with a specific color scheme
2737
+ *
2738
+ * ```js
2739
+ * {
2740
+ * helpers: {
2741
+ * Playwright : {
2742
+ * url: "http://localhost",
2743
+ * colorScheme: "dark",
2744
+ * }
2745
+ * }
2746
+ * }
2747
+ * ```
2748
+ *
2739
2749
  * Note: When connecting to remote browser `show` and specific `chrome` options (e.g. `headless` or `devtools`) are ignored.
2740
2750
  *
2741
2751
  * ## Access From Helpers
@@ -2773,7 +2783,7 @@ declare namespace CodeceptJS {
2773
2783
  * @param description - used to show in logs.
2774
2784
  * @param fn - async function that executed with Playwright helper as argument
2775
2785
  */
2776
- usePlaywrightTo(description: string, fn: (...params: any[]) => any): void;
2786
+ usePlaywrightTo(description: string, fn: (...params: any[]) => any): Promise<any>;
2777
2787
  /**
2778
2788
  * Set the automatic popup response to Accept.
2779
2789
  * This must be set before a popup is triggered.
@@ -2784,13 +2794,13 @@ declare namespace CodeceptJS {
2784
2794
  * I.acceptPopup();
2785
2795
  * ```
2786
2796
  */
2787
- amAcceptingPopups(): void;
2797
+ amAcceptingPopups(): Promise<any>;
2788
2798
  /**
2789
2799
  * Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
2790
2800
  * Don't confuse popups with modal windows, as created by [various
2791
2801
  * libraries](http://jster.net/category/windows-modals-popups).
2792
2802
  */
2793
- acceptPopup(): void;
2803
+ acceptPopup(): Promise<any>;
2794
2804
  /**
2795
2805
  * Set the automatic popup response to Cancel/Dismiss.
2796
2806
  * This must be set before a popup is triggered.
@@ -2801,11 +2811,11 @@ declare namespace CodeceptJS {
2801
2811
  * I.cancelPopup();
2802
2812
  * ```
2803
2813
  */
2804
- amCancellingPopups(): void;
2814
+ amCancellingPopups(): Promise<any>;
2805
2815
  /**
2806
2816
  * Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt.
2807
2817
  */
2808
- cancelPopup(): void;
2818
+ cancelPopup(): Promise<any>;
2809
2819
  /**
2810
2820
  * Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the
2811
2821
  * given string.
@@ -2815,20 +2825,22 @@ declare namespace CodeceptJS {
2815
2825
  * ```
2816
2826
  * @param text - value to check.
2817
2827
  */
2818
- seeInPopup(text: string): void;
2828
+ seeInPopup(text: string): Promise<any>;
2819
2829
  /**
2820
2830
  * Set current page
2821
2831
  * @param page - page to set
2822
2832
  */
2823
- _setPage(page: any): void;
2833
+ _setPage(page: any): Promise<any>;
2824
2834
  /**
2825
2835
  * Add the 'dialog' event listener to a page
2836
+ * @returns The popup listener handles the dialog with the predefined action when it appears on the page.
2837
+ * It also saves a reference to the object which is used in seeInPopup.
2826
2838
  */
2827
- _addPopupListener(): void;
2839
+ _addPopupListener(): Promise<any>;
2828
2840
  /**
2829
2841
  * Gets page URL including hash.
2830
2842
  */
2831
- _getPageUrl(): void;
2843
+ _getPageUrl(): Promise<any>;
2832
2844
  /**
2833
2845
  * Grab the text within the popup. If no popup is visible then it will return null
2834
2846
  *
@@ -2848,14 +2860,13 @@ declare namespace CodeceptJS {
2848
2860
  * ```
2849
2861
  * @param url - url path or global url.
2850
2862
  */
2851
- amOnPage(url: string): void;
2863
+ amOnPage(url: string): Promise<any>;
2852
2864
  /**
2853
2865
  * Resize the current window to provided width and height.
2854
2866
  * First parameter can be set to `maximize`.
2855
2867
  * @param width - width in pixels or `maximize`.
2856
2868
  * @param height - height in pixels.
2857
- *
2858
- * Unlike other drivers Playwright changes the size of a viewport, not the window!
2869
+ * @returns Unlike other drivers Playwright changes the size of a viewport, not the window!
2859
2870
  * Playwright does not control the window of a browser so it can't adjust its real size.
2860
2871
  * It also can't maximize a window.
2861
2872
  *
@@ -2867,7 +2878,7 @@ declare namespace CodeceptJS {
2867
2878
  * { setWindowSize } = require('@codeceptjs/configure');
2868
2879
  * ````
2869
2880
  */
2870
- resizeWindow(width: number, height: number): void;
2881
+ resizeWindow(width: number, height: number): Promise<any>;
2871
2882
  /**
2872
2883
  * Set headers for all next requests
2873
2884
  *
@@ -2878,7 +2889,7 @@ declare namespace CodeceptJS {
2878
2889
  * ```
2879
2890
  * @param customHeaders - headers to set
2880
2891
  */
2881
- haveRequestHeaders(customHeaders: any): void;
2892
+ haveRequestHeaders(customHeaders: any): Promise<any>;
2882
2893
  /**
2883
2894
  * Moves cursor to element matched by locator.
2884
2895
  * Extra shift can be set with offsetX and offsetY options.
@@ -2891,7 +2902,7 @@ declare namespace CodeceptJS {
2891
2902
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
2892
2903
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
2893
2904
  */
2894
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
2905
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
2895
2906
  /**
2896
2907
  * Drag an item to a destination element.
2897
2908
  *
@@ -2900,9 +2911,7 @@ declare namespace CodeceptJS {
2900
2911
  * ```
2901
2912
  * @param srcElement - located by CSS|XPath|strict locator.
2902
2913
  * @param destElement - located by CSS|XPath|strict locator.
2903
- *
2904
- *
2905
- * [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
2914
+ * @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
2906
2915
  *
2907
2916
  * ```js
2908
2917
  * // specify coordinates for source position
@@ -2911,7 +2920,7 @@ declare namespace CodeceptJS {
2911
2920
  *
2912
2921
  * > By default option `force: true` is set
2913
2922
  */
2914
- dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
2923
+ dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString, options?: any): Promise<any>;
2915
2924
  /**
2916
2925
  * Reload the current page.
2917
2926
  *
@@ -2919,7 +2928,7 @@ declare namespace CodeceptJS {
2919
2928
  * I.refreshPage();
2920
2929
  * ```
2921
2930
  */
2922
- refreshPage(): void;
2931
+ refreshPage(): Promise<any>;
2923
2932
  /**
2924
2933
  * Scroll page to the top.
2925
2934
  *
@@ -2927,7 +2936,7 @@ declare namespace CodeceptJS {
2927
2936
  * I.scrollPageToTop();
2928
2937
  * ```
2929
2938
  */
2930
- scrollPageToTop(): void;
2939
+ scrollPageToTop(): Promise<any>;
2931
2940
  /**
2932
2941
  * Scroll page to the bottom.
2933
2942
  *
@@ -2935,7 +2944,7 @@ declare namespace CodeceptJS {
2935
2944
  * I.scrollPageToBottom();
2936
2945
  * ```
2937
2946
  */
2938
- scrollPageToBottom(): void;
2947
+ scrollPageToBottom(): Promise<any>;
2939
2948
  /**
2940
2949
  * Scrolls to element matched by locator.
2941
2950
  * Extra shift can be set with offsetX and offsetY options.
@@ -2948,7 +2957,7 @@ declare namespace CodeceptJS {
2948
2957
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
2949
2958
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
2950
2959
  */
2951
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
2960
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
2952
2961
  /**
2953
2962
  * Checks that title contains text.
2954
2963
  *
@@ -2957,7 +2966,7 @@ declare namespace CodeceptJS {
2957
2966
  * ```
2958
2967
  * @param text - text value to check.
2959
2968
  */
2960
- seeInTitle(text: string): void;
2969
+ seeInTitle(text: string): Promise<any>;
2961
2970
  /**
2962
2971
  * Retrieves a page scroll position and returns it to test.
2963
2972
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -2971,12 +2980,12 @@ declare namespace CodeceptJS {
2971
2980
  /**
2972
2981
  * Checks that title is equal to provided one.
2973
2982
  *
2974
- * ```js
2975
- * I.seeTitleEquals('Test title.');
2976
- * ```
2983
+ * ```js
2984
+ * I.seeTitleEquals('Test title.');
2985
+ * ```
2977
2986
  * @param text - value to check.
2978
2987
  */
2979
- seeTitleEquals(text: string): void;
2988
+ seeTitleEquals(text: string): Promise<any>;
2980
2989
  /**
2981
2990
  * Checks that title does not contain text.
2982
2991
  *
@@ -2985,7 +2994,7 @@ declare namespace CodeceptJS {
2985
2994
  * ```
2986
2995
  * @param text - value to check.
2987
2996
  */
2988
- dontSeeInTitle(text: string): void;
2997
+ dontSeeInTitle(text: string): Promise<any>;
2989
2998
  /**
2990
2999
  * Retrieves a page title and returns it to test.
2991
3000
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -3004,7 +3013,7 @@ declare namespace CodeceptJS {
3004
3013
  * const elements = await this.helpers['Playwright']._locate({name: 'password'});
3005
3014
  * ```
3006
3015
  */
3007
- _locate(): void;
3016
+ _locate(): Promise<any>;
3008
3017
  /**
3009
3018
  * Find a checkbox by providing human readable text:
3010
3019
  * NOTE: Assumes the checkable element exists
@@ -3013,7 +3022,7 @@ declare namespace CodeceptJS {
3013
3022
  * this.helpers['Playwright']._locateCheckable('I agree with terms and conditions').then // ...
3014
3023
  * ```
3015
3024
  */
3016
- _locateCheckable(): void;
3025
+ _locateCheckable(): Promise<any>;
3017
3026
  /**
3018
3027
  * Find a clickable element by providing human readable text:
3019
3028
  *
@@ -3021,7 +3030,7 @@ declare namespace CodeceptJS {
3021
3030
  * this.helpers['Playwright']._locateClickable('Next page').then // ...
3022
3031
  * ```
3023
3032
  */
3024
- _locateClickable(): void;
3033
+ _locateClickable(): Promise<any>;
3025
3034
  /**
3026
3035
  * Find field elements by providing human readable text:
3027
3036
  *
@@ -3029,7 +3038,7 @@ declare namespace CodeceptJS {
3029
3038
  * this.helpers['Playwright']._locateFields('Your email').then // ...
3030
3039
  * ```
3031
3040
  */
3032
- _locateFields(): void;
3041
+ _locateFields(): Promise<any>;
3033
3042
  /**
3034
3043
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab
3035
3044
  *
@@ -3038,7 +3047,7 @@ declare namespace CodeceptJS {
3038
3047
  * I.switchToNextTab(2);
3039
3048
  * ```
3040
3049
  */
3041
- switchToNextTab(num?: number): void;
3050
+ switchToNextTab(num?: number): Promise<any>;
3042
3051
  /**
3043
3052
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab
3044
3053
  *
@@ -3047,7 +3056,7 @@ declare namespace CodeceptJS {
3047
3056
  * I.switchToPreviousTab(2);
3048
3057
  * ```
3049
3058
  */
3050
- switchToPreviousTab(num?: number): void;
3059
+ switchToPreviousTab(num?: number): Promise<any>;
3051
3060
  /**
3052
3061
  * Close current tab and switches to previous.
3053
3062
  *
@@ -3055,7 +3064,7 @@ declare namespace CodeceptJS {
3055
3064
  * I.closeCurrentTab();
3056
3065
  * ```
3057
3066
  */
3058
- closeCurrentTab(): void;
3067
+ closeCurrentTab(): Promise<any>;
3059
3068
  /**
3060
3069
  * Close all tabs except for the current one.
3061
3070
  *
@@ -3063,7 +3072,7 @@ declare namespace CodeceptJS {
3063
3072
  * I.closeOtherTabs();
3064
3073
  * ```
3065
3074
  */
3066
- closeOtherTabs(): void;
3075
+ closeOtherTabs(): Promise<any>;
3067
3076
  /**
3068
3077
  * Open new tab and automatically switched to new tab
3069
3078
  *
@@ -3078,7 +3087,7 @@ declare namespace CodeceptJS {
3078
3087
  * I.openNewTab({ isMobile: true });
3079
3088
  * ```
3080
3089
  */
3081
- openNewTab(): void;
3090
+ openNewTab(): Promise<any>;
3082
3091
  /**
3083
3092
  * Grab number of open tabs.
3084
3093
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -3098,7 +3107,7 @@ declare namespace CodeceptJS {
3098
3107
  * ```
3099
3108
  * @param locator - located by CSS|XPath|strict locator.
3100
3109
  */
3101
- seeElement(locator: CodeceptJS.LocatorOrString): void;
3110
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
3102
3111
  /**
3103
3112
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
3104
3113
  *
@@ -3107,7 +3116,7 @@ declare namespace CodeceptJS {
3107
3116
  * ```
3108
3117
  * @param locator - located by CSS|XPath|Strict locator.
3109
3118
  */
3110
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
3119
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
3111
3120
  /**
3112
3121
  * Checks that a given Element is present in the DOM
3113
3122
  * Element is located by CSS or XPath.
@@ -3117,7 +3126,7 @@ declare namespace CodeceptJS {
3117
3126
  * ```
3118
3127
  * @param locator - element located by CSS|XPath|strict locator.
3119
3128
  */
3120
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
3129
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
3121
3130
  /**
3122
3131
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
3123
3132
  *
@@ -3126,7 +3135,7 @@ declare namespace CodeceptJS {
3126
3135
  * ```
3127
3136
  * @param locator - located by CSS|XPath|Strict locator.
3128
3137
  */
3129
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
3138
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
3130
3139
  /**
3131
3140
  * Handles a file download.Aa file name is required to save the file on disk.
3132
3141
  * Files are saved to "output" directory.
@@ -3142,7 +3151,7 @@ declare namespace CodeceptJS {
3142
3151
  * ```
3143
3152
  * @param [fileName = downloads] - set filename for downloaded file
3144
3153
  */
3145
- handleDownloads(fileName?: string): void;
3154
+ handleDownloads(fileName?: string): Promise<void>;
3146
3155
  /**
3147
3156
  * Perform a click on a link or a button, given by a locator.
3148
3157
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -3167,9 +3176,7 @@ declare namespace CodeceptJS {
3167
3176
  * ```
3168
3177
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3169
3178
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3170
- *
3171
- *
3172
- * [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
3179
+ * @param [opts] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
3173
3180
  *
3174
3181
  * Examples:
3175
3182
  *
@@ -3181,11 +3188,11 @@ declare namespace CodeceptJS {
3181
3188
  * I.click('.edit', null, { modifiers: ['Ctrl'] } )
3182
3189
  * ```
3183
3190
  */
3184
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3191
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, opts?: any): Promise<any>;
3185
3192
  /**
3186
3193
  * Clicks link and waits for navigation (deprecated)
3187
3194
  */
3188
- clickLink(): void;
3195
+ clickLink(): Promise<any>;
3189
3196
  /**
3190
3197
  * Perform an emulated click on a link or a button, given by a locator.
3191
3198
  * Unlike normal click instead of sending native event, emulates a click with JavaScript.
@@ -3214,7 +3221,7 @@ declare namespace CodeceptJS {
3214
3221
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3215
3222
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3216
3223
  */
3217
- forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3224
+ forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3218
3225
  /**
3219
3226
  * Performs a double-click on an element matched by link|button|label|CSS or XPath.
3220
3227
  * Context can be specified as second parameter to narrow search.
@@ -3228,7 +3235,7 @@ declare namespace CodeceptJS {
3228
3235
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3229
3236
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3230
3237
  */
3231
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3238
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3232
3239
  /**
3233
3240
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
3234
3241
  *
@@ -3243,7 +3250,7 @@ declare namespace CodeceptJS {
3243
3250
  * @param locator - clickable element located by CSS|XPath|strict locator.
3244
3251
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
3245
3252
  */
3246
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3253
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3247
3254
  /**
3248
3255
  * Selects a checkbox or radio button.
3249
3256
  * Element is located by label or name or CSS or XPath.
@@ -3257,8 +3264,7 @@ declare namespace CodeceptJS {
3257
3264
  * ```
3258
3265
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
3259
3266
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
3260
- *
3261
- * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
3267
+ * @returns [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
3262
3268
  *
3263
3269
  * Examples:
3264
3270
  *
@@ -3268,7 +3274,7 @@ declare namespace CodeceptJS {
3268
3274
  * ```
3269
3275
  * > ⚠️ To avoid flakiness, option `force: true` is set by default
3270
3276
  */
3271
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3277
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3272
3278
  /**
3273
3279
  * Unselects a checkbox or radio button.
3274
3280
  * Element is located by label or name or CSS or XPath.
@@ -3282,8 +3288,7 @@ declare namespace CodeceptJS {
3282
3288
  * ```
3283
3289
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
3284
3290
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
3285
- *
3286
- * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
3291
+ * @returns [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
3287
3292
  *
3288
3293
  * Examples:
3289
3294
  *
@@ -3293,7 +3298,7 @@ declare namespace CodeceptJS {
3293
3298
  * ```
3294
3299
  * > ⚠️ To avoid flakiness, option `force: true` is set by default
3295
3300
  */
3296
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3301
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3297
3302
  /**
3298
3303
  * Verifies that the specified checkbox is checked.
3299
3304
  *
@@ -3304,7 +3309,7 @@ declare namespace CodeceptJS {
3304
3309
  * ```
3305
3310
  * @param field - located by label|name|CSS|XPath|strict locator.
3306
3311
  */
3307
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
3312
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
3308
3313
  /**
3309
3314
  * Verifies that the specified checkbox is not checked.
3310
3315
  *
@@ -3315,7 +3320,7 @@ declare namespace CodeceptJS {
3315
3320
  * ```
3316
3321
  * @param field - located by label|name|CSS|XPath|strict locator.
3317
3322
  */
3318
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
3323
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
3319
3324
  /**
3320
3325
  * Presses a key in the browser and leaves it in a down state.
3321
3326
  *
@@ -3328,7 +3333,7 @@ declare namespace CodeceptJS {
3328
3333
  * ```
3329
3334
  * @param key - name of key to press down.
3330
3335
  */
3331
- pressKeyDown(key: string): void;
3336
+ pressKeyDown(key: string): Promise<any>;
3332
3337
  /**
3333
3338
  * Releases a key in the browser which was previously set to a down state.
3334
3339
  *
@@ -3341,7 +3346,7 @@ declare namespace CodeceptJS {
3341
3346
  * ```
3342
3347
  * @param key - name of key to release.
3343
3348
  */
3344
- pressKeyUp(key: string): void;
3349
+ pressKeyUp(key: string): Promise<any>;
3345
3350
  /**
3346
3351
  * Presses a key in the browser (on a focused element).
3347
3352
  *
@@ -3401,11 +3406,9 @@ declare namespace CodeceptJS {
3401
3406
  * - `'Space'`
3402
3407
  * - `'Tab'`
3403
3408
  * @param key - key or array of keys to press.
3404
- *
3405
- *
3406
- * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
3409
+ * @returns _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
3407
3410
  */
3408
- pressKey(key: string | string[]): void;
3411
+ pressKey(key: string | string[]): Promise<any>;
3409
3412
  /**
3410
3413
  * Types out the given text into an active field.
3411
3414
  * To slow down typing use a second parameter, to set interval between key presses.
@@ -3424,7 +3427,7 @@ declare namespace CodeceptJS {
3424
3427
  * @param key - or array of keys to type.
3425
3428
  * @param [delay = null] - (optional) delay in ms between key presses
3426
3429
  */
3427
- type(key: string | string[], delay?: number): void;
3430
+ type(key: string | string[], delay?: number): Promise<any>;
3428
3431
  /**
3429
3432
  * Fills a text field or textarea, after clearing its value, with the given string.
3430
3433
  * Field is located by name, label, CSS, or XPath.
@@ -3442,7 +3445,7 @@ declare namespace CodeceptJS {
3442
3445
  * @param field - located by label|name|CSS|XPath|strict locator.
3443
3446
  * @param value - text value to fill.
3444
3447
  */
3445
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
3448
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
3446
3449
  /**
3447
3450
  * Clears a `<textarea>` or text `<input>` element's value.
3448
3451
  *
@@ -3453,7 +3456,7 @@ declare namespace CodeceptJS {
3453
3456
  * ```
3454
3457
  * @param editable - field located by label|name|CSS|XPath|strict locator.
3455
3458
  */
3456
- clearField(editable: LocatorOrString): void;
3459
+ clearField(editable: LocatorOrString): Promise<any>;
3457
3460
  /**
3458
3461
  * Appends text to a input field or textarea.
3459
3462
  * Field is located by name, label, CSS or XPath
@@ -3464,7 +3467,7 @@ declare namespace CodeceptJS {
3464
3467
  * @param field - located by label|name|CSS|XPath|strict locator
3465
3468
  * @param value - text value to append.
3466
3469
  */
3467
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
3470
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
3468
3471
  /**
3469
3472
  * Checks that the given input field or textarea equals to given value.
3470
3473
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -3478,7 +3481,7 @@ declare namespace CodeceptJS {
3478
3481
  * @param field - located by label|name|CSS|XPath|strict locator.
3479
3482
  * @param value - value to check.
3480
3483
  */
3481
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
3484
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
3482
3485
  /**
3483
3486
  * Checks that value of input field or textarea doesn't equal to given value
3484
3487
  * Opposite to `seeInField`.
@@ -3490,7 +3493,7 @@ declare namespace CodeceptJS {
3490
3493
  * @param field - located by label|name|CSS|XPath|strict locator.
3491
3494
  * @param value - value to check.
3492
3495
  */
3493
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
3496
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
3494
3497
  /**
3495
3498
  * Attaches a file to element located by label, name, CSS or XPath
3496
3499
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -3503,7 +3506,7 @@ declare namespace CodeceptJS {
3503
3506
  * @param locator - field located by label|name|CSS|XPath|strict locator.
3504
3507
  * @param pathToFile - local file path relative to codecept.json config file.
3505
3508
  */
3506
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
3509
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
3507
3510
  /**
3508
3511
  * Selects an option in a drop-down select.
3509
3512
  * Field is searched by label | name | CSS | XPath.
@@ -3526,7 +3529,7 @@ declare namespace CodeceptJS {
3526
3529
  * @param select - field located by label|name|CSS|XPath|strict locator.
3527
3530
  * @param option - visible text or value of option.
3528
3531
  */
3529
- selectOption(select: LocatorOrString, option: string | any[]): void;
3532
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
3530
3533
  /**
3531
3534
  * Grab number of visible elements by locator.
3532
3535
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -3546,12 +3549,12 @@ declare namespace CodeceptJS {
3546
3549
  * ```
3547
3550
  * @param url - a fragment to check
3548
3551
  */
3549
- seeInCurrentUrl(url: string): void;
3552
+ seeInCurrentUrl(url: string): Promise<any>;
3550
3553
  /**
3551
3554
  * Checks that current url does not contain a provided fragment.
3552
3555
  * @param url - value to check.
3553
3556
  */
3554
- dontSeeInCurrentUrl(url: string): void;
3557
+ dontSeeInCurrentUrl(url: string): Promise<any>;
3555
3558
  /**
3556
3559
  * Checks that current url is equal to provided one.
3557
3560
  * If a relative url provided, a configured url will be prepended to it.
@@ -3563,7 +3566,7 @@ declare namespace CodeceptJS {
3563
3566
  * ```
3564
3567
  * @param url - value to check.
3565
3568
  */
3566
- seeCurrentUrlEquals(url: string): void;
3569
+ seeCurrentUrlEquals(url: string): Promise<any>;
3567
3570
  /**
3568
3571
  * Checks that current url is not equal to provided one.
3569
3572
  * If a relative url provided, a configured url will be prepended to it.
@@ -3574,7 +3577,7 @@ declare namespace CodeceptJS {
3574
3577
  * ```
3575
3578
  * @param url - value to check.
3576
3579
  */
3577
- dontSeeCurrentUrlEquals(url: string): void;
3580
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
3578
3581
  /**
3579
3582
  * Checks that a page contains a visible text.
3580
3583
  * Use context parameter to narrow down the search.
@@ -3587,7 +3590,7 @@ declare namespace CodeceptJS {
3587
3590
  * @param text - expected on page.
3588
3591
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
3589
3592
  */
3590
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
3593
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
3591
3594
  /**
3592
3595
  * Checks that text is equal to provided one.
3593
3596
  *
@@ -3597,7 +3600,7 @@ declare namespace CodeceptJS {
3597
3600
  * @param text - element value to check.
3598
3601
  * @param [context = null] - element located by CSS|XPath|strict locator.
3599
3602
  */
3600
- seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): void;
3603
+ seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
3601
3604
  /**
3602
3605
  * Opposite to `see`. Checks that a text is not present on a page.
3603
3606
  * Use context parameter to narrow down the search.
@@ -3609,7 +3612,7 @@ declare namespace CodeceptJS {
3609
3612
  * @param text - which is not present.
3610
3613
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
3611
3614
  */
3612
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
3615
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
3613
3616
  /**
3614
3617
  * Retrieves page source and returns it to test.
3615
3618
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -3648,7 +3651,7 @@ declare namespace CodeceptJS {
3648
3651
  * ```
3649
3652
  * @param text - value to check.
3650
3653
  */
3651
- seeInSource(text: string): void;
3654
+ seeInSource(text: string): Promise<any>;
3652
3655
  /**
3653
3656
  * Checks that the current page does not contains the given string in its raw source code.
3654
3657
  *
@@ -3657,7 +3660,7 @@ declare namespace CodeceptJS {
3657
3660
  * ```
3658
3661
  * @param value - to check.
3659
3662
  */
3660
- dontSeeInSource(value: string): void;
3663
+ dontSeeInSource(value: string): Promise<any>;
3661
3664
  /**
3662
3665
  * Asserts that an element appears a given number of times in the DOM.
3663
3666
  * Element is located by label or name or CSS or XPath.
@@ -3669,7 +3672,7 @@ declare namespace CodeceptJS {
3669
3672
  * @param locator - element located by CSS|XPath|strict locator.
3670
3673
  * @param num - number of elements.
3671
3674
  */
3672
- seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): void;
3675
+ seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
3673
3676
  /**
3674
3677
  * Asserts that an element is visible a given number of times.
3675
3678
  * Element is located by CSS or XPath.
@@ -3680,7 +3683,7 @@ declare namespace CodeceptJS {
3680
3683
  * @param locator - element located by CSS|XPath|strict locator.
3681
3684
  * @param num - number of elements.
3682
3685
  */
3683
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
3686
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
3684
3687
  /**
3685
3688
  * Sets cookie(s).
3686
3689
  *
@@ -3697,7 +3700,7 @@ declare namespace CodeceptJS {
3697
3700
  * ```
3698
3701
  * @param cookie - a cookie object or array of cookie objects.
3699
3702
  */
3700
- setCookie(cookie: Cookie | Cookie[]): void;
3703
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
3701
3704
  /**
3702
3705
  * Checks that cookie with given name exists.
3703
3706
  *
@@ -3706,7 +3709,7 @@ declare namespace CodeceptJS {
3706
3709
  * ```
3707
3710
  * @param name - cookie name.
3708
3711
  */
3709
- seeCookie(name: string): void;
3712
+ seeCookie(name: string): Promise<any>;
3710
3713
  /**
3711
3714
  * Checks that cookie with given name does not exist.
3712
3715
  *
@@ -3715,7 +3718,7 @@ declare namespace CodeceptJS {
3715
3718
  * ```
3716
3719
  * @param name - cookie name.
3717
3720
  */
3718
- dontSeeCookie(name: string): void;
3721
+ dontSeeCookie(name: string): Promise<any>;
3719
3722
  /**
3720
3723
  * Gets a cookie object by name.
3721
3724
  * If none provided gets all cookies.
@@ -3742,7 +3745,7 @@ declare namespace CodeceptJS {
3742
3745
  * ```
3743
3746
  * @param [cookie = null] - (optional, `null` by default) cookie name
3744
3747
  */
3745
- clearCookie(cookie?: string): void;
3748
+ clearCookie(cookie?: string): Promise<any>;
3746
3749
  /**
3747
3750
  * Executes a script on the page:
3748
3751
  *
@@ -3873,7 +3876,7 @@ declare namespace CodeceptJS {
3873
3876
  * @param locator - located by CSS|XPath|strict locator.
3874
3877
  * @param cssProperties - object with CSS properties and their values to check.
3875
3878
  */
3876
- seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): void;
3879
+ seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
3877
3880
  /**
3878
3881
  * Checks that all elements with given locator have given attributes.
3879
3882
  *
@@ -3883,7 +3886,7 @@ declare namespace CodeceptJS {
3883
3886
  * @param locator - located by CSS|XPath|strict locator.
3884
3887
  * @param attributes - attributes and their values to check.
3885
3888
  */
3886
- seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): void;
3889
+ seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
3887
3890
  /**
3888
3891
  * Drag the scrubber of a slider to a given position
3889
3892
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -3895,7 +3898,7 @@ declare namespace CodeceptJS {
3895
3898
  * @param locator - located by label|name|CSS|XPath|strict locator.
3896
3899
  * @param offsetX - position to drag.
3897
3900
  */
3898
- dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): void;
3901
+ dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): Promise<any>;
3899
3902
  /**
3900
3903
  * Retrieves an attribute from an element located by CSS or XPath and returns it to test.
3901
3904
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -3931,7 +3934,7 @@ declare namespace CodeceptJS {
3931
3934
  * @param locator - element located by CSS|XPath|strict locator.
3932
3935
  * @param fileName - file name to save.
3933
3936
  */
3934
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
3937
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
3935
3938
  /**
3936
3939
  * Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
3937
3940
  * Filename is relative to output folder.
@@ -3944,7 +3947,7 @@ declare namespace CodeceptJS {
3944
3947
  * @param fileName - file name to save.
3945
3948
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
3946
3949
  */
3947
- saveScreenshot(fileName: string, fullPage?: boolean): void;
3950
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
3948
3951
  /**
3949
3952
  * Performs [api request](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get) using
3950
3953
  * the cookies from the current browser session.
@@ -3970,14 +3973,14 @@ declare namespace CodeceptJS {
3970
3973
  * ```
3971
3974
  * @param sec - number of second to wait.
3972
3975
  */
3973
- wait(sec: number): void;
3976
+ wait(sec: number): Promise<any>;
3974
3977
  /**
3975
3978
  * Waits for element to become enabled (by default waits for 1sec).
3976
3979
  * Element can be located by CSS or XPath.
3977
3980
  * @param locator - element located by CSS|XPath|strict locator.
3978
3981
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
3979
3982
  */
3980
- waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): void;
3983
+ waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
3981
3984
  /**
3982
3985
  * Waits for the specified value to be in value attribute.
3983
3986
  *
@@ -3988,7 +3991,7 @@ declare namespace CodeceptJS {
3988
3991
  * @param value - expected value.
3989
3992
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
3990
3993
  */
3991
- waitForValue(field: LocatorOrString, value: string, sec?: number): void;
3994
+ waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
3992
3995
  /**
3993
3996
  * Waits for a specified number of elements on the page.
3994
3997
  *
@@ -3999,7 +4002,7 @@ declare namespace CodeceptJS {
3999
4002
  * @param num - number of elements.
4000
4003
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4001
4004
  */
4002
- waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): void;
4005
+ waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
4003
4006
  /**
4004
4007
  * Waits for element to be clickable (by default waits for 1sec).
4005
4008
  * Element can be located by CSS or XPath.
@@ -4011,7 +4014,7 @@ declare namespace CodeceptJS {
4011
4014
  * @param locator - element located by CSS|XPath|strict locator.
4012
4015
  * @param [sec] - (optional, `1` by default) time in seconds to wait
4013
4016
  */
4014
- waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4017
+ waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4015
4018
  /**
4016
4019
  * Waits for element to be present on page (by default waits for 1sec).
4017
4020
  * Element can be located by CSS or XPath.
@@ -4023,7 +4026,7 @@ declare namespace CodeceptJS {
4023
4026
  * @param locator - element located by CSS|XPath|strict locator.
4024
4027
  * @param [sec] - (optional, `1` by default) time in seconds to wait
4025
4028
  */
4026
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4029
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4027
4030
  /**
4028
4031
  * Waits for an element to become visible on a page (by default waits for 1sec).
4029
4032
  * Element can be located by CSS or XPath.
@@ -4033,11 +4036,9 @@ declare namespace CodeceptJS {
4033
4036
  * ```
4034
4037
  * @param locator - element located by CSS|XPath|strict locator.
4035
4038
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4036
- *
4037
- *
4038
- * This method accepts [React selectors](https://codecept.io/react).
4039
+ * @returns This method accepts [React selectors](https://codecept.io/react).
4039
4040
  */
4040
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4041
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4041
4042
  /**
4042
4043
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
4043
4044
  * Element can be located by CSS or XPath.
@@ -4048,7 +4049,7 @@ declare namespace CodeceptJS {
4048
4049
  * @param locator - element located by CSS|XPath|strict locator.
4049
4050
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4050
4051
  */
4051
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4052
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4052
4053
  /**
4053
4054
  * Waits for an element to hide (by default waits for 1sec).
4054
4055
  * Element can be located by CSS or XPath.
@@ -4059,7 +4060,7 @@ declare namespace CodeceptJS {
4059
4060
  * @param locator - element located by CSS|XPath|strict locator.
4060
4061
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4061
4062
  */
4062
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4063
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4063
4064
  /**
4064
4065
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
4065
4066
  *
@@ -4069,7 +4070,7 @@ declare namespace CodeceptJS {
4069
4070
  * @param urlPart - value to check.
4070
4071
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4071
4072
  */
4072
- waitInUrl(urlPart: string, sec?: number): void;
4073
+ waitInUrl(urlPart: string, sec?: number): Promise<any>;
4073
4074
  /**
4074
4075
  * Waits for the entire URL to match the expected
4075
4076
  *
@@ -4080,7 +4081,7 @@ declare namespace CodeceptJS {
4080
4081
  * @param urlPart - value to check.
4081
4082
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4082
4083
  */
4083
- waitUrlEquals(urlPart: string, sec?: number): void;
4084
+ waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
4084
4085
  /**
4085
4086
  * Waits for a text to appear (by default waits for 1sec).
4086
4087
  * Element can be located by CSS or XPath.
@@ -4094,7 +4095,7 @@ declare namespace CodeceptJS {
4094
4095
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4095
4096
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
4096
4097
  */
4097
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
4098
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
4098
4099
  /**
4099
4100
  * Waits for a network request.
4100
4101
  *
@@ -4104,7 +4105,7 @@ declare namespace CodeceptJS {
4104
4105
  * ```
4105
4106
  * @param [sec = null] - seconds to wait
4106
4107
  */
4107
- waitForRequest(urlOrPredicate: string | ((...params: any[]) => any), sec?: number): void;
4108
+ waitForRequest(urlOrPredicate: string | ((...params: any[]) => any), sec?: number): Promise<any>;
4108
4109
  /**
4109
4110
  * Waits for a network response.
4110
4111
  *
@@ -4114,7 +4115,7 @@ declare namespace CodeceptJS {
4114
4115
  * ```
4115
4116
  * @param [sec = null] - number of seconds to wait
4116
4117
  */
4117
- waitForResponse(urlOrPredicate: string | ((...params: any[]) => any), sec?: number): void;
4118
+ waitForResponse(urlOrPredicate: string | ((...params: any[]) => any), sec?: number): Promise<any>;
4118
4119
  /**
4119
4120
  * Switches frame or in case of null locator reverts to parent.
4120
4121
  *
@@ -4124,7 +4125,7 @@ declare namespace CodeceptJS {
4124
4125
  * ```
4125
4126
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
4126
4127
  */
4127
- switchTo(locator?: CodeceptJS.LocatorOrString): void;
4128
+ switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
4128
4129
  /**
4129
4130
  * Waits for a function to return true (waits for 1 sec by default).
4130
4131
  * Running in browser context.
@@ -4142,13 +4143,13 @@ declare namespace CodeceptJS {
4142
4143
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
4143
4144
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
4144
4145
  */
4145
- waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
4146
+ waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
4146
4147
  /**
4147
4148
  * Waits for navigation to finish. By default takes configured `waitForNavigation` option.
4148
4149
  *
4149
4150
  * See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions)
4150
4151
  */
4151
- waitForNavigation(opts: any): void;
4152
+ waitForNavigation(opts: any): Promise<any>;
4152
4153
  /**
4153
4154
  * Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
4154
4155
  * Element can be located by CSS or XPath.
@@ -4159,7 +4160,7 @@ declare namespace CodeceptJS {
4159
4160
  * @param locator - element located by CSS|XPath|strict locator.
4160
4161
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4161
4162
  */
4162
- waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4163
+ waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4163
4164
  /**
4164
4165
  * Grab the data from performance timing using Navigation Timing API.
4165
4166
  * The returned data will contain following things in ms:
@@ -4181,7 +4182,7 @@ declare namespace CodeceptJS {
4181
4182
  * }
4182
4183
  * ```
4183
4184
  */
4184
- grabDataFromPerformanceTiming(): void;
4185
+ grabDataFromPerformanceTiming(): Promise<any>;
4185
4186
  /**
4186
4187
  * Grab the width, height, location of given locator.
4187
4188
  * Provide `width` or `height`as second param to get your desired prop.
@@ -4215,7 +4216,7 @@ declare namespace CodeceptJS {
4215
4216
  * @param [url] - URL, regex or pattern for to match URL
4216
4217
  * @param [handler] - a function to process request
4217
4218
  */
4218
- mockRoute(url?: string, handler?: (...params: any[]) => any): void;
4219
+ mockRoute(url?: string | RegExp, handler?: (...params: any[]) => any): Promise<any>;
4219
4220
  /**
4220
4221
  * Stops network mocking created by `mockRoute`.
4221
4222
  *
@@ -4227,7 +4228,7 @@ declare namespace CodeceptJS {
4227
4228
  * @param [url] - URL, regex or pattern for to match URL
4228
4229
  * @param [handler] - a function to process request
4229
4230
  */
4230
- stopMockingRoute(url?: string, handler?: (...params: any[]) => any): void;
4231
+ stopMockingRoute(url?: string | RegExp, handler?: (...params: any[]) => any): Promise<any>;
4231
4232
  }
4232
4233
  /**
4233
4234
  * This helper works the same as MockRequest helper. It has been included for backwards compatibility
@@ -4431,7 +4432,7 @@ declare namespace CodeceptJS {
4431
4432
  * ```
4432
4433
  * @param url - url path or global url.
4433
4434
  */
4434
- amOnPage(url: string): void;
4435
+ amOnPage(url: string): Promise<any>;
4435
4436
  /**
4436
4437
  * Perform a click on a link or a button, given by a locator.
4437
4438
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -4457,7 +4458,7 @@ declare namespace CodeceptJS {
4457
4458
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
4458
4459
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
4459
4460
  */
4460
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
4461
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
4461
4462
  /**
4462
4463
  * Performs a double-click on an element matched by link|button|label|CSS or XPath.
4463
4464
  * Context can be specified as second parameter to narrow search.
@@ -4471,7 +4472,7 @@ declare namespace CodeceptJS {
4471
4472
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
4472
4473
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
4473
4474
  */
4474
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
4475
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4475
4476
  /**
4476
4477
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
4477
4478
  *
@@ -4486,7 +4487,7 @@ declare namespace CodeceptJS {
4486
4487
  * @param locator - clickable element located by CSS|XPath|strict locator.
4487
4488
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
4488
4489
  */
4489
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
4490
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4490
4491
  /**
4491
4492
  * Moves cursor to element matched by locator.
4492
4493
  * Extra shift can be set with offsetX and offsetY options.
@@ -4499,7 +4500,7 @@ declare namespace CodeceptJS {
4499
4500
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
4500
4501
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
4501
4502
  */
4502
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
4503
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
4503
4504
  /**
4504
4505
  * Checks that a page contains a visible text.
4505
4506
  * Use context parameter to narrow down the search.
@@ -4512,7 +4513,7 @@ declare namespace CodeceptJS {
4512
4513
  * @param text - expected on page.
4513
4514
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
4514
4515
  */
4515
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
4516
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
4516
4517
  /**
4517
4518
  * Checks that text is equal to provided one.
4518
4519
  *
@@ -4522,7 +4523,7 @@ declare namespace CodeceptJS {
4522
4523
  * @param text - element value to check.
4523
4524
  * @param [context = null] - element located by CSS|XPath|strict locator.
4524
4525
  */
4525
- seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): void;
4526
+ seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
4526
4527
  /**
4527
4528
  * Opposite to `see`. Checks that a text is not present on a page.
4528
4529
  * Use context parameter to narrow down the search.
@@ -4534,7 +4535,7 @@ declare namespace CodeceptJS {
4534
4535
  * @param text - which is not present.
4535
4536
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
4536
4537
  */
4537
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
4538
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
4538
4539
  /**
4539
4540
  * Get JS log from browser. Log buffer is reset after each request.
4540
4541
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -4579,7 +4580,7 @@ declare namespace CodeceptJS {
4579
4580
  * @param select - field located by label|name|CSS|XPath|strict locator.
4580
4581
  * @param option - visible text or value of option.
4581
4582
  */
4582
- selectOption(select: LocatorOrString, option: string | any[]): void;
4583
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
4583
4584
  /**
4584
4585
  * Fills a text field or textarea, after clearing its value, with the given string.
4585
4586
  * Field is located by name, label, CSS, or XPath.
@@ -4597,7 +4598,7 @@ declare namespace CodeceptJS {
4597
4598
  * @param field - located by label|name|CSS|XPath|strict locator.
4598
4599
  * @param value - text value to fill.
4599
4600
  */
4600
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
4601
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
4601
4602
  /**
4602
4603
  * Presses a key on a focused element.
4603
4604
  * Special keys like 'Enter', 'Control', [etc](https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value)
@@ -4609,9 +4610,9 @@ declare namespace CodeceptJS {
4609
4610
  * I.pressKey(['Control','a']);
4610
4611
  * ```
4611
4612
  * @param key - key or array of keys to press.
4612
- * {{ keys }}
4613
+ * @returns {{ keys }}
4613
4614
  */
4614
- pressKey(key: string | string[]): void;
4615
+ pressKey(key: string | string[]): Promise<any>;
4615
4616
  /**
4616
4617
  * Attaches a file to element located by label, name, CSS or XPath
4617
4618
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -4624,7 +4625,7 @@ declare namespace CodeceptJS {
4624
4625
  * @param locator - field located by label|name|CSS|XPath|strict locator.
4625
4626
  * @param pathToFile - local file path relative to codecept.json config file.
4626
4627
  */
4627
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
4628
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
4628
4629
  /**
4629
4630
  * Checks that the given input field or textarea equals to given value.
4630
4631
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -4638,7 +4639,7 @@ declare namespace CodeceptJS {
4638
4639
  * @param field - located by label|name|CSS|XPath|strict locator.
4639
4640
  * @param value - value to check.
4640
4641
  */
4641
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
4642
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
4642
4643
  /**
4643
4644
  * Checks that value of input field or textarea doesn't equal to given value
4644
4645
  * Opposite to `seeInField`.
@@ -4650,7 +4651,7 @@ declare namespace CodeceptJS {
4650
4651
  * @param field - located by label|name|CSS|XPath|strict locator.
4651
4652
  * @param value - value to check.
4652
4653
  */
4653
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
4654
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
4654
4655
  /**
4655
4656
  * Appends text to a input field or textarea.
4656
4657
  * Field is located by name, label, CSS or XPath
@@ -4661,7 +4662,7 @@ declare namespace CodeceptJS {
4661
4662
  * @param field - located by label|name|CSS|XPath|strict locator
4662
4663
  * @param value - text value to append.
4663
4664
  */
4664
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
4665
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
4665
4666
  /**
4666
4667
  * Clears a `<textarea>` or text `<input>` element's value.
4667
4668
  *
@@ -4672,7 +4673,7 @@ declare namespace CodeceptJS {
4672
4673
  * ```
4673
4674
  * @param editable - field located by label|name|CSS|XPath|strict locator.
4674
4675
  */
4675
- clearField(editable: LocatorOrString): void;
4676
+ clearField(editable: LocatorOrString): Promise<any>;
4676
4677
  /**
4677
4678
  * Selects a checkbox or radio button.
4678
4679
  * Element is located by label or name or CSS or XPath.
@@ -4687,7 +4688,7 @@ declare namespace CodeceptJS {
4687
4688
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
4688
4689
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
4689
4690
  */
4690
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
4691
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4691
4692
  /**
4692
4693
  * Unselects a checkbox or radio button.
4693
4694
  * Element is located by label or name or CSS or XPath.
@@ -4702,7 +4703,7 @@ declare namespace CodeceptJS {
4702
4703
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
4703
4704
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
4704
4705
  */
4705
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
4706
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4706
4707
  /**
4707
4708
  * Verifies that the specified checkbox is checked.
4708
4709
  *
@@ -4713,7 +4714,7 @@ declare namespace CodeceptJS {
4713
4714
  * ```
4714
4715
  * @param field - located by label|name|CSS|XPath|strict locator.
4715
4716
  */
4716
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
4717
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
4717
4718
  /**
4718
4719
  * Verifies that the specified checkbox is not checked.
4719
4720
  *
@@ -4724,7 +4725,7 @@ declare namespace CodeceptJS {
4724
4725
  * ```
4725
4726
  * @param field - located by label|name|CSS|XPath|strict locator.
4726
4727
  */
4727
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
4728
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
4728
4729
  /**
4729
4730
  * Retrieves all texts from an element located by CSS or XPath and returns it to test.
4730
4731
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -4852,16 +4853,16 @@ declare namespace CodeceptJS {
4852
4853
  * ```
4853
4854
  * @param text - text value to check.
4854
4855
  */
4855
- seeInTitle(text: string): void;
4856
+ seeInTitle(text: string): Promise<any>;
4856
4857
  /**
4857
4858
  * Checks that title is equal to provided one.
4858
4859
  *
4859
- * ```js
4860
- * I.seeTitleEquals('Test title.');
4861
- * ```
4860
+ * ```js
4861
+ * I.seeTitleEquals('Test title.');
4862
+ * ```
4862
4863
  * @param text - value to check.
4863
4864
  */
4864
- seeTitleEquals(text: string): void;
4865
+ seeTitleEquals(text: string): Promise<any>;
4865
4866
  /**
4866
4867
  * Checks that title does not contain text.
4867
4868
  *
@@ -4870,7 +4871,7 @@ declare namespace CodeceptJS {
4870
4871
  * ```
4871
4872
  * @param text - value to check.
4872
4873
  */
4873
- dontSeeInTitle(text: string): void;
4874
+ dontSeeInTitle(text: string): Promise<any>;
4874
4875
  /**
4875
4876
  * Retrieves a page title and returns it to test.
4876
4877
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -4890,7 +4891,7 @@ declare namespace CodeceptJS {
4890
4891
  * ```
4891
4892
  * @param locator - located by CSS|XPath|strict locator.
4892
4893
  */
4893
- seeElement(locator: CodeceptJS.LocatorOrString): void;
4894
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
4894
4895
  /**
4895
4896
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
4896
4897
  *
@@ -4899,7 +4900,7 @@ declare namespace CodeceptJS {
4899
4900
  * ```
4900
4901
  * @param locator - located by CSS|XPath|Strict locator.
4901
4902
  */
4902
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
4903
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
4903
4904
  /**
4904
4905
  * Checks that a given Element is present in the DOM
4905
4906
  * Element is located by CSS or XPath.
@@ -4909,7 +4910,7 @@ declare namespace CodeceptJS {
4909
4910
  * ```
4910
4911
  * @param locator - element located by CSS|XPath|strict locator.
4911
4912
  */
4912
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
4913
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
4913
4914
  /**
4914
4915
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
4915
4916
  *
@@ -4918,7 +4919,7 @@ declare namespace CodeceptJS {
4918
4919
  * ```
4919
4920
  * @param locator - located by CSS|XPath|Strict locator.
4920
4921
  */
4921
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
4922
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
4922
4923
  /**
4923
4924
  * Checks that the current page contains the given string in its raw source code.
4924
4925
  *
@@ -4927,7 +4928,7 @@ declare namespace CodeceptJS {
4927
4928
  * ```
4928
4929
  * @param text - value to check.
4929
4930
  */
4930
- seeInSource(text: string): void;
4931
+ seeInSource(text: string): Promise<any>;
4931
4932
  /**
4932
4933
  * Retrieves page source and returns it to test.
4933
4934
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -4946,7 +4947,7 @@ declare namespace CodeceptJS {
4946
4947
  * ```
4947
4948
  * @param value - to check.
4948
4949
  */
4949
- dontSeeInSource(value: string): void;
4950
+ dontSeeInSource(value: string): Promise<any>;
4950
4951
  /**
4951
4952
  * Asserts that an element appears a given number of times in the DOM.
4952
4953
  * Element is located by label or name or CSS or XPath.
@@ -4958,7 +4959,7 @@ declare namespace CodeceptJS {
4958
4959
  * @param locator - element located by CSS|XPath|strict locator.
4959
4960
  * @param num - number of elements.
4960
4961
  */
4961
- seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): void;
4962
+ seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
4962
4963
  /**
4963
4964
  * Asserts that an element is visible a given number of times.
4964
4965
  * Element is located by CSS or XPath.
@@ -4969,7 +4970,7 @@ declare namespace CodeceptJS {
4969
4970
  * @param locator - element located by CSS|XPath|strict locator.
4970
4971
  * @param num - number of elements.
4971
4972
  */
4972
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
4973
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
4973
4974
  /**
4974
4975
  * Grab number of visible elements by locator.
4975
4976
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -4990,7 +4991,7 @@ declare namespace CodeceptJS {
4990
4991
  * @param locator - located by CSS|XPath|strict locator.
4991
4992
  * @param cssProperties - object with CSS properties and their values to check.
4992
4993
  */
4993
- seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): void;
4994
+ seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
4994
4995
  /**
4995
4996
  * Checks that all elements with given locator have given attributes.
4996
4997
  *
@@ -5000,7 +5001,7 @@ declare namespace CodeceptJS {
5000
5001
  * @param locator - located by CSS|XPath|strict locator.
5001
5002
  * @param attributes - attributes and their values to check.
5002
5003
  */
5003
- seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): void;
5004
+ seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
5004
5005
  /**
5005
5006
  * Executes sync script on a page.
5006
5007
  * Pass arguments to function as additional parameters.
@@ -5061,12 +5062,12 @@ declare namespace CodeceptJS {
5061
5062
  * ```
5062
5063
  * @param url - a fragment to check
5063
5064
  */
5064
- seeInCurrentUrl(url: string): void;
5065
+ seeInCurrentUrl(url: string): Promise<any>;
5065
5066
  /**
5066
5067
  * Checks that current url does not contain a provided fragment.
5067
5068
  * @param url - value to check.
5068
5069
  */
5069
- dontSeeInCurrentUrl(url: string): void;
5070
+ dontSeeInCurrentUrl(url: string): Promise<any>;
5070
5071
  /**
5071
5072
  * Checks that current url is equal to provided one.
5072
5073
  * If a relative url provided, a configured url will be prepended to it.
@@ -5078,7 +5079,7 @@ declare namespace CodeceptJS {
5078
5079
  * ```
5079
5080
  * @param url - value to check.
5080
5081
  */
5081
- seeCurrentUrlEquals(url: string): void;
5082
+ seeCurrentUrlEquals(url: string): Promise<any>;
5082
5083
  /**
5083
5084
  * Checks that current url is not equal to provided one.
5084
5085
  * If a relative url provided, a configured url will be prepended to it.
@@ -5089,7 +5090,7 @@ declare namespace CodeceptJS {
5089
5090
  * ```
5090
5091
  * @param url - value to check.
5091
5092
  */
5092
- dontSeeCurrentUrlEquals(url: string): void;
5093
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
5093
5094
  /**
5094
5095
  * Saves screenshot of the specified locator to ouput folder (set in codecept.json or codecept.conf.js).
5095
5096
  * Filename is relative to output folder.
@@ -5100,7 +5101,7 @@ declare namespace CodeceptJS {
5100
5101
  * @param locator - element located by CSS|XPath|strict locator.
5101
5102
  * @param fileName - file name to save.
5102
5103
  */
5103
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
5104
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
5104
5105
  /**
5105
5106
  * Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
5106
5107
  * Filename is relative to output folder.
@@ -5113,7 +5114,7 @@ declare namespace CodeceptJS {
5113
5114
  * @param fileName - file name to save.
5114
5115
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
5115
5116
  */
5116
- saveScreenshot(fileName: string, fullPage?: boolean): void;
5117
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
5117
5118
  /**
5118
5119
  * Clears a cookie by name,
5119
5120
  * if none provided clears all cookies.
@@ -5124,7 +5125,7 @@ declare namespace CodeceptJS {
5124
5125
  * ```
5125
5126
  * @param [cookie = null] - (optional, `null` by default) cookie name
5126
5127
  */
5127
- clearCookie(cookie?: string): void;
5128
+ clearCookie(cookie?: string): Promise<any>;
5128
5129
  /**
5129
5130
  * Checks that cookie with given name exists.
5130
5131
  *
@@ -5133,7 +5134,7 @@ declare namespace CodeceptJS {
5133
5134
  * ```
5134
5135
  * @param name - cookie name.
5135
5136
  */
5136
- seeCookie(name: string): void;
5137
+ seeCookie(name: string): Promise<any>;
5137
5138
  /**
5138
5139
  * Checks that cookie with given name does not exist.
5139
5140
  *
@@ -5142,7 +5143,7 @@ declare namespace CodeceptJS {
5142
5143
  * ```
5143
5144
  * @param name - cookie name.
5144
5145
  */
5145
- dontSeeCookie(name: string): void;
5146
+ dontSeeCookie(name: string): Promise<any>;
5146
5147
  /**
5147
5148
  * Gets a cookie object by name.
5148
5149
  * If none provided gets all cookies.
@@ -5178,7 +5179,7 @@ declare namespace CodeceptJS {
5178
5179
  * ```
5179
5180
  * @param text - value to check.
5180
5181
  */
5181
- seeInPopup(text: string): void;
5182
+ seeInPopup(text: string): Promise<any>;
5182
5183
  /**
5183
5184
  * Grab the text within the popup. If no popup is visible then it will return null
5184
5185
  *
@@ -5193,7 +5194,7 @@ declare namespace CodeceptJS {
5193
5194
  * @param width - width in pixels or `maximize`.
5194
5195
  * @param height - height in pixels.
5195
5196
  */
5196
- resizeWindow(width: number, height: number): void;
5197
+ resizeWindow(width: number, height: number): Promise<any>;
5197
5198
  /**
5198
5199
  * Drag an item to a destination element.
5199
5200
  *
@@ -5203,7 +5204,7 @@ declare namespace CodeceptJS {
5203
5204
  * @param srcElement - located by CSS|XPath|strict locator.
5204
5205
  * @param destElement - located by CSS|XPath|strict locator.
5205
5206
  */
5206
- dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
5207
+ dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): Promise<any>;
5207
5208
  /**
5208
5209
  * Close all tabs except for the current one.
5209
5210
  *
@@ -5270,7 +5271,7 @@ declare namespace CodeceptJS {
5270
5271
  * ```
5271
5272
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
5272
5273
  */
5273
- switchTo(locator?: CodeceptJS.LocatorOrString): void;
5274
+ switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
5274
5275
  /**
5275
5276
  * Pauses execution for a number of seconds.
5276
5277
  *
@@ -5279,7 +5280,7 @@ declare namespace CodeceptJS {
5279
5280
  * ```
5280
5281
  * @param sec - number of second to wait.
5281
5282
  */
5282
- wait(sec: number): void;
5283
+ wait(sec: number): Promise<any>;
5283
5284
  /**
5284
5285
  * Waits for element to be present on page (by default waits for 1sec).
5285
5286
  * Element can be located by CSS or XPath.
@@ -5291,7 +5292,7 @@ declare namespace CodeceptJS {
5291
5292
  * @param locator - element located by CSS|XPath|strict locator.
5292
5293
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
5293
5294
  */
5294
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5295
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5295
5296
  /**
5296
5297
  * Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
5297
5298
  * Element can be located by CSS or XPath.
@@ -5302,7 +5303,7 @@ declare namespace CodeceptJS {
5302
5303
  * @param locator - element located by CSS|XPath|strict locator.
5303
5304
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5304
5305
  */
5305
- waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5306
+ waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5306
5307
  /**
5307
5308
  * Waits for element to become clickable for number of seconds.
5308
5309
  *
@@ -5321,7 +5322,7 @@ declare namespace CodeceptJS {
5321
5322
  * @param locator - element located by CSS|XPath|strict locator.
5322
5323
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5323
5324
  */
5324
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5325
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5325
5326
  /**
5326
5327
  * Waits for an element to hide (by default waits for 1sec).
5327
5328
  * Element can be located by CSS or XPath.
@@ -5332,7 +5333,7 @@ declare namespace CodeceptJS {
5332
5333
  * @param locator - element located by CSS|XPath|strict locator.
5333
5334
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5334
5335
  */
5335
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5336
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5336
5337
  /**
5337
5338
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
5338
5339
  * Element can be located by CSS or XPath.
@@ -5343,7 +5344,7 @@ declare namespace CodeceptJS {
5343
5344
  * @param locator - element located by CSS|XPath|strict locator.
5344
5345
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5345
5346
  */
5346
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5347
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5347
5348
  /**
5348
5349
  * Waits for a specified number of elements on the page.
5349
5350
  *
@@ -5354,14 +5355,14 @@ declare namespace CodeceptJS {
5354
5355
  * @param num - number of elements.
5355
5356
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5356
5357
  */
5357
- waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): void;
5358
+ waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
5358
5359
  /**
5359
5360
  * Waits for element to become enabled (by default waits for 1sec).
5360
5361
  * Element can be located by CSS or XPath.
5361
5362
  * @param locator - element located by CSS|XPath|strict locator.
5362
5363
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
5363
5364
  */
5364
- waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5365
+ waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5365
5366
  /**
5366
5367
  * Waits for the specified value to be in value attribute.
5367
5368
  *
@@ -5372,7 +5373,7 @@ declare namespace CodeceptJS {
5372
5373
  * @param value - expected value.
5373
5374
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5374
5375
  */
5375
- waitForValue(field: LocatorOrString, value: string, sec?: number): void;
5376
+ waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
5376
5377
  /**
5377
5378
  * Waits for a function to return true (waits for 1 sec by default).
5378
5379
  * Running in browser context.
@@ -5390,7 +5391,7 @@ declare namespace CodeceptJS {
5390
5391
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
5391
5392
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
5392
5393
  */
5393
- waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
5394
+ waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
5394
5395
  /**
5395
5396
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
5396
5397
  *
@@ -5400,7 +5401,7 @@ declare namespace CodeceptJS {
5400
5401
  * @param urlPart - value to check.
5401
5402
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5402
5403
  */
5403
- waitInUrl(urlPart: string, sec?: number): void;
5404
+ waitInUrl(urlPart: string, sec?: number): Promise<any>;
5404
5405
  /**
5405
5406
  * Waits for the entire URL to match the expected
5406
5407
  *
@@ -5411,7 +5412,7 @@ declare namespace CodeceptJS {
5411
5412
  * @param urlPart - value to check.
5412
5413
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5413
5414
  */
5414
- waitUrlEquals(urlPart: string, sec?: number): void;
5415
+ waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
5415
5416
  /**
5416
5417
  * Waits for a text to appear (by default waits for 1sec).
5417
5418
  * Element can be located by CSS or XPath.
@@ -5425,7 +5426,7 @@ declare namespace CodeceptJS {
5425
5426
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5426
5427
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
5427
5428
  */
5428
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
5429
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
5429
5430
  /**
5430
5431
  * Moves to url
5431
5432
  */
@@ -5437,7 +5438,7 @@ declare namespace CodeceptJS {
5437
5438
  * I.refreshPage();
5438
5439
  * ```
5439
5440
  */
5440
- refreshPage(): void;
5441
+ refreshPage(): Promise<any>;
5441
5442
  /**
5442
5443
  * Reloads page
5443
5444
  */
@@ -5454,7 +5455,7 @@ declare namespace CodeceptJS {
5454
5455
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
5455
5456
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
5456
5457
  */
5457
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
5458
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
5458
5459
  /**
5459
5460
  * Scroll page to the top.
5460
5461
  *
@@ -5462,7 +5463,7 @@ declare namespace CodeceptJS {
5462
5463
  * I.scrollPageToTop();
5463
5464
  * ```
5464
5465
  */
5465
- scrollPageToTop(): void;
5466
+ scrollPageToTop(): Promise<any>;
5466
5467
  /**
5467
5468
  * Scroll page to the bottom.
5468
5469
  *
@@ -5470,7 +5471,7 @@ declare namespace CodeceptJS {
5470
5471
  * I.scrollPageToBottom();
5471
5472
  * ```
5472
5473
  */
5473
- scrollPageToBottom(): void;
5474
+ scrollPageToBottom(): Promise<any>;
5474
5475
  /**
5475
5476
  * Retrieves a page scroll position and returns it to test.
5476
5477
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -5516,7 +5517,7 @@ declare namespace CodeceptJS {
5516
5517
  * ```
5517
5518
  * @param cookie - a cookie object or array of cookie objects.
5518
5519
  */
5519
- setCookie(cookie: Cookie | Cookie[]): void;
5520
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
5520
5521
  }
5521
5522
  /**
5522
5523
  * Uses [Google Chrome's Puppeteer](https://github.com/GoogleChrome/puppeteer) library to run tests inside headless Chrome.
@@ -5725,7 +5726,7 @@ declare namespace CodeceptJS {
5725
5726
  * ```
5726
5727
  * @param text - value to check.
5727
5728
  */
5728
- seeInPopup(text: string): void;
5729
+ seeInPopup(text: string): Promise<any>;
5729
5730
  /**
5730
5731
  * Set current page
5731
5732
  * @param page - page to set
@@ -5758,18 +5759,17 @@ declare namespace CodeceptJS {
5758
5759
  * ```
5759
5760
  * @param url - url path or global url.
5760
5761
  */
5761
- amOnPage(url: string): void;
5762
+ amOnPage(url: string): Promise<any>;
5762
5763
  /**
5763
5764
  * Resize the current window to provided width and height.
5764
5765
  * First parameter can be set to `maximize`.
5765
5766
  * @param width - width in pixels or `maximize`.
5766
5767
  * @param height - height in pixels.
5767
- *
5768
- * Unlike other drivers Puppeteer changes the size of a viewport, not the window!
5768
+ * @returns Unlike other drivers Puppeteer changes the size of a viewport, not the window!
5769
5769
  * Puppeteer does not control the window of a browser so it can't adjust its real size.
5770
5770
  * It also can't maximize a window.
5771
5771
  */
5772
- resizeWindow(width: number, height: number): void;
5772
+ resizeWindow(width: number, height: number): Promise<any>;
5773
5773
  /**
5774
5774
  * Set headers for all next requests
5775
5775
  *
@@ -5792,10 +5792,9 @@ declare namespace CodeceptJS {
5792
5792
  * @param locator - located by CSS|XPath|strict locator.
5793
5793
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
5794
5794
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
5795
- *
5796
- * {{ react }}
5795
+ * @returns {{ react }}
5797
5796
  */
5798
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
5797
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
5799
5798
  /**
5800
5799
  * Drag an item to a destination element.
5801
5800
  *
@@ -5805,7 +5804,7 @@ declare namespace CodeceptJS {
5805
5804
  * @param srcElement - located by CSS|XPath|strict locator.
5806
5805
  * @param destElement - located by CSS|XPath|strict locator.
5807
5806
  */
5808
- dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
5807
+ dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): Promise<any>;
5809
5808
  /**
5810
5809
  * Reload the current page.
5811
5810
  *
@@ -5813,7 +5812,7 @@ declare namespace CodeceptJS {
5813
5812
  * I.refreshPage();
5814
5813
  * ```
5815
5814
  */
5816
- refreshPage(): void;
5815
+ refreshPage(): Promise<any>;
5817
5816
  /**
5818
5817
  * Scroll page to the top.
5819
5818
  *
@@ -5821,7 +5820,7 @@ declare namespace CodeceptJS {
5821
5820
  * I.scrollPageToTop();
5822
5821
  * ```
5823
5822
  */
5824
- scrollPageToTop(): void;
5823
+ scrollPageToTop(): Promise<any>;
5825
5824
  /**
5826
5825
  * Scroll page to the bottom.
5827
5826
  *
@@ -5829,7 +5828,7 @@ declare namespace CodeceptJS {
5829
5828
  * I.scrollPageToBottom();
5830
5829
  * ```
5831
5830
  */
5832
- scrollPageToBottom(): void;
5831
+ scrollPageToBottom(): Promise<any>;
5833
5832
  /**
5834
5833
  * Scrolls to element matched by locator.
5835
5834
  * Extra shift can be set with offsetX and offsetY options.
@@ -5842,7 +5841,7 @@ declare namespace CodeceptJS {
5842
5841
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
5843
5842
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
5844
5843
  */
5845
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
5844
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
5846
5845
  /**
5847
5846
  * Checks that title contains text.
5848
5847
  *
@@ -5851,7 +5850,7 @@ declare namespace CodeceptJS {
5851
5850
  * ```
5852
5851
  * @param text - text value to check.
5853
5852
  */
5854
- seeInTitle(text: string): void;
5853
+ seeInTitle(text: string): Promise<any>;
5855
5854
  /**
5856
5855
  * Retrieves a page scroll position and returns it to test.
5857
5856
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -5865,12 +5864,12 @@ declare namespace CodeceptJS {
5865
5864
  /**
5866
5865
  * Checks that title is equal to provided one.
5867
5866
  *
5868
- * ```js
5869
- * I.seeTitleEquals('Test title.');
5870
- * ```
5867
+ * ```js
5868
+ * I.seeTitleEquals('Test title.');
5869
+ * ```
5871
5870
  * @param text - value to check.
5872
5871
  */
5873
- seeTitleEquals(text: string): void;
5872
+ seeTitleEquals(text: string): Promise<any>;
5874
5873
  /**
5875
5874
  * Checks that title does not contain text.
5876
5875
  *
@@ -5879,7 +5878,7 @@ declare namespace CodeceptJS {
5879
5878
  * ```
5880
5879
  * @param text - value to check.
5881
5880
  */
5882
- dontSeeInTitle(text: string): void;
5881
+ dontSeeInTitle(text: string): Promise<any>;
5883
5882
  /**
5884
5883
  * Retrieves a page title and returns it to test.
5885
5884
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -5986,9 +5985,9 @@ declare namespace CodeceptJS {
5986
5985
  * I.seeElement('#modal');
5987
5986
  * ```
5988
5987
  * @param locator - located by CSS|XPath|strict locator.
5989
- * {{ react }}
5988
+ * @returns {{ react }}
5990
5989
  */
5991
- seeElement(locator: CodeceptJS.LocatorOrString): void;
5990
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
5992
5991
  /**
5993
5992
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
5994
5993
  *
@@ -5996,9 +5995,9 @@ declare namespace CodeceptJS {
5996
5995
  * I.dontSeeElement('.modal'); // modal is not shown
5997
5996
  * ```
5998
5997
  * @param locator - located by CSS|XPath|Strict locator.
5999
- * {{ react }}
5998
+ * @returns {{ react }}
6000
5999
  */
6001
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
6000
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
6002
6001
  /**
6003
6002
  * Checks that a given Element is present in the DOM
6004
6003
  * Element is located by CSS or XPath.
@@ -6008,7 +6007,7 @@ declare namespace CodeceptJS {
6008
6007
  * ```
6009
6008
  * @param locator - element located by CSS|XPath|strict locator.
6010
6009
  */
6011
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
6010
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
6012
6011
  /**
6013
6012
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
6014
6013
  *
@@ -6017,7 +6016,7 @@ declare namespace CodeceptJS {
6017
6016
  * ```
6018
6017
  * @param locator - located by CSS|XPath|Strict locator.
6019
6018
  */
6020
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
6019
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
6021
6020
  /**
6022
6021
  * Perform a click on a link or a button, given by a locator.
6023
6022
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -6042,11 +6041,9 @@ declare namespace CodeceptJS {
6042
6041
  * ```
6043
6042
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
6044
6043
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
6045
- *
6046
- *
6047
- * {{ react }}
6044
+ * @returns {{ react }}
6048
6045
  */
6049
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6046
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
6050
6047
  /**
6051
6048
  * Perform an emulated click on a link or a button, given by a locator.
6052
6049
  * Unlike normal click instead of sending native event, emulates a click with JavaScript.
@@ -6074,11 +6071,9 @@ declare namespace CodeceptJS {
6074
6071
  * ```
6075
6072
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
6076
6073
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
6077
- *
6078
- *
6079
- * {{ react }}
6074
+ * @returns {{ react }}
6080
6075
  */
6081
- forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6076
+ forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6082
6077
  /**
6083
6078
  * Performs a click on a link and waits for navigation before moving on.
6084
6079
  *
@@ -6087,10 +6082,9 @@ declare namespace CodeceptJS {
6087
6082
  * ```
6088
6083
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator
6089
6084
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator
6090
- *
6091
- * {{ react }}
6085
+ * @returns {{ react }}
6092
6086
  */
6093
- clickLink(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6087
+ clickLink(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6094
6088
  /**
6095
6089
  * Sets a directory to where save files. Allows to test file downloads.
6096
6090
  * Should be used with [FileSystem helper](https://codecept.io/helpers/FileSystem) to check that file were downloaded correctly.
@@ -6126,11 +6120,9 @@ declare namespace CodeceptJS {
6126
6120
  * ```
6127
6121
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
6128
6122
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
6129
- *
6130
- *
6131
- * {{ react }}
6123
+ * @returns {{ react }}
6132
6124
  */
6133
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6125
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6134
6126
  /**
6135
6127
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
6136
6128
  *
@@ -6144,11 +6136,9 @@ declare namespace CodeceptJS {
6144
6136
  * ```
6145
6137
  * @param locator - clickable element located by CSS|XPath|strict locator.
6146
6138
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
6147
- *
6148
- *
6149
- * {{ react }}
6139
+ * @returns {{ react }}
6150
6140
  */
6151
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6141
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6152
6142
  /**
6153
6143
  * Selects a checkbox or radio button.
6154
6144
  * Element is located by label or name or CSS or XPath.
@@ -6163,7 +6153,7 @@ declare namespace CodeceptJS {
6163
6153
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
6164
6154
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
6165
6155
  */
6166
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6156
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6167
6157
  /**
6168
6158
  * Unselects a checkbox or radio button.
6169
6159
  * Element is located by label or name or CSS or XPath.
@@ -6178,7 +6168,7 @@ declare namespace CodeceptJS {
6178
6168
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
6179
6169
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
6180
6170
  */
6181
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6171
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6182
6172
  /**
6183
6173
  * Verifies that the specified checkbox is checked.
6184
6174
  *
@@ -6189,7 +6179,7 @@ declare namespace CodeceptJS {
6189
6179
  * ```
6190
6180
  * @param field - located by label|name|CSS|XPath|strict locator.
6191
6181
  */
6192
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
6182
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
6193
6183
  /**
6194
6184
  * Verifies that the specified checkbox is not checked.
6195
6185
  *
@@ -6200,7 +6190,7 @@ declare namespace CodeceptJS {
6200
6190
  * ```
6201
6191
  * @param field - located by label|name|CSS|XPath|strict locator.
6202
6192
  */
6203
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
6193
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
6204
6194
  /**
6205
6195
  * Presses a key in the browser and leaves it in a down state.
6206
6196
  *
@@ -6213,7 +6203,7 @@ declare namespace CodeceptJS {
6213
6203
  * ```
6214
6204
  * @param key - name of key to press down.
6215
6205
  */
6216
- pressKeyDown(key: string): void;
6206
+ pressKeyDown(key: string): Promise<any>;
6217
6207
  /**
6218
6208
  * Releases a key in the browser which was previously set to a down state.
6219
6209
  *
@@ -6226,7 +6216,7 @@ declare namespace CodeceptJS {
6226
6216
  * ```
6227
6217
  * @param key - name of key to release.
6228
6218
  */
6229
- pressKeyUp(key: string): void;
6219
+ pressKeyUp(key: string): Promise<any>;
6230
6220
  /**
6231
6221
  * Presses a key in the browser (on a focused element).
6232
6222
  *
@@ -6286,11 +6276,9 @@ declare namespace CodeceptJS {
6286
6276
  * - `'Space'`
6287
6277
  * - `'Tab'`
6288
6278
  * @param key - key or array of keys to press.
6289
- *
6290
- *
6291
- * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
6279
+ * @returns _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
6292
6280
  */
6293
- pressKey(key: string | string[]): void;
6281
+ pressKey(key: string | string[]): Promise<any>;
6294
6282
  /**
6295
6283
  * Types out the given text into an active field.
6296
6284
  * To slow down typing use a second parameter, to set interval between key presses.
@@ -6309,7 +6297,7 @@ declare namespace CodeceptJS {
6309
6297
  * @param key - or array of keys to type.
6310
6298
  * @param [delay = null] - (optional) delay in ms between key presses
6311
6299
  */
6312
- type(key: string | string[], delay?: number): void;
6300
+ type(key: string | string[], delay?: number): Promise<any>;
6313
6301
  /**
6314
6302
  * Fills a text field or textarea, after clearing its value, with the given string.
6315
6303
  * Field is located by name, label, CSS, or XPath.
@@ -6326,10 +6314,9 @@ declare namespace CodeceptJS {
6326
6314
  * ```
6327
6315
  * @param field - located by label|name|CSS|XPath|strict locator.
6328
6316
  * @param value - text value to fill.
6329
- *
6330
- * {{ react }}
6317
+ * @returns {{ react }}
6331
6318
  */
6332
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
6319
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
6333
6320
  /**
6334
6321
  * Clears a `<textarea>` or text `<input>` element's value.
6335
6322
  *
@@ -6340,7 +6327,7 @@ declare namespace CodeceptJS {
6340
6327
  * ```
6341
6328
  * @param editable - field located by label|name|CSS|XPath|strict locator.
6342
6329
  */
6343
- clearField(editable: LocatorOrString): void;
6330
+ clearField(editable: LocatorOrString): Promise<any>;
6344
6331
  /**
6345
6332
  * Appends text to a input field or textarea.
6346
6333
  * Field is located by name, label, CSS or XPath
@@ -6350,10 +6337,9 @@ declare namespace CodeceptJS {
6350
6337
  * ```
6351
6338
  * @param field - located by label|name|CSS|XPath|strict locator
6352
6339
  * @param value - text value to append.
6353
- *
6354
- * {{ react }}
6340
+ * @returns {{ react }}
6355
6341
  */
6356
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
6342
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
6357
6343
  /**
6358
6344
  * Checks that the given input field or textarea equals to given value.
6359
6345
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -6367,7 +6353,7 @@ declare namespace CodeceptJS {
6367
6353
  * @param field - located by label|name|CSS|XPath|strict locator.
6368
6354
  * @param value - value to check.
6369
6355
  */
6370
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
6356
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
6371
6357
  /**
6372
6358
  * Checks that value of input field or textarea doesn't equal to given value
6373
6359
  * Opposite to `seeInField`.
@@ -6379,7 +6365,7 @@ declare namespace CodeceptJS {
6379
6365
  * @param field - located by label|name|CSS|XPath|strict locator.
6380
6366
  * @param value - value to check.
6381
6367
  */
6382
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
6368
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
6383
6369
  /**
6384
6370
  * Attaches a file to element located by label, name, CSS or XPath
6385
6371
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -6391,10 +6377,9 @@ declare namespace CodeceptJS {
6391
6377
  * ```
6392
6378
  * @param locator - field located by label|name|CSS|XPath|strict locator.
6393
6379
  * @param pathToFile - local file path relative to codecept.json config file.
6394
- *
6395
- * > ⚠ 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.
6380
+ * @returns > ⚠ 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.
6396
6381
  */
6397
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
6382
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
6398
6383
  /**
6399
6384
  * Selects an option in a drop-down select.
6400
6385
  * Field is searched by label | name | CSS | XPath.
@@ -6417,7 +6402,7 @@ declare namespace CodeceptJS {
6417
6402
  * @param select - field located by label|name|CSS|XPath|strict locator.
6418
6403
  * @param option - visible text or value of option.
6419
6404
  */
6420
- selectOption(select: LocatorOrString, option: string | any[]): void;
6405
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
6421
6406
  /**
6422
6407
  * Grab number of visible elements by locator.
6423
6408
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -6438,12 +6423,12 @@ declare namespace CodeceptJS {
6438
6423
  * ```
6439
6424
  * @param url - a fragment to check
6440
6425
  */
6441
- seeInCurrentUrl(url: string): void;
6426
+ seeInCurrentUrl(url: string): Promise<any>;
6442
6427
  /**
6443
6428
  * Checks that current url does not contain a provided fragment.
6444
6429
  * @param url - value to check.
6445
6430
  */
6446
- dontSeeInCurrentUrl(url: string): void;
6431
+ dontSeeInCurrentUrl(url: string): Promise<any>;
6447
6432
  /**
6448
6433
  * Checks that current url is equal to provided one.
6449
6434
  * If a relative url provided, a configured url will be prepended to it.
@@ -6455,7 +6440,7 @@ declare namespace CodeceptJS {
6455
6440
  * ```
6456
6441
  * @param url - value to check.
6457
6442
  */
6458
- seeCurrentUrlEquals(url: string): void;
6443
+ seeCurrentUrlEquals(url: string): Promise<any>;
6459
6444
  /**
6460
6445
  * Checks that current url is not equal to provided one.
6461
6446
  * If a relative url provided, a configured url will be prepended to it.
@@ -6466,7 +6451,7 @@ declare namespace CodeceptJS {
6466
6451
  * ```
6467
6452
  * @param url - value to check.
6468
6453
  */
6469
- dontSeeCurrentUrlEquals(url: string): void;
6454
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
6470
6455
  /**
6471
6456
  * Checks that a page contains a visible text.
6472
6457
  * Use context parameter to narrow down the search.
@@ -6478,10 +6463,9 @@ declare namespace CodeceptJS {
6478
6463
  * ```
6479
6464
  * @param text - expected on page.
6480
6465
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
6481
- *
6482
- * {{ react }}
6466
+ * @returns {{ react }}
6483
6467
  */
6484
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
6468
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
6485
6469
  /**
6486
6470
  * Checks that text is equal to provided one.
6487
6471
  *
@@ -6491,7 +6475,7 @@ declare namespace CodeceptJS {
6491
6475
  * @param text - element value to check.
6492
6476
  * @param [context = null] - element located by CSS|XPath|strict locator.
6493
6477
  */
6494
- seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): void;
6478
+ seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
6495
6479
  /**
6496
6480
  * Opposite to `see`. Checks that a text is not present on a page.
6497
6481
  * Use context parameter to narrow down the search.
@@ -6502,11 +6486,9 @@ declare namespace CodeceptJS {
6502
6486
  * ```
6503
6487
  * @param text - which is not present.
6504
6488
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
6505
- *
6506
- *
6507
- * {{ react }}
6489
+ * @returns {{ react }}
6508
6490
  */
6509
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
6491
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
6510
6492
  /**
6511
6493
  * Retrieves page source and returns it to test.
6512
6494
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -6545,7 +6527,7 @@ declare namespace CodeceptJS {
6545
6527
  * ```
6546
6528
  * @param text - value to check.
6547
6529
  */
6548
- seeInSource(text: string): void;
6530
+ seeInSource(text: string): Promise<any>;
6549
6531
  /**
6550
6532
  * Checks that the current page does not contains the given string in its raw source code.
6551
6533
  *
@@ -6554,7 +6536,7 @@ declare namespace CodeceptJS {
6554
6536
  * ```
6555
6537
  * @param value - to check.
6556
6538
  */
6557
- dontSeeInSource(value: string): void;
6539
+ dontSeeInSource(value: string): Promise<any>;
6558
6540
  /**
6559
6541
  * Asserts that an element appears a given number of times in the DOM.
6560
6542
  * Element is located by label or name or CSS or XPath.
@@ -6565,11 +6547,9 @@ declare namespace CodeceptJS {
6565
6547
  * ```
6566
6548
  * @param locator - element located by CSS|XPath|strict locator.
6567
6549
  * @param num - number of elements.
6568
- *
6569
- *
6570
- * {{ react }}
6550
+ * @returns {{ react }}
6571
6551
  */
6572
- seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): void;
6552
+ seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
6573
6553
  /**
6574
6554
  * Asserts that an element is visible a given number of times.
6575
6555
  * Element is located by CSS or XPath.
@@ -6579,11 +6559,9 @@ declare namespace CodeceptJS {
6579
6559
  * ```
6580
6560
  * @param locator - element located by CSS|XPath|strict locator.
6581
6561
  * @param num - number of elements.
6582
- *
6583
- *
6584
- * {{ react }}
6562
+ * @returns {{ react }}
6585
6563
  */
6586
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
6564
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
6587
6565
  /**
6588
6566
  * Sets cookie(s).
6589
6567
  *
@@ -6600,7 +6578,7 @@ declare namespace CodeceptJS {
6600
6578
  * ```
6601
6579
  * @param cookie - a cookie object or array of cookie objects.
6602
6580
  */
6603
- setCookie(cookie: Cookie | Cookie[]): void;
6581
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
6604
6582
  /**
6605
6583
  * Checks that cookie with given name exists.
6606
6584
  *
@@ -6609,7 +6587,7 @@ declare namespace CodeceptJS {
6609
6587
  * ```
6610
6588
  * @param name - cookie name.
6611
6589
  */
6612
- seeCookie(name: string): void;
6590
+ seeCookie(name: string): Promise<any>;
6613
6591
  /**
6614
6592
  * Checks that cookie with given name does not exist.
6615
6593
  *
@@ -6618,7 +6596,7 @@ declare namespace CodeceptJS {
6618
6596
  * ```
6619
6597
  * @param name - cookie name.
6620
6598
  */
6621
- dontSeeCookie(name: string): void;
6599
+ dontSeeCookie(name: string): Promise<any>;
6622
6600
  /**
6623
6601
  * Gets a cookie object by name.
6624
6602
  * If none provided gets all cookies.
@@ -6645,7 +6623,7 @@ declare namespace CodeceptJS {
6645
6623
  * ```
6646
6624
  * @param [cookie = null] - (optional, `null` by default) cookie name
6647
6625
  */
6648
- clearCookie(cookie?: string): void;
6626
+ clearCookie(cookie?: string): Promise<any>;
6649
6627
  /**
6650
6628
  * Executes sync script on a page.
6651
6629
  * Pass arguments to function as additional parameters.
@@ -6810,9 +6788,9 @@ declare namespace CodeceptJS {
6810
6788
  * ```
6811
6789
  * @param locator - located by CSS|XPath|strict locator.
6812
6790
  * @param cssProperties - object with CSS properties and their values to check.
6813
- * {{ react }}
6791
+ * @returns {{ react }}
6814
6792
  */
6815
- seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): void;
6793
+ seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
6816
6794
  /**
6817
6795
  * Checks that all elements with given locator have given attributes.
6818
6796
  *
@@ -6821,9 +6799,9 @@ declare namespace CodeceptJS {
6821
6799
  * ```
6822
6800
  * @param locator - located by CSS|XPath|strict locator.
6823
6801
  * @param attributes - attributes and their values to check.
6824
- * {{ react }}
6802
+ * @returns {{ react }}
6825
6803
  */
6826
- seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): void;
6804
+ seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
6827
6805
  /**
6828
6806
  * Drag the scrubber of a slider to a given position
6829
6807
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -6834,9 +6812,9 @@ declare namespace CodeceptJS {
6834
6812
  * ```
6835
6813
  * @param locator - located by label|name|CSS|XPath|strict locator.
6836
6814
  * @param offsetX - position to drag.
6837
- * {{ react }}
6815
+ * @returns {{ react }}
6838
6816
  */
6839
- dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): void;
6817
+ dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): Promise<any>;
6840
6818
  /**
6841
6819
  * Retrieves an array of attributes from elements located by CSS or XPath and returns it to test.
6842
6820
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -6876,7 +6854,7 @@ declare namespace CodeceptJS {
6876
6854
  * @param locator - element located by CSS|XPath|strict locator.
6877
6855
  * @param fileName - file name to save.
6878
6856
  */
6879
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
6857
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
6880
6858
  /**
6881
6859
  * Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
6882
6860
  * Filename is relative to output folder.
@@ -6889,7 +6867,7 @@ declare namespace CodeceptJS {
6889
6867
  * @param fileName - file name to save.
6890
6868
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
6891
6869
  */
6892
- saveScreenshot(fileName: string, fullPage?: boolean): void;
6870
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
6893
6871
  /**
6894
6872
  * Pauses execution for a number of seconds.
6895
6873
  *
@@ -6898,14 +6876,14 @@ declare namespace CodeceptJS {
6898
6876
  * ```
6899
6877
  * @param sec - number of second to wait.
6900
6878
  */
6901
- wait(sec: number): void;
6879
+ wait(sec: number): Promise<any>;
6902
6880
  /**
6903
6881
  * Waits for element to become enabled (by default waits for 1sec).
6904
6882
  * Element can be located by CSS or XPath.
6905
6883
  * @param locator - element located by CSS|XPath|strict locator.
6906
6884
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
6907
6885
  */
6908
- waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6886
+ waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6909
6887
  /**
6910
6888
  * Waits for the specified value to be in value attribute.
6911
6889
  *
@@ -6916,7 +6894,7 @@ declare namespace CodeceptJS {
6916
6894
  * @param value - expected value.
6917
6895
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6918
6896
  */
6919
- waitForValue(field: LocatorOrString, value: string, sec?: number): void;
6897
+ waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
6920
6898
  /**
6921
6899
  * Waits for a specified number of elements on the page.
6922
6900
  *
@@ -6926,9 +6904,9 @@ declare namespace CodeceptJS {
6926
6904
  * @param locator - element located by CSS|XPath|strict locator.
6927
6905
  * @param num - number of elements.
6928
6906
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6929
- * {{ react }}
6907
+ * @returns {{ react }}
6930
6908
  */
6931
- waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): void;
6909
+ waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
6932
6910
  /**
6933
6911
  * Waits for element to be clickable (by default waits for 1sec).
6934
6912
  * Element can be located by CSS or XPath.
@@ -6940,7 +6918,7 @@ declare namespace CodeceptJS {
6940
6918
  * @param locator - element located by CSS|XPath|strict locator.
6941
6919
  * @param [sec] - (optional, `1` by default) time in seconds to wait
6942
6920
  */
6943
- waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6921
+ waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6944
6922
  /**
6945
6923
  * Waits for element to be present on page (by default waits for 1sec).
6946
6924
  * Element can be located by CSS or XPath.
@@ -6951,9 +6929,9 @@ declare namespace CodeceptJS {
6951
6929
  * ```
6952
6930
  * @param locator - element located by CSS|XPath|strict locator.
6953
6931
  * @param [sec] - (optional, `1` by default) time in seconds to wait
6954
- * {{ react }}
6932
+ * @returns {{ react }}
6955
6933
  */
6956
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6934
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6957
6935
  /**
6958
6936
  * Waits for an element to become visible on a page (by default waits for 1sec).
6959
6937
  * Element can be located by CSS or XPath.
@@ -6963,11 +6941,9 @@ declare namespace CodeceptJS {
6963
6941
  * ```
6964
6942
  * @param locator - element located by CSS|XPath|strict locator.
6965
6943
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6966
- *
6967
- *
6968
- * This method accepts [React selectors](https://codecept.io/react).
6944
+ * @returns This method accepts [React selectors](https://codecept.io/react).
6969
6945
  */
6970
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6946
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6971
6947
  /**
6972
6948
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
6973
6949
  * Element can be located by CSS or XPath.
@@ -6978,7 +6954,7 @@ declare namespace CodeceptJS {
6978
6954
  * @param locator - element located by CSS|XPath|strict locator.
6979
6955
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6980
6956
  */
6981
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6957
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6982
6958
  /**
6983
6959
  * Waits for an element to hide (by default waits for 1sec).
6984
6960
  * Element can be located by CSS or XPath.
@@ -6989,7 +6965,7 @@ declare namespace CodeceptJS {
6989
6965
  * @param locator - element located by CSS|XPath|strict locator.
6990
6966
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6991
6967
  */
6992
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6968
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6993
6969
  /**
6994
6970
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
6995
6971
  *
@@ -6999,7 +6975,7 @@ declare namespace CodeceptJS {
6999
6975
  * @param urlPart - value to check.
7000
6976
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7001
6977
  */
7002
- waitInUrl(urlPart: string, sec?: number): void;
6978
+ waitInUrl(urlPart: string, sec?: number): Promise<any>;
7003
6979
  /**
7004
6980
  * Waits for the entire URL to match the expected
7005
6981
  *
@@ -7010,7 +6986,7 @@ declare namespace CodeceptJS {
7010
6986
  * @param urlPart - value to check.
7011
6987
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7012
6988
  */
7013
- waitUrlEquals(urlPart: string, sec?: number): void;
6989
+ waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
7014
6990
  /**
7015
6991
  * Waits for a text to appear (by default waits for 1sec).
7016
6992
  * Element can be located by CSS or XPath.
@@ -7024,7 +7000,7 @@ declare namespace CodeceptJS {
7024
7000
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7025
7001
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
7026
7002
  */
7027
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
7003
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
7028
7004
  /**
7029
7005
  * Waits for a network request.
7030
7006
  *
@@ -7054,7 +7030,7 @@ declare namespace CodeceptJS {
7054
7030
  * ```
7055
7031
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
7056
7032
  */
7057
- switchTo(locator?: CodeceptJS.LocatorOrString): void;
7033
+ switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
7058
7034
  /**
7059
7035
  * Waits for a function to return true (waits for 1 sec by default).
7060
7036
  * Running in browser context.
@@ -7072,7 +7048,7 @@ declare namespace CodeceptJS {
7072
7048
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
7073
7049
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
7074
7050
  */
7075
- waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
7051
+ waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
7076
7052
  /**
7077
7053
  * Waits for navigation to finish. By default takes configured `waitForNavigation` option.
7078
7054
  *
@@ -7089,7 +7065,7 @@ declare namespace CodeceptJS {
7089
7065
  * @param locator - element located by CSS|XPath|strict locator.
7090
7066
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7091
7067
  */
7092
- waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): void;
7068
+ waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7093
7069
  /**
7094
7070
  * Grab the data from performance timing using Navigation Timing API.
7095
7071
  * The returned data will contain following things in ms:
@@ -7111,7 +7087,7 @@ declare namespace CodeceptJS {
7111
7087
  * }
7112
7088
  * ```
7113
7089
  */
7114
- grabDataFromPerformanceTiming(): void;
7090
+ grabDataFromPerformanceTiming(): Promise<any>;
7115
7091
  /**
7116
7092
  * Grab the width, height, location of given locator.
7117
7093
  * Provide `width` or `height`as second param to get your desired prop.
@@ -7190,7 +7166,7 @@ declare namespace CodeceptJS {
7190
7166
  * ```
7191
7167
  * @param accessToken - Bearer access token
7192
7168
  */
7193
- amBearerAuthenticated(accessToken: string): void;
7169
+ amBearerAuthenticated(accessToken: string | CodeceptJS.Secret): void;
7194
7170
  /**
7195
7171
  * Executes axios request
7196
7172
  * @returns response
@@ -7450,14 +7426,14 @@ declare namespace CodeceptJS {
7450
7426
  * ```
7451
7427
  * @param url - url path or global url.
7452
7428
  */
7453
- amOnPage(url: string): void;
7429
+ amOnPage(url: string): Promise<any>;
7454
7430
  /**
7455
7431
  * Resize the current window to provided width and height.
7456
7432
  * First parameter can be set to `maximize`.
7457
7433
  * @param width - width in pixels or `maximize`.
7458
7434
  * @param height - height in pixels.
7459
7435
  */
7460
- resizeWindow(width: number, height: number): void;
7436
+ resizeWindow(width: number, height: number): Promise<any>;
7461
7437
  /**
7462
7438
  * Perform a click on a link or a button, given by a locator.
7463
7439
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -7483,7 +7459,7 @@ declare namespace CodeceptJS {
7483
7459
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
7484
7460
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
7485
7461
  */
7486
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
7462
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
7487
7463
  /**
7488
7464
  * Reload the current page.
7489
7465
  *
@@ -7491,7 +7467,7 @@ declare namespace CodeceptJS {
7491
7467
  * I.refreshPage();
7492
7468
  * ```
7493
7469
  */
7494
- refreshPage(): void;
7470
+ refreshPage(): Promise<any>;
7495
7471
  /**
7496
7472
  * Waits for an element to become visible on a page (by default waits for 1sec).
7497
7473
  * Element can be located by CSS or XPath.
@@ -7502,7 +7478,7 @@ declare namespace CodeceptJS {
7502
7478
  * @param locator - element located by CSS|XPath|strict locator.
7503
7479
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7504
7480
  */
7505
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
7481
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7506
7482
  /**
7507
7483
  * Fills a text field or textarea, after clearing its value, with the given string.
7508
7484
  * Field is located by name, label, CSS, or XPath.
@@ -7520,7 +7496,7 @@ declare namespace CodeceptJS {
7520
7496
  * @param field - located by label|name|CSS|XPath|strict locator.
7521
7497
  * @param value - text value to fill.
7522
7498
  */
7523
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
7499
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
7524
7500
  /**
7525
7501
  * Clears a `<textarea>` or text `<input>` element's value.
7526
7502
  *
@@ -7531,7 +7507,7 @@ declare namespace CodeceptJS {
7531
7507
  * ```
7532
7508
  * @param editable - field located by label|name|CSS|XPath|strict locator.
7533
7509
  */
7534
- clearField(editable: LocatorOrString): void;
7510
+ clearField(editable: LocatorOrString): Promise<any>;
7535
7511
  /**
7536
7512
  * Appends text to a input field or textarea.
7537
7513
  * Field is located by name, label, CSS or XPath
@@ -7542,7 +7518,7 @@ declare namespace CodeceptJS {
7542
7518
  * @param field - located by label|name|CSS|XPath|strict locator
7543
7519
  * @param value - text value to append.
7544
7520
  */
7545
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
7521
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
7546
7522
  /**
7547
7523
  * Attaches a file to element located by label, name, CSS or XPath
7548
7524
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -7555,7 +7531,7 @@ declare namespace CodeceptJS {
7555
7531
  * @param locator - field located by label|name|CSS|XPath|strict locator.
7556
7532
  * @param pathToFile - local file path relative to codecept.json config file.
7557
7533
  */
7558
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
7534
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
7559
7535
  /**
7560
7536
  * Presses a key on a focused element.
7561
7537
  * Special keys like 'Enter', 'Control', [etc](https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value)
@@ -7567,10 +7543,9 @@ declare namespace CodeceptJS {
7567
7543
  * I.pressKey(['Control','a']);
7568
7544
  * ```
7569
7545
  * @param key - key or array of keys to press.
7570
- *
7571
- * {{ keys }}
7546
+ * @returns {{ keys }}
7572
7547
  */
7573
- pressKey(key: string | string[]): void;
7548
+ pressKey(key: string | string[]): Promise<any>;
7574
7549
  /**
7575
7550
  * Moves cursor to element matched by locator.
7576
7551
  * Extra shift can be set with offsetX and offsetY options.
@@ -7583,7 +7558,7 @@ declare namespace CodeceptJS {
7583
7558
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
7584
7559
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
7585
7560
  */
7586
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
7561
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
7587
7562
  /**
7588
7563
  * Performs a double-click on an element matched by link|button|label|CSS or XPath.
7589
7564
  * Context can be specified as second parameter to narrow search.
@@ -7597,7 +7572,7 @@ declare namespace CodeceptJS {
7597
7572
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
7598
7573
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
7599
7574
  */
7600
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
7575
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7601
7576
  /**
7602
7577
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
7603
7578
  *
@@ -7612,7 +7587,7 @@ declare namespace CodeceptJS {
7612
7587
  * @param locator - clickable element located by CSS|XPath|strict locator.
7613
7588
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
7614
7589
  */
7615
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
7590
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7616
7591
  /**
7617
7592
  * Selects a checkbox or radio button.
7618
7593
  * Element is located by label or name or CSS or XPath.
@@ -7627,7 +7602,7 @@ declare namespace CodeceptJS {
7627
7602
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
7628
7603
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
7629
7604
  */
7630
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
7605
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7631
7606
  /**
7632
7607
  * Unselects a checkbox or radio button.
7633
7608
  * Element is located by label or name or CSS or XPath.
@@ -7642,7 +7617,7 @@ declare namespace CodeceptJS {
7642
7617
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
7643
7618
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
7644
7619
  */
7645
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
7620
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7646
7621
  /**
7647
7622
  * Verifies that the specified checkbox is checked.
7648
7623
  *
@@ -7653,7 +7628,7 @@ declare namespace CodeceptJS {
7653
7628
  * ```
7654
7629
  * @param field - located by label|name|CSS|XPath|strict locator.
7655
7630
  */
7656
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
7631
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
7657
7632
  /**
7658
7633
  * Verifies that the specified checkbox is not checked.
7659
7634
  *
@@ -7664,7 +7639,7 @@ declare namespace CodeceptJS {
7664
7639
  * ```
7665
7640
  * @param field - located by label|name|CSS|XPath|strict locator.
7666
7641
  */
7667
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
7642
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
7668
7643
  /**
7669
7644
  * Selects an option in a drop-down select.
7670
7645
  * Field is searched by label | name | CSS | XPath.
@@ -7687,7 +7662,7 @@ declare namespace CodeceptJS {
7687
7662
  * @param select - field located by label|name|CSS|XPath|strict locator.
7688
7663
  * @param option - visible text or value of option.
7689
7664
  */
7690
- selectOption(select: LocatorOrString, option: string | any[]): void;
7665
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
7691
7666
  /**
7692
7667
  * Checks that current url contains a provided fragment.
7693
7668
  *
@@ -7696,12 +7671,12 @@ declare namespace CodeceptJS {
7696
7671
  * ```
7697
7672
  * @param url - a fragment to check
7698
7673
  */
7699
- seeInCurrentUrl(url: string): void;
7674
+ seeInCurrentUrl(url: string): Promise<any>;
7700
7675
  /**
7701
7676
  * Checks that current url does not contain a provided fragment.
7702
7677
  * @param url - value to check.
7703
7678
  */
7704
- dontSeeInCurrentUrl(url: string): void;
7679
+ dontSeeInCurrentUrl(url: string): Promise<any>;
7705
7680
  /**
7706
7681
  * Checks that current url is equal to provided one.
7707
7682
  * If a relative url provided, a configured url will be prepended to it.
@@ -7713,7 +7688,7 @@ declare namespace CodeceptJS {
7713
7688
  * ```
7714
7689
  * @param url - value to check.
7715
7690
  */
7716
- seeCurrentUrlEquals(url: string): void;
7691
+ seeCurrentUrlEquals(url: string): Promise<any>;
7717
7692
  /**
7718
7693
  * Checks that current url is not equal to provided one.
7719
7694
  * If a relative url provided, a configured url will be prepended to it.
@@ -7724,7 +7699,7 @@ declare namespace CodeceptJS {
7724
7699
  * ```
7725
7700
  * @param url - value to check.
7726
7701
  */
7727
- dontSeeCurrentUrlEquals(url: string): void;
7702
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
7728
7703
  /**
7729
7704
  * Checks that a page contains a visible text.
7730
7705
  * Use context parameter to narrow down the search.
@@ -7737,7 +7712,7 @@ declare namespace CodeceptJS {
7737
7712
  * @param text - expected on page.
7738
7713
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
7739
7714
  */
7740
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
7715
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
7741
7716
  /**
7742
7717
  * Opposite to `see`. Checks that a text is not present on a page.
7743
7718
  * Use context parameter to narrow down the search.
@@ -7749,7 +7724,7 @@ declare namespace CodeceptJS {
7749
7724
  * @param text - which is not present.
7750
7725
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
7751
7726
  */
7752
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
7727
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
7753
7728
  /**
7754
7729
  * Checks that a given Element is visible
7755
7730
  * Element is located by CSS or XPath.
@@ -7759,7 +7734,7 @@ declare namespace CodeceptJS {
7759
7734
  * ```
7760
7735
  * @param locator - located by CSS|XPath|strict locator.
7761
7736
  */
7762
- seeElement(locator: CodeceptJS.LocatorOrString): void;
7737
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
7763
7738
  /**
7764
7739
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
7765
7740
  *
@@ -7768,7 +7743,7 @@ declare namespace CodeceptJS {
7768
7743
  * ```
7769
7744
  * @param locator - located by CSS|XPath|Strict locator.
7770
7745
  */
7771
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
7746
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
7772
7747
  /**
7773
7748
  * Checks that a given Element is present in the DOM
7774
7749
  * Element is located by CSS or XPath.
@@ -7778,7 +7753,7 @@ declare namespace CodeceptJS {
7778
7753
  * ```
7779
7754
  * @param locator - element located by CSS|XPath|strict locator.
7780
7755
  */
7781
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
7756
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
7782
7757
  /**
7783
7758
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
7784
7759
  *
@@ -7787,7 +7762,7 @@ declare namespace CodeceptJS {
7787
7762
  * ```
7788
7763
  * @param locator - located by CSS|XPath|Strict locator.
7789
7764
  */
7790
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
7765
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
7791
7766
  /**
7792
7767
  * Asserts that an element is visible a given number of times.
7793
7768
  * Element is located by CSS or XPath.
@@ -7798,7 +7773,7 @@ declare namespace CodeceptJS {
7798
7773
  * @param locator - element located by CSS|XPath|strict locator.
7799
7774
  * @param num - number of elements.
7800
7775
  */
7801
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
7776
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
7802
7777
  /**
7803
7778
  * Grab number of visible elements by locator.
7804
7779
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -7823,7 +7798,7 @@ declare namespace CodeceptJS {
7823
7798
  * @param field - located by label|name|CSS|XPath|strict locator.
7824
7799
  * @param value - value to check.
7825
7800
  */
7826
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
7801
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
7827
7802
  /**
7828
7803
  * Checks that value of input field or textarea doesn't equal to given value
7829
7804
  * Opposite to `seeInField`.
@@ -7835,7 +7810,7 @@ declare namespace CodeceptJS {
7835
7810
  * @param field - located by label|name|CSS|XPath|strict locator.
7836
7811
  * @param value - value to check.
7837
7812
  */
7838
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
7813
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
7839
7814
  /**
7840
7815
  * Checks that text is equal to provided one.
7841
7816
  *
@@ -7852,7 +7827,7 @@ declare namespace CodeceptJS {
7852
7827
  * ```
7853
7828
  * @param text - value to check.
7854
7829
  */
7855
- seeInSource(text: string): void;
7830
+ seeInSource(text: string): Promise<any>;
7856
7831
  /**
7857
7832
  * Checks that the current page does not contains the given string in its raw source code.
7858
7833
  *
@@ -7861,7 +7836,7 @@ declare namespace CodeceptJS {
7861
7836
  * ```
7862
7837
  * @param value - to check.
7863
7838
  */
7864
- dontSeeInSource(value: string): void;
7839
+ dontSeeInSource(value: string): Promise<any>;
7865
7840
  /**
7866
7841
  * Saves screenshot of the specified locator to ouput folder (set in codecept.json or codecept.conf.js).
7867
7842
  * Filename is relative to output folder.
@@ -7872,7 +7847,7 @@ declare namespace CodeceptJS {
7872
7847
  * @param locator - element located by CSS|XPath|strict locator.
7873
7848
  * @param fileName - file name to save.
7874
7849
  */
7875
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
7850
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
7876
7851
  /**
7877
7852
  * Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
7878
7853
  * Filename is relative to output folder.
@@ -7885,7 +7860,7 @@ declare namespace CodeceptJS {
7885
7860
  * @param fileName - file name to save.
7886
7861
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
7887
7862
  */
7888
- saveScreenshot(fileName: string, fullPage?: boolean): void;
7863
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
7889
7864
  /**
7890
7865
  * Pauses execution for a number of seconds.
7891
7866
  *
@@ -7894,7 +7869,7 @@ declare namespace CodeceptJS {
7894
7869
  * ```
7895
7870
  * @param sec - number of second to wait.
7896
7871
  */
7897
- wait(sec: number): void;
7872
+ wait(sec: number): Promise<any>;
7898
7873
  /**
7899
7874
  * Executes sync script on a page.
7900
7875
  * Pass arguments to function as additional parameters.
@@ -8042,7 +8017,7 @@ declare namespace CodeceptJS {
8042
8017
  * I.scrollPageToTop();
8043
8018
  * ```
8044
8019
  */
8045
- scrollPageToTop(): void;
8020
+ scrollPageToTop(): Promise<any>;
8046
8021
  /**
8047
8022
  * Scroll page to the bottom.
8048
8023
  *
@@ -8050,7 +8025,7 @@ declare namespace CodeceptJS {
8050
8025
  * I.scrollPageToBottom();
8051
8026
  * ```
8052
8027
  */
8053
- scrollPageToBottom(): void;
8028
+ scrollPageToBottom(): Promise<any>;
8054
8029
  /**
8055
8030
  * Scrolls to element matched by locator.
8056
8031
  * Extra shift can be set with offsetX and offsetY options.
@@ -8063,7 +8038,7 @@ declare namespace CodeceptJS {
8063
8038
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
8064
8039
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
8065
8040
  */
8066
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
8041
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
8067
8042
  /**
8068
8043
  * Switches frame or in case of null locator reverts to parent.
8069
8044
  *
@@ -8073,7 +8048,7 @@ declare namespace CodeceptJS {
8073
8048
  * ```
8074
8049
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
8075
8050
  */
8076
- switchTo(locator?: CodeceptJS.LocatorOrString): void;
8051
+ switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
8077
8052
  /**
8078
8053
  * Sets cookie(s).
8079
8054
  *
@@ -8090,7 +8065,7 @@ declare namespace CodeceptJS {
8090
8065
  * ```
8091
8066
  * @param cookie - a cookie object or array of cookie objects.
8092
8067
  */
8093
- setCookie(cookie: Cookie | Cookie[]): void;
8068
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
8094
8069
  /**
8095
8070
  * Checks that cookie with given name exists.
8096
8071
  *
@@ -8099,7 +8074,7 @@ declare namespace CodeceptJS {
8099
8074
  * ```
8100
8075
  * @param name - cookie name.
8101
8076
  */
8102
- seeCookie(name: string): void;
8077
+ seeCookie(name: string): Promise<any>;
8103
8078
  /**
8104
8079
  * Checks that cookie with given name does not exist.
8105
8080
  *
@@ -8108,7 +8083,7 @@ declare namespace CodeceptJS {
8108
8083
  * ```
8109
8084
  * @param name - cookie name.
8110
8085
  */
8111
- dontSeeCookie(name: string): void;
8086
+ dontSeeCookie(name: string): Promise<any>;
8112
8087
  /**
8113
8088
  * Gets a cookie object by name.
8114
8089
  * If none provided gets all cookies.
@@ -8135,7 +8110,7 @@ declare namespace CodeceptJS {
8135
8110
  * ```
8136
8111
  * @param [cookie = null] - (optional, `null` by default) cookie name
8137
8112
  */
8138
- clearCookie(cookie?: string): void;
8113
+ clearCookie(cookie?: string): Promise<any>;
8139
8114
  /**
8140
8115
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
8141
8116
  *
@@ -8145,7 +8120,7 @@ declare namespace CodeceptJS {
8145
8120
  * @param urlPart - value to check.
8146
8121
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8147
8122
  */
8148
- waitInUrl(urlPart: string, sec?: number): void;
8123
+ waitInUrl(urlPart: string, sec?: number): Promise<any>;
8149
8124
  /**
8150
8125
  * Waits for the entire URL to match the expected
8151
8126
  *
@@ -8156,7 +8131,7 @@ declare namespace CodeceptJS {
8156
8131
  * @param urlPart - value to check.
8157
8132
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8158
8133
  */
8159
- waitUrlEquals(urlPart: string, sec?: number): void;
8134
+ waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
8160
8135
  /**
8161
8136
  * Waits for a function to return true (waits for 1 sec by default).
8162
8137
  * Running in browser context.
@@ -8174,7 +8149,7 @@ declare namespace CodeceptJS {
8174
8149
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
8175
8150
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
8176
8151
  */
8177
- waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
8152
+ waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
8178
8153
  /**
8179
8154
  * Waits for a specified number of elements on the page.
8180
8155
  *
@@ -8185,7 +8160,7 @@ declare namespace CodeceptJS {
8185
8160
  * @param num - number of elements.
8186
8161
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8187
8162
  */
8188
- waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): void;
8163
+ waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
8189
8164
  /**
8190
8165
  * Waits for element to be present on page (by default waits for 1sec).
8191
8166
  * Element can be located by CSS or XPath.
@@ -8197,7 +8172,7 @@ declare namespace CodeceptJS {
8197
8172
  * @param locator - element located by CSS|XPath|strict locator.
8198
8173
  * @param [sec] - (optional, `1` by default) time in seconds to wait
8199
8174
  */
8200
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
8175
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
8201
8176
  /**
8202
8177
  * Waits for an element to hide (by default waits for 1sec).
8203
8178
  * Element can be located by CSS or XPath.
@@ -8208,7 +8183,7 @@ declare namespace CodeceptJS {
8208
8183
  * @param locator - element located by CSS|XPath|strict locator.
8209
8184
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8210
8185
  */
8211
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
8186
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
8212
8187
  /**
8213
8188
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
8214
8189
  * Element can be located by CSS or XPath.
@@ -8219,7 +8194,7 @@ declare namespace CodeceptJS {
8219
8194
  * @param locator - element located by CSS|XPath|strict locator.
8220
8195
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8221
8196
  */
8222
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
8197
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
8223
8198
  /**
8224
8199
  * Waits for a text to appear (by default waits for 1sec).
8225
8200
  * Element can be located by CSS or XPath.
@@ -8233,7 +8208,7 @@ declare namespace CodeceptJS {
8233
8208
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8234
8209
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
8235
8210
  */
8236
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
8211
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
8237
8212
  }
8238
8213
  /**
8239
8214
  * WebDriver helper which wraps [webdriverio](http://webdriver.io/) library to
@@ -8670,7 +8645,7 @@ declare namespace CodeceptJS {
8670
8645
  * ```
8671
8646
  * @param url - url path or global url.
8672
8647
  */
8673
- amOnPage(url: string): void;
8648
+ amOnPage(url: string): Promise<any>;
8674
8649
  /**
8675
8650
  * Perform a click on a link or a button, given by a locator.
8676
8651
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -8695,11 +8670,9 @@ declare namespace CodeceptJS {
8695
8670
  * ```
8696
8671
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
8697
8672
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
8698
- *
8699
- *
8700
- * {{ react }}
8673
+ * @returns {{ react }}
8701
8674
  */
8702
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8675
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
8703
8676
  /**
8704
8677
  * Perform an emulated click on a link or a button, given by a locator.
8705
8678
  * Unlike normal click instead of sending native event, emulates a click with JavaScript.
@@ -8727,11 +8700,9 @@ declare namespace CodeceptJS {
8727
8700
  * ```
8728
8701
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
8729
8702
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
8730
- *
8731
- *
8732
- * {{ react }}
8703
+ * @returns {{ react }}
8733
8704
  */
8734
- forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8705
+ forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8735
8706
  /**
8736
8707
  * Performs a double-click on an element matched by link|button|label|CSS or XPath.
8737
8708
  * Context can be specified as second parameter to narrow search.
@@ -8744,11 +8715,9 @@ declare namespace CodeceptJS {
8744
8715
  * ```
8745
8716
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
8746
8717
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
8747
- *
8748
- *
8749
- * {{ react }}
8718
+ * @returns {{ react }}
8750
8719
  */
8751
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8720
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8752
8721
  /**
8753
8722
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
8754
8723
  *
@@ -8762,11 +8731,9 @@ declare namespace CodeceptJS {
8762
8731
  * ```
8763
8732
  * @param locator - clickable element located by CSS|XPath|strict locator.
8764
8733
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
8765
- *
8766
- *
8767
- * {{ react }}
8734
+ * @returns {{ react }}
8768
8735
  */
8769
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8736
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8770
8737
  /**
8771
8738
  * Emulates right click on an element.
8772
8739
  * Unlike normal click instead of sending native event, emulates a click with JavaScript.
@@ -8784,11 +8751,9 @@ declare namespace CodeceptJS {
8784
8751
  * ```
8785
8752
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
8786
8753
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
8787
- *
8788
- *
8789
- * {{ react }}
8754
+ * @returns {{ react }}
8790
8755
  */
8791
- forceRightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8756
+ forceRightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8792
8757
  /**
8793
8758
  * Fills a text field or textarea, after clearing its value, with the given string.
8794
8759
  * Field is located by name, label, CSS, or XPath.
@@ -8805,11 +8770,10 @@ declare namespace CodeceptJS {
8805
8770
  * ```
8806
8771
  * @param field - located by label|name|CSS|XPath|strict locator.
8807
8772
  * @param value - text value to fill.
8808
- *
8809
- * {{ react }}
8773
+ * @returns {{ react }}
8810
8774
  * {{ custom }}
8811
8775
  */
8812
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
8776
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
8813
8777
  /**
8814
8778
  * Appends text to a input field or textarea.
8815
8779
  * Field is located by name, label, CSS or XPath
@@ -8819,9 +8783,9 @@ declare namespace CodeceptJS {
8819
8783
  * ```
8820
8784
  * @param field - located by label|name|CSS|XPath|strict locator
8821
8785
  * @param value - text value to append.
8822
- * {{ react }}
8786
+ * @returns {{ react }}
8823
8787
  */
8824
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
8788
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
8825
8789
  /**
8826
8790
  * Clears a `<textarea>` or text `<input>` element's value.
8827
8791
  *
@@ -8832,7 +8796,7 @@ declare namespace CodeceptJS {
8832
8796
  * ```
8833
8797
  * @param editable - field located by label|name|CSS|XPath|strict locator.
8834
8798
  */
8835
- clearField(editable: LocatorOrString): void;
8799
+ clearField(editable: LocatorOrString): Promise<any>;
8836
8800
  /**
8837
8801
  * Selects an option in a drop-down select.
8838
8802
  * Field is searched by label | name | CSS | XPath.
@@ -8855,7 +8819,7 @@ declare namespace CodeceptJS {
8855
8819
  * @param select - field located by label|name|CSS|XPath|strict locator.
8856
8820
  * @param option - visible text or value of option.
8857
8821
  */
8858
- selectOption(select: LocatorOrString, option: string | any[]): void;
8822
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
8859
8823
  /**
8860
8824
  * Attaches a file to element located by label, name, CSS or XPath
8861
8825
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -8867,9 +8831,9 @@ declare namespace CodeceptJS {
8867
8831
  * ```
8868
8832
  * @param locator - field located by label|name|CSS|XPath|strict locator.
8869
8833
  * @param pathToFile - local file path relative to codecept.json config file.
8870
- * Appium: not tested
8834
+ * @returns Appium: not tested
8871
8835
  */
8872
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
8836
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
8873
8837
  /**
8874
8838
  * Selects a checkbox or radio button.
8875
8839
  * Element is located by label or name or CSS or XPath.
@@ -8883,9 +8847,9 @@ declare namespace CodeceptJS {
8883
8847
  * ```
8884
8848
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
8885
8849
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
8886
- * Appium: not tested
8850
+ * @returns Appium: not tested
8887
8851
  */
8888
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8852
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8889
8853
  /**
8890
8854
  * Unselects a checkbox or radio button.
8891
8855
  * Element is located by label or name or CSS or XPath.
@@ -8899,9 +8863,9 @@ declare namespace CodeceptJS {
8899
8863
  * ```
8900
8864
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
8901
8865
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
8902
- * Appium: not tested
8866
+ * @returns Appium: not tested
8903
8867
  */
8904
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8868
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8905
8869
  /**
8906
8870
  * Retrieves all texts from an element located by CSS or XPath and returns it to test.
8907
8871
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -9029,16 +8993,16 @@ declare namespace CodeceptJS {
9029
8993
  * ```
9030
8994
  * @param text - text value to check.
9031
8995
  */
9032
- seeInTitle(text: string): void;
8996
+ seeInTitle(text: string): Promise<any>;
9033
8997
  /**
9034
8998
  * Checks that title is equal to provided one.
9035
8999
  *
9036
- * ```js
9037
- * I.seeTitleEquals('Test title.');
9038
- * ```
9000
+ * ```js
9001
+ * I.seeTitleEquals('Test title.');
9002
+ * ```
9039
9003
  * @param text - value to check.
9040
9004
  */
9041
- seeTitleEquals(text: string): void;
9005
+ seeTitleEquals(text: string): Promise<any>;
9042
9006
  /**
9043
9007
  * Checks that title does not contain text.
9044
9008
  *
@@ -9047,7 +9011,7 @@ declare namespace CodeceptJS {
9047
9011
  * ```
9048
9012
  * @param text - value to check.
9049
9013
  */
9050
- dontSeeInTitle(text: string): void;
9014
+ dontSeeInTitle(text: string): Promise<any>;
9051
9015
  /**
9052
9016
  * Retrieves a page title and returns it to test.
9053
9017
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -9069,10 +9033,9 @@ declare namespace CodeceptJS {
9069
9033
  * ```
9070
9034
  * @param text - expected on page.
9071
9035
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
9072
- *
9073
- * {{ react }}
9036
+ * @returns {{ react }}
9074
9037
  */
9075
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
9038
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
9076
9039
  /**
9077
9040
  * Checks that text is equal to provided one.
9078
9041
  *
@@ -9082,7 +9045,7 @@ declare namespace CodeceptJS {
9082
9045
  * @param text - element value to check.
9083
9046
  * @param [context = null] - element located by CSS|XPath|strict locator.
9084
9047
  */
9085
- seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): void;
9048
+ seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
9086
9049
  /**
9087
9050
  * Opposite to `see`. Checks that a text is not present on a page.
9088
9051
  * Use context parameter to narrow down the search.
@@ -9093,11 +9056,9 @@ declare namespace CodeceptJS {
9093
9056
  * ```
9094
9057
  * @param text - which is not present.
9095
9058
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
9096
- *
9097
- *
9098
- * {{ react }}
9059
+ * @returns {{ react }}
9099
9060
  */
9100
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
9061
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
9101
9062
  /**
9102
9063
  * Checks that the given input field or textarea equals to given value.
9103
9064
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -9111,7 +9072,7 @@ declare namespace CodeceptJS {
9111
9072
  * @param field - located by label|name|CSS|XPath|strict locator.
9112
9073
  * @param value - value to check.
9113
9074
  */
9114
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
9075
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
9115
9076
  /**
9116
9077
  * Checks that value of input field or textarea doesn't equal to given value
9117
9078
  * Opposite to `seeInField`.
@@ -9123,7 +9084,7 @@ declare namespace CodeceptJS {
9123
9084
  * @param field - located by label|name|CSS|XPath|strict locator.
9124
9085
  * @param value - value to check.
9125
9086
  */
9126
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
9087
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
9127
9088
  /**
9128
9089
  * Verifies that the specified checkbox is checked.
9129
9090
  *
@@ -9133,10 +9094,9 @@ declare namespace CodeceptJS {
9133
9094
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
9134
9095
  * ```
9135
9096
  * @param field - located by label|name|CSS|XPath|strict locator.
9136
- *
9137
- * Appium: not tested
9097
+ * @returns Appium: not tested
9138
9098
  */
9139
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
9099
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
9140
9100
  /**
9141
9101
  * Verifies that the specified checkbox is not checked.
9142
9102
  *
@@ -9146,10 +9106,9 @@ declare namespace CodeceptJS {
9146
9106
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
9147
9107
  * ```
9148
9108
  * @param field - located by label|name|CSS|XPath|strict locator.
9149
- *
9150
- * Appium: not tested
9109
+ * @returns Appium: not tested
9151
9110
  */
9152
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
9111
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
9153
9112
  /**
9154
9113
  * Checks that a given Element is visible
9155
9114
  * Element is located by CSS or XPath.
@@ -9158,9 +9117,9 @@ declare namespace CodeceptJS {
9158
9117
  * I.seeElement('#modal');
9159
9118
  * ```
9160
9119
  * @param locator - located by CSS|XPath|strict locator.
9161
- * {{ react }}
9120
+ * @returns {{ react }}
9162
9121
  */
9163
- seeElement(locator: CodeceptJS.LocatorOrString): void;
9122
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
9164
9123
  /**
9165
9124
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
9166
9125
  *
@@ -9168,9 +9127,9 @@ declare namespace CodeceptJS {
9168
9127
  * I.dontSeeElement('.modal'); // modal is not shown
9169
9128
  * ```
9170
9129
  * @param locator - located by CSS|XPath|Strict locator.
9171
- * {{ react }}
9130
+ * @returns {{ react }}
9172
9131
  */
9173
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
9132
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
9174
9133
  /**
9175
9134
  * Checks that a given Element is present in the DOM
9176
9135
  * Element is located by CSS or XPath.
@@ -9180,7 +9139,7 @@ declare namespace CodeceptJS {
9180
9139
  * ```
9181
9140
  * @param locator - element located by CSS|XPath|strict locator.
9182
9141
  */
9183
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
9142
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
9184
9143
  /**
9185
9144
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
9186
9145
  *
@@ -9189,7 +9148,7 @@ declare namespace CodeceptJS {
9189
9148
  * ```
9190
9149
  * @param locator - located by CSS|XPath|Strict locator.
9191
9150
  */
9192
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
9151
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
9193
9152
  /**
9194
9153
  * Checks that the current page contains the given string in its raw source code.
9195
9154
  *
@@ -9198,7 +9157,7 @@ declare namespace CodeceptJS {
9198
9157
  * ```
9199
9158
  * @param text - value to check.
9200
9159
  */
9201
- seeInSource(text: string): void;
9160
+ seeInSource(text: string): Promise<any>;
9202
9161
  /**
9203
9162
  * Retrieves page source and returns it to test.
9204
9163
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -9239,7 +9198,7 @@ declare namespace CodeceptJS {
9239
9198
  * ```
9240
9199
  * @param value - to check.
9241
9200
  */
9242
- dontSeeInSource(value: string): void;
9201
+ dontSeeInSource(value: string): Promise<any>;
9243
9202
  /**
9244
9203
  * Asserts that an element appears a given number of times in the DOM.
9245
9204
  * Element is located by label or name or CSS or XPath.
@@ -9250,10 +9209,9 @@ declare namespace CodeceptJS {
9250
9209
  * ```
9251
9210
  * @param locator - element located by CSS|XPath|strict locator.
9252
9211
  * @param num - number of elements.
9253
- *
9254
- * {{ react }}
9212
+ * @returns {{ react }}
9255
9213
  */
9256
- seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): void;
9214
+ seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
9257
9215
  /**
9258
9216
  * Asserts that an element is visible a given number of times.
9259
9217
  * Element is located by CSS or XPath.
@@ -9263,10 +9221,9 @@ declare namespace CodeceptJS {
9263
9221
  * ```
9264
9222
  * @param locator - element located by CSS|XPath|strict locator.
9265
9223
  * @param num - number of elements.
9266
- *
9267
- * {{ react }}
9224
+ * @returns {{ react }}
9268
9225
  */
9269
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
9226
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
9270
9227
  /**
9271
9228
  * Checks that all elements with given locator have given CSS properties.
9272
9229
  *
@@ -9276,7 +9233,7 @@ declare namespace CodeceptJS {
9276
9233
  * @param locator - located by CSS|XPath|strict locator.
9277
9234
  * @param cssProperties - object with CSS properties and their values to check.
9278
9235
  */
9279
- seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): void;
9236
+ seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
9280
9237
  /**
9281
9238
  * Checks that all elements with given locator have given attributes.
9282
9239
  *
@@ -9286,7 +9243,7 @@ declare namespace CodeceptJS {
9286
9243
  * @param locator - located by CSS|XPath|strict locator.
9287
9244
  * @param attributes - attributes and their values to check.
9288
9245
  */
9289
- seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): void;
9246
+ seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
9290
9247
  /**
9291
9248
  * Grab number of visible elements by locator.
9292
9249
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -9306,12 +9263,12 @@ declare namespace CodeceptJS {
9306
9263
  * ```
9307
9264
  * @param url - a fragment to check
9308
9265
  */
9309
- seeInCurrentUrl(url: string): void;
9266
+ seeInCurrentUrl(url: string): Promise<any>;
9310
9267
  /**
9311
9268
  * Checks that current url does not contain a provided fragment.
9312
9269
  * @param url - value to check.
9313
9270
  */
9314
- dontSeeInCurrentUrl(url: string): void;
9271
+ dontSeeInCurrentUrl(url: string): Promise<any>;
9315
9272
  /**
9316
9273
  * Checks that current url is equal to provided one.
9317
9274
  * If a relative url provided, a configured url will be prepended to it.
@@ -9323,7 +9280,7 @@ declare namespace CodeceptJS {
9323
9280
  * ```
9324
9281
  * @param url - value to check.
9325
9282
  */
9326
- seeCurrentUrlEquals(url: string): void;
9283
+ seeCurrentUrlEquals(url: string): Promise<any>;
9327
9284
  /**
9328
9285
  * Checks that current url is not equal to provided one.
9329
9286
  * If a relative url provided, a configured url will be prepended to it.
@@ -9334,7 +9291,7 @@ declare namespace CodeceptJS {
9334
9291
  * ```
9335
9292
  * @param url - value to check.
9336
9293
  */
9337
- dontSeeCurrentUrlEquals(url: string): void;
9294
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
9338
9295
  /**
9339
9296
  * Executes sync script on a page.
9340
9297
  * Pass arguments to function as additional parameters.
@@ -9399,7 +9356,7 @@ declare namespace CodeceptJS {
9399
9356
  * @param locator - located by CSS|XPath|strict locator.
9400
9357
  * @param scrollIntoViewOptions - see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
9401
9358
  */
9402
- scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): void;
9359
+ scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): Promise<any>;
9403
9360
  /**
9404
9361
  * Scrolls to element matched by locator.
9405
9362
  * Extra shift can be set with offsetX and offsetY options.
@@ -9412,7 +9369,7 @@ declare namespace CodeceptJS {
9412
9369
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
9413
9370
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
9414
9371
  */
9415
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
9372
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
9416
9373
  /**
9417
9374
  * Moves cursor to element matched by locator.
9418
9375
  * Extra shift can be set with offsetX and offsetY options.
@@ -9425,7 +9382,7 @@ declare namespace CodeceptJS {
9425
9382
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
9426
9383
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
9427
9384
  */
9428
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
9385
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
9429
9386
  /**
9430
9387
  * Saves screenshot of the specified locator to ouput folder (set in codecept.json or codecept.conf.js).
9431
9388
  * Filename is relative to output folder.
@@ -9436,7 +9393,7 @@ declare namespace CodeceptJS {
9436
9393
  * @param locator - element located by CSS|XPath|strict locator.
9437
9394
  * @param fileName - file name to save.
9438
9395
  */
9439
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
9396
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
9440
9397
  /**
9441
9398
  * Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
9442
9399
  * Filename is relative to output folder.
@@ -9449,7 +9406,7 @@ declare namespace CodeceptJS {
9449
9406
  * @param fileName - file name to save.
9450
9407
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
9451
9408
  */
9452
- saveScreenshot(fileName: string, fullPage?: boolean): void;
9409
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
9453
9410
  /**
9454
9411
  * Sets cookie(s).
9455
9412
  *
@@ -9465,13 +9422,10 @@ declare namespace CodeceptJS {
9465
9422
  * ]);
9466
9423
  * ```
9467
9424
  * @param cookie - a cookie object or array of cookie objects.
9468
- *
9469
- *
9470
- *
9471
- * Uses Selenium's JSON [cookie
9425
+ * @returns Uses Selenium's JSON [cookie
9472
9426
  * format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
9473
9427
  */
9474
- setCookie(cookie: Cookie | Cookie[]): void;
9428
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
9475
9429
  /**
9476
9430
  * Clears a cookie by name,
9477
9431
  * if none provided clears all cookies.
@@ -9482,7 +9436,7 @@ declare namespace CodeceptJS {
9482
9436
  * ```
9483
9437
  * @param [cookie = null] - (optional, `null` by default) cookie name
9484
9438
  */
9485
- clearCookie(cookie?: string): void;
9439
+ clearCookie(cookie?: string): Promise<any>;
9486
9440
  /**
9487
9441
  * Checks that cookie with given name exists.
9488
9442
  *
@@ -9491,7 +9445,7 @@ declare namespace CodeceptJS {
9491
9445
  * ```
9492
9446
  * @param name - cookie name.
9493
9447
  */
9494
- seeCookie(name: string): void;
9448
+ seeCookie(name: string): Promise<any>;
9495
9449
  /**
9496
9450
  * Checks that cookie with given name does not exist.
9497
9451
  *
@@ -9500,7 +9454,7 @@ declare namespace CodeceptJS {
9500
9454
  * ```
9501
9455
  * @param name - cookie name.
9502
9456
  */
9503
- dontSeeCookie(name: string): void;
9457
+ dontSeeCookie(name: string): Promise<any>;
9504
9458
  /**
9505
9459
  * Gets a cookie object by name.
9506
9460
  * If none provided gets all cookies.
@@ -9549,7 +9503,7 @@ declare namespace CodeceptJS {
9549
9503
  * ```
9550
9504
  * @param key - name of key to press down.
9551
9505
  */
9552
- pressKeyDown(key: string): void;
9506
+ pressKeyDown(key: string): Promise<any>;
9553
9507
  /**
9554
9508
  * Releases a key in the browser which was previously set to a down state.
9555
9509
  *
@@ -9562,7 +9516,7 @@ declare namespace CodeceptJS {
9562
9516
  * ```
9563
9517
  * @param key - name of key to release.
9564
9518
  */
9565
- pressKeyUp(key: string): void;
9519
+ pressKeyUp(key: string): Promise<any>;
9566
9520
  /**
9567
9521
  * Presses a key in the browser (on a focused element).
9568
9522
  *
@@ -9622,11 +9576,9 @@ declare namespace CodeceptJS {
9622
9576
  * - `'Space'`
9623
9577
  * - `'Tab'`
9624
9578
  * @param key - key or array of keys to press.
9625
- *
9626
- *
9627
- * _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.
9579
+ * @returns _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.
9628
9580
  */
9629
- pressKey(key: string | string[]): void;
9581
+ pressKey(key: string | string[]): Promise<any>;
9630
9582
  /**
9631
9583
  * Types out the given text into an active field.
9632
9584
  * To slow down typing use a second parameter, to set interval between key presses.
@@ -9645,15 +9597,15 @@ declare namespace CodeceptJS {
9645
9597
  * @param key - or array of keys to type.
9646
9598
  * @param [delay = null] - (optional) delay in ms between key presses
9647
9599
  */
9648
- type(key: string | string[], delay?: number): void;
9600
+ type(key: string | string[], delay?: number): Promise<any>;
9649
9601
  /**
9650
9602
  * Resize the current window to provided width and height.
9651
9603
  * First parameter can be set to `maximize`.
9652
9604
  * @param width - width in pixels or `maximize`.
9653
9605
  * @param height - height in pixels.
9654
- * Appium: not tested in web, in apps doesn't work
9606
+ * @returns Appium: not tested in web, in apps doesn't work
9655
9607
  */
9656
- resizeWindow(width: number, height: number): void;
9608
+ resizeWindow(width: number, height: number): Promise<any>;
9657
9609
  /**
9658
9610
  * Drag an item to a destination element.
9659
9611
  *
@@ -9662,10 +9614,9 @@ declare namespace CodeceptJS {
9662
9614
  * ```
9663
9615
  * @param srcElement - located by CSS|XPath|strict locator.
9664
9616
  * @param destElement - located by CSS|XPath|strict locator.
9665
- *
9666
- * Appium: not tested
9617
+ * @returns Appium: not tested
9667
9618
  */
9668
- dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
9619
+ dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): Promise<any>;
9669
9620
  /**
9670
9621
  * Drag the scrubber of a slider to a given position
9671
9622
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -9677,7 +9628,7 @@ declare namespace CodeceptJS {
9677
9628
  * @param locator - located by label|name|CSS|XPath|strict locator.
9678
9629
  * @param offsetX - position to drag.
9679
9630
  */
9680
- dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): void;
9631
+ dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): Promise<any>;
9681
9632
  /**
9682
9633
  * Get all Window Handles.
9683
9634
  * Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
@@ -9714,11 +9665,11 @@ declare namespace CodeceptJS {
9714
9665
  * Close all tabs except for the current one.
9715
9666
  *
9716
9667
  *
9717
- * ```js
9718
- * I.closeOtherTabs();
9719
- * ```
9668
+ * ```js
9669
+ * I.closeOtherTabs();
9670
+ * ```
9720
9671
  */
9721
- closeOtherTabs(): void;
9672
+ closeOtherTabs(): Promise<any>;
9722
9673
  /**
9723
9674
  * Pauses execution for a number of seconds.
9724
9675
  *
@@ -9727,14 +9678,14 @@ declare namespace CodeceptJS {
9727
9678
  * ```
9728
9679
  * @param sec - number of second to wait.
9729
9680
  */
9730
- wait(sec: number): void;
9681
+ wait(sec: number): Promise<any>;
9731
9682
  /**
9732
9683
  * Waits for element to become enabled (by default waits for 1sec).
9733
9684
  * Element can be located by CSS or XPath.
9734
9685
  * @param locator - element located by CSS|XPath|strict locator.
9735
9686
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
9736
9687
  */
9737
- waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9688
+ waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9738
9689
  /**
9739
9690
  * Waits for element to be present on page (by default waits for 1sec).
9740
9691
  * Element can be located by CSS or XPath.
@@ -9746,7 +9697,7 @@ declare namespace CodeceptJS {
9746
9697
  * @param locator - element located by CSS|XPath|strict locator.
9747
9698
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
9748
9699
  */
9749
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9700
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9750
9701
  /**
9751
9702
  * Waits for element to be clickable (by default waits for 1sec).
9752
9703
  * Element can be located by CSS or XPath.
@@ -9758,7 +9709,7 @@ declare namespace CodeceptJS {
9758
9709
  * @param locator - element located by CSS|XPath|strict locator.
9759
9710
  * @param [sec] - (optional, `1` by default) time in seconds to wait
9760
9711
  */
9761
- waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9712
+ waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9762
9713
  /**
9763
9714
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
9764
9715
  *
@@ -9768,7 +9719,7 @@ declare namespace CodeceptJS {
9768
9719
  * @param urlPart - value to check.
9769
9720
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9770
9721
  */
9771
- waitInUrl(urlPart: string, sec?: number): void;
9722
+ waitInUrl(urlPart: string, sec?: number): Promise<any>;
9772
9723
  /**
9773
9724
  * Waits for the entire URL to match the expected
9774
9725
  *
@@ -9779,7 +9730,7 @@ declare namespace CodeceptJS {
9779
9730
  * @param urlPart - value to check.
9780
9731
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9781
9732
  */
9782
- waitUrlEquals(urlPart: string, sec?: number): void;
9733
+ waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
9783
9734
  /**
9784
9735
  * Waits for a text to appear (by default waits for 1sec).
9785
9736
  * Element can be located by CSS or XPath.
@@ -9793,7 +9744,7 @@ declare namespace CodeceptJS {
9793
9744
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9794
9745
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
9795
9746
  */
9796
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
9747
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
9797
9748
  /**
9798
9749
  * Waits for the specified value to be in value attribute.
9799
9750
  *
@@ -9804,7 +9755,7 @@ declare namespace CodeceptJS {
9804
9755
  * @param value - expected value.
9805
9756
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9806
9757
  */
9807
- waitForValue(field: LocatorOrString, value: string, sec?: number): void;
9758
+ waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
9808
9759
  /**
9809
9760
  * Waits for an element to become visible on a page (by default waits for 1sec).
9810
9761
  * Element can be located by CSS or XPath.
@@ -9815,7 +9766,7 @@ declare namespace CodeceptJS {
9815
9766
  * @param locator - element located by CSS|XPath|strict locator.
9816
9767
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9817
9768
  */
9818
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9769
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9819
9770
  /**
9820
9771
  * Waits for a specified number of elements on the page.
9821
9772
  *
@@ -9826,7 +9777,7 @@ declare namespace CodeceptJS {
9826
9777
  * @param num - number of elements.
9827
9778
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9828
9779
  */
9829
- waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): void;
9780
+ waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
9830
9781
  /**
9831
9782
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
9832
9783
  * Element can be located by CSS or XPath.
@@ -9837,7 +9788,7 @@ declare namespace CodeceptJS {
9837
9788
  * @param locator - element located by CSS|XPath|strict locator.
9838
9789
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9839
9790
  */
9840
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9791
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9841
9792
  /**
9842
9793
  * Waits for an element to hide (by default waits for 1sec).
9843
9794
  * Element can be located by CSS or XPath.
@@ -9848,7 +9799,7 @@ declare namespace CodeceptJS {
9848
9799
  * @param locator - element located by CSS|XPath|strict locator.
9849
9800
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9850
9801
  */
9851
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9802
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9852
9803
  /**
9853
9804
  * Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
9854
9805
  * Element can be located by CSS or XPath.
@@ -9859,7 +9810,7 @@ declare namespace CodeceptJS {
9859
9810
  * @param locator - element located by CSS|XPath|strict locator.
9860
9811
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9861
9812
  */
9862
- waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9813
+ waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9863
9814
  /**
9864
9815
  * Waits for a function to return true (waits for 1 sec by default).
9865
9816
  * Running in browser context.
@@ -9877,7 +9828,7 @@ declare namespace CodeceptJS {
9877
9828
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
9878
9829
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
9879
9830
  */
9880
- waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
9831
+ waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
9881
9832
  /**
9882
9833
  * Switches frame or in case of null locator reverts to parent.
9883
9834
  *
@@ -9887,45 +9838,45 @@ declare namespace CodeceptJS {
9887
9838
  * ```
9888
9839
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
9889
9840
  */
9890
- switchTo(locator?: CodeceptJS.LocatorOrString): void;
9841
+ switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
9891
9842
  /**
9892
9843
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab.
9893
9844
  *
9894
- * ```js
9895
- * I.switchToNextTab();
9896
- * I.switchToNextTab(2);
9897
- * ```
9845
+ * ```js
9846
+ * I.switchToNextTab();
9847
+ * I.switchToNextTab(2);
9848
+ * ```
9898
9849
  * @param [num = 1] - (optional) number of tabs to switch forward, default: 1.
9899
9850
  * @param [sec = null] - (optional) time in seconds to wait.
9900
9851
  */
9901
- switchToNextTab(num?: number, sec?: number | null): void;
9852
+ switchToNextTab(num?: number, sec?: number | null): Promise<any>;
9902
9853
  /**
9903
9854
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab.
9904
9855
  *
9905
- * ```js
9906
- * I.switchToPreviousTab();
9907
- * I.switchToPreviousTab(2);
9908
- * ```
9856
+ * ```js
9857
+ * I.switchToPreviousTab();
9858
+ * I.switchToPreviousTab(2);
9859
+ * ```
9909
9860
  * @param [num = 1] - (optional) number of tabs to switch backward, default: 1.
9910
9861
  * @param [sec = null] - (optional) time in seconds to wait.
9911
9862
  */
9912
- switchToPreviousTab(num?: number, sec?: number): void;
9863
+ switchToPreviousTab(num?: number, sec?: number): Promise<any>;
9913
9864
  /**
9914
9865
  * Close current tab.
9915
9866
  *
9916
- * ```js
9917
- * I.closeCurrentTab();
9918
- * ```
9867
+ * ```js
9868
+ * I.closeCurrentTab();
9869
+ * ```
9919
9870
  */
9920
- closeCurrentTab(): void;
9871
+ closeCurrentTab(): Promise<any>;
9921
9872
  /**
9922
9873
  * Open new tab and switch to it.
9923
9874
  *
9924
- * ```js
9925
- * I.openNewTab();
9926
- * ```
9875
+ * ```js
9876
+ * I.openNewTab();
9877
+ * ```
9927
9878
  */
9928
- openNewTab(): void;
9879
+ openNewTab(): Promise<any>;
9929
9880
  /**
9930
9881
  * Grab number of open tabs.
9931
9882
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -9943,7 +9894,7 @@ declare namespace CodeceptJS {
9943
9894
  * I.refreshPage();
9944
9895
  * ```
9945
9896
  */
9946
- refreshPage(): void;
9897
+ refreshPage(): Promise<any>;
9947
9898
  /**
9948
9899
  * Scroll page to the top.
9949
9900
  *
@@ -9951,7 +9902,7 @@ declare namespace CodeceptJS {
9951
9902
  * I.scrollPageToTop();
9952
9903
  * ```
9953
9904
  */
9954
- scrollPageToTop(): void;
9905
+ scrollPageToTop(): Promise<any>;
9955
9906
  /**
9956
9907
  * Scroll page to the bottom.
9957
9908
  *
@@ -9959,7 +9910,7 @@ declare namespace CodeceptJS {
9959
9910
  * I.scrollPageToBottom();
9960
9911
  * ```
9961
9912
  */
9962
- scrollPageToBottom(): void;
9913
+ scrollPageToBottom(): Promise<any>;
9963
9914
  /**
9964
9915
  * Retrieves a page scroll position and returns it to test.
9965
9916
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -9982,7 +9933,7 @@ declare namespace CodeceptJS {
9982
9933
  * @param longitude - to set
9983
9934
  * @param [altitude = null] - (optional, null by default) to set
9984
9935
  */
9985
- setGeoLocation(latitude: number, longitude: number, altitude?: number): void;
9936
+ setGeoLocation(latitude: number, longitude: number, altitude?: number): Promise<any>;
9986
9937
  /**
9987
9938
  * Return the current geo location
9988
9939
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -10018,7 +9969,7 @@ declare namespace CodeceptJS {
10018
9969
  /**
10019
9970
  * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
10020
9971
  */
10021
- runOnAndroid(): void;
9972
+ runOnAndroid(caps: any, fn: any): Promise<any>;
10022
9973
  /**
10023
9974
  * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
10024
9975
  */