codeceptjs 3.3.0-beta.4 → 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 (137) hide show
  1. package/CHANGELOG.md +43 -1
  2. package/README.md +26 -0
  3. package/docs/api.md +45 -30
  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 +58 -43
  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 +99 -70
  12. package/docs/build/Playwright.js +187 -109
  13. package/docs/build/Protractor.js +70 -32
  14. package/docs/build/Puppeteer.js +141 -98
  15. package/docs/build/REST.js +4 -1
  16. package/docs/build/TestCafe.js +96 -65
  17. package/docs/build/WebDriver.js +183 -133
  18. package/docs/changelog.md +92 -0
  19. package/docs/custom-helpers.md +1 -1
  20. package/docs/data.md +2 -2
  21. package/docs/email.md +5 -0
  22. package/docs/helpers/ApiDataFactory.md +7 -3
  23. package/docs/helpers/Appium.md +113 -15
  24. package/docs/helpers/GraphQL.md +6 -0
  25. package/docs/helpers/GraphQLDataFactory.md +3 -3
  26. package/docs/helpers/JSONResponse.md +1 -1
  27. package/docs/helpers/MockRequest.md +8 -6
  28. package/docs/helpers/Nightmare.md +131 -29
  29. package/docs/helpers/Playwright.md +424 -215
  30. package/docs/helpers/Puppeteer.md +229 -92
  31. package/docs/helpers/REST.md +1 -1
  32. package/docs/helpers/TestCafe.md +166 -62
  33. package/docs/helpers/WebDriver.md +254 -103
  34. package/docs/index.md +1 -1
  35. package/docs/locators.md +1 -1
  36. package/docs/videos.md +2 -2
  37. package/docs/webapi/amOnPage.mustache +2 -1
  38. package/docs/webapi/appendField.mustache +2 -1
  39. package/docs/webapi/attachFile.mustache +2 -1
  40. package/docs/webapi/checkOption.mustache +2 -1
  41. package/docs/webapi/clearCookie.mustache +2 -1
  42. package/docs/webapi/clearField.mustache +1 -0
  43. package/docs/webapi/click.mustache +2 -1
  44. package/docs/webapi/clickLink.mustache +2 -1
  45. package/docs/webapi/closeCurrentTab.mustache +6 -4
  46. package/docs/webapi/closeOtherTabs.mustache +6 -4
  47. package/docs/webapi/dontSee.mustache +1 -0
  48. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -0
  49. package/docs/webapi/dontSeeCookie.mustache +2 -1
  50. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +2 -1
  51. package/docs/webapi/dontSeeElement.mustache +2 -1
  52. package/docs/webapi/dontSeeElementInDOM.mustache +2 -1
  53. package/docs/webapi/dontSeeInCurrentUrl.mustache +2 -1
  54. package/docs/webapi/dontSeeInField.mustache +2 -1
  55. package/docs/webapi/dontSeeInSource.mustache +1 -0
  56. package/docs/webapi/dontSeeInTitle.mustache +2 -1
  57. package/docs/webapi/doubleClick.mustache +1 -0
  58. package/docs/webapi/downloadFile.mustache +2 -1
  59. package/docs/webapi/dragAndDrop.mustache +1 -0
  60. package/docs/webapi/dragSlider.mustache +2 -1
  61. package/docs/webapi/fillField.mustache +1 -0
  62. package/docs/webapi/forceClick.mustache +1 -0
  63. package/docs/webapi/forceRightClick.mustache +1 -0
  64. package/docs/webapi/grabDataFromPerformanceTiming.mustache +2 -1
  65. package/docs/webapi/moveCursorTo.mustache +1 -0
  66. package/docs/webapi/openNewTab.mustache +6 -4
  67. package/docs/webapi/pressKey.mustache +2 -1
  68. package/docs/webapi/pressKeyDown.mustache +1 -0
  69. package/docs/webapi/pressKeyUp.mustache +1 -0
  70. package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -0
  71. package/docs/webapi/refreshPage.mustache +1 -0
  72. package/docs/webapi/resizeWindow.mustache +2 -1
  73. package/docs/webapi/rightClick.mustache +1 -0
  74. package/docs/webapi/saveElementScreenshot.mustache +1 -0
  75. package/docs/webapi/saveScreenshot.mustache +2 -1
  76. package/docs/webapi/say.mustache +2 -1
  77. package/docs/webapi/scrollIntoView.mustache +1 -0
  78. package/docs/webapi/scrollPageToBottom.mustache +1 -0
  79. package/docs/webapi/scrollPageToTop.mustache +1 -0
  80. package/docs/webapi/scrollTo.mustache +2 -1
  81. package/docs/webapi/see.mustache +2 -1
  82. package/docs/webapi/seeAttributesOnElements.mustache +2 -1
  83. package/docs/webapi/seeCheckboxIsChecked.mustache +1 -0
  84. package/docs/webapi/seeCookie.mustache +1 -0
  85. package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -1
  86. package/docs/webapi/seeCurrentUrlEquals.mustache +2 -1
  87. package/docs/webapi/seeElement.mustache +2 -1
  88. package/docs/webapi/seeElementInDOM.mustache +1 -0
  89. package/docs/webapi/seeInCurrentUrl.mustache +2 -1
  90. package/docs/webapi/seeInField.mustache +1 -0
  91. package/docs/webapi/seeInPopup.mustache +1 -0
  92. package/docs/webapi/seeInSource.mustache +2 -1
  93. package/docs/webapi/seeInTitle.mustache +2 -1
  94. package/docs/webapi/seeNumberOfElements.mustache +1 -0
  95. package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -0
  96. package/docs/webapi/seeTextEquals.mustache +2 -1
  97. package/docs/webapi/seeTitleEquals.mustache +6 -5
  98. package/docs/webapi/selectOption.mustache +1 -0
  99. package/docs/webapi/setCookie.mustache +1 -0
  100. package/docs/webapi/setGeoLocation.mustache +1 -0
  101. package/docs/webapi/switchTo.mustache +2 -1
  102. package/docs/webapi/switchToNextTab.mustache +8 -7
  103. package/docs/webapi/switchToPreviousTab.mustache +8 -7
  104. package/docs/webapi/type.mustache +1 -0
  105. package/docs/webapi/uncheckOption.mustache +2 -1
  106. package/docs/webapi/wait.mustache +2 -1
  107. package/docs/webapi/waitForClickable.mustache +2 -1
  108. package/docs/webapi/waitForDetached.mustache +2 -1
  109. package/docs/webapi/waitForElement.mustache +2 -1
  110. package/docs/webapi/waitForEnabled.mustache +2 -1
  111. package/docs/webapi/waitForFunction.mustache +1 -0
  112. package/docs/webapi/waitForInvisible.mustache +2 -1
  113. package/docs/webapi/waitForText.mustache +2 -1
  114. package/docs/webapi/waitForValue.mustache +1 -0
  115. package/docs/webapi/waitForVisible.mustache +1 -0
  116. package/docs/webapi/waitInUrl.mustache +2 -1
  117. package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -1
  118. package/docs/webapi/waitToHide.mustache +2 -1
  119. package/docs/webapi/waitUrlEquals.mustache +2 -1
  120. package/lib/command/definitions.js +9 -0
  121. package/lib/command/run.js +2 -2
  122. package/lib/command/workers/runTests.js +40 -0
  123. package/lib/helper/ApiDataFactory.js +4 -3
  124. package/lib/helper/Appium.js +7 -2
  125. package/lib/helper/GraphQL.js +4 -2
  126. package/lib/helper/GraphQLDataFactory.js +3 -3
  127. package/lib/helper/JSONResponse.js +1 -1
  128. package/lib/helper/Playwright.js +49 -13
  129. package/lib/helper/REST.js +4 -1
  130. package/lib/helper/WebDriver.js +6 -0
  131. package/lib/interfaces/bdd.js +5 -0
  132. package/lib/listener/steps.js +1 -0
  133. package/lib/plugin/fakerTransform.js +1 -1
  134. package/lib/plugin/stepByStepReport.js +8 -6
  135. package/lib/workers.js +12 -0
  136. package/package.json +4 -3
  137. package/typings/types.d.ts +598 -600
