codeceptjs 3.5.10 → 3.5.12-beta.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 (225) hide show
  1. package/README.md +3 -3
  2. package/lib/command/run-multiple.js +3 -1
  3. package/lib/command/run-workers.js +32 -1
  4. package/lib/command/workers/runTests.js +18 -2
  5. package/lib/helper/Expect.js +33 -33
  6. package/lib/helper/Playwright.js +49 -26
  7. package/lib/helper/Puppeteer.js +41 -19
  8. package/lib/helper/WebDriver.js +155 -48
  9. package/lib/helper/extras/PlaywrightReactVueLocator.js +38 -0
  10. package/lib/locator.js +17 -4
  11. package/lib/plugin/retryFailedStep.js +6 -2
  12. package/lib/plugin/retryTo.js +2 -2
  13. package/lib/plugin/tryTo.js +5 -4
  14. package/package.json +25 -22
  15. package/typings/index.d.ts +8 -5
  16. package/typings/promiseBasedTypes.d.ts +203 -75
  17. package/typings/types.d.ts +213 -145
  18. package/docs/advanced.md +0 -351
  19. package/docs/ai.md +0 -248
  20. package/docs/api.md +0 -323
  21. package/docs/basics.md +0 -979
  22. package/docs/bdd.md +0 -539
  23. package/docs/best.md +0 -237
  24. package/docs/books.md +0 -37
  25. package/docs/bootstrap.md +0 -135
  26. package/docs/build/ApiDataFactory.js +0 -410
  27. package/docs/build/Appium.js +0 -2027
  28. package/docs/build/Expect.js +0 -422
  29. package/docs/build/FileSystem.js +0 -228
  30. package/docs/build/GraphQL.js +0 -229
  31. package/docs/build/GraphQLDataFactory.js +0 -309
  32. package/docs/build/JSONResponse.js +0 -338
  33. package/docs/build/Mochawesome.js +0 -71
  34. package/docs/build/Nightmare.js +0 -2152
  35. package/docs/build/OpenAI.js +0 -126
  36. package/docs/build/Playwright.js +0 -5078
  37. package/docs/build/Protractor.js +0 -2706
  38. package/docs/build/Puppeteer.js +0 -3874
  39. package/docs/build/REST.js +0 -344
  40. package/docs/build/TestCafe.js +0 -2125
  41. package/docs/build/WebDriver.js +0 -4124
  42. package/docs/changelog.md +0 -2572
  43. package/docs/commands.md +0 -266
  44. package/docs/community-helpers.md +0 -58
  45. package/docs/configuration.md +0 -157
  46. package/docs/continuous-integration.md +0 -22
  47. package/docs/custom-helpers.md +0 -306
  48. package/docs/data.md +0 -379
  49. package/docs/detox.md +0 -235
  50. package/docs/docker.md +0 -136
  51. package/docs/email.md +0 -183
  52. package/docs/examples.md +0 -149
  53. package/docs/helpers/ApiDataFactory.md +0 -266
  54. package/docs/helpers/Appium.md +0 -1374
  55. package/docs/helpers/Detox.md +0 -586
  56. package/docs/helpers/Expect.md +0 -275
  57. package/docs/helpers/FileSystem.md +0 -152
  58. package/docs/helpers/GraphQL.md +0 -151
  59. package/docs/helpers/GraphQLDataFactory.md +0 -226
  60. package/docs/helpers/JSONResponse.md +0 -254
  61. package/docs/helpers/Mochawesome.md +0 -8
  62. package/docs/helpers/MockRequest.md +0 -377
  63. package/docs/helpers/Nightmare.md +0 -1305
  64. package/docs/helpers/OpenAI.md +0 -70
  65. package/docs/helpers/Playwright.md +0 -2706
  66. package/docs/helpers/Polly.md +0 -44
  67. package/docs/helpers/Protractor.md +0 -1769
  68. package/docs/helpers/Puppeteer-firefox.md +0 -86
  69. package/docs/helpers/Puppeteer.md +0 -2291
  70. package/docs/helpers/REST.md +0 -218
  71. package/docs/helpers/TestCafe.md +0 -1321
  72. package/docs/helpers/WebDriver.md +0 -2460
  73. package/docs/hooks.md +0 -340
  74. package/docs/index.md +0 -111
  75. package/docs/installation.md +0 -75
  76. package/docs/internal-api.md +0 -266
  77. package/docs/locators.md +0 -331
  78. package/docs/mobile-react-native-locators.md +0 -67
  79. package/docs/mobile.md +0 -338
  80. package/docs/pageobjects.md +0 -291
  81. package/docs/parallel.md +0 -400
  82. package/docs/playwright.md +0 -632
  83. package/docs/plugins.md +0 -1259
  84. package/docs/puppeteer.md +0 -316
  85. package/docs/quickstart.md +0 -162
  86. package/docs/react.md +0 -69
  87. package/docs/reports.md +0 -392
  88. package/docs/secrets.md +0 -36
  89. package/docs/shadow.md +0 -68
  90. package/docs/shared/keys.mustache +0 -31
  91. package/docs/shared/react.mustache +0 -1
  92. package/docs/testcafe.md +0 -174
  93. package/docs/translation.md +0 -247
  94. package/docs/tutorial.md +0 -271
  95. package/docs/typescript.md +0 -180
  96. package/docs/ui.md +0 -59
  97. package/docs/videos.md +0 -28
  98. package/docs/visual.md +0 -202
  99. package/docs/vue.md +0 -121
  100. package/docs/webapi/amOnPage.mustache +0 -11
  101. package/docs/webapi/appendField.mustache +0 -11
  102. package/docs/webapi/attachFile.mustache +0 -12
  103. package/docs/webapi/blur.mustache +0 -18
  104. package/docs/webapi/checkOption.mustache +0 -13
  105. package/docs/webapi/clearCookie.mustache +0 -9
  106. package/docs/webapi/clearField.mustache +0 -9
  107. package/docs/webapi/click.mustache +0 -25
  108. package/docs/webapi/clickLink.mustache +0 -8
  109. package/docs/webapi/closeCurrentTab.mustache +0 -7
  110. package/docs/webapi/closeOtherTabs.mustache +0 -8
  111. package/docs/webapi/dontSee.mustache +0 -11
  112. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +0 -10
  113. package/docs/webapi/dontSeeCookie.mustache +0 -8
  114. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +0 -10
  115. package/docs/webapi/dontSeeElement.mustache +0 -8
  116. package/docs/webapi/dontSeeElementInDOM.mustache +0 -8
  117. package/docs/webapi/dontSeeInCurrentUrl.mustache +0 -4
  118. package/docs/webapi/dontSeeInField.mustache +0 -11
  119. package/docs/webapi/dontSeeInSource.mustache +0 -8
  120. package/docs/webapi/dontSeeInTitle.mustache +0 -8
  121. package/docs/webapi/doubleClick.mustache +0 -13
  122. package/docs/webapi/downloadFile.mustache +0 -12
  123. package/docs/webapi/dragAndDrop.mustache +0 -9
  124. package/docs/webapi/dragSlider.mustache +0 -11
  125. package/docs/webapi/executeAsyncScript.mustache +0 -24
  126. package/docs/webapi/executeScript.mustache +0 -26
  127. package/docs/webapi/fillField.mustache +0 -16
  128. package/docs/webapi/focus.mustache +0 -13
  129. package/docs/webapi/forceClick.mustache +0 -28
  130. package/docs/webapi/forceRightClick.mustache +0 -18
  131. package/docs/webapi/grabAllWindowHandles.mustache +0 -7
  132. package/docs/webapi/grabAttributeFrom.mustache +0 -10
  133. package/docs/webapi/grabAttributeFromAll.mustache +0 -9
  134. package/docs/webapi/grabBrowserLogs.mustache +0 -9
  135. package/docs/webapi/grabCookie.mustache +0 -11
  136. package/docs/webapi/grabCssPropertyFrom.mustache +0 -11
  137. package/docs/webapi/grabCssPropertyFromAll.mustache +0 -10
  138. package/docs/webapi/grabCurrentUrl.mustache +0 -9
  139. package/docs/webapi/grabCurrentWindowHandle.mustache +0 -6
  140. package/docs/webapi/grabDataFromPerformanceTiming.mustache +0 -20
  141. package/docs/webapi/grabElementBoundingRect.mustache +0 -20
  142. package/docs/webapi/grabGeoLocation.mustache +0 -8
  143. package/docs/webapi/grabHTMLFrom.mustache +0 -10
  144. package/docs/webapi/grabHTMLFromAll.mustache +0 -9
  145. package/docs/webapi/grabNumberOfOpenTabs.mustache +0 -8
  146. package/docs/webapi/grabNumberOfVisibleElements.mustache +0 -9
  147. package/docs/webapi/grabPageScrollPosition.mustache +0 -8
  148. package/docs/webapi/grabPopupText.mustache +0 -5
  149. package/docs/webapi/grabSource.mustache +0 -8
  150. package/docs/webapi/grabTextFrom.mustache +0 -10
  151. package/docs/webapi/grabTextFromAll.mustache +0 -9
  152. package/docs/webapi/grabTitle.mustache +0 -8
  153. package/docs/webapi/grabValueFrom.mustache +0 -9
  154. package/docs/webapi/grabValueFromAll.mustache +0 -8
  155. package/docs/webapi/grabWebElement.mustache +0 -9
  156. package/docs/webapi/grabWebElements.mustache +0 -9
  157. package/docs/webapi/moveCursorTo.mustache +0 -12
  158. package/docs/webapi/openNewTab.mustache +0 -7
  159. package/docs/webapi/pressKey.mustache +0 -12
  160. package/docs/webapi/pressKeyDown.mustache +0 -12
  161. package/docs/webapi/pressKeyUp.mustache +0 -12
  162. package/docs/webapi/pressKeyWithKeyNormalization.mustache +0 -60
  163. package/docs/webapi/refreshPage.mustache +0 -6
  164. package/docs/webapi/resizeWindow.mustache +0 -6
  165. package/docs/webapi/rightClick.mustache +0 -14
  166. package/docs/webapi/saveElementScreenshot.mustache +0 -10
  167. package/docs/webapi/saveScreenshot.mustache +0 -12
  168. package/docs/webapi/say.mustache +0 -10
  169. package/docs/webapi/scrollIntoView.mustache +0 -11
  170. package/docs/webapi/scrollPageToBottom.mustache +0 -6
  171. package/docs/webapi/scrollPageToTop.mustache +0 -6
  172. package/docs/webapi/scrollTo.mustache +0 -12
  173. package/docs/webapi/see.mustache +0 -11
  174. package/docs/webapi/seeAttributesOnElements.mustache +0 -9
  175. package/docs/webapi/seeCheckboxIsChecked.mustache +0 -10
  176. package/docs/webapi/seeCookie.mustache +0 -8
  177. package/docs/webapi/seeCssPropertiesOnElements.mustache +0 -9
  178. package/docs/webapi/seeCurrentUrlEquals.mustache +0 -11
  179. package/docs/webapi/seeElement.mustache +0 -8
  180. package/docs/webapi/seeElementInDOM.mustache +0 -8
  181. package/docs/webapi/seeInCurrentUrl.mustache +0 -8
  182. package/docs/webapi/seeInField.mustache +0 -12
  183. package/docs/webapi/seeInPopup.mustache +0 -8
  184. package/docs/webapi/seeInSource.mustache +0 -7
  185. package/docs/webapi/seeInTitle.mustache +0 -8
  186. package/docs/webapi/seeNumberOfElements.mustache +0 -11
  187. package/docs/webapi/seeNumberOfVisibleElements.mustache +0 -10
  188. package/docs/webapi/seeTextEquals.mustache +0 -9
  189. package/docs/webapi/seeTitleEquals.mustache +0 -8
  190. package/docs/webapi/selectOption.mustache +0 -21
  191. package/docs/webapi/setCookie.mustache +0 -16
  192. package/docs/webapi/setGeoLocation.mustache +0 -12
  193. package/docs/webapi/switchTo.mustache +0 -9
  194. package/docs/webapi/switchToNextTab.mustache +0 -10
  195. package/docs/webapi/switchToPreviousTab.mustache +0 -10
  196. package/docs/webapi/type.mustache +0 -21
  197. package/docs/webapi/uncheckOption.mustache +0 -13
  198. package/docs/webapi/wait.mustache +0 -8
  199. package/docs/webapi/waitForClickable.mustache +0 -11
  200. package/docs/webapi/waitForDetached.mustache +0 -10
  201. package/docs/webapi/waitForElement.mustache +0 -11
  202. package/docs/webapi/waitForEnabled.mustache +0 -6
  203. package/docs/webapi/waitForFunction.mustache +0 -17
  204. package/docs/webapi/waitForInvisible.mustache +0 -10
  205. package/docs/webapi/waitForText.mustache +0 -13
  206. package/docs/webapi/waitForValue.mustache +0 -10
  207. package/docs/webapi/waitForVisible.mustache +0 -10
  208. package/docs/webapi/waitInUrl.mustache +0 -9
  209. package/docs/webapi/waitNumberOfVisibleElements.mustache +0 -10
  210. package/docs/webapi/waitToHide.mustache +0 -10
  211. package/docs/webapi/waitUrlEquals.mustache +0 -10
  212. package/docs/webdriver.md +0 -655
  213. package/docs/wiki/Books-&-Posts.md +0 -27
  214. package/docs/wiki/Community-Helpers-&-Plugins.md +0 -53
  215. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +0 -61
  216. package/docs/wiki/Examples.md +0 -145
  217. package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +0 -68
  218. package/docs/wiki/Home.md +0 -16
  219. package/docs/wiki/Migration-to-Appium-v2---CodeceptJS.md +0 -83
  220. package/docs/wiki/Release-Process.md +0 -24
  221. package/docs/wiki/Roadmap.md +0 -23
  222. package/docs/wiki/Tests.md +0 -1393
  223. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +0 -153
  224. package/docs/wiki/Videos.md +0 -19
  225. package/lib/helper/extras/PlaywrightReact.js +0 -9