@@ -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.
@@ -2583,15 +2579,19 @@ declare namespace CodeceptJS {
2583
2579
  * * `url`: base url of website to be tested
2584
2580
  * * `browser`: a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
2585
2581
  * * `show`: (optional, default: false) - show browser window.
2586
- * * `restart`: (optional, default: true) - restart browser between tests.
2582
+ * * `restart`: (optional, default: false) - restart strategy between tests. Possible values:
2583
+ * * 'context' or **false** - restarts [browser context](https://playwright.dev/docs/api/class-browsercontext) but keeps running browser. Recommended by Playwright team to keep tests isolated.
2584
+ * * 'browser' or **true** - closes browser and opens it again between tests.
2585
+ * * 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with `keepCookies` and `keepBrowserState` options. This behavior was default before CodeceptJS 3.1
2586
+ * * `timeout`: (optional, default: 1000) - [timeout](https://playwright.dev/docs/api/class-page#page-set-default-timeout) in ms of all Playwright actions .
2587
2587
  * * `disableScreenshots`: (optional, default: false) - don't save screenshot on failure.
2588
2588
  * * `emulate`: (optional, default: {}) launch browser in device emulation mode.
2589
2589
  * * `video`: (optional, default: false) enables video recording for failed tests; videos are saved into `output/videos` folder
2590
2590
  * * `trace`: (optional, default: false) record [tracing information](https://playwright.dev/docs/trace-viewer) with screenshots and snapshots.
2591
2591
  * * `fullPageScreenshots` (optional, default: false) - make full page screenshots on failure.
2592
2592
  * * `uniqueScreenshotNames`: (optional, default: false) - option to prevent screenshot override if you have scenarios with the same name in different suites.
2593
- * * `keepBrowserState`: (optional, default: false) - keep browser state between tests when `restart` is set to false.
2594
- * * `keepCookies`: (optional, default: false) - keep cookies between tests when `restart` is set to false.
2593
+ * * `keepBrowserState`: (optional, default: false) - keep browser state between tests when `restart` is set to 'session'.
2594
+ * * `keepCookies`: (optional, default: false) - keep cookies between tests when `restart` is set to 'session'.
2595
2595
  * * `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
2596
2596
  * * `waitForNavigation`: (optional, default: 'load'). When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API](https://github.com/microsoft/playwright/blob/main/docs/api.md#pagewaitfornavigationoptions).
2597
2597
  * * `pressKeyDelay`: (optional, default: '10'). Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
@@ -2599,6 +2599,7 @@ declare namespace CodeceptJS {
2599
2599
  * * `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000.
2600
2600
  * * `basicAuth`: (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
2601
2601
  * * `windowSize`: (optional) default window size. Set a dimension like `640x480`.
2602
+ * * `colorScheme`: (optional) default color scheme. Possible values: `dark` | `light` | `no-preference`.
2602
2603
  * * `userAgent`: (optional) user-agent string.
2603
2604
  * * `locale`: (optional) locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
2604
2605
  * * `manualStart`: (optional, default: false) - do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
@@ -2719,7 +2720,7 @@ declare namespace CodeceptJS {
2719
2720
  * }
2720
2721
  * ```
2721
2722
  *
2722
- * #### Example #7: Launch test with a specifc user locale
2723
+ * #### Example #7: Launch test with a specific user locale
2723
2724
  *
2724
2725
  * ```js
2725
2726
  * {
@@ -2732,6 +2733,19 @@ declare namespace CodeceptJS {
2732
2733
  * }
2733
2734
  * ```
2734
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
+ *
2735
2749
  * Note: When connecting to remote browser `show` and specific `chrome` options (e.g. `headless` or `devtools`) are ignored.
2736
2750
  *
2737
2751
  * ## Access From Helpers
@@ -2769,7 +2783,7 @@ declare namespace CodeceptJS {
2769
2783
  * @param description - used to show in logs.
2770
2784
  * @param fn - async function that executed with Playwright helper as argument
2771
2785
  */
2772
- usePlaywrightTo(description: string, fn: (...params: any[]) => any): void;
2786
+ usePlaywrightTo(description: string, fn: (...params: any[]) => any): Promise<any>;
2773
2787
  /**
2774
2788
  * Set the automatic popup response to Accept.
2775
2789
  * This must be set before a popup is triggered.
@@ -2780,13 +2794,13 @@ declare namespace CodeceptJS {
2780
2794
  * I.acceptPopup();
2781
2795
  * ```
2782
2796
  */
2783
- amAcceptingPopups(): void;
2797
+ amAcceptingPopups(): Promise<any>;
2784
2798
  /**
2785
2799
  * Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
2786
2800
  * Don't confuse popups with modal windows, as created by [various
2787
2801
  * libraries](http://jster.net/category/windows-modals-popups).
2788
2802
  */
2789
- acceptPopup(): void;
2803
+ acceptPopup(): Promise<any>;
2790
2804
  /**
2791
2805
  * Set the automatic popup response to Cancel/Dismiss.
2792
2806
  * This must be set before a popup is triggered.
@@ -2797,11 +2811,11 @@ declare namespace CodeceptJS {
2797
2811
  * I.cancelPopup();
2798
2812
  * ```
2799
2813
  */
2800
- amCancellingPopups(): void;
2814
+ amCancellingPopups(): Promise<any>;
2801
2815
  /**
2802
2816
  * Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt.
2803
2817
  */
2804
- cancelPopup(): void;
2818
+ cancelPopup(): Promise<any>;
2805
2819
  /**
2806
2820
  * Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the
2807
2821
  * given string.
@@ -2811,20 +2825,22 @@ declare namespace CodeceptJS {
2811
2825
  * ```
2812
2826
  * @param text - value to check.
2813
2827
  */
2814
- seeInPopup(text: string): void;
2828
+ seeInPopup(text: string): Promise<any>;
2815
2829
  /**
2816
2830
  * Set current page
2817
2831
  * @param page - page to set
2818
2832
  */
2819
- _setPage(page: any): void;
2833
+ _setPage(page: any): Promise<any>;
2820
2834
  /**
2821
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.
2822
2838
  */
2823
- _addPopupListener(): void;
2839
+ _addPopupListener(): Promise<any>;
2824
2840
  /**
2825
2841
  * Gets page URL including hash.
2826
2842
  */
2827
- _getPageUrl(): void;
2843
+ _getPageUrl(): Promise<any>;
2828
2844
  /**
2829
2845
  * Grab the text within the popup. If no popup is visible then it will return null
2830
2846
  *
@@ -2844,14 +2860,13 @@ declare namespace CodeceptJS {
2844
2860
  * ```
2845
2861
  * @param url - url path or global url.
2846
2862
  */
2847
- amOnPage(url: string): void;
2863
+ amOnPage(url: string): Promise<any>;
2848
2864
  /**
2849
2865
  * Resize the current window to provided width and height.
2850
2866
  * First parameter can be set to `maximize`.
2851
2867
  * @param width - width in pixels or `maximize`.
2852
2868
  * @param height - height in pixels.
2853
- *
2854
- * 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!
2855
2870
  * Playwright does not control the window of a browser so it can't adjust its real size.
2856
2871
  * It also can't maximize a window.
2857
2872
  *
@@ -2863,7 +2878,7 @@ declare namespace CodeceptJS {
2863
2878
  * { setWindowSize } = require('@codeceptjs/configure');
2864
2879
  * ````
2865
2880
  */
2866
- resizeWindow(width: number, height: number): void;
2881
+ resizeWindow(width: number, height: number): Promise<any>;
2867
2882
  /**
2868
2883
  * Set headers for all next requests
2869
2884
  *
@@ -2874,7 +2889,7 @@ declare namespace CodeceptJS {
2874
2889
  * ```
2875
2890
  * @param customHeaders - headers to set
2876
2891
  */
2877
- haveRequestHeaders(customHeaders: any): void;
2892
+ haveRequestHeaders(customHeaders: any): Promise<any>;
2878
2893
  /**
2879
2894
  * Moves cursor to element matched by locator.
2880
2895
  * Extra shift can be set with offsetX and offsetY options.
@@ -2887,7 +2902,7 @@ declare namespace CodeceptJS {
2887
2902
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
2888
2903
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
2889
2904
  */
2890
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
2905
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
2891
2906
  /**
2892
2907
  * Drag an item to a destination element.
2893
2908
  *
@@ -2896,8 +2911,16 @@ declare namespace CodeceptJS {
2896
2911
  * ```
2897
2912
  * @param srcElement - located by CSS|XPath|strict locator.
2898
2913
  * @param destElement - located by CSS|XPath|strict locator.
2914
+ * @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
2915
+ *
2916
+ * ```js
2917
+ * // specify coordinates for source position
2918
+ * I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
2919
+ * ```
2920
+ *
2921
+ * > By default option `force: true` is set
2899
2922
  */
2900
- dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
2923
+ dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString, options?: any): Promise<any>;
2901
2924
  /**
2902
2925
  * Reload the current page.
2903
2926
  *
@@ -2905,7 +2928,7 @@ declare namespace CodeceptJS {
2905
2928
  * I.refreshPage();
2906
2929
  * ```
2907
2930
  */
2908
- refreshPage(): void;
2931
+ refreshPage(): Promise<any>;
2909
2932
  /**
2910
2933
  * Scroll page to the top.
2911
2934
  *
@@ -2913,7 +2936,7 @@ declare namespace CodeceptJS {
2913
2936
  * I.scrollPageToTop();
2914
2937
  * ```
2915
2938
  */
2916
- scrollPageToTop(): void;
2939
+ scrollPageToTop(): Promise<any>;
2917
2940
  /**
2918
2941
  * Scroll page to the bottom.
2919
2942
  *
@@ -2921,7 +2944,7 @@ declare namespace CodeceptJS {
2921
2944
  * I.scrollPageToBottom();
2922
2945
  * ```
2923
2946
  */
2924
- scrollPageToBottom(): void;
2947
+ scrollPageToBottom(): Promise<any>;
2925
2948
  /**
2926
2949
  * Scrolls to element matched by locator.
2927
2950
  * Extra shift can be set with offsetX and offsetY options.
@@ -2934,7 +2957,7 @@ declare namespace CodeceptJS {
2934
2957
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
2935
2958
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
2936
2959
  */
2937
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
2960
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
2938
2961
  /**
2939
2962
  * Checks that title contains text.
2940
2963
  *
@@ -2943,7 +2966,7 @@ declare namespace CodeceptJS {
2943
2966
  * ```
2944
2967
  * @param text - text value to check.
2945
2968
  */
2946
- seeInTitle(text: string): void;
2969
+ seeInTitle(text: string): Promise<any>;
2947
2970
  /**
2948
2971
  * Retrieves a page scroll position and returns it to test.
2949
2972
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -2957,12 +2980,12 @@ declare namespace CodeceptJS {
2957
2980
  /**
2958
2981
  * Checks that title is equal to provided one.
2959
2982
  *
2960
- * ```js
2961
- * I.seeTitleEquals('Test title.');
2962
- * ```
2983
+ * ```js
2984
+ * I.seeTitleEquals('Test title.');
2985
+ * ```
2963
2986
  * @param text - value to check.
2964
2987
  */
2965
- seeTitleEquals(text: string): void;
2988
+ seeTitleEquals(text: string): Promise<any>;
2966
2989
  /**
2967
2990
  * Checks that title does not contain text.
2968
2991
  *
@@ -2971,7 +2994,7 @@ declare namespace CodeceptJS {
2971
2994
  * ```
2972
2995
  * @param text - value to check.
2973
2996
  */
2974
- dontSeeInTitle(text: string): void;
2997
+ dontSeeInTitle(text: string): Promise<any>;
2975
2998
  /**
2976
2999
  * Retrieves a page title and returns it to test.
2977
3000
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -2990,7 +3013,7 @@ declare namespace CodeceptJS {
2990
3013
  * const elements = await this.helpers['Playwright']._locate({name: 'password'});
2991
3014
  * ```
2992
3015
  */
2993
- _locate(): void;
3016
+ _locate(): Promise<any>;
2994
3017
  /**
2995
3018
  * Find a checkbox by providing human readable text:
2996
3019
  * NOTE: Assumes the checkable element exists
@@ -2999,7 +3022,7 @@ declare namespace CodeceptJS {
2999
3022
  * this.helpers['Playwright']._locateCheckable('I agree with terms and conditions').then // ...
3000
3023
  * ```
3001
3024
  */
3002
- _locateCheckable(): void;
3025
+ _locateCheckable(): Promise<any>;
3003
3026
  /**
3004
3027
  * Find a clickable element by providing human readable text:
3005
3028
  *
@@ -3007,7 +3030,7 @@ declare namespace CodeceptJS {
3007
3030
  * this.helpers['Playwright']._locateClickable('Next page').then // ...
3008
3031
  * ```
3009
3032
  */
3010
- _locateClickable(): void;
3033
+ _locateClickable(): Promise<any>;
3011
3034
  /**
3012
3035
  * Find field elements by providing human readable text:
3013
3036
  *
@@ -3015,7 +3038,7 @@ declare namespace CodeceptJS {
3015
3038
  * this.helpers['Playwright']._locateFields('Your email').then // ...
3016
3039
  * ```
3017
3040
  */
3018
- _locateFields(): void;
3041
+ _locateFields(): Promise<any>;
3019
3042
  /**
3020
3043
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab
3021
3044
  *
@@ -3024,7 +3047,7 @@ declare namespace CodeceptJS {
3024
3047
  * I.switchToNextTab(2);
3025
3048
  * ```
3026
3049
  */
3027
- switchToNextTab(num?: number): void;
3050
+ switchToNextTab(num?: number): Promise<any>;
3028
3051
  /**
3029
3052
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab
3030
3053
  *
@@ -3033,7 +3056,7 @@ declare namespace CodeceptJS {
3033
3056
  * I.switchToPreviousTab(2);
3034
3057
  * ```
3035
3058
  */
3036
- switchToPreviousTab(num?: number): void;
3059
+ switchToPreviousTab(num?: number): Promise<any>;
3037
3060
  /**
3038
3061
  * Close current tab and switches to previous.
3039
3062
  *
@@ -3041,7 +3064,7 @@ declare namespace CodeceptJS {
3041
3064
  * I.closeCurrentTab();
3042
3065
  * ```
3043
3066
  */
3044
- closeCurrentTab(): void;
3067
+ closeCurrentTab(): Promise<any>;
3045
3068
  /**
3046
3069
  * Close all tabs except for the current one.
3047
3070
  *
@@ -3049,7 +3072,7 @@ declare namespace CodeceptJS {
3049
3072
  * I.closeOtherTabs();
3050
3073
  * ```
3051
3074
  */
3052
- closeOtherTabs(): void;
3075
+ closeOtherTabs(): Promise<any>;
3053
3076
  /**
3054
3077
  * Open new tab and automatically switched to new tab
3055
3078
  *
@@ -3064,7 +3087,7 @@ declare namespace CodeceptJS {
3064
3087
  * I.openNewTab({ isMobile: true });
3065
3088
  * ```
3066
3089
  */
3067
- openNewTab(): void;
3090
+ openNewTab(): Promise<any>;
3068
3091
  /**
3069
3092
  * Grab number of open tabs.
3070
3093
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -3084,7 +3107,7 @@ declare namespace CodeceptJS {
3084
3107
  * ```
3085
3108
  * @param locator - located by CSS|XPath|strict locator.
3086
3109
  */
3087
- seeElement(locator: CodeceptJS.LocatorOrString): void;
3110
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
3088
3111
  /**
3089
3112
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
3090
3113
  *
@@ -3093,7 +3116,7 @@ declare namespace CodeceptJS {
3093
3116
  * ```
3094
3117
  * @param locator - located by CSS|XPath|Strict locator.
3095
3118
  */
3096
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
3119
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
3097
3120
  /**
3098
3121
  * Checks that a given Element is present in the DOM
3099
3122
  * Element is located by CSS or XPath.
@@ -3103,7 +3126,7 @@ declare namespace CodeceptJS {
3103
3126
  * ```
3104
3127
  * @param locator - element located by CSS|XPath|strict locator.
3105
3128
  */
3106
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
3129
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
3107
3130
  /**
3108
3131
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
3109
3132
  *
@@ -3112,7 +3135,7 @@ declare namespace CodeceptJS {
3112
3135
  * ```
3113
3136
  * @param locator - located by CSS|XPath|Strict locator.
3114
3137
  */
3115
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
3138
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
3116
3139
  /**
3117
3140
  * Handles a file download.Aa file name is required to save the file on disk.
3118
3141
  * Files are saved to "output" directory.
@@ -3128,7 +3151,7 @@ declare namespace CodeceptJS {
3128
3151
  * ```
3129
3152
  * @param [fileName = downloads] - set filename for downloaded file
3130
3153
  */
3131
- handleDownloads(fileName?: string): void;
3154
+ handleDownloads(fileName?: string): Promise<void>;
3132
3155
  /**
3133
3156
  * Perform a click on a link or a button, given by a locator.
3134
3157
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -3153,12 +3176,23 @@ declare namespace CodeceptJS {
3153
3176
  * ```
3154
3177
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3155
3178
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3179
+ * @param [opts] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
3180
+ *
3181
+ * Examples:
3182
+ *
3183
+ * ```js
3184
+ * // click on element at position
3185
+ * I.click('canvas', '.model', { position: { x: 20, y: 40 } })
3186
+ *
3187
+ * // make ctrl-click
3188
+ * I.click('.edit', null, { modifiers: ['Ctrl'] } )
3189
+ * ```
3156
3190
  */
3157
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3191
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, opts?: any): Promise<any>;
3158
3192
  /**
3159
3193
  * Clicks link and waits for navigation (deprecated)
3160
3194
  */
3161
- clickLink(): void;
3195
+ clickLink(): Promise<any>;
3162
3196
  /**
3163
3197
  * Perform an emulated click on a link or a button, given by a locator.
3164
3198
  * Unlike normal click instead of sending native event, emulates a click with JavaScript.
@@ -3187,7 +3221,7 @@ declare namespace CodeceptJS {
3187
3221
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3188
3222
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3189
3223
  */
3190
- forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3224
+ forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3191
3225
  /**
3192
3226
  * Performs a double-click on an element matched by link|button|label|CSS or XPath.
3193
3227
  * Context can be specified as second parameter to narrow search.
@@ -3201,7 +3235,7 @@ declare namespace CodeceptJS {
3201
3235
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3202
3236
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3203
3237
  */
3204
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3238
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3205
3239
  /**
3206
3240
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
3207
3241
  *
@@ -3216,7 +3250,7 @@ declare namespace CodeceptJS {
3216
3250
  * @param locator - clickable element located by CSS|XPath|strict locator.
3217
3251
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
3218
3252
  */
3219
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3253
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3220
3254
  /**
3221
3255
  * Selects a checkbox or radio button.
3222
3256
  * Element is located by label or name or CSS or XPath.
@@ -3230,8 +3264,17 @@ declare namespace CodeceptJS {
3230
3264
  * ```
3231
3265
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
3232
3266
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
3267
+ * @returns [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
3268
+ *
3269
+ * Examples:
3270
+ *
3271
+ * ```js
3272
+ * // click on element at position
3273
+ * I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3274
+ * ```
3275
+ * > ⚠️ To avoid flakiness, option `force: true` is set by default
3233
3276
  */
3234
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3277
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3235
3278
  /**
3236
3279
  * Unselects a checkbox or radio button.
3237
3280
  * Element is located by label or name or CSS or XPath.
@@ -3245,8 +3288,17 @@ declare namespace CodeceptJS {
3245
3288
  * ```
3246
3289
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
3247
3290
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
3291
+ * @returns [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
3292
+ *
3293
+ * Examples:
3294
+ *
3295
+ * ```js
3296
+ * // click on element at position
3297
+ * I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3298
+ * ```
3299
+ * > ⚠️ To avoid flakiness, option `force: true` is set by default
3248
3300
  */
3249
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3301
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
3250
3302
  /**
3251
3303
  * Verifies that the specified checkbox is checked.
3252
3304
  *
@@ -3257,7 +3309,7 @@ declare namespace CodeceptJS {
3257
3309
  * ```
3258
3310
  * @param field - located by label|name|CSS|XPath|strict locator.
3259
3311
  */
3260
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
3312
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
3261
3313
  /**
3262
3314
  * Verifies that the specified checkbox is not checked.
3263
3315
  *
@@ -3268,7 +3320,7 @@ declare namespace CodeceptJS {
3268
3320
  * ```
3269
3321
  * @param field - located by label|name|CSS|XPath|strict locator.
3270
3322
  */
3271
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
3323
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
3272
3324
  /**
3273
3325
  * Presses a key in the browser and leaves it in a down state.
3274
3326
  *
@@ -3281,7 +3333,7 @@ declare namespace CodeceptJS {
3281
3333
  * ```
3282
3334
  * @param key - name of key to press down.
3283
3335
  */
3284
- pressKeyDown(key: string): void;
3336
+ pressKeyDown(key: string): Promise<any>;
3285
3337
  /**
3286
3338
  * Releases a key in the browser which was previously set to a down state.
3287
3339
  *
@@ -3294,7 +3346,7 @@ declare namespace CodeceptJS {
3294
3346
  * ```
3295
3347
  * @param key - name of key to release.
3296
3348
  */
3297
- pressKeyUp(key: string): void;
3349
+ pressKeyUp(key: string): Promise<any>;
3298
3350
  /**
3299
3351
  * Presses a key in the browser (on a focused element).
3300
3352
  *
@@ -3354,11 +3406,9 @@ declare namespace CodeceptJS {
3354
3406
  * - `'Space'`
3355
3407
  * - `'Tab'`
3356
3408
  * @param key - key or array of keys to press.
3357
- *
3358
- *
3359
- * _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)).
3360
3410
  */
3361
- pressKey(key: string | string[]): void;
3411
+ pressKey(key: string | string[]): Promise<any>;
3362
3412
  /**
3363
3413
  * Types out the given text into an active field.
3364
3414
  * To slow down typing use a second parameter, to set interval between key presses.
@@ -3377,7 +3427,7 @@ declare namespace CodeceptJS {
3377
3427
  * @param key - or array of keys to type.
3378
3428
  * @param [delay = null] - (optional) delay in ms between key presses
3379
3429
  */
3380
- type(key: string | string[], delay?: number): void;
3430
+ type(key: string | string[], delay?: number): Promise<any>;
3381
3431
  /**
3382
3432
  * Fills a text field or textarea, after clearing its value, with the given string.
3383
3433
  * Field is located by name, label, CSS, or XPath.
@@ -3395,7 +3445,7 @@ declare namespace CodeceptJS {
3395
3445
  * @param field - located by label|name|CSS|XPath|strict locator.
3396
3446
  * @param value - text value to fill.
3397
3447
  */
3398
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
3448
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
3399
3449
  /**
3400
3450
  * Clears a `<textarea>` or text `<input>` element's value.
3401
3451
  *
@@ -3406,7 +3456,7 @@ declare namespace CodeceptJS {
3406
3456
  * ```
3407
3457
  * @param editable - field located by label|name|CSS|XPath|strict locator.
3408
3458
  */
3409
- clearField(editable: LocatorOrString): void;
3459
+ clearField(editable: LocatorOrString): Promise<any>;
3410
3460
  /**
3411
3461
  * Appends text to a input field or textarea.
3412
3462
  * Field is located by name, label, CSS or XPath
@@ -3417,7 +3467,7 @@ declare namespace CodeceptJS {
3417
3467
  * @param field - located by label|name|CSS|XPath|strict locator
3418
3468
  * @param value - text value to append.
3419
3469
  */
3420
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
3470
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
3421
3471
  /**
3422
3472
  * Checks that the given input field or textarea equals to given value.
3423
3473
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -3431,7 +3481,7 @@ declare namespace CodeceptJS {
3431
3481
  * @param field - located by label|name|CSS|XPath|strict locator.
3432
3482
  * @param value - value to check.
3433
3483
  */
3434
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
3484
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
3435
3485
  /**
3436
3486
  * Checks that value of input field or textarea doesn't equal to given value
3437
3487
  * Opposite to `seeInField`.
@@ -3443,7 +3493,7 @@ declare namespace CodeceptJS {
3443
3493
  * @param field - located by label|name|CSS|XPath|strict locator.
3444
3494
  * @param value - value to check.
3445
3495
  */
3446
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
3496
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
3447
3497
  /**
3448
3498
  * Attaches a file to element located by label, name, CSS or XPath
3449
3499
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -3456,7 +3506,7 @@ declare namespace CodeceptJS {
3456
3506
  * @param locator - field located by label|name|CSS|XPath|strict locator.
3457
3507
  * @param pathToFile - local file path relative to codecept.json config file.
3458
3508
  */
3459
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
3509
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
3460
3510
  /**
3461
3511
  * Selects an option in a drop-down select.
3462
3512
  * Field is searched by label | name | CSS | XPath.
@@ -3479,7 +3529,7 @@ declare namespace CodeceptJS {
3479
3529
  * @param select - field located by label|name|CSS|XPath|strict locator.
3480
3530
  * @param option - visible text or value of option.
3481
3531
  */
3482
- selectOption(select: LocatorOrString, option: string | any[]): void;
3532
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
3483
3533
  /**
3484
3534
  * Grab number of visible elements by locator.
3485
3535
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -3499,12 +3549,12 @@ declare namespace CodeceptJS {
3499
3549
  * ```
3500
3550
  * @param url - a fragment to check
3501
3551
  */
3502
- seeInCurrentUrl(url: string): void;
3552
+ seeInCurrentUrl(url: string): Promise<any>;
3503
3553
  /**
3504
3554
  * Checks that current url does not contain a provided fragment.
3505
3555
  * @param url - value to check.
3506
3556
  */
3507
- dontSeeInCurrentUrl(url: string): void;
3557
+ dontSeeInCurrentUrl(url: string): Promise<any>;
3508
3558
  /**
3509
3559
  * Checks that current url is equal to provided one.
3510
3560
  * If a relative url provided, a configured url will be prepended to it.
@@ -3516,7 +3566,7 @@ declare namespace CodeceptJS {
3516
3566
  * ```
3517
3567
  * @param url - value to check.
3518
3568
  */
3519
- seeCurrentUrlEquals(url: string): void;
3569
+ seeCurrentUrlEquals(url: string): Promise<any>;
3520
3570
  /**
3521
3571
  * Checks that current url is not equal to provided one.
3522
3572
  * If a relative url provided, a configured url will be prepended to it.
@@ -3527,7 +3577,7 @@ declare namespace CodeceptJS {
3527
3577
  * ```
3528
3578
  * @param url - value to check.
3529
3579
  */
3530
- dontSeeCurrentUrlEquals(url: string): void;
3580
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
3531
3581
  /**
3532
3582
  * Checks that a page contains a visible text.
3533
3583
  * Use context parameter to narrow down the search.
@@ -3540,7 +3590,7 @@ declare namespace CodeceptJS {
3540
3590
  * @param text - expected on page.
3541
3591
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
3542
3592
  */
3543
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
3593
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
3544
3594
  /**
3545
3595
  * Checks that text is equal to provided one.
3546
3596
  *
@@ -3550,7 +3600,7 @@ declare namespace CodeceptJS {
3550
3600
  * @param text - element value to check.
3551
3601
  * @param [context = null] - element located by CSS|XPath|strict locator.
3552
3602
  */
3553
- seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): void;
3603
+ seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
3554
3604
  /**
3555
3605
  * Opposite to `see`. Checks that a text is not present on a page.
3556
3606
  * Use context parameter to narrow down the search.
@@ -3562,7 +3612,7 @@ declare namespace CodeceptJS {
3562
3612
  * @param text - which is not present.
3563
3613
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
3564
3614
  */
3565
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
3615
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
3566
3616
  /**
3567
3617
  * Retrieves page source and returns it to test.
3568
3618
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -3601,7 +3651,7 @@ declare namespace CodeceptJS {
3601
3651
  * ```
3602
3652
  * @param text - value to check.
3603
3653
  */
3604
- seeInSource(text: string): void;
3654
+ seeInSource(text: string): Promise<any>;
3605
3655
  /**
3606
3656
  * Checks that the current page does not contains the given string in its raw source code.
3607
3657
  *
@@ -3610,7 +3660,7 @@ declare namespace CodeceptJS {
3610
3660
  * ```
3611
3661
  * @param value - to check.
3612
3662
  */
3613
- dontSeeInSource(value: string): void;
3663
+ dontSeeInSource(value: string): Promise<any>;
3614
3664
  /**
3615
3665
  * Asserts that an element appears a given number of times in the DOM.
3616
3666
  * Element is located by label or name or CSS or XPath.
@@ -3622,7 +3672,7 @@ declare namespace CodeceptJS {
3622
3672
  * @param locator - element located by CSS|XPath|strict locator.
3623
3673
  * @param num - number of elements.
3624
3674
  */
3625
- seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): void;
3675
+ seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
3626
3676
  /**
3627
3677
  * Asserts that an element is visible a given number of times.
3628
3678
  * Element is located by CSS or XPath.
@@ -3633,7 +3683,7 @@ declare namespace CodeceptJS {
3633
3683
  * @param locator - element located by CSS|XPath|strict locator.
3634
3684
  * @param num - number of elements.
3635
3685
  */
3636
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
3686
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
3637
3687
  /**
3638
3688
  * Sets cookie(s).
3639
3689
  *
@@ -3650,7 +3700,7 @@ declare namespace CodeceptJS {
3650
3700
  * ```
3651
3701
  * @param cookie - a cookie object or array of cookie objects.
3652
3702
  */
3653
- setCookie(cookie: Cookie | Cookie[]): void;
3703
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
3654
3704
  /**
3655
3705
  * Checks that cookie with given name exists.
3656
3706
  *
@@ -3659,7 +3709,7 @@ declare namespace CodeceptJS {
3659
3709
  * ```
3660
3710
  * @param name - cookie name.
3661
3711
  */
3662
- seeCookie(name: string): void;
3712
+ seeCookie(name: string): Promise<any>;
3663
3713
  /**
3664
3714
  * Checks that cookie with given name does not exist.
3665
3715
  *
@@ -3668,7 +3718,7 @@ declare namespace CodeceptJS {
3668
3718
  * ```
3669
3719
  * @param name - cookie name.
3670
3720
  */
3671
- dontSeeCookie(name: string): void;
3721
+ dontSeeCookie(name: string): Promise<any>;
3672
3722
  /**
3673
3723
  * Gets a cookie object by name.
3674
3724
  * If none provided gets all cookies.
@@ -3695,7 +3745,7 @@ declare namespace CodeceptJS {
3695
3745
  * ```
3696
3746
  * @param [cookie = null] - (optional, `null` by default) cookie name
3697
3747
  */
3698
- clearCookie(cookie?: string): void;
3748
+ clearCookie(cookie?: string): Promise<any>;
3699
3749
  /**
3700
3750
  * Executes a script on the page:
3701
3751
  *
@@ -3826,7 +3876,7 @@ declare namespace CodeceptJS {
3826
3876
  * @param locator - located by CSS|XPath|strict locator.
3827
3877
  * @param cssProperties - object with CSS properties and their values to check.
3828
3878
  */
3829
- seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): void;
3879
+ seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
3830
3880
  /**
3831
3881
  * Checks that all elements with given locator have given attributes.
3832
3882
  *
@@ -3836,7 +3886,7 @@ declare namespace CodeceptJS {
3836
3886
  * @param locator - located by CSS|XPath|strict locator.
3837
3887
  * @param attributes - attributes and their values to check.
3838
3888
  */
3839
- seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): void;
3889
+ seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
3840
3890
  /**
3841
3891
  * Drag the scrubber of a slider to a given position
3842
3892
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -3848,7 +3898,7 @@ declare namespace CodeceptJS {
3848
3898
  * @param locator - located by label|name|CSS|XPath|strict locator.
3849
3899
  * @param offsetX - position to drag.
3850
3900
  */