@@ -980,13 +980,13 @@ declare namespace CodeceptJS {
980
980
  * I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
981
981
  * ```
982
982
  * @param locator - located by CSS|XPath|strict locator.
983
- * @param scrollIntoViewOptions - see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
983
+ * @param scrollIntoViewOptions - either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
984
984
  * @returns automatically synchronized promise through #recorder
985
985
  *
986
986
  *
987
987
  * Supported only for web testing
988
988
  */
989
- scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): void;
989
+ scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions | boolean): void;
990
990
  /**
991
991
  * Verifies that the specified checkbox is checked.
992
992
  *
@@ -1131,7 +1131,7 @@ declare namespace CodeceptJS {
1131
1131
  * {
1132
1132
  * helpers: {
1133
1133
  * Playwright: {...},
1134
- * ExpectHelper: {},
1134
+ * Expect: {},
1135
1135
  * }
1136
1136
  * }
1137
1137
  * ```
@@ -1139,57 +1139,51 @@ declare namespace CodeceptJS {
1139
1139
  * ## Methods
1140
1140
  */
1141
1141
  class ExpectHelper {
1142
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg: any): void;
1143
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg: any): void;
1144
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg: any): void;
1145
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg: any): void;
1146
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg: any): void;
1147
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg: any): void;
1148
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg: any): void;
1149
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg: any): void;
1150
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg: any): void;
1151
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg: any): void;
1152
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg: any): void;
1142
+ expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1143
+ expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1144
+ expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1145
+ expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1146
+ expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
1147
+ expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
1148
+ expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
1149
+ expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
1150
+ expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
1151
+ expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
1152
+ expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
1153
1153
  /**
1154
1154
  * @param ajvOptions - Pass AJV options
1155
1155
  */