3851
- dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): void;
3901
+ dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): Promise<any>;
3852
3902
  /**
3853
3903
  * Retrieves an attribute from an element located by CSS or XPath and returns it to test.
3854
3904
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -3884,7 +3934,7 @@ declare namespace CodeceptJS {
3884
3934
  * @param locator - element located by CSS|XPath|strict locator.
3885
3935
  * @param fileName - file name to save.
3886
3936
  */
3887
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
3937
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
3888
3938
  /**
3889
3939
  * Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
3890
3940
  * Filename is relative to output folder.
@@ -3897,7 +3947,7 @@ declare namespace CodeceptJS {
3897
3947
  * @param fileName - file name to save.
3898
3948
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
3899
3949
  */
3900
- saveScreenshot(fileName: string, fullPage?: boolean): void;
3950
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
3901
3951
  /**
3902
3952
  * Performs [api request](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get) using
3903
3953
  * the cookies from the current browser session.
@@ -3923,14 +3973,14 @@ declare namespace CodeceptJS {
3923
3973
  * ```
3924
3974
  * @param sec - number of second to wait.
3925
3975
  */
3926
- wait(sec: number): void;
3976
+ wait(sec: number): Promise<any>;
3927
3977
  /**
3928
3978
  * Waits for element to become enabled (by default waits for 1sec).
3929
3979
  * Element can be located by CSS or XPath.
3930
3980
  * @param locator - element located by CSS|XPath|strict locator.
3931
3981
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
3932
3982
  */
3933
- waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): void;
3983
+ waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
3934
3984
  /**
3935
3985
  * Waits for the specified value to be in value attribute.
3936
3986
  *
@@ -3941,7 +3991,7 @@ declare namespace CodeceptJS {
3941
3991
  * @param value - expected value.
3942
3992
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
3943
3993
  */
3944
- waitForValue(field: LocatorOrString, value: string, sec?: number): void;
3994
+ waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
3945
3995
  /**
3946
3996
  * Waits for a specified number of elements on the page.
3947
3997
  *
@@ -3952,7 +4002,7 @@ declare namespace CodeceptJS {
3952
4002
  * @param num - number of elements.
3953
4003
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
3954
4004
  */
3955
- waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): void;
4005
+ waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
3956
4006
  /**
3957
4007
  * Waits for element to be clickable (by default waits for 1sec).
3958
4008
  * Element can be located by CSS or XPath.
@@ -3964,7 +4014,7 @@ declare namespace CodeceptJS {
3964
4014
  * @param locator - element located by CSS|XPath|strict locator.
3965
4015
  * @param [sec] - (optional, `1` by default) time in seconds to wait
3966
4016
  */
3967
- waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4017
+ waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
3968
4018
  /**
3969
4019
  * Waits for element to be present on page (by default waits for 1sec).
3970
4020
  * Element can be located by CSS or XPath.
@@ -3976,7 +4026,7 @@ declare namespace CodeceptJS {
3976
4026
  * @param locator - element located by CSS|XPath|strict locator.
3977
4027
  * @param [sec] - (optional, `1` by default) time in seconds to wait
3978
4028
  */
3979
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4029
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
3980
4030
  /**
3981
4031
  * Waits for an element to become visible on a page (by default waits for 1sec).
3982
4032
  * Element can be located by CSS or XPath.
@@ -3986,11 +4036,9 @@ declare namespace CodeceptJS {
3986
4036
  * ```
3987
4037
  * @param locator - element located by CSS|XPath|strict locator.
3988
4038
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
3989
- *
3990
- *
3991
- * This method accepts [React selectors](https://codecept.io/react).
4039
+ * @returns This method accepts [React selectors](https://codecept.io/react).
3992
4040
  */
3993
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4041
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
3994
4042
  /**
3995
4043
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
3996
4044
  * Element can be located by CSS or XPath.
@@ -4001,7 +4049,7 @@ declare namespace CodeceptJS {
4001
4049
  * @param locator - element located by CSS|XPath|strict locator.
4002
4050
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4003
4051
  */
4004
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4052
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4005
4053
  /**
4006
4054
  * Waits for an element to hide (by default waits for 1sec).
4007
4055
  * Element can be located by CSS or XPath.
@@ -4012,7 +4060,7 @@ declare namespace CodeceptJS {
4012
4060
  * @param locator - element located by CSS|XPath|strict locator.
4013
4061
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4014
4062
  */
4015
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4063
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4016
4064
  /**
4017
4065
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
4018
4066
  *
@@ -4022,7 +4070,7 @@ declare namespace CodeceptJS {
4022
4070
  * @param urlPart - value to check.
4023
4071
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4024
4072
  */
4025
- waitInUrl(urlPart: string, sec?: number): void;
4073
+ waitInUrl(urlPart: string, sec?: number): Promise<any>;
4026
4074
  /**
4027
4075
  * Waits for the entire URL to match the expected
4028
4076
  *
@@ -4033,7 +4081,7 @@ declare namespace CodeceptJS {
4033
4081
  * @param urlPart - value to check.
4034
4082
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4035
4083
  */
4036
- waitUrlEquals(urlPart: string, sec?: number): void;
4084
+ waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
4037
4085
  /**
4038
4086
  * Waits for a text to appear (by default waits for 1sec).
4039
4087
  * Element can be located by CSS or XPath.
@@ -4047,7 +4095,7 @@ declare namespace CodeceptJS {
4047
4095
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4048
4096
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
4049
4097
  */
4050
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
4098
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
4051
4099
  /**
4052
4100
  * Waits for a network request.
4053
4101
  *
@@ -4057,7 +4105,7 @@ declare namespace CodeceptJS {
4057
4105
  * ```
4058
4106
  * @param [sec = null] - seconds to wait
4059
4107
  */
4060
- waitForRequest(urlOrPredicate: string | ((...params: any[]) => any), sec?: number): void;
4108
+ waitForRequest(urlOrPredicate: string | ((...params: any[]) => any), sec?: number): Promise<any>;
4061
4109
  /**
4062
4110
  * Waits for a network response.
4063
4111
  *
@@ -4067,7 +4115,7 @@ declare namespace CodeceptJS {
4067
4115
  * ```
4068
4116
  * @param [sec = null] - number of seconds to wait
4069
4117
  */
4070
- waitForResponse(urlOrPredicate: string | ((...params: any[]) => any), sec?: number): void;
4118
+ waitForResponse(urlOrPredicate: string | ((...params: any[]) => any), sec?: number): Promise<any>;
4071
4119
  /**
4072
4120
  * Switches frame or in case of null locator reverts to parent.
4073
4121
  *
@@ -4077,7 +4125,7 @@ declare namespace CodeceptJS {
4077
4125
  * ```
4078
4126
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
4079
4127
  */
4080
- switchTo(locator?: CodeceptJS.LocatorOrString): void;
4128
+ switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
4081
4129
  /**
4082
4130
  * Waits for a function to return true (waits for 1 sec by default).
4083
4131
  * Running in browser context.
@@ -4095,13 +4143,13 @@ declare namespace CodeceptJS {
4095
4143
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
4096
4144
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
4097
4145
  */
4098
- 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>;
4099
4147
  /**
4100
4148
  * Waits for navigation to finish. By default takes configured `waitForNavigation` option.
4101
4149
  *
4102
4150
  * See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions)
4103
4151
  */
4104
- waitForNavigation(opts: any): void;
4152
+ waitForNavigation(opts: any): Promise<any>;
4105
4153
  /**
4106
4154
  * Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
4107
4155
  * Element can be located by CSS or XPath.
@@ -4112,7 +4160,7 @@ declare namespace CodeceptJS {
4112
4160
  * @param locator - element located by CSS|XPath|strict locator.
4113
4161
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4114
4162
  */
4115
- waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4163
+ waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4116
4164
  /**
4117
4165
  * Grab the data from performance timing using Navigation Timing API.
4118
4166
  * The returned data will contain following things in ms:
@@ -4134,7 +4182,7 @@ declare namespace CodeceptJS {
4134
4182
  * }
4135
4183
  * ```
4136
4184
  */
4137
- grabDataFromPerformanceTiming(): void;
4185
+ grabDataFromPerformanceTiming(): Promise<any>;
4138
4186
  /**
4139
4187
  * Grab the width, height, location of given locator.
4140
4188
  * Provide `width` or `height`as second param to get your desired prop.
@@ -4168,7 +4216,7 @@ declare namespace CodeceptJS {
4168
4216
  * @param [url] - URL, regex or pattern for to match URL
4169
4217
  * @param [handler] - a function to process request
4170
4218
  */
4171
- mockRoute(url?: string, handler?: (...params: any[]) => any): void;
4219
+ mockRoute(url?: string | RegExp, handler?: (...params: any[]) => any): Promise<any>;
4172
4220
  /**
4173
4221
  * Stops network mocking created by `mockRoute`.
4174
4222
  *
@@ -4180,7 +4228,7 @@ declare namespace CodeceptJS {
4180
4228
  * @param [url] - URL, regex or pattern for to match URL
4181
4229
  * @param [handler] - a function to process request
4182
4230
  */
4183
- stopMockingRoute(url?: string, handler?: (...params: any[]) => any): void;
4231
+ stopMockingRoute(url?: string | RegExp, handler?: (...params: any[]) => any): Promise<any>;
4184
4232
  }
4185
4233
  /**
4186
4234
  * This helper works the same as MockRequest helper. It has been included for backwards compatibility
@@ -4384,7 +4432,7 @@ declare namespace CodeceptJS {
4384
4432
  * ```
4385
4433
  * @param url - url path or global url.
4386
4434
  */
4387
- amOnPage(url: string): void;
4435
+ amOnPage(url: string): Promise<any>;
4388
4436
  /**
4389
4437
  * Perform a click on a link or a button, given by a locator.
4390
4438
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -4410,7 +4458,7 @@ declare namespace CodeceptJS {
4410
4458
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
4411
4459
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
4412
4460
  */
4413
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
4461
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
4414
4462
  /**
4415
4463
  * Performs a double-click on an element matched by link|button|label|CSS or XPath.
4416
4464
  * Context can be specified as second parameter to narrow search.
@@ -4424,7 +4472,7 @@ declare namespace CodeceptJS {
4424
4472
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
4425
4473
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
4426
4474
  */
4427
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
4475
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4428
4476
  /**
4429
4477
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
4430
4478
  *
@@ -4439,7 +4487,7 @@ declare namespace CodeceptJS {
4439
4487
  * @param locator - clickable element located by CSS|XPath|strict locator.
4440
4488
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
4441
4489
  */
4442
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
4490
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4443
4491
  /**
4444
4492
  * Moves cursor to element matched by locator.
4445
4493
  * Extra shift can be set with offsetX and offsetY options.
@@ -4452,7 +4500,7 @@ declare namespace CodeceptJS {
4452
4500
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
4453
4501
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
4454
4502
  */
4455
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
4503
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
4456
4504
  /**
4457
4505
  * Checks that a page contains a visible text.
4458
4506
  * Use context parameter to narrow down the search.
@@ -4465,7 +4513,7 @@ declare namespace CodeceptJS {
4465
4513
  * @param text - expected on page.
4466
4514
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
4467
4515
  */
4468
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
4516
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
4469
4517
  /**
4470
4518
  * Checks that text is equal to provided one.
4471
4519
  *
@@ -4475,7 +4523,7 @@ declare namespace CodeceptJS {
4475
4523
  * @param text - element value to check.
4476
4524
  * @param [context = null] - element located by CSS|XPath|strict locator.
4477
4525
  */
4478
- seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): void;
4526
+ seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
4479
4527
  /**
4480
4528
  * Opposite to `see`. Checks that a text is not present on a page.
4481
4529
  * Use context parameter to narrow down the search.
@@ -4487,7 +4535,7 @@ declare namespace CodeceptJS {
4487
4535
  * @param text - which is not present.
4488
4536
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
4489
4537
  */
4490
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
4538
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
4491
4539
  /**
4492
4540
  * Get JS log from browser. Log buffer is reset after each request.
4493
4541
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -4532,7 +4580,7 @@ declare namespace CodeceptJS {
4532
4580
  * @param select - field located by label|name|CSS|XPath|strict locator.
4533
4581
  * @param option - visible text or value of option.
4534
4582
  */
4535
- selectOption(select: LocatorOrString, option: string | any[]): void;
4583
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
4536
4584
  /**
4537
4585
  * Fills a text field or textarea, after clearing its value, with the given string.
4538
4586
  * Field is located by name, label, CSS, or XPath.
@@ -4550,7 +4598,7 @@ declare namespace CodeceptJS {
4550
4598
  * @param field - located by label|name|CSS|XPath|strict locator.
4551
4599
  * @param value - text value to fill.
4552
4600
  */
4553
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
4601
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
4554
4602
  /**
4555
4603
  * Presses a key on a focused element.
4556
4604
  * Special keys like 'Enter', 'Control', [etc](https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value)
@@ -4562,9 +4610,9 @@ declare namespace CodeceptJS {
4562
4610
  * I.pressKey(['Control','a']);
4563
4611
  * ```
4564
4612
  * @param key - key or array of keys to press.
4565
- * {{ keys }}
4613
+ * @returns {{ keys }}
4566
4614
  */
4567
- pressKey(key: string | string[]): void;
4615
+ pressKey(key: string | string[]): Promise<any>;
4568
4616
  /**
4569
4617
  * Attaches a file to element located by label, name, CSS or XPath
4570
4618
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -4577,7 +4625,7 @@ declare namespace CodeceptJS {
4577
4625
  * @param locator - field located by label|name|CSS|XPath|strict locator.
4578
4626
  * @param pathToFile - local file path relative to codecept.json config file.
4579
4627
  */
4580
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
4628
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
4581
4629
  /**
4582
4630
  * Checks that the given input field or textarea equals to given value.
4583
4631
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -4591,7 +4639,7 @@ declare namespace CodeceptJS {
4591
4639
  * @param field - located by label|name|CSS|XPath|strict locator.
4592
4640
  * @param value - value to check.
4593
4641
  */
4594
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
4642
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
4595
4643
  /**
4596
4644
  * Checks that value of input field or textarea doesn't equal to given value
4597
4645
  * Opposite to `seeInField`.
@@ -4603,7 +4651,7 @@ declare namespace CodeceptJS {
4603
4651
  * @param field - located by label|name|CSS|XPath|strict locator.
4604
4652
  * @param value - value to check.
4605
4653
  */
4606
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
4654
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
4607
4655
  /**
4608
4656
  * Appends text to a input field or textarea.
4609
4657
  * Field is located by name, label, CSS or XPath
@@ -4614,7 +4662,7 @@ declare namespace CodeceptJS {
4614
4662
  * @param field - located by label|name|CSS|XPath|strict locator
4615
4663
  * @param value - text value to append.
4616
4664
  */
4617
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
4665
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
4618
4666
  /**
4619
4667
  * Clears a `<textarea>` or text `<input>` element's value.
4620
4668
  *
@@ -4625,7 +4673,7 @@ declare namespace CodeceptJS {
4625
4673
  * ```
4626
4674
  * @param editable - field located by label|name|CSS|XPath|strict locator.
4627
4675
  */
4628
- clearField(editable: LocatorOrString): void;
4676
+ clearField(editable: LocatorOrString): Promise<any>;
4629
4677
  /**
4630
4678
  * Selects a checkbox or radio button.
4631
4679
  * Element is located by label or name or CSS or XPath.
@@ -4640,7 +4688,7 @@ declare namespace CodeceptJS {
4640
4688
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
4641
4689
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
4642
4690
  */
4643
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
4691
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4644
4692
  /**
4645
4693
  * Unselects a checkbox or radio button.
4646
4694
  * Element is located by label or name or CSS or XPath.
@@ -4655,7 +4703,7 @@ declare namespace CodeceptJS {
4655
4703
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
4656
4704
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
4657
4705
  */
4658
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
4706
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
4659
4707
  /**
4660
4708
  * Verifies that the specified checkbox is checked.
4661
4709
  *
@@ -4666,7 +4714,7 @@ declare namespace CodeceptJS {
4666
4714
  * ```
4667
4715
  * @param field - located by label|name|CSS|XPath|strict locator.
4668
4716
  */
4669
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
4717
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
4670
4718
  /**
4671
4719
  * Verifies that the specified checkbox is not checked.
4672
4720
  *
@@ -4677,7 +4725,7 @@ declare namespace CodeceptJS {
4677
4725
  * ```
4678
4726
  * @param field - located by label|name|CSS|XPath|strict locator.
4679
4727
  */
4680
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
4728
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
4681
4729
  /**
4682
4730
  * Retrieves all texts from an element located by CSS or XPath and returns it to test.
4683
4731
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -4805,16 +4853,16 @@ declare namespace CodeceptJS {
4805
4853
  * ```
4806
4854
  * @param text - text value to check.
4807
4855
  */
4808
- seeInTitle(text: string): void;
4856
+ seeInTitle(text: string): Promise<any>;
4809
4857
  /**
4810
4858
  * Checks that title is equal to provided one.
4811
4859
  *
4812
- * ```js
4813
- * I.seeTitleEquals('Test title.');
4814
- * ```
4860
+ * ```js
4861
+ * I.seeTitleEquals('Test title.');
4862
+ * ```
4815
4863
  * @param text - value to check.
4816
4864
  */
4817
- seeTitleEquals(text: string): void;
4865
+ seeTitleEquals(text: string): Promise<any>;
4818
4866
  /**
4819
4867
  * Checks that title does not contain text.
4820
4868
  *
@@ -4823,7 +4871,7 @@ declare namespace CodeceptJS {
4823
4871
  * ```
4824
4872
  * @param text - value to check.
4825
4873
  */
4826
- dontSeeInTitle(text: string): void;
4874
+ dontSeeInTitle(text: string): Promise<any>;
4827
4875
  /**
4828
4876
  * Retrieves a page title and returns it to test.
4829
4877
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -4843,7 +4891,7 @@ declare namespace CodeceptJS {
4843
4891
  * ```
4844
4892
  * @param locator - located by CSS|XPath|strict locator.
4845
4893
  */
4846
- seeElement(locator: CodeceptJS.LocatorOrString): void;
4894
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
4847
4895
  /**
4848
4896
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
4849
4897
  *
@@ -4852,7 +4900,7 @@ declare namespace CodeceptJS {
4852
4900
  * ```
4853
4901
  * @param locator - located by CSS|XPath|Strict locator.
4854
4902
  */
4855
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
4903
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
4856
4904
  /**
4857
4905
  * Checks that a given Element is present in the DOM
4858
4906
  * Element is located by CSS or XPath.
@@ -4862,7 +4910,7 @@ declare namespace CodeceptJS {
4862
4910
  * ```
4863
4911
  * @param locator - element located by CSS|XPath|strict locator.
4864
4912
  */
4865
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
4913
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
4866
4914
  /**
4867
4915
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
4868
4916
  *
@@ -4871,7 +4919,7 @@ declare namespace CodeceptJS {
4871
4919
  * ```
4872
4920
  * @param locator - located by CSS|XPath|Strict locator.
4873
4921
  */