1156
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg: any, ajvOptions: any): void;
1157
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg: any): void;
1158
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg: any): void;
1159
- expectToBeA(targetData: any, type: any, customErrorMsg: any): void;
1160
- expectToBeAn(targetData: any, type: any, customErrorMsg: any): void;
1161
- expectMatchRegex(targetData: any, regex: any, customErrorMsg: any): void;
1162
- expectLengthOf(targetData: any, length: any, customErrorMsg: any): void;
1163
- expectEmpty(targetData: any, customErrorMsg: any): void;
1164
- expectTrue(targetData: any, customErrorMsg: any): void;
1165
- expectFalse(targetData: any, customErrorMsg: any): void;
1166
- /**
1167
- * @param aboveThan - number | Date
1168
- */
1169
- expectAbove(targetData: any, aboveThan: any, customErrorMsg: any): void;
1170
- /**
1171
- * @param belowThan - number | Date
1172
- */
1173
- expectBelow(targetData: any, belowThan: any, customErrorMsg: any): void;
1174
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg: any): void;
1175
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg: any): void;
1176
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg: any): void;
1156
+ expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions: any): void;
1157
+ expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
1158
+ expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
1159
+ expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
1160
+ expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
1161
+ expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
1162
+ expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
1163
+ expectEmpty(targetData: any, customErrorMsg?: any): void;
1164
+ expectTrue(targetData: any, customErrorMsg?: any): void;
1165
+ expectFalse(targetData: any, customErrorMsg?: any): void;
1166
+ expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
1167
+ expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
1168
+ expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
1169
+ expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
1170
+ expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1177
1171
  /**
1178
1172
  * expects members of two arrays are deeply equal
1179
1173
  */
1180
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg: any): void;
1174
+ expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1181
1175
  /**
1182
1176
  * expects an array to be a superset of another array
1183
1177
  */
1184
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg: any): void;
1178
+ expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
1185
1179
  /**
1186
1180
  * expects members of two JSON objects are deeply equal excluding some properties
1187
1181
  */
1188
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg: any): void;
1182
+ expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
1189
1183
  /**
1190
1184
  * expects a JSON object matches a provided pattern
1191
1185
  */
1192
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg: any): void;
1186
+ expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
1193
1187
  }
1194
1188
  /**
1195
1189
  * Helper for testing filesystem.
@@ -3120,7 +3114,7 @@ declare namespace CodeceptJS {
3120
3114
  * });
3121
3115
  * ```
3122
3116
  * @param description - used to show in logs.
3123
- * @param fn - async function that executed with Playwright helper as argumen
3117
+ * @param fn - async function that executed with Playwright helper as arguments
3124
3118
  */
3125
3119
  usePlaywrightTo(description: string, fn: (...params: any[]) => any): void;
3126
3120
  /**
@@ -3207,15 +3201,8 @@ declare namespace CodeceptJS {
3207
3201
  */