4874
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
4922
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
4875
4923
  /**
4876
4924
  * Checks that the current page contains the given string in its raw source code.
4877
4925
  *
@@ -4880,7 +4928,7 @@ declare namespace CodeceptJS {
4880
4928
  * ```
4881
4929
  * @param text - value to check.
4882
4930
  */
4883
- seeInSource(text: string): void;
4931
+ seeInSource(text: string): Promise<any>;
4884
4932
  /**
4885
4933
  * Retrieves page source and returns it to test.
4886
4934
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -4899,7 +4947,7 @@ declare namespace CodeceptJS {
4899
4947
  * ```
4900
4948
  * @param value - to check.
4901
4949
  */
4902
- dontSeeInSource(value: string): void;
4950
+ dontSeeInSource(value: string): Promise<any>;
4903
4951
  /**
4904
4952
  * Asserts that an element appears a given number of times in the DOM.
4905
4953
  * Element is located by label or name or CSS or XPath.
@@ -4911,7 +4959,7 @@ declare namespace CodeceptJS {
4911
4959
  * @param locator - element located by CSS|XPath|strict locator.
4912
4960
  * @param num - number of elements.
4913
4961
  */
4914
- seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): void;
4962
+ seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
4915
4963
  /**
4916
4964
  * Asserts that an element is visible a given number of times.
4917
4965
  * Element is located by CSS or XPath.
@@ -4922,7 +4970,7 @@ declare namespace CodeceptJS {
4922
4970
  * @param locator - element located by CSS|XPath|strict locator.
4923
4971
  * @param num - number of elements.
4924
4972
  */
4925
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
4973
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
4926
4974
  /**
4927
4975
  * Grab number of visible elements by locator.
4928
4976
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -4943,7 +4991,7 @@ declare namespace CodeceptJS {
4943
4991
  * @param locator - located by CSS|XPath|strict locator.
4944
4992
  * @param cssProperties - object with CSS properties and their values to check.
4945
4993
  */
4946
- seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): void;
4994
+ seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
4947
4995
  /**
4948
4996
  * Checks that all elements with given locator have given attributes.
4949
4997
  *
@@ -4953,7 +5001,7 @@ declare namespace CodeceptJS {
4953
5001
  * @param locator - located by CSS|XPath|strict locator.
4954
5002
  * @param attributes - attributes and their values to check.
4955
5003
  */
4956
- seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): void;
5004
+ seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
4957
5005
  /**
4958
5006
  * Executes sync script on a page.
4959
5007
  * Pass arguments to function as additional parameters.
@@ -5014,12 +5062,12 @@ declare namespace CodeceptJS {
5014
5062
  * ```
5015
5063
  * @param url - a fragment to check
5016
5064
  */
5017
- seeInCurrentUrl(url: string): void;
5065
+ seeInCurrentUrl(url: string): Promise<any>;
5018
5066
  /**
5019
5067
  * Checks that current url does not contain a provided fragment.
5020
5068
  * @param url - value to check.
5021
5069
  */
5022
- dontSeeInCurrentUrl(url: string): void;
5070
+ dontSeeInCurrentUrl(url: string): Promise<any>;
5023
5071
  /**
5024
5072
  * Checks that current url is equal to provided one.
5025
5073
  * If a relative url provided, a configured url will be prepended to it.
@@ -5031,7 +5079,7 @@ declare namespace CodeceptJS {
5031
5079
  * ```
5032
5080
  * @param url - value to check.
5033
5081
  */
5034
- seeCurrentUrlEquals(url: string): void;
5082
+ seeCurrentUrlEquals(url: string): Promise<any>;
5035
5083
  /**
5036
5084
  * Checks that current url is not equal to provided one.
5037
5085
  * If a relative url provided, a configured url will be prepended to it.
@@ -5042,7 +5090,7 @@ declare namespace CodeceptJS {
5042
5090
  * ```
5043
5091
  * @param url - value to check.
5044
5092
  */
5045
- dontSeeCurrentUrlEquals(url: string): void;
5093
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
5046
5094
  /**
5047
5095
  * Saves screenshot of the specified locator to ouput folder (set in codecept.json or codecept.conf.js).
5048
5096
  * Filename is relative to output folder.
@@ -5053,7 +5101,7 @@ declare namespace CodeceptJS {
5053
5101
  * @param locator - element located by CSS|XPath|strict locator.
5054
5102
  * @param fileName - file name to save.
5055
5103
  */
5056
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
5104
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
5057
5105
  /**
5058
5106
  * Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
5059
5107
  * Filename is relative to output folder.
@@ -5066,7 +5114,7 @@ declare namespace CodeceptJS {
5066
5114
  * @param fileName - file name to save.
5067
5115
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
5068
5116
  */
5069
- saveScreenshot(fileName: string, fullPage?: boolean): void;
5117
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
5070
5118
  /**
5071
5119
  * Clears a cookie by name,
5072
5120
  * if none provided clears all cookies.
@@ -5077,7 +5125,7 @@ declare namespace CodeceptJS {
5077
5125
  * ```
5078
5126
  * @param [cookie = null] - (optional, `null` by default) cookie name
5079
5127
  */
5080
- clearCookie(cookie?: string): void;
5128
+ clearCookie(cookie?: string): Promise<any>;
5081
5129
  /**
5082
5130
  * Checks that cookie with given name exists.
5083
5131
  *
@@ -5086,7 +5134,7 @@ declare namespace CodeceptJS {
5086
5134
  * ```
5087
5135
  * @param name - cookie name.
5088
5136
  */
5089
- seeCookie(name: string): void;
5137
+ seeCookie(name: string): Promise<any>;
5090
5138
  /**
5091
5139
  * Checks that cookie with given name does not exist.
5092
5140
  *
@@ -5095,7 +5143,7 @@ declare namespace CodeceptJS {
5095
5143
  * ```
5096
5144
  * @param name - cookie name.
5097
5145
  */
5098
- dontSeeCookie(name: string): void;
5146
+ dontSeeCookie(name: string): Promise<any>;
5099
5147
  /**
5100
5148
  * Gets a cookie object by name.
5101
5149
  * If none provided gets all cookies.
@@ -5131,7 +5179,7 @@ declare namespace CodeceptJS {
5131
5179
  * ```
5132
5180
  * @param text - value to check.
5133
5181
  */
5134
- seeInPopup(text: string): void;
5182
+ seeInPopup(text: string): Promise<any>;
5135
5183
  /**
5136
5184
  * Grab the text within the popup. If no popup is visible then it will return null
5137
5185
  *
@@ -5146,7 +5194,7 @@ declare namespace CodeceptJS {
5146
5194
  * @param width - width in pixels or `maximize`.
5147
5195
  * @param height - height in pixels.
5148
5196
  */
5149
- resizeWindow(width: number, height: number): void;
5197
+ resizeWindow(width: number, height: number): Promise<any>;
5150
5198
  /**
5151
5199
  * Drag an item to a destination element.
5152
5200
  *
@@ -5156,7 +5204,7 @@ declare namespace CodeceptJS {
5156
5204
  * @param srcElement - located by CSS|XPath|strict locator.
5157
5205
  * @param destElement - located by CSS|XPath|strict locator.
5158
5206
  */
5159
- dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
5207
+ dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): Promise<any>;
5160
5208
  /**
5161
5209
  * Close all tabs except for the current one.
5162
5210
  *
@@ -5223,7 +5271,7 @@ declare namespace CodeceptJS {
5223
5271
  * ```
5224
5272
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
5225
5273
  */
5226
- switchTo(locator?: CodeceptJS.LocatorOrString): void;
5274
+ switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
5227
5275
  /**
5228
5276
  * Pauses execution for a number of seconds.
5229
5277
  *
@@ -5232,7 +5280,7 @@ declare namespace CodeceptJS {
5232
5280
  * ```
5233
5281
  * @param sec - number of second to wait.
5234
5282
  */
5235
- wait(sec: number): void;
5283
+ wait(sec: number): Promise<any>;
5236
5284
  /**
5237
5285
  * Waits for element to be present on page (by default waits for 1sec).
5238
5286
  * Element can be located by CSS or XPath.
@@ -5244,7 +5292,7 @@ declare namespace CodeceptJS {
5244
5292
  * @param locator - element located by CSS|XPath|strict locator.
5245
5293
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
5246
5294
  */
5247
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5295
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5248
5296
  /**
5249
5297
  * Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
5250
5298
  * Element can be located by CSS or XPath.
@@ -5255,7 +5303,7 @@ declare namespace CodeceptJS {
5255
5303
  * @param locator - element located by CSS|XPath|strict locator.
5256
5304
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5257
5305
  */
5258
- waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5306
+ waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5259
5307
  /**
5260
5308
  * Waits for element to become clickable for number of seconds.
5261
5309
  *
@@ -5274,7 +5322,7 @@ declare namespace CodeceptJS {
5274
5322
  * @param locator - element located by CSS|XPath|strict locator.
5275
5323
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5276
5324
  */
5277
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5325
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5278
5326
  /**
5279
5327
  * Waits for an element to hide (by default waits for 1sec).
5280
5328
  * Element can be located by CSS or XPath.
@@ -5285,7 +5333,7 @@ declare namespace CodeceptJS {
5285
5333
  * @param locator - element located by CSS|XPath|strict locator.
5286
5334
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5287
5335
  */
5288
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5336
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5289
5337
  /**
5290
5338
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
5291
5339
  * Element can be located by CSS or XPath.
@@ -5296,7 +5344,7 @@ declare namespace CodeceptJS {
5296
5344
  * @param locator - element located by CSS|XPath|strict locator.
5297
5345
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5298
5346
  */
5299
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5347
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5300
5348
  /**
5301
5349
  * Waits for a specified number of elements on the page.
5302
5350
  *
@@ -5307,14 +5355,14 @@ declare namespace CodeceptJS {
5307
5355
  * @param num - number of elements.
5308
5356
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5309
5357
  */
5310
- waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): void;
5358
+ waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
5311
5359
  /**
5312
5360
  * Waits for element to become enabled (by default waits for 1sec).
5313
5361
  * Element can be located by CSS or XPath.
5314
5362
  * @param locator - element located by CSS|XPath|strict locator.
5315
5363
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
5316
5364
  */
5317
- waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): void;
5365
+ waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
5318
5366
  /**
5319
5367
  * Waits for the specified value to be in value attribute.
5320
5368
  *
@@ -5325,7 +5373,7 @@ declare namespace CodeceptJS {
5325
5373
  * @param value - expected value.
5326
5374
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5327
5375
  */
5328
- waitForValue(field: LocatorOrString, value: string, sec?: number): void;
5376
+ waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
5329
5377
  /**
5330
5378
  * Waits for a function to return true (waits for 1 sec by default).
5331
5379
  * Running in browser context.
@@ -5343,7 +5391,7 @@ declare namespace CodeceptJS {
5343
5391
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
5344
5392
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
5345
5393
  */
5346
- 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>;
5347
5395
  /**
5348
5396
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
5349
5397
  *
@@ -5353,7 +5401,7 @@ declare namespace CodeceptJS {
5353
5401
  * @param urlPart - value to check.
5354
5402
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5355
5403
  */
5356
- waitInUrl(urlPart: string, sec?: number): void;
5404
+ waitInUrl(urlPart: string, sec?: number): Promise<any>;
5357
5405
  /**
5358
5406
  * Waits for the entire URL to match the expected
5359
5407
  *
@@ -5364,7 +5412,7 @@ declare namespace CodeceptJS {
5364
5412
  * @param urlPart - value to check.
5365
5413
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5366
5414
  */
5367
- waitUrlEquals(urlPart: string, sec?: number): void;
5415
+ waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
5368
5416
  /**
5369
5417
  * Waits for a text to appear (by default waits for 1sec).
5370
5418
  * Element can be located by CSS or XPath.
@@ -5378,7 +5426,7 @@ declare namespace CodeceptJS {
5378
5426
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
5379
5427
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
5380
5428
  */
5381
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
5429
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
5382
5430
  /**
5383
5431
  * Moves to url
5384
5432
  */
@@ -5390,7 +5438,7 @@ declare namespace CodeceptJS {
5390
5438
  * I.refreshPage();
5391
5439
  * ```
5392
5440
  */
5393
- refreshPage(): void;
5441
+ refreshPage(): Promise<any>;
5394
5442
  /**
5395
5443
  * Reloads page
5396
5444
  */
@@ -5407,7 +5455,7 @@ declare namespace CodeceptJS {
5407
5455
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
5408
5456
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
5409
5457
  */
5410
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
5458
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
5411
5459
  /**
5412
5460
  * Scroll page to the top.
5413
5461
  *
@@ -5415,7 +5463,7 @@ declare namespace CodeceptJS {
5415
5463
  * I.scrollPageToTop();
5416
5464
  * ```
5417
5465
  */
5418
- scrollPageToTop(): void;
5466
+ scrollPageToTop(): Promise<any>;
5419
5467
  /**
5420
5468
  * Scroll page to the bottom.
5421
5469
  *
@@ -5423,7 +5471,7 @@ declare namespace CodeceptJS {
5423
5471
  * I.scrollPageToBottom();
5424
5472
  * ```
5425
5473
  */
5426
- scrollPageToBottom(): void;
5474
+ scrollPageToBottom(): Promise<any>;
5427
5475
  /**
5428
5476
  * Retrieves a page scroll position and returns it to test.
5429
5477
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -5469,7 +5517,7 @@ declare namespace CodeceptJS {
5469
5517
  * ```
5470
5518
  * @param cookie - a cookie object or array of cookie objects.
5471
5519
  */
5472
- setCookie(cookie: Cookie | Cookie[]): void;
5520
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
5473
5521
  }
5474
5522
  /**
5475
5523
  * Uses [Google Chrome's Puppeteer](https://github.com/GoogleChrome/puppeteer) library to run tests inside headless Chrome.
@@ -5678,7 +5726,7 @@ declare namespace CodeceptJS {
5678
5726
  * ```
5679
5727
  * @param text - value to check.
5680
5728
  */
5681
- seeInPopup(text: string): void;
5729
+ seeInPopup(text: string): Promise<any>;
5682
5730
  /**
5683
5731
  * Set current page
5684
5732
  * @param page - page to set
@@ -5711,18 +5759,17 @@ declare namespace CodeceptJS {
5711
5759
  * ```
5712
5760
  * @param url - url path or global url.
5713
5761
  */
5714
- amOnPage(url: string): void;
5762
+ amOnPage(url: string): Promise<any>;
5715
5763
  /**
5716
5764
  * Resize the current window to provided width and height.
5717
5765
  * First parameter can be set to `maximize`.
5718
5766
  * @param width - width in pixels or `maximize`.
5719
5767
  * @param height - height in pixels.
5720
- *
5721
- * 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!
5722
5769
  * Puppeteer does not control the window of a browser so it can't adjust its real size.
5723
5770
  * It also can't maximize a window.
5724
5771
  */
5725
- resizeWindow(width: number, height: number): void;
5772
+ resizeWindow(width: number, height: number): Promise<any>;
5726
5773
  /**
5727
5774
  * Set headers for all next requests
5728
5775
  *
@@ -5745,10 +5792,9 @@ declare namespace CodeceptJS {
5745
5792
  * @param locator - located by CSS|XPath|strict locator.
5746
5793
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
5747
5794
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
5748
- *
5749
- * {{ react }}
5795
+ * @returns {{ react }}
5750
5796
  */
5751
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
5797
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
5752
5798
  /**
5753
5799
  * Drag an item to a destination element.
5754
5800
  *
@@ -5758,7 +5804,7 @@ declare namespace CodeceptJS {
5758
5804
  * @param srcElement - located by CSS|XPath|strict locator.
5759
5805
  * @param destElement - located by CSS|XPath|strict locator.
5760
5806
  */
5761
- dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
5807
+ dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): Promise<any>;
5762
5808
  /**
5763
5809
  * Reload the current page.
5764
5810
  *
@@ -5766,7 +5812,7 @@ declare namespace CodeceptJS {
5766
5812
  * I.refreshPage();
5767
5813
  * ```
5768
5814
  */
5769
- refreshPage(): void;
5815
+ refreshPage(): Promise<any>;
5770
5816
  /**
5771
5817
  * Scroll page to the top.
5772
5818
  *
@@ -5774,7 +5820,7 @@ declare namespace CodeceptJS {
5774
5820
  * I.scrollPageToTop();
5775
5821
  * ```
5776
5822
  */
5777
- scrollPageToTop(): void;
5823
+ scrollPageToTop(): Promise<any>;
5778
5824
  /**
5779
5825
  * Scroll page to the bottom.
5780
5826
  *
@@ -5782,7 +5828,7 @@ declare namespace CodeceptJS {
5782
5828
  * I.scrollPageToBottom();
5783
5829
  * ```
5784
5830
  */
5785
- scrollPageToBottom(): void;
5831
+ scrollPageToBottom(): Promise<any>;
5786
5832
  /**
5787
5833
  * Scrolls to element matched by locator.
5788
5834
  * Extra shift can be set with offsetX and offsetY options.
@@ -5795,7 +5841,7 @@ declare namespace CodeceptJS {
5795
5841
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
5796
5842
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
5797
5843
  */
5798
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
5844
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
5799
5845
  /**
5800
5846
  * Checks that title contains text.
5801
5847
  *
@@ -5804,7 +5850,7 @@ declare namespace CodeceptJS {
5804
5850
  * ```
5805
5851
  * @param text - text value to check.
5806
5852
  */
5807
- seeInTitle(text: string): void;
5853
+ seeInTitle(text: string): Promise<any>;
5808
5854
  /**
5809
5855
  * Retrieves a page scroll position and returns it to test.
5810
5856
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -5818,12 +5864,12 @@ declare namespace CodeceptJS {
5818
5864
  /**
5819
5865
  * Checks that title is equal to provided one.
5820
5866
  *
5821
- * ```js
5822
- * I.seeTitleEquals('Test title.');
5823
- * ```
5867
+ * ```js
5868
+ * I.seeTitleEquals('Test title.');
5869
+ * ```
5824
5870
  * @param text - value to check.
5825
5871
  */
5826
- seeTitleEquals(text: string): void;
5872
+ seeTitleEquals(text: string): Promise<any>;
5827
5873
  /**
5828
5874
  * Checks that title does not contain text.
5829
5875
  *
@@ -5832,7 +5878,7 @@ declare namespace CodeceptJS {
5832
5878
  * ```
5833
5879
  * @param text - value to check.
5834
5880
  */
5835
- dontSeeInTitle(text: string): void;
5881
+ dontSeeInTitle(text: string): Promise<any>;
5836
5882
  /**
5837
5883
  * Retrieves a page title and returns it to test.
5838
5884
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -5939,9 +5985,9 @@ declare namespace CodeceptJS {
5939
5985
  * I.seeElement('#modal');
5940
5986
  * ```
5941
5987
  * @param locator - located by CSS|XPath|strict locator.
5942
- * {{ react }}
5988
+ * @returns {{ react }}
5943
5989
  */
5944
- seeElement(locator: CodeceptJS.LocatorOrString): void;
5990
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
5945
5991
  /**
5946
5992
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
5947
5993
  *
@@ -5949,9 +5995,9 @@ declare namespace CodeceptJS {
5949
5995
  * I.dontSeeElement('.modal'); // modal is not shown
5950
5996
  * ```
5951
5997
  * @param locator - located by CSS|XPath|Strict locator.
5952
- * {{ react }}
5998
+ * @returns {{ react }}
5953
5999
  */
5954
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
6000
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
5955
6001
  /**
5956
6002
  * Checks that a given Element is present in the DOM
5957
6003
  * Element is located by CSS or XPath.
@@ -5961,7 +6007,7 @@ declare namespace CodeceptJS {
5961
6007
  * ```
5962
6008
  * @param locator - element located by CSS|XPath|strict locator.
5963
6009
  */