3208
3202
  amOnPage(url: string): void;
3209
3203
  /**
3210
- * Resize the current window to provided width and height.
3211
- * First parameter can be set to `maximize`.
3212
- * @param width - width in pixels or `maximize`.
3213
- * @param height - height in pixels.
3214
- * @returns automatically synchronized promise through #recorder
3215
- *
3216
- *
3217
3204
  * Unlike other drivers Playwright changes the size of a viewport, not the window!
3218
- * Playwright does not control the window of a browser so it can't adjust its real size.
3205
+ * Playwright does not control the window of a browser, so it can't adjust its real size.
3219
3206
  * It also can't maximize a window.
3220
3207
  *
3221
3208
  * Update configuration to change real window size on start:
@@ -3225,6 +3212,12 @@ declare namespace CodeceptJS {
3225
3212
  * // @codeceptjs/configure package must be installed
3226
3213
  * { setWindowSize } = require('@codeceptjs/configure');
3227
3214
  * ````
3215
+ *
3216
+ * Resize the current window to provided width and height.
3217
+ * First parameter can be set to `maximize`.
3218
+ * @param width - width in pixels or `maximize`.
3219
+ * @param height - height in pixels.
3220
+ * @returns automatically synchronized promise through #recorder
3228
3221
  */
3229
3222
  resizeWindow(width: number, height: number): void;
3230
3223
  /**
@@ -3300,6 +3293,13 @@ declare namespace CodeceptJS {
3300
3293
  */
3301
3294
  grabDisabledElementStatus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<boolean>;
3302
3295
  /**
3296
+ * ```js
3297
+ * // specify coordinates for source position
3298
+ * I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
3299
+ * ```
3300
+ *
3301
+ * > When no option is set, custom drag and drop would be used, to use the dragAndDrop API from Playwright, please set options, for example `force: true`
3302
+ *
3303
3303
  * Drag an item to a destination element.
3304
3304
  *
3305
3305
  * ```js
@@ -3308,13 +3308,6 @@ declare namespace CodeceptJS {
3308
3308
  * @param srcElement - located by CSS|XPath|strict locator.
3309
3309
  * @param destElement - located by CSS|XPath|strict locator.
3310
3310
  * @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
3311
- *
3312
- * ```js
3313
- * // specify coordinates for source position
3314
- * I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
3315
- * ```
3316
- *
3317
- * > When no option is set, custom drag and drop would be used, to use the dragAndDrop API from Playwright, please set options, for example `force: true`
3318
3311
  * @returns automatically synchronized promise through #recorder
3319
3312
  */
3320
3313
  dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString, options?: any): void;
@@ -3643,12 +3636,7 @@ declare namespace CodeceptJS {
3643
3636
  * // using strict locator
3644
3637
  * I.click({css: 'nav a.login'});
3645
3638
  * ```
3646
- * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3647
- * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3648
- * @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
3649
- *
3650
- * Examples:
3651
- *
3639
+ * @example
3652
3640
  * ```js
3653
3641
  * // click on element at position
3654
3642
  * I.click('canvas', '.model', { position: { x: 20, y: 40 } })
@@ -3656,6 +3644,9 @@ declare namespace CodeceptJS {
3656
3644
  * // make ctrl-click
3657
3645
  * I.click('.edit', null, { modifiers: ['Ctrl'] } )
3658
3646
  * ```
3647
+ * @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
3648
+ * @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
3649
+ * @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
3659
3650
  * @returns automatically synchronized promise through #recorder
3660
3651
  */
3661
3652
  click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, options?: any): void;
@@ -3725,6 +3716,16 @@ declare namespace CodeceptJS {
3725
3716
  */
3726
3717
  rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3727
3718
  /**
3719
+ * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
3720
+ *
3721
+ * Examples:
3722
+ *
3723
+ * ```js
3724
+ * // click on element at position
3725
+ * I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3726
+ * ```
3727
+ * > ⚠️ To avoid flakiness, option `force: true` is set by default
3728
+ *
3728
3729
  * Selects a checkbox or radio button.
3729
3730
  * Element is located by label or name or CSS or XPath.
3730
3731
  *
@@ -3738,20 +3739,19 @@ declare namespace CodeceptJS {
3738
3739
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
3739
3740
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
3740
3741
  * @returns automatically synchronized promise through #recorder
3741
- *
3742
- *
3743
- * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
3742
+ */
3743
+ checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3744
+ /**
3745
+ * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
3744
3746
  *
3745
3747
  * Examples:
3746
3748
  *
3747
3749
  * ```js
3748
3750
  * // click on element at position
3749
- * I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3751
+ * I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3750
3752
  * ```
3751
3753
  * > ⚠️ To avoid flakiness, option `force: true` is set by default
3752
- */
3753
- checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3754
- /**
3754
+ *
3755
3755
  * Unselects a checkbox or radio button.
3756
3756
  * Element is located by label or name or CSS or XPath.
3757
3757
  *
@@ -3765,17 +3765,6 @@ declare namespace CodeceptJS {
3765
3765
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
3766
3766
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
3767
3767
  * @returns automatically synchronized promise through #recorder
3768
- *
3769
- *
3770
- * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
3771
- *
3772
- * Examples:
3773
- *
3774
- * ```js
3775
- * // click on element at position
3776
- * I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
3777
- * ```
3778
- * > ⚠️ To avoid flakiness, option `force: true` is set by default
3779
3768
  */
3780
3769
  uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
3781
3770
  /**
@@ -3831,6 +3820,8 @@ declare namespace CodeceptJS {
3831
3820
  */
3832
3821
  pressKeyUp(key: string): void;
3833
3822
  /**
3823
+ * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
3824
+ *
3834
3825
  * Presses a key in the browser (on a focused element).
3835
3826
  *
3836
3827
  * _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
@@ -3890,9 +3881,6 @@ declare namespace CodeceptJS {
3890
3881
  * - `'Tab'`
3891
3882
  * @param key - key or array of keys to press.
3892
3883
  * @returns automatically synchronized promise through #recorder
3893
- *
3894
- *
3895
- * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
3896
3884
  */
3897
3885
  pressKey(key: string | string[]): void;
3898
3886
  /**
@@ -4240,6 +4228,8 @@ declare namespace CodeceptJS {
4240
4228
  */
4241
4229
  dontSeeCookie(name: string): void;
4242
4230
  /**
4231
+ * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
4232
+ *
4243
4233
  * Gets a cookie object by name.
4244
4234
  * If none provided gets all cookies.
4245
4235
  * Resumes test execution, so **should be used inside async function with `await`** operator.
@@ -4250,9 +4240,6 @@ declare namespace CodeceptJS {
4250
4240
  * ```
4251
4241
  * @param [name = null] - cookie name.
4252
4242
  * @returns attribute value
4253
- *
4254
- *
4255
- * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
4256
4243
  */
4257
4244
  grabCookie(name?: string): any;
4258
4245
  /**
@@ -4278,8 +4265,8 @@ declare namespace CodeceptJS {
4278
4265
  * ```js
4279
4266
  * I.executeScript(({x, y}) => x + y, {x, y});
4280
4267
  * ```
4281
- * You can pass only one parameter into a function
4282
- * but you can pass in array or object.
4268
+ * You can pass only one parameter into a function,
4269
+ * or you can pass in array or object.
4283
4270
  *
4284
4271
  * ```js
4285
4272
  * I.executeScript(([x, y]) => x + y, [x, y]);
@@ -4559,6 +4546,8 @@ declare namespace CodeceptJS {
4559
4546
  */
4560
4547
  waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4561
4548
  /**
4549
+ * This method accepts [React selectors](https://codecept.io/react).
4550
+ *
4562
4551
  * Waits for an element to become visible on a page (by default waits for 1sec).
4563
4552
  * Element can be located by CSS or XPath.
4564
4553
  *
@@ -4568,9 +4557,6 @@ declare namespace CodeceptJS {
4568
4557
  * @param locator - element located by CSS|XPath|strict locator.
4569
4558
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4570
4559
  * @returns automatically synchronized promise through #recorder
4571
- *
4572
- *
4573
- * This method accepts [React selectors](https://codecept.io/react).
4574
4560
  */
4575
4561
  waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4576
4562
  /**
@@ -4597,6 +4583,17 @@ declare namespace CodeceptJS {
4597
4583
  * @returns automatically synchronized promise through #recorder
4598
4584
  */
4599
4585
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4586
+ /**
4587
+ * Waits for number of tabs.
4588
+ *
4589
+ * ```js
4590
+ * I.waitForNumberOfTabs(2);
4591
+ * ```
4592
+ * @param expectedTabs - expecting the number of tabs.
4593
+ * @param sec - number of secs to wait.
4594
+ * @returns automatically synchronized promise through #recorder
4595
+ */
4596
+ waitForNumberOfTabs(expectedTabs: number, sec: number): void;
4600
4597
  /**
4601
4598
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
4602
4599
  *
@@ -6597,16 +6594,15 @@ declare namespace CodeceptJS {
6597
6594
  */
6598
6595
  amOnPage(url: string): void;
6599
6596
  /**
6597
+ * Unlike other drivers Puppeteer changes the size of a viewport, not the window!
6598
+ * Puppeteer does not control the window of a browser, so it can't adjust its real size.
6599
+ * It also can't maximize a window.
6600
+ *
6600
6601
  * Resize the current window to provided width and height.
6601
6602
  * First parameter can be set to `maximize`.
6602
6603
  * @param width - width in pixels or `maximize`.
6603
6604
  * @param height - height in pixels.
6604
6605
  * @returns automatically synchronized promise through #recorder
6605
- *
6606
- *
6607
- * Unlike other drivers Puppeteer changes the size of a viewport, not the window!
6608
- * Puppeteer does not control the window of a browser so it can't adjust its real size.
6609
- * It also can't maximize a window.
6610
6606
  */
6611
6607
  resizeWindow(width: number, height: number): void;
6612
6608
  /**
@@ -6785,7 +6781,7 @@ declare namespace CodeceptJS {
6785
6781
  */
6786
6782
  _locate(): void;
6787
6783
  /**
6788
- * Find a checkbox by providing human readable text:
6784
+ * Find a checkbox by providing human-readable text:
6789
6785
  * NOTE: Assumes the checkable element exists
6790
6786
  *
6791
6787
  * ```js
@@ -6794,7 +6790,7 @@ declare namespace CodeceptJS {
6794
6790
  */
6795
6791
  _locateCheckable(): void;
6796
6792
  /**
6797
- * Find a clickable element by providing human readable text:
6793
+ * Find a clickable element by providing human-readable text:
6798
6794
  *
6799
6795
  * ```js
6800
6796
  * this.helpers['Puppeteer']._locateClickable('Next page').then // ...
@@ -6802,7 +6798,7 @@ declare namespace CodeceptJS {
6802
6798
  */
6803
6799
  _locateClickable(): void;
6804
6800
  /**
6805
- * Find field elements by providing human readable text:
6801
+ * Find field elements by providing human-readable text:
6806
6802
  *
6807
6803
  * ```js
6808
6804
  * this.helpers['Puppeteer']._locateFields('Your email').then // ...
@@ -6999,7 +6995,7 @@ declare namespace CodeceptJS {
6999
6995
  * Sets a directory to where save files. Allows to test file downloads.
7000
6996
  * Should be used with [FileSystem helper](https://codecept.io/helpers/FileSystem) to check that file were downloaded correctly.
7001
6997
  *
7002
- * By default files are saved to `output/downloads`.
6998
+ * By default, files are saved to `output/downloads`.
7003
6999
  * This directory is cleaned on every `handleDownloads` call, to ensure no old files are kept.
7004
7000
  *
7005
7001
  * ```js
@@ -7140,6 +7136,8 @@ declare namespace CodeceptJS {
7140
7136
  */
7141
7137
  pressKeyUp(key: string): void;
7142
7138
  /**
7139
+ * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
7140
+ *
7143
7141
  * Presses a key in the browser (on a focused element).
7144
7142
  *
7145
7143
  * _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
@@ -7199,9 +7197,6 @@ declare namespace CodeceptJS {
7199
7197
  * - `'Tab'`
7200
7198
  * @param key - key or array of keys to press.
7201
7199
  * @returns automatically synchronized promise through #recorder
7202
- *
7203
- *
7204
- * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
7205
7200
  */
7206
7201
  pressKey(key: string | string[]): void;
7207
7202
  /**
@@ -7306,6 +7301,8 @@ declare namespace CodeceptJS {
7306
7301
  */
7307
7302
  dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
7308
7303
  /**
7304
+ * > ⚠ 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.
7305
+ *
7309
7306
  * Attaches a file to element located by label, name, CSS or XPath
7310
7307
  * Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
7311
7308
  * File will be uploaded to remote system (if tests are running remotely).
@@ -7317,9 +7314,6 @@ declare namespace CodeceptJS {
7317
7314
  * @param locator - field located by label|name|CSS|XPath|strict locator.
7318
7315
  * @param pathToFile - local file path relative to codecept.conf.ts or codecept.conf.js config file.
7319
7316
  * @returns automatically synchronized promise through #recorder
7320
- *
7321
- *
7322
- * > ⚠ 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.
7323
7317
  */
7324
7318
  attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
7325
7319
  /**
@@ -7590,6 +7584,8 @@ declare namespace CodeceptJS {
7590
7584
  */
7591
7585
  clearCookie(cookie?: string): void;
7592
7586
  /**
7587
+ * If a function returns a Promise, tt will wait for its resolution.
7588
+ *
7593
7589
  * Executes sync script on a page.
7594
7590
  * Pass arguments to function as additional parameters.
7595
7591
  * Will return execution result to a test.
@@ -7615,12 +7611,10 @@ declare namespace CodeceptJS {
7615
7611
  * @param fn - function to be executed in browser context.
7616
7612
  * @param args - to be passed to function.
7617
7613
  * @returns script return value
7618
- *
7619
- *
7620
- * If a function returns a Promise It will wait for it resolution.
7621
7614
  */
7622
7615
  executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
7623
7616
  /**
7617
+ * Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
7624
7618
  * Executes async script on page.
7625
7619
  * Provided function should execute a passed callback (as first argument) to signal it is finished.
7626
7620
  *
@@ -7644,9 +7638,6 @@ declare namespace CodeceptJS {
7644
7638
  * @param fn - function to be executed in browser context.
7645
7639
  * @param args - to be passed to function.
7646
7640
  * @returns script return value
7647
- *
7648
- *
7649
- * Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
7650
7641
  */
7651
7642
  executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
7652
7643
  /**
@@ -7931,7 +7922,7 @@ declare namespace CodeceptJS {
7931
7922
  * @returns automatically synchronized promise through #recorder
7932
7923
  *
7933
7924
  *
7934
- * This method accepts [React selectors](https://codecept.io/react).
7925
+ * {{ react }}
7935
7926
  */
7936
7927
  waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
7937
7928
  /**
@@ -7958,6 +7949,17 @@ declare namespace CodeceptJS {
7958
7949
  * @returns automatically synchronized promise through #recorder
7959
7950
  */
7960
7951
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
7952
+ /**
7953
+ * Waits for number of tabs.
7954
+ *
7955
+ * ```js
7956
+ * I.waitForNumberOfTabs(2);
7957
+ * ```
7958
+ * @param expectedTabs - expecting the number of tabs.
7959
+ * @param sec - number of secs to wait.
7960
+ * @returns automatically synchronized promise through #recorder
7961
+ */
7962
+ waitForNumberOfTabs(expectedTabs: number, sec: number): void;
7961
7963
  /**
7962
7964
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
7963
7965
  *
@@ -8047,9 +8049,9 @@ declare namespace CodeceptJS {
8047
8049
  */
8048
8050
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
8049
8051
  /**
8050
- * Waits for navigation to finish. By default takes configured `waitForNavigation` option.
8052
+ * Waits for navigation to finish. By default, takes configured `waitForNavigation` option.
8051
8053
  *
8052
- * See [Pupeteer's reference](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
8054
+ * See [Puppeteer's reference](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
8053
8055
  */
8054
8056
  waitForNavigation(opts: any): void;
8055
8057
  /**
@@ -9275,6 +9277,8 @@ declare namespace CodeceptJS {
9275
9277
  * @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
9276
9278
  * @property [timeouts] - [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
9277
9279
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
9280
+ * @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
9281
+ * @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
9278
9282
  */
9279
9283
  type WebDriverConfig = {
9280
9284
  url: string;
@@ -9297,6 +9301,8 @@ declare namespace CodeceptJS {
9297
9301
  manualStart?: boolean;
9298
9302
  timeouts?: any;
9299
9303
  highlightElement?: boolean;
9304
+ logLevel?: string;
9305
+ devtoolsProtocol?: boolean;
9300
9306
  };
9301
9307
  /**
9302
9308
  * WebDriver helper which wraps [webdriverio](http://webdriver.io/) library to
@@ -9304,6 +9310,13 @@ declare namespace CodeceptJS {
9304
9310
  *
9305
9311
  * WebDriver requires Selenium Server and ChromeDriver/GeckoDriver to be installed. Those tools can be easily installed via NPM. Please check [Testing with WebDriver](https://codecept.io/webdriver/#testing-with-webdriver) for more details.
9306
9312
  *
9313
+ * With the release of WebdriverIO version v8.14.0, and onwards, all driver management hassles are now a thing of the past 🙌. Read more [here](https://webdriver.io/blog/2023/07/31/driver-management/).
9314
+ * One of the significant advantages of this update is that you can now get rid of any driver services you previously had to manage, such as
9315
+ * `wdio-chromedriver-service`, `wdio-geckodriver-service`, `wdio-edgedriver-service`, `wdio-safaridriver-service`, and even `@wdio/selenium-standalone-service`.
9316
+ *
9317
+ * For those who require custom driver options, fear not; WebDriver Helper allows you to pass in driver options through custom WebDriver configuration.
9318
+ * If you have a custom grid, use a cloud service, or prefer to run your own driver, there's no need to worry since WebDriver Helper will only start a driver when there are no other connection information settings like hostname or port specified.
9319
+ *
9307
9320
  * <!-- configuration -->
9308
9321
  *
9309
9322
  * Example:
@@ -9325,6 +9338,28 @@ declare namespace CodeceptJS {
9325
9338
  * }
9326
9339
  * ```
9327
9340
  *
9341
+ * Testing Chrome locally is now more convenient than ever. You can define a browser channel, and WebDriver Helper will take care of downloading the specified browser version for you.
9342
+ * For example:
9343
+ *
9344
+ * ```js
9345
+ * {
9346
+ * helpers: {
9347
+ * WebDriver : {
9348
+ * smartWait: 5000,
9349
+ * browser: "chrome",
9350
+ * browserVersion: '116.0.5793.0', // or 'stable', 'beta', 'dev' or 'canary'
9351
+ * restart: false,
9352
+ * windowSize: "maximize",
9353
+ * timeouts: {
9354
+ * "script": 60000,
9355
+ * "page load": 10000
9356
+ * }
9357
+ * }
9358
+ * }
9359
+ * }
9360
+ * ```
9361
+ *
9362
+ *
9328
9363
  * Example with basic authentication
9329
9364
  * ```js
9330
9365
  * {
@@ -9365,6 +9400,25 @@ declare namespace CodeceptJS {
9365
9400
  * }
9366
9401
  * ```
9367
9402
  *
9403
+ * ### Running with devtools protocol
9404
+ *
9405
+ * ```js
9406
+ * {
9407
+ * helpers: {
9408
+ * WebDriver : {
9409
+ * url: "http://localhost",
9410
+ * browser: "chrome",
9411
+ * devtoolsProtocol: true,
9412
+ * desiredCapabilities: {
9413
+ * chromeOptions: {
9414
+ * args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
9415
+ * }
9416
+ * }
9417
+ * }
9418
+ * }
9419
+ * }
9420
+ * ```
9421
+ *
9368
9422
  * ### Internet Explorer
9369
9423
  *
9370
9424
  * Additional configuration params can be used from [IE options](https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/IE/Options.html)
@@ -9920,6 +9974,8 @@ declare namespace CodeceptJS {
9920
9974
  */
9921
9975
  selectOption(select: LocatorOrString, option: string | any[]): void;
9922
9976
  /**
9977
+ * Appium: not tested
9978
+ *
9923
9979
  * Attaches a file to element located by label, name, CSS or XPath
9924
9980
  * Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
9925
9981
  * File will be uploaded to remote system (if tests are running remotely).
@@ -9931,11 +9987,10 @@ declare namespace CodeceptJS {
9931
9987
  * @param locator - field located by label|name|CSS|XPath|strict locator.
9932
9988
  * @param pathToFile - local file path relative to codecept.conf.ts or codecept.conf.js config file.
9933
9989
  * @returns automatically synchronized promise through #recorder
9934
- *
9935
- * Appium: not tested
9936
9990
  */
9937
9991
  attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
9938
9992
  /**
9993
+ * Appium: not tested
9939
9994
  * Selects a checkbox or radio button.
9940
9995
  * Element is located by label or name or CSS or XPath.
9941
9996
  *
@@ -9949,11 +10004,10 @@ declare namespace CodeceptJS {
9949
10004
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
9950
10005
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
9951
10006
  * @returns automatically synchronized promise through #recorder
9952
- *
9953
- * Appium: not tested
9954
10007
  */
9955
10008
  checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
9956
10009
  /**
10010
+ * Appium: not tested
9957
10011
  * Unselects a checkbox or radio button.
9958
10012
  * Element is located by label or name or CSS or XPath.
9959
10013
  *
@@ -9967,8 +10021,6 @@ declare namespace CodeceptJS {
9967
10021
  * @param field - checkbox located by label | name | CSS | XPath | strict locator.
9968
10022
  * @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
9969
10023
  * @returns automatically synchronized promise through #recorder
9970
- *
9971
- * Appium: not tested
9972
10024
  */
9973
10025
  uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
9974
10026
  /**
@@ -10203,6 +10255,7 @@ declare namespace CodeceptJS {
10203
10255
  */
10204
10256
  dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
10205
10257
  /**
10258
+ * Appium: not tested
10206
10259
  * Verifies that the specified checkbox is checked.
10207
10260
  *
10208
10261
  * ```js
@@ -10212,11 +10265,10 @@ declare namespace CodeceptJS {
10212
10265
  * ```
10213
10266
  * @param field - located by label|name|CSS|XPath|strict locator.
10214
10267
  * @returns automatically synchronized promise through #recorder
10215
- *
10216
- * Appium: not tested
10217
10268
  */
10218
10269
  seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
10219
10270
  /**
10271
+ * Appium: not tested
10220
10272
  * Verifies that the specified checkbox is not checked.
10221
10273
  *
10222
10274
  * ```js
@@ -10226,8 +10278,6 @@ declare namespace CodeceptJS {
10226
10278
  * ```
10227
10279
  * @param field - located by label|name|CSS|XPath|strict locator.
10228
10280
  * @returns automatically synchronized promise through #recorder
10229
- *
10230
- * Appium: not tested
10231
10281
  */
10232
10282
  dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
10233
10283
  /**
@@ -10432,6 +10482,8 @@ declare namespace CodeceptJS {
10432
10482
  */
10433
10483
  dontSeeCurrentUrlEquals(url: string): void;
10434
10484
  /**
10485
+ * Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
10486
+ *
10435
10487
  * Executes sync script on a page.
10436
10488
  * Pass arguments to function as additional parameters.
10437
10489
  * Will return execution result to a test.
@@ -10457,10 +10509,6 @@ declare namespace CodeceptJS {
10457
10509
  * @param fn - function to be executed in browser context.
10458
10510
  * @param args - to be passed to function.
10459
10511
  * @returns script return value
10460
- *
10461
- *
10462
- *
10463
- * Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
10464
10512
  */
10465
10513
  executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
10466
10514
  /**
@@ -10498,10 +10546,10 @@ declare namespace CodeceptJS {
10498
10546
  * I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
10499
10547
  * ```
10500
10548
  * @param locator - located by CSS|XPath|strict locator.
10501
- * @param scrollIntoViewOptions - see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
10549
+ * @param scrollIntoViewOptions - either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
10502
10550
  * @returns automatically synchronized promise through #recorder
10503
10551
  */
10504
- scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): void;
10552
+ scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions | boolean): void;
10505
10553
  /**
10506
10554
  * Scrolls to element matched by locator.
10507
10555
  * Extra shift can be set with offsetX and offsetY options.
@@ -10557,6 +10605,7 @@ declare namespace CodeceptJS {
10557
10605
  */
10558
10606
  saveScreenshot(fileName: string, fullPage?: boolean): void;
10559
10607
  /**
10608
+ * Uses Selenium's JSON [cookie format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
10560
10609
  * Sets cookie(s).
10561
10610
  *
10562
10611
  * Can be a single cookie object or an array of cookies:
@@ -10572,11 +10621,6 @@ declare namespace CodeceptJS {
10572
10621
  * ```
10573
10622
  * @param cookie - a cookie object or array of cookie objects.
10574
10623
  * @returns automatically synchronized promise through #recorder
10575
- *
10576
- *
10577
- *
10578
- * Uses Selenium's JSON [cookie
10579
- * format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
10580
10624
  */
10581
10625
  setCookie(cookie: Cookie | Cookie[]): void;
10582
10626
  /**
@@ -10630,7 +10674,7 @@ declare namespace CodeceptJS {
10630
10674
  */
10631
10675
  acceptPopup(): void;
10632
10676
  /**
10633
- * Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt.
10677
+ * Dismisses the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`.
10634
10678
  */
10635
10679
  cancelPopup(): void;
10636
10680
  /**
@@ -10675,6 +10719,8 @@ declare namespace CodeceptJS {
10675
10719
  */
10676
10720
  pressKeyUp(key: string): void;
10677
10721
  /**
10722
+ * _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.
10723
+ *
10678
10724
  * Presses a key in the browser (on a focused element).
10679
10725
  *
10680
10726
  * _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
@@ -10734,9 +10780,6 @@ declare namespace CodeceptJS {
10734
10780
  * - `'Tab'`
10735
10781
  * @param key - key or array of keys to press.
10736
10782
  * @returns automatically synchronized promise through #recorder
10737
- *
10738
- *
10739
- * _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.
10740
10783
  */
10741
10784
  pressKey(key: string | string[]): void;
10742
10785
  /**
@@ -10763,13 +10806,13 @@ declare namespace CodeceptJS {
10763
10806
  */
10764
10807
  type(key: string | string[], delay?: number): void;
10765
10808
  /**
10809
+ * Appium: not tested in web, in apps doesn't work
10810
+ *
10766
10811
  * Resize the current window to provided width and height.
10767
10812
  * First parameter can be set to `maximize`.
10768
10813
  * @param width - width in pixels or `maximize`.
10769
10814
  * @param height - height in pixels.
10770
10815
  * @returns automatically synchronized promise through #recorder
10771
- *
10772
- * Appium: not tested in web, in apps doesn't work
10773
10816
  */
10774
10817
  resizeWindow(width: number, height: number): void;
10775
10818
  /**
@@ -10808,6 +10851,7 @@ declare namespace CodeceptJS {
10808
10851
  */
10809
10852
  blur(locator: CodeceptJS.LocatorOrString, options?: any): void;
10810
10853
  /**
10854
+ * Appium: not tested
10811
10855
  * Drag an item to a destination element.
10812
10856
  *
10813
10857
  * ```js
@@ -10816,8 +10860,6 @@ declare namespace CodeceptJS {
10816
10860
  * @param srcElement - located by CSS|XPath|strict locator.
10817
10861
  * @param destElement - located by CSS|XPath|strict locator.
10818
10862
  * @returns automatically synchronized promise through #recorder
10819
- *
10820
- * Appium: not tested
10821
10863
  */
10822
10864
  dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
10823
10865
  /**
@@ -11048,6 +11090,17 @@ declare namespace CodeceptJS {
11048
11090
  * @returns automatically synchronized promise through #recorder
11049
11091
  */
11050
11092
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
11093
+ /**
11094
+ * Waits for number of tabs.
11095
+ *
11096
+ * ```js
11097
+ * I.waitForNumberOfTabs(2);
11098
+ * ```
11099
+ * @param expectedTabs - expecting the number of tabs.
11100
+ * @param sec - number of secs to wait.
11101
+ * @returns automatically synchronized promise through #recorder
11102
+ */
11103
+ waitForNumberOfTabs(expectedTabs: number, sec: number): void;
11051
11104
  /**
11052
11105
  * Switches frame or in case of null locator reverts to parent.
11053
11106
  *
@@ -11149,6 +11202,9 @@ declare namespace CodeceptJS {
11149
11202
  */
11150
11203
  grabPageScrollPosition(): Promise<PageScrollPosition>;
11151
11204
  /**
11205
+ * This method is **deprecated**.
11206
+ *
11207
+ *
11152
11208
  * Set the current geo location
11153
11209
  *
11154
11210
  *
@@ -11158,11 +11214,13 @@ declare namespace CodeceptJS {
11158
11214
  * ```
11159
11215
  * @param latitude - to set.
11160
11216
  * @param longitude - to set
11161
- * @param [altitude = null] - (optional, null by default) to set
11217
+ * @param [altitude] - (optional, null by default) to set
11162
11218
  * @returns automatically synchronized promise through #recorder
11163
11219
  */
11164
11220
  setGeoLocation(latitude: number, longitude: number, altitude?: number): void;
11165
11221
  /**
11222
+ * This method is **deprecated**.
11223
+ *
11166
11224
  * Return the current geo location
11167
11225
  * Resumes test execution, so **should be used inside async function with `await`** operator.
11168
11226
  *
@@ -11545,7 +11603,10 @@ declare namespace CodeceptJS {
11545
11603
  isStrict(): boolean;
11546
11604
  isAccessibilityId(): boolean;
11547
11605
  isBasic(): boolean;
11548
- toXPath(): string;
11606
+ /**
11607
+ * @param [pseudoSelector] - CSS to XPath extension pseudo: https://www.npmjs.com/package/csstoxpath?activeTab=explore#extension-pseudos
11608
+ */
11609
+ toXPath(pseudoSelector?: string): string;
11549
11610
  or(locator: CodeceptJS.LocatorOrString): Locator;
11550
11611
  find(locator: CodeceptJS.LocatorOrString): Locator;
11551
11612
  withChild(locator: CodeceptJS.LocatorOrString): Locator;
@@ -11553,7 +11614,14 @@ declare namespace CodeceptJS {
11553
11614
  at(position: number): Locator;
11554
11615
  first(): Locator;
11555
11616
  last(): Locator;
11617
+ /**
11618
+ * Find an element containing a text
11619
+ */
11556
11620
  withText(text: string): Locator;
11621
+ /**
11622
+ * Find an element with exact text
11623
+ */
11624
+ withTextEquals(text: string): Locator;
11557
11625
  withAttr(attributes: {
11558
11626
  [key: string]: string;
11559
11627
  }): Locator;