5964
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
6010
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
5965
6011
  /**
5966
6012
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
5967
6013
  *
@@ -5970,7 +6016,7 @@ declare namespace CodeceptJS {
5970
6016
  * ```
5971
6017
  * @param locator - located by CSS|XPath|Strict locator.
5972
6018
  */
5973
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
6019
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
5974
6020
  /**
5975
6021
  * Perform a click on a link or a button, given by a locator.
5976
6022
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -5995,11 +6041,9 @@ declare namespace CodeceptJS {
5995
6041
  * ```
5996
6042
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
5997
6043
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
5998
- *
5999
- *
6000
- * {{ react }}
6044
+ * @returns {{ react }}
6001
6045
  */
6002
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6046
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
6003
6047
  /**
6004
6048
  * Perform an emulated click on a link or a button, given by a locator.
6005
6049
  * Unlike normal click instead of sending native event, emulates a click with JavaScript.
@@ -6027,11 +6071,9 @@ declare namespace CodeceptJS {
6027
6071
  * ```
6028
6072
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
6029
6073
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
6030
- *
6031
- *
6032
- * {{ react }}
6074
+ * @returns {{ react }}
6033
6075
  */
6034
- forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6076
+ forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6035
6077
  /**
6036
6078
  * Performs a click on a link and waits for navigation before moving on.
6037
6079
  *
@@ -6040,10 +6082,9 @@ declare namespace CodeceptJS {
6040
6082
  * ```
6041
6083
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator
6042
6084
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator
6043
- *
6044
- * {{ react }}
6085
+ * @returns {{ react }}
6045
6086
  */
6046
- clickLink(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6087
+ clickLink(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6047
6088
  /**
6048
6089
  * Sets a directory to where save files. Allows to test file downloads.
6049
6090
  * Should be used with [FileSystem helper](https://codecept.io/helpers/FileSystem) to check that file were downloaded correctly.
@@ -6079,11 +6120,9 @@ declare namespace CodeceptJS {
6079
6120
  * ```
6080
6121
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
6081
6122
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
6082
- *
6083
- *
6084
- * {{ react }}
6123
+ * @returns {{ react }}
6085
6124
  */
6086
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6125
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6087
6126
  /**
6088
6127
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
6089
6128
  *
@@ -6097,11 +6136,9 @@ declare namespace CodeceptJS {
6097
6136
  * ```
6098
6137
  * @param locator - clickable element located by CSS|XPath|strict locator.
6099
6138
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
6100
- *
6101
- *
6102
- * {{ react }}
6139
+ * @returns {{ react }}
6103
6140
  */
6104
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6141
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6105
6142
  /**
6106
6143
  * Selects a checkbox or radio button.
6107
6144
  * Element is located by label or name or CSS or XPath.
@@ -6116,7 +6153,7 @@ declare namespace CodeceptJS {
6116
6153
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
6117
6154
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
6118
6155
  */
6119
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6156
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6120
6157
  /**
6121
6158
  * Unselects a checkbox or radio button.
6122
6159
  * Element is located by label or name or CSS or XPath.
@@ -6131,7 +6168,7 @@ declare namespace CodeceptJS {
6131
6168
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
6132
6169
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
6133
6170
  */
6134
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
6171
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
6135
6172
  /**
6136
6173
  * Verifies that the specified checkbox is checked.
6137
6174
  *
@@ -6142,7 +6179,7 @@ declare namespace CodeceptJS {
6142
6179
  * ```
6143
6180
  * @param field - located by label|name|CSS|XPath|strict locator.
6144
6181
  */
6145
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
6182
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
6146
6183
  /**
6147
6184
  * Verifies that the specified checkbox is not checked.
6148
6185
  *
@@ -6153,7 +6190,7 @@ declare namespace CodeceptJS {
6153
6190
  * ```
6154
6191
  * @param field - located by label|name|CSS|XPath|strict locator.
6155
6192
  */
6156
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
6193
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
6157
6194
  /**
6158
6195
  * Presses a key in the browser and leaves it in a down state.
6159
6196
  *
@@ -6166,7 +6203,7 @@ declare namespace CodeceptJS {
6166
6203
  * ```
6167
6204
  * @param key - name of key to press down.
6168
6205
  */
6169
- pressKeyDown(key: string): void;
6206
+ pressKeyDown(key: string): Promise<any>;
6170
6207
  /**
6171
6208
  * Releases a key in the browser which was previously set to a down state.
6172
6209
  *
@@ -6179,7 +6216,7 @@ declare namespace CodeceptJS {
6179
6216
  * ```
6180
6217
  * @param key - name of key to release.
6181
6218
  */
6182
- pressKeyUp(key: string): void;
6219
+ pressKeyUp(key: string): Promise<any>;
6183
6220
  /**
6184
6221
  * Presses a key in the browser (on a focused element).
6185
6222
  *
@@ -6239,11 +6276,9 @@ declare namespace CodeceptJS {
6239
6276
  * - `'Space'`
6240
6277
  * - `'Tab'`
6241
6278
  * @param key - key or array of keys to press.
6242
- *
6243
- *
6244
- * _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)).
6245
6280
  */
6246
- pressKey(key: string | string[]): void;
6281
+ pressKey(key: string | string[]): Promise<any>;
6247
6282
  /**
6248
6283
  * Types out the given text into an active field.
6249
6284
  * To slow down typing use a second parameter, to set interval between key presses.
@@ -6262,7 +6297,7 @@ declare namespace CodeceptJS {
6262
6297
  * @param key - or array of keys to type.
6263
6298
  * @param [delay = null] - (optional) delay in ms between key presses
6264
6299
  */
6265
- type(key: string | string[], delay?: number): void;
6300
+ type(key: string | string[], delay?: number): Promise<any>;
6266
6301
  /**
6267
6302
  * Fills a text field or textarea, after clearing its value, with the given string.
6268
6303
  * Field is located by name, label, CSS, or XPath.
@@ -6279,10 +6314,9 @@ declare namespace CodeceptJS {
6279
6314
  * ```
6280
6315
  * @param field - located by label|name|CSS|XPath|strict locator.
6281
6316
  * @param value - text value to fill.
6282
- *
6283
- * {{ react }}
6317
+ * @returns {{ react }}
6284
6318
  */
6285
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
6319
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
6286
6320
  /**
6287
6321
  * Clears a `<textarea>` or text `<input>` element's value.
6288
6322
  *
@@ -6293,7 +6327,7 @@ declare namespace CodeceptJS {
6293
6327
  * ```
6294
6328
  * @param editable - field located by label|name|CSS|XPath|strict locator.
6295
6329
  */
6296
- clearField(editable: LocatorOrString): void;
6330
+ clearField(editable: LocatorOrString): Promise<any>;
6297
6331
  /**
6298
6332
  * Appends text to a input field or textarea.
6299
6333
  * Field is located by name, label, CSS or XPath
@@ -6303,10 +6337,9 @@ declare namespace CodeceptJS {
6303
6337
  * ```
6304
6338
  * @param field - located by label|name|CSS|XPath|strict locator
6305
6339
  * @param value - text value to append.
6306
- *
6307
- * {{ react }}
6340
+ * @returns {{ react }}
6308
6341
  */
6309
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
6342
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
6310
6343
  /**
6311
6344
  * Checks that the given input field or textarea equals to given value.
6312
6345
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -6320,7 +6353,7 @@ declare namespace CodeceptJS {
6320
6353
  * @param field - located by label|name|CSS|XPath|strict locator.
6321
6354
  * @param value - value to check.
6322
6355
  */
6323
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
6356
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
6324
6357
  /**
6325
6358
  * Checks that value of input field or textarea doesn't equal to given value
6326
6359
  * Opposite to `seeInField`.
@@ -6332,7 +6365,7 @@ declare namespace CodeceptJS {
6332
6365
  * @param field - located by label|name|CSS|XPath|strict locator.
6333
6366
  * @param value - value to check.
6334
6367
  */
6335
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
6368
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
6336
6369
  /**
6337
6370
  * Attaches a file to element located by label, name, CSS or XPath
6338
6371
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -6344,10 +6377,9 @@ declare namespace CodeceptJS {
6344
6377
  * ```
6345
6378
  * @param locator - field located by label|name|CSS|XPath|strict locator.
6346
6379
  * @param pathToFile - local file path relative to codecept.json config file.
6347
- *
6348
- * > ⚠ 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.
6349
6381
  */
6350
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
6382
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
6351
6383
  /**
6352
6384
  * Selects an option in a drop-down select.
6353
6385
  * Field is searched by label | name | CSS | XPath.
@@ -6370,7 +6402,7 @@ declare namespace CodeceptJS {
6370
6402
  * @param select - field located by label|name|CSS|XPath|strict locator.
6371
6403
  * @param option - visible text or value of option.
6372
6404
  */
6373
- selectOption(select: LocatorOrString, option: string | any[]): void;
6405
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
6374
6406
  /**
6375
6407
  * Grab number of visible elements by locator.
6376
6408
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -6391,12 +6423,12 @@ declare namespace CodeceptJS {
6391
6423
  * ```
6392
6424
  * @param url - a fragment to check
6393
6425
  */
6394
- seeInCurrentUrl(url: string): void;
6426
+ seeInCurrentUrl(url: string): Promise<any>;
6395
6427
  /**
6396
6428
  * Checks that current url does not contain a provided fragment.
6397
6429
  * @param url - value to check.
6398
6430
  */
6399
- dontSeeInCurrentUrl(url: string): void;
6431
+ dontSeeInCurrentUrl(url: string): Promise<any>;
6400
6432
  /**
6401
6433
  * Checks that current url is equal to provided one.
6402
6434
  * If a relative url provided, a configured url will be prepended to it.
@@ -6408,7 +6440,7 @@ declare namespace CodeceptJS {
6408
6440
  * ```
6409
6441
  * @param url - value to check.
6410
6442
  */
6411
- seeCurrentUrlEquals(url: string): void;
6443
+ seeCurrentUrlEquals(url: string): Promise<any>;
6412
6444
  /**
6413
6445
  * Checks that current url is not equal to provided one.
6414
6446
  * If a relative url provided, a configured url will be prepended to it.
@@ -6419,7 +6451,7 @@ declare namespace CodeceptJS {
6419
6451
  * ```
6420
6452
  * @param url - value to check.
6421
6453
  */
6422
- dontSeeCurrentUrlEquals(url: string): void;
6454
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
6423
6455
  /**
6424
6456
  * Checks that a page contains a visible text.
6425
6457
  * Use context parameter to narrow down the search.
@@ -6431,10 +6463,9 @@ declare namespace CodeceptJS {
6431
6463
  * ```
6432
6464
  * @param text - expected on page.
6433
6465
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
6434
- *
6435
- * {{ react }}
6466
+ * @returns {{ react }}
6436
6467
  */
6437
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
6468
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
6438
6469
  /**
6439
6470
  * Checks that text is equal to provided one.
6440
6471
  *
@@ -6444,7 +6475,7 @@ declare namespace CodeceptJS {
6444
6475
  * @param text - element value to check.
6445
6476
  * @param [context = null] - element located by CSS|XPath|strict locator.
6446
6477
  */
6447
- seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): void;
6478
+ seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
6448
6479
  /**
6449
6480
  * Opposite to `see`. Checks that a text is not present on a page.
6450
6481
  * Use context parameter to narrow down the search.
@@ -6455,11 +6486,9 @@ declare namespace CodeceptJS {
6455
6486
  * ```
6456
6487
  * @param text - which is not present.
6457
6488
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
6458
- *
6459
- *
6460
- * {{ react }}
6489
+ * @returns {{ react }}
6461
6490
  */
6462
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
6491
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
6463
6492
  /**
6464
6493
  * Retrieves page source and returns it to test.
6465
6494
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -6498,7 +6527,7 @@ declare namespace CodeceptJS {
6498
6527
  * ```
6499
6528
  * @param text - value to check.
6500
6529
  */
6501
- seeInSource(text: string): void;
6530
+ seeInSource(text: string): Promise<any>;
6502
6531
  /**
6503
6532
  * Checks that the current page does not contains the given string in its raw source code.
6504
6533
  *
@@ -6507,7 +6536,7 @@ declare namespace CodeceptJS {
6507
6536
  * ```
6508
6537
  * @param value - to check.
6509
6538
  */
6510
- dontSeeInSource(value: string): void;
6539
+ dontSeeInSource(value: string): Promise<any>;
6511
6540
  /**
6512
6541
  * Asserts that an element appears a given number of times in the DOM.
6513
6542
  * Element is located by label or name or CSS or XPath.
@@ -6518,11 +6547,9 @@ declare namespace CodeceptJS {
6518
6547
  * ```
6519
6548
  * @param locator - element located by CSS|XPath|strict locator.
6520
6549
  * @param num - number of elements.
6521
- *
6522
- *
6523
- * {{ react }}
6550
+ * @returns {{ react }}
6524
6551
  */
6525
- seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): void;
6552
+ seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
6526
6553
  /**
6527
6554
  * Asserts that an element is visible a given number of times.
6528
6555
  * Element is located by CSS or XPath.
@@ -6532,11 +6559,9 @@ declare namespace CodeceptJS {
6532
6559
  * ```
6533
6560
  * @param locator - element located by CSS|XPath|strict locator.
6534
6561
  * @param num - number of elements.
6535
- *
6536
- *
6537
- * {{ react }}
6562
+ * @returns {{ react }}
6538
6563
  */
6539
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
6564
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
6540
6565
  /**
6541
6566
  * Sets cookie(s).
6542
6567
  *
@@ -6553,7 +6578,7 @@ declare namespace CodeceptJS {
6553
6578
  * ```
6554
6579
  * @param cookie - a cookie object or array of cookie objects.
6555
6580
  */
6556
- setCookie(cookie: Cookie | Cookie[]): void;
6581
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
6557
6582
  /**
6558
6583
  * Checks that cookie with given name exists.
6559
6584
  *
@@ -6562,7 +6587,7 @@ declare namespace CodeceptJS {
6562
6587
  * ```
6563
6588
  * @param name - cookie name.
6564
6589
  */
6565
- seeCookie(name: string): void;
6590
+ seeCookie(name: string): Promise<any>;
6566
6591
  /**
6567
6592
  * Checks that cookie with given name does not exist.
6568
6593
  *
@@ -6571,7 +6596,7 @@ declare namespace CodeceptJS {
6571
6596
  * ```
6572
6597
  * @param name - cookie name.
6573
6598
  */
6574
- dontSeeCookie(name: string): void;
6599
+ dontSeeCookie(name: string): Promise<any>;
6575
6600
  /**
6576
6601
  * Gets a cookie object by name.
6577
6602
  * If none provided gets all cookies.
@@ -6598,7 +6623,7 @@ declare namespace CodeceptJS {
6598
6623
  * ```
6599
6624
  * @param [cookie = null] - (optional, `null` by default) cookie name
6600
6625
  */
6601
- clearCookie(cookie?: string): void;
6626
+ clearCookie(cookie?: string): Promise<any>;
6602
6627
  /**
6603
6628
  * Executes sync script on a page.
6604
6629
  * Pass arguments to function as additional parameters.
@@ -6763,9 +6788,9 @@ declare namespace CodeceptJS {
6763
6788
  * ```
6764
6789
  * @param locator - located by CSS|XPath|strict locator.
6765
6790
  * @param cssProperties - object with CSS properties and their values to check.
6766
- * {{ react }}
6791
+ * @returns {{ react }}
6767
6792
  */
6768
- seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): void;
6793
+ seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
6769
6794
  /**
6770
6795
  * Checks that all elements with given locator have given attributes.
6771
6796
  *
@@ -6774,9 +6799,9 @@ declare namespace CodeceptJS {
6774
6799
  * ```
6775
6800
  * @param locator - located by CSS|XPath|strict locator.
6776
6801
  * @param attributes - attributes and their values to check.
6777
- * {{ react }}
6802
+ * @returns {{ react }}
6778
6803
  */
6779
- seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): void;
6804
+ seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
6780
6805
  /**
6781
6806
  * Drag the scrubber of a slider to a given position
6782
6807
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -6787,9 +6812,9 @@ declare namespace CodeceptJS {
6787
6812
  * ```
6788
6813
  * @param locator - located by label|name|CSS|XPath|strict locator.
6789
6814
  * @param offsetX - position to drag.
6790
- * {{ react }}
6815
+ * @returns {{ react }}
6791
6816
  */
6792
- dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): void;
6817
+ dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): Promise<any>;
6793
6818
  /**
6794
6819
  * Retrieves an array of attributes from elements located by CSS or XPath and returns it to test.
6795
6820
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -6829,7 +6854,7 @@ declare namespace CodeceptJS {
6829
6854
  * @param locator - element located by CSS|XPath|strict locator.
6830
6855
  * @param fileName - file name to save.
6831
6856
  */
6832
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
6857
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
6833
6858
  /**
6834
6859
  * Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
6835
6860
  * Filename is relative to output folder.
@@ -6842,7 +6867,7 @@ declare namespace CodeceptJS {
6842
6867
  * @param fileName - file name to save.
6843
6868
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
6844
6869
  */
6845
- saveScreenshot(fileName: string, fullPage?: boolean): void;
6870
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
6846
6871
  /**
6847
6872
  * Pauses execution for a number of seconds.
6848
6873
  *
@@ -6851,14 +6876,14 @@ declare namespace CodeceptJS {
6851
6876
  * ```
6852
6877
  * @param sec - number of second to wait.
6853
6878
  */
6854
- wait(sec: number): void;
6879
+ wait(sec: number): Promise<any>;
6855
6880
  /**
6856
6881
  * Waits for element to become enabled (by default waits for 1sec).
6857
6882
  * Element can be located by CSS or XPath.
6858
6883
  * @param locator - element located by CSS|XPath|strict locator.
6859
6884
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
6860
6885
  */
6861
- waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6886
+ waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6862
6887
  /**
6863
6888
  * Waits for the specified value to be in value attribute.
6864
6889
  *
@@ -6869,7 +6894,7 @@ declare namespace CodeceptJS {
6869
6894
  * @param value - expected value.
6870
6895
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6871
6896
  */
6872
- waitForValue(field: LocatorOrString, value: string, sec?: number): void;
6897
+ waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
6873
6898
  /**
6874
6899
  * Waits for a specified number of elements on the page.
6875
6900
  *
@@ -6879,9 +6904,9 @@ declare namespace CodeceptJS {
6879
6904
  * @param locator - element located by CSS|XPath|strict locator.
6880
6905
  * @param num - number of elements.
6881
6906
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6882
- * {{ react }}
6907
+ * @returns {{ react }}
6883
6908
  */
6884
- waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): void;
6909
+ waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
6885
6910
  /**
6886
6911
  * Waits for element to be clickable (by default waits for 1sec).
6887
6912
  * Element can be located by CSS or XPath.
@@ -6893,7 +6918,7 @@ declare namespace CodeceptJS {
6893
6918
  * @param locator - element located by CSS|XPath|strict locator.
6894
6919
  * @param [sec] - (optional, `1` by default) time in seconds to wait
6895
6920
  */
6896
- waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6921
+ waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6897
6922
  /**
6898
6923
  * Waits for element to be present on page (by default waits for 1sec).
6899
6924
  * Element can be located by CSS or XPath.
@@ -6904,9 +6929,9 @@ declare namespace CodeceptJS {
6904
6929
  * ```
6905
6930
  * @param locator - element located by CSS|XPath|strict locator.
6906
6931
  * @param [sec] - (optional, `1` by default) time in seconds to wait
6907
- * {{ react }}
6932
+ * @returns {{ react }}
6908
6933
  */
6909
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6934
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6910
6935
  /**
6911
6936
  * Waits for an element to become visible on a page (by default waits for 1sec).
6912
6937
  * Element can be located by CSS or XPath.
@@ -6916,11 +6941,9 @@ declare namespace CodeceptJS {
6916
6941
  * ```
6917
6942
  * @param locator - element located by CSS|XPath|strict locator.
6918
6943
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6919
- *
6920
- *
6921
- * This method accepts [React selectors](https://codecept.io/react).
6944
+ * @returns This method accepts [React selectors](https://codecept.io/react).
6922
6945
  */
6923
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6946
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6924
6947
  /**
6925
6948
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
6926
6949
  * Element can be located by CSS or XPath.
@@ -6931,7 +6954,7 @@ declare namespace CodeceptJS {
6931
6954
  * @param locator - element located by CSS|XPath|strict locator.
6932
6955
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6933
6956
  */
6934
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6957
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6935
6958
  /**
6936
6959
  * Waits for an element to hide (by default waits for 1sec).
6937
6960
  * Element can be located by CSS or XPath.
@@ -6942,7 +6965,7 @@ declare namespace CodeceptJS {
6942
6965
  * @param locator - element located by CSS|XPath|strict locator.
6943
6966
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6944
6967
  */
6945
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
6968
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
6946
6969
  /**
6947
6970
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
6948
6971
  *
@@ -6952,7 +6975,7 @@ declare namespace CodeceptJS {
6952
6975
  * @param urlPart - value to check.
6953
6976
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6954
6977
  */
6955
- waitInUrl(urlPart: string, sec?: number): void;
6978
+ waitInUrl(urlPart: string, sec?: number): Promise<any>;
6956
6979
  /**
6957
6980
  * Waits for the entire URL to match the expected
6958
6981
  *
@@ -6963,7 +6986,7 @@ declare namespace CodeceptJS {
6963
6986
  * @param urlPart - value to check.
6964
6987
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6965
6988
  */
6966
- waitUrlEquals(urlPart: string, sec?: number): void;
6989
+ waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
6967
6990
  /**
6968
6991
  * Waits for a text to appear (by default waits for 1sec).
6969
6992
  * Element can be located by CSS or XPath.
@@ -6977,7 +7000,7 @@ declare namespace CodeceptJS {
6977
7000
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
6978
7001
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
6979
7002
  */
6980
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
7003
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
6981
7004
  /**
6982
7005
  * Waits for a network request.
6983
7006
  *
@@ -7007,7 +7030,7 @@ declare namespace CodeceptJS {
7007
7030
  * ```
7008
7031
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
7009
7032
  */
7010
- switchTo(locator?: CodeceptJS.LocatorOrString): void;
7033
+ switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
7011
7034
  /**
7012
7035
  * Waits for a function to return true (waits for 1 sec by default).
7013
7036
  * Running in browser context.
@@ -7025,7 +7048,7 @@ declare namespace CodeceptJS {
7025
7048
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
7026
7049
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
7027
7050
  */
7028
- 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>;
7029
7052
  /**
7030
7053
  * Waits for navigation to finish. By default takes configured `waitForNavigation` option.
7031
7054
  *
@@ -7042,7 +7065,7 @@ declare namespace CodeceptJS {
7042
7065
  * @param locator - element located by CSS|XPath|strict locator.
7043
7066
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7044
7067
  */
7045
- waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): void;
7068
+ waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7046
7069
  /**
7047
7070
  * Grab the data from performance timing using Navigation Timing API.
7048
7071
  * The returned data will contain following things in ms:
@@ -7064,7 +7087,7 @@ declare namespace CodeceptJS {
7064
7087
  * }
7065
7088
  * ```
7066
7089
  */
7067
- grabDataFromPerformanceTiming(): void;
7090
+ grabDataFromPerformanceTiming(): Promise<any>;
7068
7091
  /**
7069
7092
  * Grab the width, height, location of given locator.
7070
7093
  * Provide `width` or `height`as second param to get your desired prop.
@@ -7143,7 +7166,7 @@ declare namespace CodeceptJS {
7143
7166
  * ```
7144
7167
  * @param accessToken - Bearer access token
7145
7168
  */
7146
- amBearerAuthenticated(accessToken: string): void;
7169
+ amBearerAuthenticated(accessToken: string | CodeceptJS.Secret): void;
7147
7170
  /**
7148
7171
  * Executes axios request
7149
7172
  * @returns response
@@ -7403,14 +7426,14 @@ declare namespace CodeceptJS {
7403
7426
  * ```
7404
7427
  * @param url - url path or global url.
7405
7428
  */
7406
- amOnPage(url: string): void;
7429
+ amOnPage(url: string): Promise<any>;
7407
7430
  /**
7408
7431
  * Resize the current window to provided width and height.
7409
7432
  * First parameter can be set to `maximize`.
7410
7433
  * @param width - width in pixels or `maximize`.
7411
7434
  * @param height - height in pixels.
7412
7435
  */
7413
- resizeWindow(width: number, height: number): void;
7436
+ resizeWindow(width: number, height: number): Promise<any>;
7414
7437
  /**
7415
7438
  * Perform a click on a link or a button, given by a locator.
7416
7439
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -7436,7 +7459,7 @@ declare namespace CodeceptJS {
7436
7459
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
7437
7460
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
7438
7461
  */
7439
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
7462
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
7440
7463
  /**
7441
7464
  * Reload the current page.
7442
7465
  *
@@ -7444,7 +7467,7 @@ declare namespace CodeceptJS {
7444
7467
  * I.refreshPage();
7445
7468
  * ```
7446
7469
  */
7447
- refreshPage(): void;
7470
+ refreshPage(): Promise<any>;
7448
7471
  /**
7449
7472
  * Waits for an element to become visible on a page (by default waits for 1sec).
7450
7473
  * Element can be located by CSS or XPath.
@@ -7455,7 +7478,7 @@ declare namespace CodeceptJS {
7455
7478
  * @param locator - element located by CSS|XPath|strict locator.
7456
7479
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7457
7480
  */
7458
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
7481
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7459
7482
  /**
7460
7483
  * Fills a text field or textarea, after clearing its value, with the given string.
7461
7484
  * Field is located by name, label, CSS, or XPath.
@@ -7473,7 +7496,7 @@ declare namespace CodeceptJS {
7473
7496
  * @param field - located by label|name|CSS|XPath|strict locator.
7474
7497
  * @param value - text value to fill.
7475
7498
  */
7476
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
7499
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
7477
7500
  /**
7478
7501
  * Clears a `<textarea>` or text `<input>` element's value.
7479
7502
  *
@@ -7484,7 +7507,7 @@ declare namespace CodeceptJS {
7484
7507
  * ```
7485
7508
  * @param editable - field located by label|name|CSS|XPath|strict locator.
7486
7509
  */
7487
- clearField(editable: LocatorOrString): void;
7510
+ clearField(editable: LocatorOrString): Promise<any>;
7488
7511
  /**
7489
7512
  * Appends text to a input field or textarea.
7490
7513
  * Field is located by name, label, CSS or XPath
@@ -7495,7 +7518,7 @@ declare namespace CodeceptJS {
7495
7518
  * @param field - located by label|name|CSS|XPath|strict locator
7496
7519
  * @param value - text value to append.
7497
7520
  */
7498
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
7521
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
7499
7522
  /**
7500
7523
  * Attaches a file to element located by label, name, CSS or XPath
7501
7524
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -7508,7 +7531,7 @@ declare namespace CodeceptJS {
7508
7531
  * @param locator - field located by label|name|CSS|XPath|strict locator.
7509
7532
  * @param pathToFile - local file path relative to codecept.json config file.
7510
7533
  */
7511
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
7534
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
7512
7535
  /**
7513
7536
  * Presses a key on a focused element.
7514
7537
  * Special keys like 'Enter', 'Control', [etc](https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value)
@@ -7520,10 +7543,9 @@ declare namespace CodeceptJS {
7520
7543
  * I.pressKey(['Control','a']);
7521
7544
  * ```
7522
7545
  * @param key - key or array of keys to press.
7523
- *
7524
- * {{ keys }}
7546
+ * @returns {{ keys }}
7525
7547
  */
7526
- pressKey(key: string | string[]): void;
7548
+ pressKey(key: string | string[]): Promise<any>;
7527
7549
  /**
7528
7550
  * Moves cursor to element matched by locator.
7529
7551
  * Extra shift can be set with offsetX and offsetY options.
@@ -7536,7 +7558,7 @@ declare namespace CodeceptJS {
7536
7558
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
7537
7559
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
7538
7560
  */
7539
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
7561
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
7540
7562
  /**
7541
7563
  * Performs a double-click on an element matched by link|button|label|CSS or XPath.
7542
7564
  * Context can be specified as second parameter to narrow search.
@@ -7550,7 +7572,7 @@ declare namespace CodeceptJS {
7550
7572
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
7551
7573
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
7552
7574
  */
7553
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
7575
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7554
7576
  /**
7555
7577
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
7556
7578
  *
@@ -7565,7 +7587,7 @@ declare namespace CodeceptJS {
7565
7587
  * @param locator - clickable element located by CSS|XPath|strict locator.
7566
7588
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
7567
7589
  */
7568
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
7590
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7569
7591
  /**
7570
7592
  * Selects a checkbox or radio button.
7571
7593
  * Element is located by label or name or CSS or XPath.
@@ -7580,7 +7602,7 @@ declare namespace CodeceptJS {
7580
7602
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
7581
7603
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
7582
7604
  */
7583
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
7605
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7584
7606
  /**
7585
7607
  * Unselects a checkbox or radio button.
7586
7608
  * Element is located by label or name or CSS or XPath.
@@ -7595,7 +7617,7 @@ declare namespace CodeceptJS {
7595
7617
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
7596
7618
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
7597
7619
  */
7598
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
7620
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
7599
7621
  /**
7600
7622
  * Verifies that the specified checkbox is checked.
7601
7623
  *
@@ -7606,7 +7628,7 @@ declare namespace CodeceptJS {
7606
7628
  * ```
7607
7629
  * @param field - located by label|name|CSS|XPath|strict locator.
7608
7630
  */
7609
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
7631
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
7610
7632
  /**
7611
7633
  * Verifies that the specified checkbox is not checked.
7612
7634
  *
@@ -7617,7 +7639,7 @@ declare namespace CodeceptJS {
7617
7639
  * ```
7618
7640
  * @param field - located by label|name|CSS|XPath|strict locator.
7619
7641
  */
7620
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
7642
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
7621
7643
  /**
7622
7644
  * Selects an option in a drop-down select.
7623
7645
  * Field is searched by label | name | CSS | XPath.
@@ -7640,7 +7662,7 @@ declare namespace CodeceptJS {
7640
7662
  * @param select - field located by label|name|CSS|XPath|strict locator.
7641
7663
  * @param option - visible text or value of option.
7642
7664
  */
7643
- selectOption(select: LocatorOrString, option: string | any[]): void;
7665
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
7644
7666
  /**
7645
7667
  * Checks that current url contains a provided fragment.
7646
7668
  *
@@ -7649,12 +7671,12 @@ declare namespace CodeceptJS {
7649
7671
  * ```
7650
7672
  * @param url - a fragment to check
7651
7673
  */
7652
- seeInCurrentUrl(url: string): void;
7674
+ seeInCurrentUrl(url: string): Promise<any>;
7653
7675
  /**
7654
7676
  * Checks that current url does not contain a provided fragment.
7655
7677
  * @param url - value to check.
7656
7678
  */
7657
- dontSeeInCurrentUrl(url: string): void;
7679
+ dontSeeInCurrentUrl(url: string): Promise<any>;
7658
7680
  /**
7659
7681
  * Checks that current url is equal to provided one.
7660
7682
  * If a relative url provided, a configured url will be prepended to it.
@@ -7666,7 +7688,7 @@ declare namespace CodeceptJS {
7666
7688
  * ```
7667
7689
  * @param url - value to check.
7668
7690
  */
7669
- seeCurrentUrlEquals(url: string): void;
7691
+ seeCurrentUrlEquals(url: string): Promise<any>;
7670
7692
  /**
7671
7693
  * Checks that current url is not equal to provided one.
7672
7694
  * If a relative url provided, a configured url will be prepended to it.
@@ -7677,7 +7699,7 @@ declare namespace CodeceptJS {
7677
7699
  * ```
7678
7700
  * @param url - value to check.
7679
7701
  */
7680
- dontSeeCurrentUrlEquals(url: string): void;
7702
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
7681
7703
  /**
7682
7704
  * Checks that a page contains a visible text.
7683
7705
  * Use context parameter to narrow down the search.
@@ -7690,7 +7712,7 @@ declare namespace CodeceptJS {
7690
7712
  * @param text - expected on page.
7691
7713
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
7692
7714
  */
7693
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
7715
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
7694
7716
  /**
7695
7717
  * Opposite to `see`. Checks that a text is not present on a page.
7696
7718
  * Use context parameter to narrow down the search.
@@ -7702,7 +7724,7 @@ declare namespace CodeceptJS {
7702
7724
  * @param text - which is not present.
7703
7725
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
7704
7726
  */
7705
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
7727
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
7706
7728
  /**
7707
7729
  * Checks that a given Element is visible
7708
7730
  * Element is located by CSS or XPath.
@@ -7712,7 +7734,7 @@ declare namespace CodeceptJS {
7712
7734
  * ```
7713
7735
  * @param locator - located by CSS|XPath|strict locator.
7714
7736
  */
7715
- seeElement(locator: CodeceptJS.LocatorOrString): void;
7737
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
7716
7738
  /**
7717
7739
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
7718
7740
  *
@@ -7721,7 +7743,7 @@ declare namespace CodeceptJS {
7721
7743
  * ```
7722
7744
  * @param locator - located by CSS|XPath|Strict locator.
7723
7745
  */
7724
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
7746
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
7725
7747
  /**
7726
7748
  * Checks that a given Element is present in the DOM
7727
7749
  * Element is located by CSS or XPath.
@@ -7731,7 +7753,7 @@ declare namespace CodeceptJS {
7731
7753
  * ```
7732
7754
  * @param locator - element located by CSS|XPath|strict locator.
7733
7755
  */
7734
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
7756
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
7735
7757
  /**
7736
7758
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
7737
7759
  *
@@ -7740,7 +7762,7 @@ declare namespace CodeceptJS {
7740
7762
  * ```
7741
7763
  * @param locator - located by CSS|XPath|Strict locator.
7742
7764
  */
7743
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
7765
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
7744
7766
  /**
7745
7767
  * Asserts that an element is visible a given number of times.
7746
7768
  * Element is located by CSS or XPath.
@@ -7751,7 +7773,7 @@ declare namespace CodeceptJS {
7751
7773
  * @param locator - element located by CSS|XPath|strict locator.
7752
7774
  * @param num - number of elements.
7753
7775
  */
7754
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
7776
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
7755
7777
  /**
7756
7778
  * Grab number of visible elements by locator.
7757
7779
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -7776,7 +7798,7 @@ declare namespace CodeceptJS {
7776
7798
  * @param field - located by label|name|CSS|XPath|strict locator.
7777
7799
  * @param value - value to check.
7778
7800
  */
7779
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
7801
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
7780
7802
  /**
7781
7803
  * Checks that value of input field or textarea doesn't equal to given value
7782
7804
  * Opposite to `seeInField`.
@@ -7788,7 +7810,7 @@ declare namespace CodeceptJS {
7788
7810
  * @param field - located by label|name|CSS|XPath|strict locator.
7789
7811
  * @param value - value to check.
7790
7812
  */
7791
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
7813
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
7792
7814
  /**
7793
7815
  * Checks that text is equal to provided one.
7794
7816
  *
@@ -7805,7 +7827,7 @@ declare namespace CodeceptJS {
7805
7827
  * ```
7806
7828
  * @param text - value to check.
7807
7829
  */
7808
- seeInSource(text: string): void;
7830
+ seeInSource(text: string): Promise<any>;
7809
7831
  /**
7810
7832
  * Checks that the current page does not contains the given string in its raw source code.
7811
7833
  *
@@ -7814,7 +7836,7 @@ declare namespace CodeceptJS {
7814
7836
  * ```
7815
7837
  * @param value - to check.
7816
7838
  */
7817
- dontSeeInSource(value: string): void;
7839
+ dontSeeInSource(value: string): Promise<any>;
7818
7840
  /**
7819
7841
  * Saves screenshot of the specified locator to ouput folder (set in codecept.json or codecept.conf.js).
7820
7842
  * Filename is relative to output folder.
@@ -7825,7 +7847,7 @@ declare namespace CodeceptJS {
7825
7847
  * @param locator - element located by CSS|XPath|strict locator.
7826
7848
  * @param fileName - file name to save.
7827
7849
  */
7828
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
7850
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
7829
7851
  /**
7830
7852
  * Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
7831
7853
  * Filename is relative to output folder.
@@ -7838,7 +7860,7 @@ declare namespace CodeceptJS {
7838
7860
  * @param fileName - file name to save.
7839
7861
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
7840
7862
  */
7841
- saveScreenshot(fileName: string, fullPage?: boolean): void;
7863
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
7842
7864
  /**
7843
7865
  * Pauses execution for a number of seconds.
7844
7866
  *
@@ -7847,7 +7869,7 @@ declare namespace CodeceptJS {
7847
7869
  * ```
7848
7870
  * @param sec - number of second to wait.
7849
7871
  */
7850
- wait(sec: number): void;
7872
+ wait(sec: number): Promise<any>;
7851
7873
  /**
7852
7874
  * Executes sync script on a page.
7853
7875
  * Pass arguments to function as additional parameters.
@@ -7995,7 +8017,7 @@ declare namespace CodeceptJS {
7995
8017
  * I.scrollPageToTop();
7996
8018
  * ```
7997
8019
  */
7998
- scrollPageToTop(): void;
8020
+ scrollPageToTop(): Promise<any>;
7999
8021
  /**
8000
8022
  * Scroll page to the bottom.
8001
8023
  *
@@ -8003,7 +8025,7 @@ declare namespace CodeceptJS {
8003
8025
  * I.scrollPageToBottom();
8004
8026
  * ```
8005
8027
  */
8006
- scrollPageToBottom(): void;
8028
+ scrollPageToBottom(): Promise<any>;
8007
8029
  /**
8008
8030
  * Scrolls to element matched by locator.
8009
8031
  * Extra shift can be set with offsetX and offsetY options.
@@ -8016,7 +8038,7 @@ declare namespace CodeceptJS {
8016
8038
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
8017
8039
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
8018
8040
  */
8019
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
8041
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
8020
8042
  /**
8021
8043
  * Switches frame or in case of null locator reverts to parent.
8022
8044
  *
@@ -8026,7 +8048,7 @@ declare namespace CodeceptJS {
8026
8048
  * ```
8027
8049
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
8028
8050
  */
8029
- switchTo(locator?: CodeceptJS.LocatorOrString): void;
8051
+ switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
8030
8052
  /**
8031
8053
  * Sets cookie(s).
8032
8054
  *
@@ -8043,7 +8065,7 @@ declare namespace CodeceptJS {
8043
8065
  * ```
8044
8066
  * @param cookie - a cookie object or array of cookie objects.
8045
8067
  */
8046
- setCookie(cookie: Cookie | Cookie[]): void;
8068
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
8047
8069
  /**
8048
8070
  * Checks that cookie with given name exists.
8049
8071
  *
@@ -8052,7 +8074,7 @@ declare namespace CodeceptJS {
8052
8074
  * ```
8053
8075
  * @param name - cookie name.
8054
8076
  */
8055
- seeCookie(name: string): void;
8077
+ seeCookie(name: string): Promise<any>;
8056
8078
  /**
8057
8079
  * Checks that cookie with given name does not exist.
8058
8080
  *
@@ -8061,7 +8083,7 @@ declare namespace CodeceptJS {
8061
8083
  * ```
8062
8084
  * @param name - cookie name.
8063
8085
  */
8064
- dontSeeCookie(name: string): void;
8086
+ dontSeeCookie(name: string): Promise<any>;
8065
8087
  /**
8066
8088
  * Gets a cookie object by name.
8067
8089
  * If none provided gets all cookies.
@@ -8088,7 +8110,7 @@ declare namespace CodeceptJS {
8088
8110
  * ```
8089
8111
  * @param [cookie = null] - (optional, `null` by default) cookie name
8090
8112
  */
8091
- clearCookie(cookie?: string): void;
8113
+ clearCookie(cookie?: string): Promise<any>;
8092
8114
  /**
8093
8115
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
8094
8116
  *
@@ -8098,7 +8120,7 @@ declare namespace CodeceptJS {
8098
8120
  * @param urlPart - value to check.
8099
8121
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8100
8122
  */
8101
- waitInUrl(urlPart: string, sec?: number): void;
8123
+ waitInUrl(urlPart: string, sec?: number): Promise<any>;
8102
8124
  /**
8103
8125
  * Waits for the entire URL to match the expected
8104
8126
  *
@@ -8109,7 +8131,7 @@ declare namespace CodeceptJS {
8109
8131
  * @param urlPart - value to check.
8110
8132
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8111
8133
  */
8112
- waitUrlEquals(urlPart: string, sec?: number): void;
8134
+ waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
8113
8135
  /**
8114
8136
  * Waits for a function to return true (waits for 1 sec by default).
8115
8137
  * Running in browser context.
@@ -8127,7 +8149,7 @@ declare namespace CodeceptJS {
8127
8149
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
8128
8150
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
8129
8151
  */
8130
- 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>;
8131
8153
  /**
8132
8154
  * Waits for a specified number of elements on the page.
8133
8155
  *
@@ -8138,7 +8160,7 @@ declare namespace CodeceptJS {
8138
8160
  * @param num - number of elements.
8139
8161
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8140
8162
  */
8141
- waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): void;
8163
+ waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
8142
8164
  /**
8143
8165
  * Waits for element to be present on page (by default waits for 1sec).
8144
8166
  * Element can be located by CSS or XPath.
@@ -8150,7 +8172,7 @@ declare namespace CodeceptJS {
8150
8172
  * @param locator - element located by CSS|XPath|strict locator.
8151
8173
  * @param [sec] - (optional, `1` by default) time in seconds to wait
8152
8174
  */
8153
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
8175
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
8154
8176
  /**
8155
8177
  * Waits for an element to hide (by default waits for 1sec).
8156
8178
  * Element can be located by CSS or XPath.
@@ -8161,7 +8183,7 @@ declare namespace CodeceptJS {
8161
8183
  * @param locator - element located by CSS|XPath|strict locator.
8162
8184
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8163
8185
  */
8164
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
8186
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
8165
8187
  /**
8166
8188
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
8167
8189
  * Element can be located by CSS or XPath.
@@ -8172,7 +8194,7 @@ declare namespace CodeceptJS {
8172
8194
  * @param locator - element located by CSS|XPath|strict locator.
8173
8195
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8174
8196
  */
8175
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
8197
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
8176
8198
  /**
8177
8199
  * Waits for a text to appear (by default waits for 1sec).
8178
8200
  * Element can be located by CSS or XPath.
@@ -8186,7 +8208,7 @@ declare namespace CodeceptJS {
8186
8208
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
8187
8209
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
8188
8210
  */
8189
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
8211
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
8190
8212
  }
8191
8213
  /**
8192
8214
  * WebDriver helper which wraps [webdriverio](http://webdriver.io/) library to
@@ -8623,7 +8645,7 @@ declare namespace CodeceptJS {
8623
8645
  * ```
8624
8646
  * @param url - url path or global url.
8625
8647
  */
8626
- amOnPage(url: string): void;
8648
+ amOnPage(url: string): Promise<any>;
8627
8649
  /**
8628
8650
  * Perform a click on a link or a button, given by a locator.
8629
8651
  * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
@@ -8648,11 +8670,9 @@ declare namespace CodeceptJS {
8648
8670
  * ```
8649
8671
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
8650
8672
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
8651
- *
8652
- *
8653
- * {{ react }}
8673
+ * @returns {{ react }}
8654
8674
  */
8655
- click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8675
+ click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null): Promise<any>;
8656
8676
  /**
8657
8677
  * Perform an emulated click on a link or a button, given by a locator.
8658
8678
  * Unlike normal click instead of sending native event, emulates a click with JavaScript.
@@ -8680,11 +8700,9 @@ declare namespace CodeceptJS {
8680
8700
  * ```
8681
8701
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
8682
8702
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
8683
- *
8684
- *
8685
- * {{ react }}
8703
+ * @returns {{ react }}
8686
8704
  */
8687
- forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8705
+ forceClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8688
8706
  /**
8689
8707
  * Performs a double-click on an element matched by link|button|label|CSS or XPath.
8690
8708
  * Context can be specified as second parameter to narrow search.
@@ -8697,11 +8715,9 @@ declare namespace CodeceptJS {
8697
8715
  * ```
8698
8716
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
8699
8717
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
8700
- *
8701
- *
8702
- * {{ react }}
8718
+ * @returns {{ react }}
8703
8719
  */
8704
- doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8720
+ doubleClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8705
8721
  /**
8706
8722
  * Performs right click on a clickable element matched by semantic locator, CSS or XPath.
8707
8723
  *
@@ -8715,11 +8731,9 @@ declare namespace CodeceptJS {
8715
8731
  * ```
8716
8732
  * @param locator - clickable element located by CSS|XPath|strict locator.
8717
8733
  * @param [context = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
8718
- *
8719
- *
8720
- * {{ react }}
8734
+ * @returns {{ react }}
8721
8735
  */
8722
- rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8736
+ rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8723
8737
  /**
8724
8738
  * Emulates right click on an element.
8725
8739
  * Unlike normal click instead of sending native event, emulates a click with JavaScript.
@@ -8737,11 +8751,9 @@ declare namespace CodeceptJS {
8737
8751
  * ```
8738
8752
  * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
8739
8753
  * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
8740
- *
8741
- *
8742
- * {{ react }}
8754
+ * @returns {{ react }}
8743
8755
  */
8744
- forceRightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8756
+ forceRightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8745
8757
  /**
8746
8758
  * Fills a text field or textarea, after clearing its value, with the given string.
8747
8759
  * Field is located by name, label, CSS, or XPath.
@@ -8758,11 +8770,10 @@ declare namespace CodeceptJS {
8758
8770
  * ```
8759
8771
  * @param field - located by label|name|CSS|XPath|strict locator.
8760
8772
  * @param value - text value to fill.
8761
- *
8762
- * {{ react }}
8773
+ * @returns {{ react }}
8763
8774
  * {{ custom }}
8764
8775
  */
8765
- fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
8776
+ fillField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
8766
8777
  /**
8767
8778
  * Appends text to a input field or textarea.
8768
8779
  * Field is located by name, label, CSS or XPath
@@ -8772,9 +8783,9 @@ declare namespace CodeceptJS {
8772
8783
  * ```
8773
8784
  * @param field - located by label|name|CSS|XPath|strict locator
8774
8785
  * @param value - text value to append.
8775
- * {{ react }}
8786
+ * @returns {{ react }}
8776
8787
  */
8777
- appendField(field: CodeceptJS.LocatorOrString, value: string): void;
8788
+ appendField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
8778
8789
  /**
8779
8790
  * Clears a `<textarea>` or text `<input>` element's value.
8780
8791
  *
@@ -8785,7 +8796,7 @@ declare namespace CodeceptJS {
8785
8796
  * ```
8786
8797
  * @param editable - field located by label|name|CSS|XPath|strict locator.
8787
8798
  */
8788
- clearField(editable: LocatorOrString): void;
8799
+ clearField(editable: LocatorOrString): Promise<any>;
8789
8800
  /**
8790
8801
  * Selects an option in a drop-down select.
8791
8802
  * Field is searched by label | name | CSS | XPath.
@@ -8808,7 +8819,7 @@ declare namespace CodeceptJS {
8808
8819
  * @param select - field located by label|name|CSS|XPath|strict locator.
8809
8820
  * @param option - visible text or value of option.
8810
8821
  */
8811
- selectOption(select: LocatorOrString, option: string | any[]): void;
8822
+ selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
8812
8823
  /**
8813
8824
  * Attaches a file to element located by label, name, CSS or XPath
8814
8825
  * Path to file is relative current codecept directory (where codecept.json or codecept.conf.js is located).
@@ -8820,9 +8831,9 @@ declare namespace CodeceptJS {
8820
8831
  * ```
8821
8832
  * @param locator - field located by label|name|CSS|XPath|strict locator.
8822
8833
  * @param pathToFile - local file path relative to codecept.json config file.
8823
- * Appium: not tested
8834
+ * @returns Appium: not tested
8824
8835
  */
8825
- attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
8836
+ attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
8826
8837
  /**
8827
8838
  * Selects a checkbox or radio button.
8828
8839
  * Element is located by label or name or CSS or XPath.
@@ -8836,9 +8847,9 @@ declare namespace CodeceptJS {
8836
8847
  * ```
8837
8848
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
8838
8849
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
8839
- * Appium: not tested
8850
+ * @returns Appium: not tested
8840
8851
  */
8841
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8852
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8842
8853
  /**
8843
8854
  * Unselects a checkbox or radio button.
8844
8855
  * Element is located by label or name or CSS or XPath.
@@ -8852,9 +8863,9 @@ declare namespace CodeceptJS {
8852
8863
  * ```
8853
8864
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
8854
8865
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
8855
- * Appium: not tested
8866
+ * @returns Appium: not tested
8856
8867
  */
8857
- uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
8868
+ uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
8858
8869
  /**
8859
8870
  * Retrieves all texts from an element located by CSS or XPath and returns it to test.
8860
8871
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -8982,16 +8993,16 @@ declare namespace CodeceptJS {
8982
8993
  * ```
8983
8994
  * @param text - text value to check.
8984
8995
  */
8985
- seeInTitle(text: string): void;
8996
+ seeInTitle(text: string): Promise<any>;
8986
8997
  /**
8987
8998
  * Checks that title is equal to provided one.
8988
8999
  *
8989
- * ```js
8990
- * I.seeTitleEquals('Test title.');
8991
- * ```
9000
+ * ```js
9001
+ * I.seeTitleEquals('Test title.');
9002
+ * ```
8992
9003
  * @param text - value to check.
8993
9004
  */
8994
- seeTitleEquals(text: string): void;
9005
+ seeTitleEquals(text: string): Promise<any>;
8995
9006
  /**
8996
9007
  * Checks that title does not contain text.
8997
9008
  *
@@ -9000,7 +9011,7 @@ declare namespace CodeceptJS {
9000
9011
  * ```
9001
9012
  * @param text - value to check.
9002
9013
  */
9003
- dontSeeInTitle(text: string): void;
9014
+ dontSeeInTitle(text: string): Promise<any>;
9004
9015
  /**
9005
9016
  * Retrieves a page title and returns it to test.
9006
9017
  * Resumes test execution, so **should be used inside async with `await`** operator.
@@ -9022,10 +9033,9 @@ declare namespace CodeceptJS {
9022
9033
  * ```
9023
9034
  * @param text - expected on page.
9024
9035
  * @param [context = null] - (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
9025
- *
9026
- * {{ react }}
9036
+ * @returns {{ react }}
9027
9037
  */
9028
- see(text: string, context?: CodeceptJS.LocatorOrString): void;
9038
+ see(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
9029
9039
  /**
9030
9040
  * Checks that text is equal to provided one.
9031
9041
  *
@@ -9035,7 +9045,7 @@ declare namespace CodeceptJS {
9035
9045
  * @param text - element value to check.
9036
9046
  * @param [context = null] - element located by CSS|XPath|strict locator.
9037
9047
  */
9038
- seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): void;
9048
+ seeTextEquals(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
9039
9049
  /**
9040
9050
  * Opposite to `see`. Checks that a text is not present on a page.
9041
9051
  * Use context parameter to narrow down the search.
@@ -9046,11 +9056,9 @@ declare namespace CodeceptJS {
9046
9056
  * ```
9047
9057
  * @param text - which is not present.
9048
9058
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator in which to perfrom search.
9049
- *
9050
- *
9051
- * {{ react }}
9059
+ * @returns {{ react }}
9052
9060
  */
9053
- dontSee(text: string, context?: CodeceptJS.LocatorOrString): void;
9061
+ dontSee(text: string, context?: CodeceptJS.LocatorOrString): Promise<any>;
9054
9062
  /**
9055
9063
  * Checks that the given input field or textarea equals to given value.
9056
9064
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -9064,7 +9072,7 @@ declare namespace CodeceptJS {
9064
9072
  * @param field - located by label|name|CSS|XPath|strict locator.
9065
9073
  * @param value - value to check.
9066
9074
  */
9067
- seeInField(field: CodeceptJS.LocatorOrString, value: string): void;
9075
+ seeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
9068
9076
  /**
9069
9077
  * Checks that value of input field or textarea doesn't equal to given value
9070
9078
  * Opposite to `seeInField`.
@@ -9076,7 +9084,7 @@ declare namespace CodeceptJS {
9076
9084
  * @param field - located by label|name|CSS|XPath|strict locator.
9077
9085
  * @param value - value to check.
9078
9086
  */
9079
- dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): void;
9087
+ dontSeeInField(field: CodeceptJS.LocatorOrString, value: string): Promise<any>;
9080
9088
  /**
9081
9089
  * Verifies that the specified checkbox is checked.
9082
9090
  *
@@ -9086,10 +9094,9 @@ declare namespace CodeceptJS {
9086
9094
  * I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
9087
9095
  * ```
9088
9096
  * @param field - located by label|name|CSS|XPath|strict locator.
9089
- *
9090
- * Appium: not tested
9097
+ * @returns Appium: not tested
9091
9098
  */
9092
- seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
9099
+ seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
9093
9100
  /**
9094
9101
  * Verifies that the specified checkbox is not checked.
9095
9102
  *
@@ -9099,10 +9106,9 @@ declare namespace CodeceptJS {
9099
9106
  * I.dontSeeCheckboxIsChecked('agree'); // located by name
9100
9107
  * ```
9101
9108
  * @param field - located by label|name|CSS|XPath|strict locator.
9102
- *
9103
- * Appium: not tested
9109
+ * @returns Appium: not tested
9104
9110
  */
9105
- dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
9111
+ dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
9106
9112
  /**
9107
9113
  * Checks that a given Element is visible
9108
9114
  * Element is located by CSS or XPath.
@@ -9111,9 +9117,9 @@ declare namespace CodeceptJS {
9111
9117
  * I.seeElement('#modal');
9112
9118
  * ```
9113
9119
  * @param locator - located by CSS|XPath|strict locator.
9114
- * {{ react }}
9120
+ * @returns {{ react }}
9115
9121
  */
9116
- seeElement(locator: CodeceptJS.LocatorOrString): void;
9122
+ seeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
9117
9123
  /**
9118
9124
  * Opposite to `seeElement`. Checks that element is not visible (or in DOM)
9119
9125
  *
@@ -9121,9 +9127,9 @@ declare namespace CodeceptJS {
9121
9127
  * I.dontSeeElement('.modal'); // modal is not shown
9122
9128
  * ```
9123
9129
  * @param locator - located by CSS|XPath|Strict locator.
9124
- * {{ react }}
9130
+ * @returns {{ react }}
9125
9131
  */
9126
- dontSeeElement(locator: CodeceptJS.LocatorOrString): void;
9132
+ dontSeeElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
9127
9133
  /**
9128
9134
  * Checks that a given Element is present in the DOM
9129
9135
  * Element is located by CSS or XPath.
@@ -9133,7 +9139,7 @@ declare namespace CodeceptJS {
9133
9139
  * ```
9134
9140
  * @param locator - element located by CSS|XPath|strict locator.
9135
9141
  */
9136
- seeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
9142
+ seeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
9137
9143
  /**
9138
9144
  * Opposite to `seeElementInDOM`. Checks that element is not on page.
9139
9145
  *
@@ -9142,7 +9148,7 @@ declare namespace CodeceptJS {
9142
9148
  * ```
9143
9149
  * @param locator - located by CSS|XPath|Strict locator.
9144
9150
  */
9145
- dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): void;
9151
+ dontSeeElementInDOM(locator: CodeceptJS.LocatorOrString): Promise<any>;
9146
9152
  /**
9147
9153
  * Checks that the current page contains the given string in its raw source code.
9148
9154
  *
@@ -9151,7 +9157,7 @@ declare namespace CodeceptJS {
9151
9157
  * ```
9152
9158
  * @param text - value to check.
9153
9159
  */
9154
- seeInSource(text: string): void;
9160
+ seeInSource(text: string): Promise<any>;
9155
9161
  /**
9156
9162
  * Retrieves page source and returns it to test.
9157
9163
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -9192,7 +9198,7 @@ declare namespace CodeceptJS {
9192
9198
  * ```
9193
9199
  * @param value - to check.
9194
9200
  */
9195
- dontSeeInSource(value: string): void;
9201
+ dontSeeInSource(value: string): Promise<any>;
9196
9202
  /**
9197
9203
  * Asserts that an element appears a given number of times in the DOM.
9198
9204
  * Element is located by label or name or CSS or XPath.
@@ -9203,10 +9209,9 @@ declare namespace CodeceptJS {
9203
9209
  * ```
9204
9210
  * @param locator - element located by CSS|XPath|strict locator.
9205
9211
  * @param num - number of elements.
9206
- *
9207
- * {{ react }}
9212
+ * @returns {{ react }}
9208
9213
  */
9209
- seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): void;
9214
+ seeNumberOfElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
9210
9215
  /**
9211
9216
  * Asserts that an element is visible a given number of times.
9212
9217
  * Element is located by CSS or XPath.
@@ -9216,10 +9221,9 @@ declare namespace CodeceptJS {
9216
9221
  * ```
9217
9222
  * @param locator - element located by CSS|XPath|strict locator.
9218
9223
  * @param num - number of elements.
9219
- *
9220
- * {{ react }}
9224
+ * @returns {{ react }}
9221
9225
  */
9222
- seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): void;
9226
+ seeNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number): Promise<any>;
9223
9227
  /**
9224
9228
  * Checks that all elements with given locator have given CSS properties.
9225
9229
  *
@@ -9229,7 +9233,7 @@ declare namespace CodeceptJS {
9229
9233
  * @param locator - located by CSS|XPath|strict locator.
9230
9234
  * @param cssProperties - object with CSS properties and their values to check.
9231
9235
  */
9232
- seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): void;
9236
+ seeCssPropertiesOnElements(locator: CodeceptJS.LocatorOrString, cssProperties: any): Promise<any>;
9233
9237
  /**
9234
9238
  * Checks that all elements with given locator have given attributes.
9235
9239
  *
@@ -9239,7 +9243,7 @@ declare namespace CodeceptJS {
9239
9243
  * @param locator - located by CSS|XPath|strict locator.
9240
9244
  * @param attributes - attributes and their values to check.
9241
9245
  */
9242
- seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): void;
9246
+ seeAttributesOnElements(locator: CodeceptJS.LocatorOrString, attributes: any): Promise<any>;
9243
9247
  /**
9244
9248
  * Grab number of visible elements by locator.
9245
9249
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -9259,12 +9263,12 @@ declare namespace CodeceptJS {
9259
9263
  * ```
9260
9264
  * @param url - a fragment to check
9261
9265
  */
9262
- seeInCurrentUrl(url: string): void;
9266
+ seeInCurrentUrl(url: string): Promise<any>;
9263
9267
  /**
9264
9268
  * Checks that current url does not contain a provided fragment.
9265
9269
  * @param url - value to check.
9266
9270
  */
9267
- dontSeeInCurrentUrl(url: string): void;
9271
+ dontSeeInCurrentUrl(url: string): Promise<any>;
9268
9272
  /**
9269
9273
  * Checks that current url is equal to provided one.
9270
9274
  * If a relative url provided, a configured url will be prepended to it.
@@ -9276,7 +9280,7 @@ declare namespace CodeceptJS {
9276
9280
  * ```
9277
9281
  * @param url - value to check.
9278
9282
  */
9279
- seeCurrentUrlEquals(url: string): void;
9283
+ seeCurrentUrlEquals(url: string): Promise<any>;
9280
9284
  /**
9281
9285
  * Checks that current url is not equal to provided one.
9282
9286
  * If a relative url provided, a configured url will be prepended to it.
@@ -9287,7 +9291,7 @@ declare namespace CodeceptJS {
9287
9291
  * ```
9288
9292
  * @param url - value to check.
9289
9293
  */
9290
- dontSeeCurrentUrlEquals(url: string): void;
9294
+ dontSeeCurrentUrlEquals(url: string): Promise<any>;
9291
9295
  /**
9292
9296
  * Executes sync script on a page.
9293
9297
  * Pass arguments to function as additional parameters.
@@ -9352,7 +9356,7 @@ declare namespace CodeceptJS {
9352
9356
  * @param locator - located by CSS|XPath|strict locator.
9353
9357
  * @param scrollIntoViewOptions - see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
9354
9358
  */
9355
- scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): void;
9359
+ scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): Promise<any>;
9356
9360
  /**
9357
9361
  * Scrolls to element matched by locator.
9358
9362
  * Extra shift can be set with offsetX and offsetY options.
@@ -9365,7 +9369,7 @@ declare namespace CodeceptJS {
9365
9369
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
9366
9370
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
9367
9371
  */
9368
- scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
9372
+ scrollTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
9369
9373
  /**
9370
9374
  * Moves cursor to element matched by locator.
9371
9375
  * Extra shift can be set with offsetX and offsetY options.
@@ -9378,7 +9382,7 @@ declare namespace CodeceptJS {
9378
9382
  * @param [offsetX = 0] - (optional, `0` by default) X-axis offset.
9379
9383
  * @param [offsetY = 0] - (optional, `0` by default) Y-axis offset.
9380
9384
  */
9381
- moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): void;
9385
+ moveCursorTo(locator: CodeceptJS.LocatorOrString, offsetX?: number, offsetY?: number): Promise<any>;
9382
9386
  /**
9383
9387
  * Saves screenshot of the specified locator to ouput folder (set in codecept.json or codecept.conf.js).
9384
9388
  * Filename is relative to output folder.
@@ -9389,7 +9393,7 @@ declare namespace CodeceptJS {
9389
9393
  * @param locator - element located by CSS|XPath|strict locator.
9390
9394
  * @param fileName - file name to save.
9391
9395
  */
9392
- saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): void;
9396
+ saveElementScreenshot(locator: CodeceptJS.LocatorOrString, fileName: string): Promise<any>;
9393
9397
  /**
9394
9398
  * Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
9395
9399
  * Filename is relative to output folder.
@@ -9402,7 +9406,7 @@ declare namespace CodeceptJS {
9402
9406
  * @param fileName - file name to save.
9403
9407
  * @param [fullPage = false] - (optional, `false` by default) flag to enable fullscreen screenshot mode.
9404
9408
  */
9405
- saveScreenshot(fileName: string, fullPage?: boolean): void;
9409
+ saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
9406
9410
  /**
9407
9411
  * Sets cookie(s).
9408
9412
  *
@@ -9418,13 +9422,10 @@ declare namespace CodeceptJS {
9418
9422
  * ]);
9419
9423
  * ```
9420
9424
  * @param cookie - a cookie object or array of cookie objects.
9421
- *
9422
- *
9423
- *
9424
- * Uses Selenium's JSON [cookie
9425
+ * @returns Uses Selenium's JSON [cookie
9425
9426
  * format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
9426
9427
  */
9427
- setCookie(cookie: Cookie | Cookie[]): void;
9428
+ setCookie(cookie: Cookie | Cookie[]): Promise<any>;
9428
9429
  /**
9429
9430
  * Clears a cookie by name,
9430
9431
  * if none provided clears all cookies.
@@ -9435,7 +9436,7 @@ declare namespace CodeceptJS {
9435
9436
  * ```
9436
9437
  * @param [cookie = null] - (optional, `null` by default) cookie name
9437
9438
  */
9438
- clearCookie(cookie?: string): void;
9439
+ clearCookie(cookie?: string): Promise<any>;
9439
9440
  /**
9440
9441
  * Checks that cookie with given name exists.
9441
9442
  *
@@ -9444,7 +9445,7 @@ declare namespace CodeceptJS {
9444
9445
  * ```
9445
9446
  * @param name - cookie name.
9446
9447
  */
9447
- seeCookie(name: string): void;
9448
+ seeCookie(name: string): Promise<any>;
9448
9449
  /**
9449
9450
  * Checks that cookie with given name does not exist.
9450
9451
  *
@@ -9453,7 +9454,7 @@ declare namespace CodeceptJS {
9453
9454
  * ```
9454
9455
  * @param name - cookie name.
9455
9456
  */
9456
- dontSeeCookie(name: string): void;
9457
+ dontSeeCookie(name: string): Promise<any>;
9457
9458
  /**
9458
9459
  * Gets a cookie object by name.
9459
9460
  * If none provided gets all cookies.
@@ -9502,7 +9503,7 @@ declare namespace CodeceptJS {
9502
9503
  * ```
9503
9504
  * @param key - name of key to press down.
9504
9505
  */
9505
- pressKeyDown(key: string): void;
9506
+ pressKeyDown(key: string): Promise<any>;
9506
9507
  /**
9507
9508
  * Releases a key in the browser which was previously set to a down state.
9508
9509
  *
@@ -9515,7 +9516,7 @@ declare namespace CodeceptJS {
9515
9516
  * ```
9516
9517
  * @param key - name of key to release.
9517
9518
  */
9518
- pressKeyUp(key: string): void;
9519
+ pressKeyUp(key: string): Promise<any>;
9519
9520
  /**
9520
9521
  * Presses a key in the browser (on a focused element).
9521
9522
  *
@@ -9575,11 +9576,9 @@ declare namespace CodeceptJS {
9575
9576
  * - `'Space'`
9576
9577
  * - `'Tab'`
9577
9578
  * @param key - key or array of keys to press.
9578
- *
9579
- *
9580
- * _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.
9581
9580
  */
9582
- pressKey(key: string | string[]): void;
9581
+ pressKey(key: string | string[]): Promise<any>;
9583
9582
  /**
9584
9583
  * Types out the given text into an active field.
9585
9584
  * To slow down typing use a second parameter, to set interval between key presses.
@@ -9598,15 +9597,15 @@ declare namespace CodeceptJS {
9598
9597
  * @param key - or array of keys to type.
9599
9598
  * @param [delay = null] - (optional) delay in ms between key presses
9600
9599
  */
9601
- type(key: string | string[], delay?: number): void;
9600
+ type(key: string | string[], delay?: number): Promise<any>;
9602
9601
  /**
9603
9602
  * Resize the current window to provided width and height.
9604
9603
  * First parameter can be set to `maximize`.
9605
9604
  * @param width - width in pixels or `maximize`.
9606
9605
  * @param height - height in pixels.
9607
- * Appium: not tested in web, in apps doesn't work
9606
+ * @returns Appium: not tested in web, in apps doesn't work
9608
9607
  */
9609
- resizeWindow(width: number, height: number): void;
9608
+ resizeWindow(width: number, height: number): Promise<any>;
9610
9609
  /**
9611
9610
  * Drag an item to a destination element.
9612
9611
  *
@@ -9615,10 +9614,9 @@ declare namespace CodeceptJS {
9615
9614
  * ```
9616
9615
  * @param srcElement - located by CSS|XPath|strict locator.
9617
9616
  * @param destElement - located by CSS|XPath|strict locator.
9618
- *
9619
- * Appium: not tested
9617
+ * @returns Appium: not tested
9620
9618
  */
9621
- dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
9619
+ dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): Promise<any>;
9622
9620
  /**
9623
9621
  * Drag the scrubber of a slider to a given position
9624
9622
  * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
@@ -9630,7 +9628,7 @@ declare namespace CodeceptJS {
9630
9628
  * @param locator - located by label|name|CSS|XPath|strict locator.
9631
9629
  * @param offsetX - position to drag.
9632
9630
  */
9633
- dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): void;
9631
+ dragSlider(locator: CodeceptJS.LocatorOrString, offsetX: number): Promise<any>;
9634
9632
  /**
9635
9633
  * Get all Window Handles.
9636
9634
  * Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
@@ -9667,11 +9665,11 @@ declare namespace CodeceptJS {
9667
9665
  * Close all tabs except for the current one.
9668
9666
  *
9669
9667
  *
9670
- * ```js
9671
- * I.closeOtherTabs();
9672
- * ```
9668
+ * ```js
9669
+ * I.closeOtherTabs();
9670
+ * ```
9673
9671
  */
9674
- closeOtherTabs(): void;
9672
+ closeOtherTabs(): Promise<any>;
9675
9673
  /**
9676
9674
  * Pauses execution for a number of seconds.
9677
9675
  *
@@ -9680,14 +9678,14 @@ declare namespace CodeceptJS {
9680
9678
  * ```
9681
9679
  * @param sec - number of second to wait.
9682
9680
  */
9683
- wait(sec: number): void;
9681
+ wait(sec: number): Promise<any>;
9684
9682
  /**
9685
9683
  * Waits for element to become enabled (by default waits for 1sec).
9686
9684
  * Element can be located by CSS or XPath.
9687
9685
  * @param locator - element located by CSS|XPath|strict locator.
9688
9686
  * @param [sec = 1] - (optional) time in seconds to wait, 1 by default.
9689
9687
  */
9690
- waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9688
+ waitForEnabled(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9691
9689
  /**
9692
9690
  * Waits for element to be present on page (by default waits for 1sec).
9693
9691
  * Element can be located by CSS or XPath.
@@ -9699,7 +9697,7 @@ declare namespace CodeceptJS {
9699
9697
  * @param locator - element located by CSS|XPath|strict locator.
9700
9698
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
9701
9699
  */
9702
- waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9700
+ waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9703
9701
  /**
9704
9702
  * Waits for element to be clickable (by default waits for 1sec).
9705
9703
  * Element can be located by CSS or XPath.
@@ -9711,7 +9709,7 @@ declare namespace CodeceptJS {
9711
9709
  * @param locator - element located by CSS|XPath|strict locator.
9712
9710
  * @param [sec] - (optional, `1` by default) time in seconds to wait
9713
9711
  */
9714
- waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9712
+ waitForClickable(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9715
9713
  /**
9716
9714
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
9717
9715
  *
@@ -9721,7 +9719,7 @@ declare namespace CodeceptJS {
9721
9719
  * @param urlPart - value to check.
9722
9720
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9723
9721
  */
9724
- waitInUrl(urlPart: string, sec?: number): void;
9722
+ waitInUrl(urlPart: string, sec?: number): Promise<any>;
9725
9723
  /**
9726
9724
  * Waits for the entire URL to match the expected
9727
9725
  *
@@ -9732,7 +9730,7 @@ declare namespace CodeceptJS {
9732
9730
  * @param urlPart - value to check.
9733
9731
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9734
9732
  */
9735
- waitUrlEquals(urlPart: string, sec?: number): void;
9733
+ waitUrlEquals(urlPart: string, sec?: number): Promise<any>;
9736
9734
  /**
9737
9735
  * Waits for a text to appear (by default waits for 1sec).
9738
9736
  * Element can be located by CSS or XPath.
@@ -9746,7 +9744,7 @@ declare namespace CodeceptJS {
9746
9744
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9747
9745
  * @param [context = null] - (optional) element located by CSS|XPath|strict locator.
9748
9746
  */
9749
- waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
9747
+ waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
9750
9748
  /**
9751
9749
  * Waits for the specified value to be in value attribute.
9752
9750
  *
@@ -9757,7 +9755,7 @@ declare namespace CodeceptJS {
9757
9755
  * @param value - expected value.
9758
9756
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9759
9757
  */
9760
- waitForValue(field: LocatorOrString, value: string, sec?: number): void;
9758
+ waitForValue(field: LocatorOrString, value: string, sec?: number): Promise<any>;
9761
9759
  /**
9762
9760
  * Waits for an element to become visible on a page (by default waits for 1sec).
9763
9761
  * Element can be located by CSS or XPath.
@@ -9768,7 +9766,7 @@ declare namespace CodeceptJS {
9768
9766
  * @param locator - element located by CSS|XPath|strict locator.
9769
9767
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9770
9768
  */
9771
- waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9769
+ waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9772
9770
  /**
9773
9771
  * Waits for a specified number of elements on the page.
9774
9772
  *
@@ -9779,7 +9777,7 @@ declare namespace CodeceptJS {
9779
9777
  * @param num - number of elements.
9780
9778
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9781
9779
  */
9782
- waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): void;
9780
+ waitNumberOfVisibleElements(locator: CodeceptJS.LocatorOrString, num: number, sec?: number): Promise<any>;
9783
9781
  /**
9784
9782
  * Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
9785
9783
  * Element can be located by CSS or XPath.
@@ -9790,7 +9788,7 @@ declare namespace CodeceptJS {
9790
9788
  * @param locator - element located by CSS|XPath|strict locator.
9791
9789
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9792
9790
  */
9793
- waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9791
+ waitForInvisible(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9794
9792
  /**
9795
9793
  * Waits for an element to hide (by default waits for 1sec).
9796
9794
  * Element can be located by CSS or XPath.
@@ -9801,7 +9799,7 @@ declare namespace CodeceptJS {
9801
9799
  * @param locator - element located by CSS|XPath|strict locator.
9802
9800
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9803
9801
  */
9804
- waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9802
+ waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9805
9803
  /**
9806
9804
  * Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
9807
9805
  * Element can be located by CSS or XPath.
@@ -9812,7 +9810,7 @@ declare namespace CodeceptJS {
9812
9810
  * @param locator - element located by CSS|XPath|strict locator.
9813
9811
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
9814
9812
  */
9815
- waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): void;
9813
+ waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
9816
9814
  /**
9817
9815
  * Waits for a function to return true (waits for 1 sec by default).
9818
9816
  * Running in browser context.
@@ -9830,7 +9828,7 @@ declare namespace CodeceptJS {
9830
9828
  * @param [argsOrSec = null] - (optional, `1` by default) arguments for function or seconds.
9831
9829
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
9832
9830
  */
9833
- 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>;
9834
9832
  /**
9835
9833
  * Switches frame or in case of null locator reverts to parent.
9836
9834
  *
@@ -9840,45 +9838,45 @@ declare namespace CodeceptJS {
9840
9838
  * ```
9841
9839
  * @param [locator = null] - (optional, `null` by default) element located by CSS|XPath|strict locator.
9842
9840
  */
9843
- switchTo(locator?: CodeceptJS.LocatorOrString): void;
9841
+ switchTo(locator?: CodeceptJS.LocatorOrString): Promise<any>;
9844
9842
  /**
9845
9843
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab.
9846
9844
  *
9847
- * ```js
9848
- * I.switchToNextTab();
9849
- * I.switchToNextTab(2);
9850
- * ```
9845
+ * ```js
9846
+ * I.switchToNextTab();
9847
+ * I.switchToNextTab(2);
9848
+ * ```
9851
9849
  * @param [num = 1] - (optional) number of tabs to switch forward, default: 1.
9852
9850
  * @param [sec = null] - (optional) time in seconds to wait.
9853
9851
  */
9854
- switchToNextTab(num?: number, sec?: number | null): void;
9852
+ switchToNextTab(num?: number, sec?: number | null): Promise<any>;
9855
9853
  /**
9856
9854
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab.
9857
9855
  *
9858
- * ```js
9859
- * I.switchToPreviousTab();
9860
- * I.switchToPreviousTab(2);
9861
- * ```
9856
+ * ```js
9857
+ * I.switchToPreviousTab();
9858
+ * I.switchToPreviousTab(2);
9859
+ * ```
9862
9860
  * @param [num = 1] - (optional) number of tabs to switch backward, default: 1.
9863
9861
  * @param [sec = null] - (optional) time in seconds to wait.
9864
9862
  */
9865
- switchToPreviousTab(num?: number, sec?: number): void;
9863
+ switchToPreviousTab(num?: number, sec?: number): Promise<any>;
9866
9864
  /**
9867
9865
  * Close current tab.
9868
9866
  *
9869
- * ```js
9870
- * I.closeCurrentTab();
9871
- * ```
9867
+ * ```js
9868
+ * I.closeCurrentTab();
9869
+ * ```
9872
9870
  */
9873
- closeCurrentTab(): void;
9871
+ closeCurrentTab(): Promise<any>;
9874
9872
  /**
9875
9873
  * Open new tab and switch to it.
9876
9874
  *
9877
- * ```js
9878
- * I.openNewTab();
9879
- * ```
9875
+ * ```js
9876
+ * I.openNewTab();
9877
+ * ```
9880
9878
  */
9881
- openNewTab(): void;
9879
+ openNewTab(): Promise<any>;
9882
9880
  /**
9883
9881
  * Grab number of open tabs.
9884
9882
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -9896,7 +9894,7 @@ declare namespace CodeceptJS {
9896
9894
  * I.refreshPage();
9897
9895
  * ```
9898
9896
  */
9899
- refreshPage(): void;
9897
+ refreshPage(): Promise<any>;
9900
9898
  /**
9901
9899
  * Scroll page to the top.
9902
9900
  *
@@ -9904,7 +9902,7 @@ declare namespace CodeceptJS {
9904
9902
  * I.scrollPageToTop();
9905
9903
  * ```
9906
9904
  */
9907
- scrollPageToTop(): void;
9905
+ scrollPageToTop(): Promise<any>;
9908
9906
  /**
9909
9907
  * Scroll page to the bottom.
9910
9908
  *
@@ -9912,7 +9910,7 @@ declare namespace CodeceptJS {
9912
9910
  * I.scrollPageToBottom();
9913
9911
  * ```
9914
9912
  */
9915
- scrollPageToBottom(): void;
9913
+ scrollPageToBottom(): Promise<any>;
9916
9914
  /**
9917
9915
  * Retrieves a page scroll position and returns it to test.
9918
9916
  * Resumes test execution, so **should be used inside an async function with `await`** operator.
@@ -9935,7 +9933,7 @@ declare namespace CodeceptJS {
9935
9933
  * @param longitude - to set
9936
9934
  * @param [altitude = null] - (optional, null by default) to set
9937
9935
  */
9938
- setGeoLocation(latitude: number, longitude: number, altitude?: number): void;
9936
+ setGeoLocation(latitude: number, longitude: number, altitude?: number): Promise<any>;
9939
9937
  /**
9940
9938
  * Return the current geo location
9941
9939
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -9971,7 +9969,7 @@ declare namespace CodeceptJS {
9971
9969
  /**
9972
9970
  * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
9973
9971
  */
9974
- runOnAndroid(): void;
9972
+ runOnAndroid(caps: any, fn: any): Promise<any>;
9975
9973
  /**
9976
9974
  * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
9977
9975
  */