codeceptjs 4.0.0-beta.1 → 4.0.0-beta.10.esm-aria

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 (207) hide show
  1. package/README.md +133 -120
  2. package/bin/codecept.js +107 -96
  3. package/bin/test-server.js +64 -0
  4. package/docs/webapi/clearCookie.mustache +1 -1
  5. package/docs/webapi/click.mustache +5 -1
  6. package/lib/actor.js +71 -103
  7. package/lib/ai.js +159 -188
  8. package/lib/assert/empty.js +22 -24
  9. package/lib/assert/equal.js +30 -37
  10. package/lib/assert/error.js +14 -14
  11. package/lib/assert/include.js +43 -48
  12. package/lib/assert/throws.js +11 -11
  13. package/lib/assert/truth.js +22 -22
  14. package/lib/assert.js +20 -18
  15. package/lib/codecept.js +238 -162
  16. package/lib/colorUtils.js +50 -52
  17. package/lib/command/check.js +206 -0
  18. package/lib/command/configMigrate.js +56 -51
  19. package/lib/command/definitions.js +96 -109
  20. package/lib/command/dryRun.js +77 -79
  21. package/lib/command/generate.js +234 -194
  22. package/lib/command/gherkin/init.js +42 -33
  23. package/lib/command/gherkin/snippets.js +76 -74
  24. package/lib/command/gherkin/steps.js +20 -17
  25. package/lib/command/info.js +74 -38
  26. package/lib/command/init.js +300 -290
  27. package/lib/command/interactive.js +41 -32
  28. package/lib/command/list.js +28 -27
  29. package/lib/command/run-multiple/chunk.js +51 -48
  30. package/lib/command/run-multiple/collection.js +5 -5
  31. package/lib/command/run-multiple/run.js +5 -1
  32. package/lib/command/run-multiple.js +97 -97
  33. package/lib/command/run-rerun.js +19 -25
  34. package/lib/command/run-workers.js +68 -92
  35. package/lib/command/run.js +39 -27
  36. package/lib/command/utils.js +80 -64
  37. package/lib/command/workers/runTests.js +388 -226
  38. package/lib/config.js +124 -50
  39. package/lib/container.js +751 -260
  40. package/lib/data/context.js +60 -61
  41. package/lib/data/dataScenarioConfig.js +47 -47
  42. package/lib/data/dataTableArgument.js +32 -32
  43. package/lib/data/table.js +22 -22
  44. package/lib/effects.js +307 -0
  45. package/lib/element/WebElement.js +327 -0
  46. package/lib/els.js +160 -0
  47. package/lib/event.js +173 -163
  48. package/lib/globals.js +141 -0
  49. package/lib/heal.js +89 -85
  50. package/lib/helper/AI.js +131 -41
  51. package/lib/helper/ApiDataFactory.js +107 -75
  52. package/lib/helper/Appium.js +542 -404
  53. package/lib/helper/FileSystem.js +100 -79
  54. package/lib/helper/GraphQL.js +44 -43
  55. package/lib/helper/GraphQLDataFactory.js +52 -52
  56. package/lib/helper/JSONResponse.js +126 -88
  57. package/lib/helper/Mochawesome.js +54 -29
  58. package/lib/helper/Playwright.js +2547 -1316
  59. package/lib/helper/Puppeteer.js +1578 -1181
  60. package/lib/helper/REST.js +209 -68
  61. package/lib/helper/WebDriver.js +1482 -1342
  62. package/lib/helper/errors/ConnectionRefused.js +6 -6
  63. package/lib/helper/errors/ElementAssertion.js +11 -16
  64. package/lib/helper/errors/ElementNotFound.js +5 -9
  65. package/lib/helper/errors/RemoteBrowserConnectionRefused.js +5 -5
  66. package/lib/helper/extras/Console.js +11 -11
  67. package/lib/helper/extras/PlaywrightLocator.js +110 -0
  68. package/lib/helper/extras/PlaywrightPropEngine.js +18 -18
  69. package/lib/helper/extras/PlaywrightReactVueLocator.js +17 -8
  70. package/lib/helper/extras/PlaywrightRestartOpts.js +25 -11
  71. package/lib/helper/extras/Popup.js +22 -22
  72. package/lib/helper/extras/React.js +27 -28
  73. package/lib/helper/network/actions.js +36 -42
  74. package/lib/helper/network/utils.js +78 -84
  75. package/lib/helper/scripts/blurElement.js +5 -5
  76. package/lib/helper/scripts/focusElement.js +5 -5
  77. package/lib/helper/scripts/highlightElement.js +8 -8
  78. package/lib/helper/scripts/isElementClickable.js +34 -34
  79. package/lib/helper.js +2 -3
  80. package/lib/history.js +23 -19
  81. package/lib/hooks.js +8 -8
  82. package/lib/html.js +94 -104
  83. package/lib/index.js +38 -27
  84. package/lib/listener/config.js +30 -23
  85. package/lib/listener/emptyRun.js +54 -0
  86. package/lib/listener/enhancedGlobalRetry.js +110 -0
  87. package/lib/listener/exit.js +16 -18
  88. package/lib/listener/globalRetry.js +70 -0
  89. package/lib/listener/globalTimeout.js +181 -0
  90. package/lib/listener/helpers.js +76 -51
  91. package/lib/listener/mocha.js +10 -11
  92. package/lib/listener/result.js +11 -0
  93. package/lib/listener/retryEnhancer.js +85 -0
  94. package/lib/listener/steps.js +71 -59
  95. package/lib/listener/store.js +20 -0
  96. package/lib/locator.js +214 -197
  97. package/lib/mocha/asyncWrapper.js +274 -0
  98. package/lib/mocha/bdd.js +167 -0
  99. package/lib/mocha/cli.js +341 -0
  100. package/lib/mocha/factory.js +163 -0
  101. package/lib/mocha/featureConfig.js +89 -0
  102. package/lib/mocha/gherkin.js +231 -0
  103. package/lib/mocha/hooks.js +121 -0
  104. package/lib/mocha/index.js +21 -0
  105. package/lib/mocha/inject.js +46 -0
  106. package/lib/{interfaces → mocha}/scenarioConfig.js +58 -34
  107. package/lib/mocha/suite.js +89 -0
  108. package/lib/mocha/test.js +184 -0
  109. package/lib/mocha/types.d.ts +42 -0
  110. package/lib/mocha/ui.js +242 -0
  111. package/lib/output.js +141 -71
  112. package/lib/parser.js +47 -44
  113. package/lib/pause.js +173 -145
  114. package/lib/plugin/analyze.js +403 -0
  115. package/lib/plugin/{autoLogin.js → auth.js} +178 -79
  116. package/lib/plugin/autoDelay.js +36 -40
  117. package/lib/plugin/coverage.js +131 -78
  118. package/lib/plugin/customLocator.js +22 -21
  119. package/lib/plugin/customReporter.js +53 -0
  120. package/lib/plugin/enhancedRetryFailedStep.js +99 -0
  121. package/lib/plugin/heal.js +101 -110
  122. package/lib/plugin/htmlReporter.js +3648 -0
  123. package/lib/plugin/pageInfo.js +140 -0
  124. package/lib/plugin/pauseOnFail.js +12 -11
  125. package/lib/plugin/retryFailedStep.js +82 -47
  126. package/lib/plugin/screenshotOnFail.js +111 -92
  127. package/lib/plugin/stepByStepReport.js +159 -101
  128. package/lib/plugin/stepTimeout.js +20 -25
  129. package/lib/plugin/subtitles.js +38 -38
  130. package/lib/recorder.js +193 -130
  131. package/lib/rerun.js +94 -49
  132. package/lib/result.js +238 -0
  133. package/lib/retryCoordinator.js +207 -0
  134. package/lib/secret.js +20 -18
  135. package/lib/session.js +95 -89
  136. package/lib/step/base.js +239 -0
  137. package/lib/step/comment.js +10 -0
  138. package/lib/step/config.js +50 -0
  139. package/lib/step/func.js +46 -0
  140. package/lib/step/helper.js +50 -0
  141. package/lib/step/meta.js +99 -0
  142. package/lib/step/record.js +74 -0
  143. package/lib/step/retry.js +11 -0
  144. package/lib/step/section.js +55 -0
  145. package/lib/step.js +18 -329
  146. package/lib/steps.js +54 -0
  147. package/lib/store.js +38 -7
  148. package/lib/template/heal.js +3 -12
  149. package/lib/template/prompts/generatePageObject.js +31 -0
  150. package/lib/template/prompts/healStep.js +13 -0
  151. package/lib/template/prompts/writeStep.js +9 -0
  152. package/lib/test-server.js +334 -0
  153. package/lib/timeout.js +60 -0
  154. package/lib/transform.js +8 -8
  155. package/lib/translation.js +34 -21
  156. package/lib/utils/mask_data.js +47 -0
  157. package/lib/utils.js +411 -228
  158. package/lib/workerStorage.js +37 -34
  159. package/lib/workers.js +532 -296
  160. package/package.json +115 -95
  161. package/translations/de-DE.js +5 -3
  162. package/translations/fr-FR.js +5 -4
  163. package/translations/index.js +22 -12
  164. package/translations/it-IT.js +4 -3
  165. package/translations/ja-JP.js +4 -3
  166. package/translations/nl-NL.js +76 -0
  167. package/translations/pl-PL.js +4 -3
  168. package/translations/pt-BR.js +4 -3
  169. package/translations/ru-RU.js +4 -3
  170. package/translations/utils.js +10 -0
  171. package/translations/zh-CN.js +4 -3
  172. package/translations/zh-TW.js +4 -3
  173. package/typings/index.d.ts +546 -185
  174. package/typings/promiseBasedTypes.d.ts +150 -879
  175. package/typings/types.d.ts +547 -996
  176. package/lib/cli.js +0 -249
  177. package/lib/dirname.js +0 -5
  178. package/lib/helper/Expect.js +0 -425
  179. package/lib/helper/ExpectHelper.js +0 -399
  180. package/lib/helper/MockServer.js +0 -223
  181. package/lib/helper/Nightmare.js +0 -1411
  182. package/lib/helper/Protractor.js +0 -1835
  183. package/lib/helper/SoftExpectHelper.js +0 -381
  184. package/lib/helper/TestCafe.js +0 -1410
  185. package/lib/helper/clientscripts/nightmare.js +0 -213
  186. package/lib/helper/testcafe/testControllerHolder.js +0 -42
  187. package/lib/helper/testcafe/testcafe-utils.js +0 -63
  188. package/lib/interfaces/bdd.js +0 -98
  189. package/lib/interfaces/featureConfig.js +0 -69
  190. package/lib/interfaces/gherkin.js +0 -195
  191. package/lib/listener/artifacts.js +0 -19
  192. package/lib/listener/retry.js +0 -68
  193. package/lib/listener/timeout.js +0 -109
  194. package/lib/mochaFactory.js +0 -110
  195. package/lib/plugin/allure.js +0 -15
  196. package/lib/plugin/commentStep.js +0 -136
  197. package/lib/plugin/debugErrors.js +0 -67
  198. package/lib/plugin/eachElement.js +0 -127
  199. package/lib/plugin/fakerTransform.js +0 -49
  200. package/lib/plugin/retryTo.js +0 -121
  201. package/lib/plugin/selenoid.js +0 -371
  202. package/lib/plugin/standardActingHelpers.js +0 -9
  203. package/lib/plugin/tryTo.js +0 -105
  204. package/lib/plugin/wdio.js +0 -246
  205. package/lib/scenario.js +0 -222
  206. package/lib/ui.js +0 -238
  207. package/lib/within.js +0 -70
@@ -113,7 +113,7 @@ declare namespace CodeceptJS {
113
113
  *
114
114
  * module.exports = new Factory()
115
115
  * // no need to set id, it will be set by REST API
116
- * .attr('author', () => faker.name.findName())
116
+ * .attr('author', () => faker.person.findName())
117
117
  * .attr('title', () => faker.lorem.sentence())
118
118
  * .attr('body', () => faker.lorem.paragraph());
119
119
  * ```
@@ -354,6 +354,17 @@ declare namespace CodeceptJS {
354
354
  * ```
355
355
  */
356
356
  runOnAndroid(caps: any, fn: any): Promise<any>;
357
+ /**
358
+ * Execute code only in Web mode.
359
+ *
360
+ * ```js
361
+ * I.runInWeb(() => {
362
+ * I.waitForElement('#data');
363
+ * I.seeInCurrentUrl('/data');
364
+ * });
365
+ * ```
366
+ */
367
+ runInWeb(): Promise<any>;
357
368
  /**
358
369
  * Returns app installation status.
359
370
  *
@@ -597,17 +608,11 @@ declare namespace CodeceptJS {
597
608
  * ```js
598
609
  * // taps outside to hide keyboard per default
599
610
  * I.hideDeviceKeyboard();
600
- * I.hideDeviceKeyboard('tapOutside');
601
- *
602
- * // or by pressing key
603
- * I.hideDeviceKeyboard('pressKey', 'Done');
604
611
  * ```
605
612
  *
606
613
  * Appium: support Android and iOS
607
- * @param [strategy] - Desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’)
608
- * @param [key] - Optional key
609
614
  */
610
- hideDeviceKeyboard(strategy?: 'tapOutside' | 'pressKey', key?: string): Promise<any>;
615
+ hideDeviceKeyboard(): Promise<any>;
611
616
  /**
612
617
  * Send a key event to the device.
613
618
  * List of keys: https://developer.android.com/reference/android/view/KeyEvent.html
@@ -651,6 +656,19 @@ declare namespace CodeceptJS {
651
656
  * Shortcut for `makeTouchAction`
652
657
  */
653
658
  tap(locator: any): Promise<void>;
659
+ /**
660
+ * Perform a swipe on the screen or an element.
661
+ *
662
+ * ```js
663
+ * let locator = "#io.selendroid.testapp:id/LinearLayout1";
664
+ * I.swipe(locator, 800, 1200, 1000);
665
+ * ```
666
+ *
667
+ * [See complete reference](http://webdriver.io/api/mobile/swipe.html)
668
+ * @param [speed = 1000] - (optional), 1000 by default
669
+ * @returns Appium: support Android and iOS
670
+ */
671
+ swipe(locator: CodeceptJS.LocatorOrString, xoffset: number, yoffset: number, speed?: number): Promise<void>;
654
672
  /**
655
673
  * Perform a swipe on the screen.
656
674
  *
@@ -1161,236 +1179,6 @@ declare namespace CodeceptJS {
1161
1179
  */
1162
1180
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
1163
1181
  }
1164
- /**
1165
- * This helper allows performing assertions based on Chai.
1166
- *
1167
- * ### Examples
1168
- *
1169
- * Zero-configuration when paired with other helpers like REST, Playwright:
1170
- *
1171
- * ```js
1172
- * // inside codecept.conf.js
1173
- * {
1174
- * helpers: {
1175
- * Playwright: {...},
1176
- * ExpectHelper: {},
1177
- * }
1178
- * }
1179
- * ```
1180
- *
1181
- * ## Methods
1182
- */
1183
- // @ts-ignore
1184
- // @ts-ignore
1185
- // @ts-ignore
1186
- // @ts-ignore
1187
- class ExpectHelper {
1188
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1189
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1190
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1191
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1192
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1193
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1194
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1195
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1196
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1197
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1198
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1199
- /**
1200
- * @param [ajvOptions] - Pass AJV options
1201
- */
1202
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1203
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1204
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1205
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1206
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1207
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1208
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1209
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1210
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1211
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1212
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1213
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1214
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1215
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1216
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1217
- /**
1218
- * expects members of two arrays are deeply equal
1219
- */
1220
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1221
- /**
1222
- * expects an array to be a superset of another array
1223
- */
1224
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1225
- /**
1226
- * expects members of two JSON objects are deeply equal excluding some properties
1227
- */
1228
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1229
- /**
1230
- * expects a JSON object matches a provided pattern
1231
- */
1232
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1233
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1234
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1235
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1236
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1237
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1238
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1239
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1240
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1241
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1242
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1243
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1244
- /**
1245
- * @param [ajvOptions] - Pass AJV options
1246
- */
1247
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1248
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1249
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1250
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1251
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1252
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1253
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1254
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1255
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1256
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1257
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1258
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1259
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1260
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1261
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1262
- /**
1263
- * expects members of two arrays are deeply equal
1264
- */
1265
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1266
- /**
1267
- * expects an array to be a superset of another array
1268
- */
1269
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1270
- /**
1271
- * expects members of two JSON objects are deeply equal excluding some properties
1272
- */
1273
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1274
- /**
1275
- * expects a JSON object matches a provided pattern
1276
- */
1277
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1278
- }
1279
- /**
1280
- * This helper allows performing assertions based on Chai.
1281
- *
1282
- * ### Examples
1283
- *
1284
- * Zero-configuration when paired with other helpers like REST, Playwright:
1285
- *
1286
- * ```js
1287
- * // inside codecept.conf.js
1288
- * {
1289
- * helpers: {
1290
- * Playwright: {...},
1291
- * ExpectHelper: {},
1292
- * }
1293
- * }
1294
- * ```
1295
- *
1296
- * ## Methods
1297
- */
1298
- // @ts-ignore
1299
- // @ts-ignore
1300
- // @ts-ignore
1301
- // @ts-ignore
1302
- class ExpectHelper {
1303
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1304
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1305
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1306
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1307
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1308
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1309
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1310
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1311
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1312
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1313
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1314
- /**
1315
- * @param [ajvOptions] - Pass AJV options
1316
- */
1317
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1318
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1319
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1320
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1321
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1322
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1323
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1324
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1325
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1326
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1327
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1328
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1329
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1330
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1331
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1332
- /**
1333
- * expects members of two arrays are deeply equal
1334
- */
1335
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1336
- /**
1337
- * expects an array to be a superset of another array
1338
- */
1339
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1340
- /**
1341
- * expects members of two JSON objects are deeply equal excluding some properties
1342
- */
1343
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1344
- /**
1345
- * expects a JSON object matches a provided pattern
1346
- */
1347
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1348
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1349
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1350
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1351
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1352
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1353
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1354
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1355
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1356
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1357
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1358
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1359
- /**
1360
- * @param [ajvOptions] - Pass AJV options
1361
- */
1362
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1363
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1364
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1365
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1366
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1367
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1368
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1369
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1370
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1371
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1372
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1373
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1374
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1375
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1376
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1377
- /**
1378
- * expects members of two arrays are deeply equal
1379
- */
1380
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1381
- /**
1382
- * expects an array to be a superset of another array
1383
- */
1384
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1385
- /**
1386
- * expects members of two JSON objects are deeply equal excluding some properties
1387
- */
1388
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1389
- /**
1390
- * expects a JSON object matches a provided pattern
1391
- */
1392
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1393
- }
1394
1182
  /**
1395
1183
  * Helper for testing filesystem.
1396
1184
  * Can be easily used to check file structures:
@@ -1637,7 +1425,7 @@ declare namespace CodeceptJS {
1637
1425
  * input: { ...buildObj },
1638
1426
  * }))
1639
1427
  * // 'attr'-id can be left out depending on the GraphQl resolvers
1640
- * .attr('name', () => faker.name.findName())
1428
+ * .attr('name', () => faker.person.findName())
1641
1429
  * .attr('email', () => faker.interact.email())
1642
1430
  * ```
1643
1431
  * For more options see [rosie documentation](https://github.com/rosiejs/rosie).
@@ -1914,13 +1702,14 @@ declare namespace CodeceptJS {
1914
1702
  */
1915
1703
  seeResponseContainsKeys(keys: any[]): Promise<any>;
1916
1704
  /**
1917
- * Executes a callback function passing in `response` object and chai assertions with `expect`
1705
+ * Executes a callback function passing in `response` object and assert
1918
1706
  * Use it to perform custom checks of response data
1919
1707
  *
1920
1708
  * ```js
1921
- * I.seeResponseValidByCallback(({ data, status, expect }) => {
1922
- * expect(status).to.eql(200);
1923
- * expect(data).keys.to.include(['user', 'company']);
1709
+ * I.seeResponseValidByCallback(({ data, status }) => {
1710
+ * assert.strictEqual(status, 200);
1711
+ * assert('user' in data);
1712
+ * assert('company' in data);
1924
1713
  * });
1925
1714
  * ```
1926
1715
  */
@@ -1962,196 +1751,6 @@ declare namespace CodeceptJS {
1962
1751
  */
1963
1752
  seeResponseMatchesJsonSchema(fnOrSchema: any): Promise<any>;
1964
1753
  }
1965
- /**
1966
- * ## Configuration
1967
- *
1968
- * This helper should be configured in codecept.conf.(js|ts)
1969
- * @property [port = 9393] - Mock server port
1970
- * @property [host = "0.0.0.0"] - Mock server host
1971
- * @property [httpsOpts] - key & cert values are the paths to .key and .crt files
1972
- */
1973
- // @ts-ignore
1974
- // @ts-ignore
1975
- // @ts-ignore
1976
- // @ts-ignore
1977
- type MockServerConfig = {
1978
- port?: number;
1979
- host?: string;
1980
- httpsOpts?: any;
1981
- };
1982
- /**
1983
- * MockServer
1984
- *
1985
- * The MockServer Helper in CodeceptJS empowers you to mock any server or service via HTTP or HTTPS, making it an excellent tool for simulating REST endpoints and other HTTP-based APIs.
1986
- *
1987
- * <!-- configuration -->
1988
- *
1989
- * #### Examples
1990
- *
1991
- * You can seamlessly integrate MockServer with other helpers like REST or Playwright. Here's a configuration example inside the `codecept.conf.js` file:
1992
- *
1993
- * ```javascript
1994
- * {
1995
- * helpers: {
1996
- * REST: {...},
1997
- * MockServer: {
1998
- * // default mock server config
1999
- * port: 9393,
2000
- * host: '0.0.0.0',
2001
- * httpsOpts: {
2002
- * key: '',
2003
- * cert: '',
2004
- * },
2005
- * },
2006
- * }
2007
- * }
2008
- * ```
2009
- *
2010
- * #### Adding Interactions
2011
- *
2012
- * Interactions add behavior to the mock server. Use the `I.addInteractionToMockServer()` method to include interactions. It takes an interaction object as an argument, containing request and response details.
2013
- *
2014
- * ```javascript
2015
- * I.addInteractionToMockServer({
2016
- * request: {
2017
- * method: 'GET',
2018
- * path: '/api/hello'
2019
- * },
2020
- * response: {
2021
- * status: 200,
2022
- * body: {
2023
- * 'say': 'hello to mock server'
2024
- * }
2025
- * }
2026
- * });
2027
- * ```
2028
- *
2029
- * #### Request Matching
2030
- *
2031
- * When a real request is sent to the mock server, it matches the received request with the interactions. If a match is found, it returns the specified response; otherwise, a 404 status code is returned.
2032
- *
2033
- * - Strong match on HTTP Method, Path, Query Params & JSON body.
2034
- * - Loose match on Headers.
2035
- *
2036
- * ##### Strong Match on Query Params
2037
- *
2038
- * You can send different responses based on query parameters:
2039
- *
2040
- * ```javascript
2041
- * I.addInteractionToMockServer({
2042
- * request: {
2043
- * method: 'GET',
2044
- * path: '/api/users',
2045
- * queryParams: {
2046
- * id: 1
2047
- * }
2048
- * },
2049
- * response: {
2050
- * status: 200,
2051
- * body: 'user 1'
2052
- * }
2053
- * });
2054
- *
2055
- * I.addInteractionToMockServer({
2056
- * request: {
2057
- * method: 'GET',
2058
- * path: '/api/users',
2059
- * queryParams: {
2060
- * id: 2
2061
- * }
2062
- * },
2063
- * response: {
2064
- * status: 200,
2065
- * body: 'user 2'
2066
- * }
2067
- * });
2068
- * ```
2069
- *
2070
- * - GET to `/api/users?id=1` will return 'user 1'.
2071
- * - GET to `/api/users?id=2` will return 'user 2'.
2072
- * - For all other requests, it returns a 404 status code.
2073
- *
2074
- * ##### Loose Match on Body
2075
- *
2076
- * When `strict` is set to false, it performs a loose match on query params and response body:
2077
- *
2078
- * ```javascript
2079
- * I.addInteractionToMockServer({
2080
- * strict: false,
2081
- * request: {
2082
- * method: 'POST',
2083
- * path: '/api/users',
2084
- * body: {
2085
- * name: 'john'
2086
- * }
2087
- * },
2088
- * response: {
2089
- * status: 200
2090
- * }
2091
- * });
2092
- * ```
2093
- *
2094
- * - POST to `/api/users` with the body containing `name` as 'john' will return a 200 status code.
2095
- * - POST to `/api/users` without the `name` property in the body will return a 404 status code.
2096
- *
2097
- * Happy testing with MockServer in CodeceptJS! 🚀
2098
- *
2099
- * ## Methods
2100
- */
2101
- // @ts-ignore
2102
- // @ts-ignore
2103
- // @ts-ignore
2104
- // @ts-ignore
2105
- class MockServer {
2106
- /**
2107
- * Start the mock server
2108
- * @param [port] - start the mock server with given port
2109
- */
2110
- startMockServer(port?: number): Promise<any>;
2111
- /**
2112
- * Stop the mock server
2113
- */
2114
- stopMockServer(): Promise<any>;
2115
- /**
2116
- * An interaction adds behavior to the mock server
2117
- *
2118
- *
2119
- * ```js
2120
- * I.addInteractionToMockServer({
2121
- * request: {
2122
- * method: 'GET',
2123
- * path: '/api/hello'
2124
- * },
2125
- * response: {
2126
- * status: 200,
2127
- * body: {
2128
- * 'say': 'hello to mock server'
2129
- * }
2130
- * }
2131
- * });
2132
- * ```
2133
- * ```js
2134
- * // with query params
2135
- * I.addInteractionToMockServer({
2136
- * request: {
2137
- * method: 'GET',
2138
- * path: '/api/hello',
2139
- * queryParams: {
2140
- * id: 2
2141
- * }
2142
- * },
2143
- * response: {
2144
- * status: 200,
2145
- * body: {
2146
- * 'say': 'hello to mock server'
2147
- * }
2148
- * }
2149
- * });
2150
- * ```
2151
- * @param interaction - add behavior to the mock server
2152
- */
2153
- addInteractionToMockServer(interaction: CodeceptJS.MockInteraction | any): Promise<any>;
2154
- }
2155
1754
  /**
2156
1755
  * Nightmare helper wraps [Nightmare](https://github.com/segmentio/nightmare) library to provide
2157
1756
  * fastest headless testing using Electron engine. Unlike Selenium-based drivers this uses
@@ -2890,7 +2489,7 @@ declare namespace CodeceptJS {
2890
2489
  *
2891
2490
  * ```js
2892
2491
  * I.clearCookie();
2893
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
2492
+ * I.clearCookie('test');
2894
2493
  * ```
2895
2494
  * @param [cookie = null] - (optional, `null` by default) cookie name
2896
2495
  */
@@ -3091,46 +2690,6 @@ declare namespace CodeceptJS {
3091
2690
  */
3092
2691
  grabPageScrollPosition(): Promise<PageScrollPosition>;
3093
2692
  }
3094
- /**
3095
- * OpenAI Helper for CodeceptJS.
3096
- *
3097
- * This helper class provides integration with the OpenAI GPT-3.5 or 4 language model for generating responses to questions or prompts within the context of web pages. It allows you to interact with the GPT-3.5 model to obtain intelligent responses based on HTML fragments or general prompts.
3098
- * This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
3099
- *
3100
- * ## Configuration
3101
- *
3102
- * This helper should be configured in codecept.json or codecept.conf.js
3103
- *
3104
- * * `chunkSize`: (optional, default: 80000) - The maximum number of characters to send to the OpenAI API at once. We split HTML fragments by 8000 chars to not exceed token limit. Increase this value if you use GPT-4.
3105
- */
3106
- class OpenAITs {
3107
- /**
3108
- * Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
3109
- *
3110
- * ```js
3111
- * I.askGptOnPage('what does this page do?');
3112
- * ```
3113
- * @param prompt - The question or prompt to ask the GPT model.
3114
- * @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
3115
- */
3116
- askGptOnPage(prompt: string): Promise<string>;
3117
- /**
3118
- * Asks the OpenAI GPT-3.5 language model a question based on the provided prompt within the context of a specific HTML fragment on the current page.
3119
- *
3120
- * ```js
3121
- * I.askGptOnPageFragment('describe features of this screen', '.screen');
3122
- * ```
3123
- * @param prompt - The question or prompt to ask the GPT-3.5 model.
3124
- * @param locator - The locator or selector used to identify the HTML fragment on the page.
3125
- * @returns - A Promise that resolves to the generated response from the GPT model.
3126
- */
3127
- askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
3128
- /**
3129
- * Send a general request to ChatGPT and return response.
3130
- * @returns - A Promise that resolves to the generated response from the GPT model.
3131
- */
3132
- askGptGeneralPrompt(prompt: string): Promise<string>;
3133
- }
3134
2693
  /**
3135
2694
  * ## Configuration
3136
2695
  *
@@ -3174,11 +2733,15 @@ declare namespace CodeceptJS {
3174
2733
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
3175
2734
  * @property [recordHar] - record HAR and will be saved to `output/har`. See more of [HAR options](https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har).
3176
2735
  * @property [testIdAttribute = data-testid] - locate elements based on the testIdAttribute. See more of [locate by test id](https://playwright.dev/docs/locators#locate-by-test-id).
2736
+ * @property [customLocatorStrategies] - custom locator strategies. An object with keys as strategy names and values as JavaScript functions. Example: `{ byRole: (selector, root) => { return root.querySelector(`[role="${selector}"]`) } }`
2737
+ * @property [storageState] - Playwright storage state (path to JSON file or object)
2738
+ * passed directly to `browser.newContext`.
2739
+ * If a Scenario is declared with a `cookies` option (e.g. `Scenario('name', { cookies: [...] }, fn)`),
2740
+ * those cookies are used instead and the configured `storageState` is ignored (no merge).
2741
+ * May include session cookies, auth tokens, localStorage and (if captured with
2742
+ * `grabStorageState({ indexedDB: true })`) IndexedDB data; treat as sensitive and do not commit.
3177
2743
  */
3178
2744
  // @ts-ignore
3179
- // @ts-ignore
3180
- // @ts-ignore
3181
- // @ts-ignore
3182
2745
  type PlaywrightConfig = {
3183
2746
  url?: string;
3184
2747
  browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
@@ -3216,6 +2779,8 @@ declare namespace CodeceptJS {
3216
2779
  highlightElement?: boolean;
3217
2780
  recordHar?: any;
3218
2781
  testIdAttribute?: string;
2782
+ customLocatorStrategies?: any;
2783
+ storageState?: string | any;
3219
2784
  };
3220
2785
  /**
3221
2786
  * Uses [Playwright](https://github.com/microsoft/playwright) library to run tests inside:
@@ -4127,7 +3692,7 @@ declare namespace CodeceptJS {
4127
3692
  */
4128
3693
  pressKeyUp(key: string): Promise<any>;
4129
3694
  /**
4130
- * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
3695
+ * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([puppeteer/puppeteer#1313](https://github.com/puppeteer/puppeteer/issues/1313)).
4131
3696
  *
4132
3697
  * Presses a key in the browser (on a focused element).
4133
3698
  *
@@ -4526,13 +4091,34 @@ declare namespace CodeceptJS {
4526
4091
  * @param [name = null] - cookie name.
4527
4092
  */
4528
4093
  grabCookie(name?: string): Promise<any>;
4094
+ /**
4095
+ * Grab the current storage state (cookies, localStorage, etc.) via Playwright's `browserContext.storageState()`.
4096
+ * Returns the raw object that Playwright provides.
4097
+ *
4098
+ * Security: The returned object can contain authentication tokens, session cookies
4099
+ * and (when `indexedDB: true` is used) data that may include user PII. Treat it as a secret.
4100
+ * Avoid committing it to source control and prefer storing it in a protected secrets store / CI artifact vault.
4101
+ * @param [options.indexedDB] - set to true to include IndexedDB in snapshot (Playwright >=1.51)
4102
+ *
4103
+ * ```js
4104
+ * // basic usage
4105
+ * const state = await I.grabStorageState();
4106
+ * require('fs').writeFileSync('authState.json', JSON.stringify(state));
4107
+ *
4108
+ * // include IndexedDB when using Firebase Auth, etc.
4109
+ * const stateWithIDB = await I.grabStorageState({ indexedDB: true });
4110
+ * ```
4111
+ */
4112
+ grabStorageState(options?: {
4113
+ indexedDB?: boolean;
4114
+ }): Promise<any>;
4529
4115
  /**
4530
4116
  * Clears a cookie by name,
4531
4117
  * if none provided clears all cookies.
4532
4118
  *
4533
4119
  * ```js
4534
4120
  * I.clearCookie();
4535
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
4121
+ * I.clearCookie('test');
4536
4122
  * ```
4537
4123
  * @param [cookie = null] - (optional, `null` by default) cookie name
4538
4124
  */
@@ -4956,7 +4542,7 @@ declare namespace CodeceptJS {
4956
4542
  /**
4957
4543
  * Waits for navigation to finish. By default, it takes configured `waitForNavigation` option.
4958
4544
  *
4959
- * See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions)
4545
+ * See [Playwright's reference](https://playwright.dev/docs/api/class-page#page-wait-for-navigation)
4960
4546
  */
4961
4547
  waitForNavigation(options: any): Promise<any>;
4962
4548
  /**
@@ -6134,7 +5720,7 @@ declare namespace CodeceptJS {
6134
5720
  *
6135
5721
  * ```js
6136
5722
  * I.clearCookie();
6137
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
5723
+ * I.clearCookie('test');
6138
5724
  * ```
6139
5725
  * @param [cookie = null] - (optional, `null` by default) cookie name
6140
5726
  */
@@ -6544,7 +6130,7 @@ declare namespace CodeceptJS {
6544
6130
  * @property [keepBrowserState = false] - keep browser state between tests when `restart` is set to false.
6545
6131
  * @property [keepCookies = false] - keep cookies between tests when `restart` is set to false.
6546
6132
  * @property [waitForAction = 100] - how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
6547
- * @property [waitForNavigation = load] - when to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle0`, `networkidle2`. See [Puppeteer API](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions). Array values are accepted as well.
6133
+ * @property [waitForNavigation = load] - when to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle0`, `networkidle2`. See [Puppeteer API](https://github.com/puppeteer/puppeteer/blob/main/docs/api/puppeteer.waitforoptions.md). Array values are accepted as well.
6548
6134
  * @property [pressKeyDelay = 10] - delay between key presses in ms. Used when calling Puppeteers page.type(...) in fillField/appendField
6549
6135
  * @property [getPageTimeout = 30000] - config option to set maximum navigation time in milliseconds. If the timeout is set to 0, then timeout will be disabled.
6550
6136
  * @property [waitForTimeout = 1000] - default wait* timeout in ms.
@@ -6552,13 +6138,10 @@ declare namespace CodeceptJS {
6552
6138
  * @property [userAgent] - user-agent string.
6553
6139
  * @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
6554
6140
  * @property [browser = chrome] - can be changed to `firefox` when using [puppeteer-firefox](https://codecept.io/helpers/Puppeteer-firefox).
6555
- * @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
6141
+ * @property [chrome] - pass additional [Puppeteer run options](https://github.com/puppeteer/puppeteer/blob/main/docs/api/puppeteer.launchoptions.md).
6556
6142
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
6557
6143
  */
6558
6144
  // @ts-ignore
6559
- // @ts-ignore
6560
- // @ts-ignore
6561
- // @ts-ignore
6562
6145
  type PuppeteerConfig = {
6563
6146
  url: string;
6564
6147
  basicAuth?: any;
@@ -6572,7 +6155,7 @@ declare namespace CodeceptJS {
6572
6155
  keepBrowserState?: boolean;
6573
6156
  keepCookies?: boolean;
6574
6157
  waitForAction?: number;
6575
- waitForNavigation?: string;
6158
+ waitForNavigation?: string | string[];
6576
6159
  pressKeyDelay?: number;
6577
6160
  getPageTimeout?: number;
6578
6161
  waitForTimeout?: number;
@@ -6584,7 +6167,7 @@ declare namespace CodeceptJS {
6584
6167
  highlightElement?: boolean;
6585
6168
  };
6586
6169
  /**
6587
- * Uses [Google Chrome's Puppeteer](https://github.com/GoogleChrome/puppeteer) library to run tests inside headless Chrome.
6170
+ * Uses [Google Chrome's Puppeteer](https://github.com/puppeteer/puppeteer) library to run tests inside headless Chrome.
6588
6171
  * Browser control is executed via DevTools Protocol (instead of Selenium).
6589
6172
  * This helper works with a browser out of the box with no additional tools required to install.
6590
6173
  *
@@ -6982,6 +6565,17 @@ declare namespace CodeceptJS {
6982
6565
  * {{ react }}
6983
6566
  */
6984
6567
  _locate(): Promise<any>;
6568
+ /**
6569
+ * Get single element by different locator types, including strict locator
6570
+ * Should be used in custom helpers:
6571
+ *
6572
+ * ```js
6573
+ * const element = await this.helpers['Puppeteer']._locateElement({name: 'password'});
6574
+ * ```
6575
+ *
6576
+ * {{ react }}
6577
+ */
6578
+ _locateElement(): Promise<any>;
6985
6579
  /**
6986
6580
  * Find a checkbox by providing human-readable text:
6987
6581
  * NOTE: Assumes the checkable element exists
@@ -7018,6 +6612,17 @@ declare namespace CodeceptJS {
7018
6612
  * @returns WebElement of being used Web helper
7019
6613
  */
7020
6614
  grabWebElements(locator: CodeceptJS.LocatorOrString): Promise<any>;
6615
+ /**
6616
+ * Grab WebElement for given locator
6617
+ * Resumes test execution, so **should be used inside an async function with `await`** operator.
6618
+ *
6619
+ * ```js
6620
+ * const webElement = await I.grabWebElement('#button');
6621
+ * ```
6622
+ * @param locator - element located by CSS|XPath|strict locator.
6623
+ * @returns WebElement of being used Web helper
6624
+ */
6625
+ grabWebElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
7021
6626
  /**
7022
6627
  * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab
7023
6628
  *
@@ -7304,7 +6909,7 @@ declare namespace CodeceptJS {
7304
6909
  */
7305
6910
  pressKeyUp(key: string): Promise<any>;
7306
6911
  /**
7307
- * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
6912
+ * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([puppeteer/puppeteer#1313](https://github.com/puppeteer/puppeteer/issues/1313)).
7308
6913
  *
7309
6914
  * Presses a key in the browser (on a focused element).
7310
6915
  *
@@ -7712,7 +7317,7 @@ declare namespace CodeceptJS {
7712
7317
  *
7713
7318
  * ```js
7714
7319
  * I.clearCookie();
7715
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
7320
+ * I.clearCookie('test');
7716
7321
  * ```
7717
7322
  * @param [cookie = null] - (optional, `null` by default) cookie name
7718
7323
  */
@@ -8152,7 +7757,7 @@ declare namespace CodeceptJS {
8152
7757
  /**
8153
7758
  * Waits for navigation to finish. By default, takes configured `waitForNavigation` option.
8154
7759
  *
8155
- * See [Puppeteer's reference](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
7760
+ * See [Puppeteer's reference](https://github.com/puppeteer/puppeteer/blob/main/docs/api/puppeteer.page.waitfornavigation.md)
8156
7761
  */
8157
7762
  waitForNavigation(opts: any): Promise<any>;
8158
7763
  /**
@@ -8353,6 +7958,22 @@ declare namespace CodeceptJS {
8353
7958
  */
8354
7959
  flushWebSocketMessages(): Promise<any>;
8355
7960
  }
7961
+ /**
7962
+ * Find elements using Puppeteer's native element discovery methods
7963
+ * Note: Unlike Playwright, Puppeteer's Locator API doesn't have .all() method for multiple elements
7964
+ * @param matcher - Puppeteer context to search within
7965
+ * @param locator - Locator specification
7966
+ * @returns Array of ElementHandle objects
7967
+ */
7968
+ function findElements(matcher: any, locator: any | string): Promise<any[]>;
7969
+ /**
7970
+ * Find a single element using Puppeteer's native element discovery methods
7971
+ * Note: Puppeteer Locator API doesn't have .first() method like Playwright
7972
+ * @param matcher - Puppeteer context to search within
7973
+ * @param locator - Locator specification
7974
+ * @returns Single ElementHandle object
7975
+ */
7976
+ function findElement(matcher: any, locator: any | string): Promise<object>;
8356
7977
  /**
8357
7978
  * ## Configuration
8358
7979
  * @property [endpoint] - API base URL
@@ -8366,9 +7987,6 @@ declare namespace CodeceptJS {
8366
7987
  * @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
8367
7988
  */
8368
7989
  // @ts-ignore
8369
- // @ts-ignore
8370
- // @ts-ignore
8371
- // @ts-ignore
8372
7990
  type RESTConfig = {
8373
7991
  endpoint?: string;
8374
7992
  prettyPrintJson?: boolean;
@@ -8494,6 +8112,16 @@ declare namespace CodeceptJS {
8494
8112
  * @returns response
8495
8113
  */
8496
8114
  sendGetRequest(url: any, headers?: any): Promise<any>;
8115
+ /**
8116
+ * Send HEAD request to REST API
8117
+ *
8118
+ * ```js
8119
+ * I.sendHeadRequest('/api/users.json');
8120
+ * ```
8121
+ * @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
8122
+ * @returns response
8123
+ */
8124
+ sendHeadRequest(url: any, headers?: any): Promise<any>;
8497
8125
  /**
8498
8126
  * Sends POST request to API.
8499
8127
  *
@@ -8549,250 +8177,17 @@ declare namespace CodeceptJS {
8549
8177
  * @returns response
8550
8178
  */
8551
8179
  sendDeleteRequest(url: any, headers?: any): Promise<any>;
8552
- }
8553
- /**
8554
- * SoftAssertHelper is a utility class for performing soft assertions.
8555
- * Unlike traditional assertions that stop the execution on failure,
8556
- * soft assertions allow the execution to continue and report all failures at the end.
8557
- *
8558
- * ### Examples
8559
- *
8560
- * Zero-configuration when paired with other helpers like REST, Playwright:
8561
- *
8562
- * ```js
8563
- * // inside codecept.conf.js
8564
- * {
8565
- * helpers: {
8566
- * Playwright: {...},
8567
- * SoftExpectHelper: {},
8568
- * }
8569
- * }
8570
- * ```
8571
- *
8572
- * ```js
8573
- * // in scenario
8574
- * I.softExpectEqual('a', 'b')
8575
- * I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
8576
- * ```
8577
- *
8578
- * ## Methods
8579
- */
8580
- class SoftAssertHelperTs {
8581
- /**
8582
- * Performs a soft assertion by executing the provided assertion function.
8583
- * If the assertion fails, the error is caught and stored without halting the execution.
8584
- * @param assertionFn - The assertion function to execute.
8585
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8586
- */
8587
- softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): Promise<any>;
8588
- /**
8589
- * Throws an error if any soft assertions have failed.
8590
- * The error message contains all the accumulated failures.
8591
- */
8592
- flushSoftAssertions(): Promise<any>;
8593
- /**
8594
- * Softly asserts that two values are equal.
8595
- * @param actualValue - The actual value.
8596
- * @param expectedValue - The expected value.
8597
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8598
- */
8599
- softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8600
- /**
8601
- * Softly asserts that two values are not equal.
8602
- * @param actualValue - The actual value.
8603
- * @param expectedValue - The expected value.
8604
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8605
- */
8606
- softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8607
- /**
8608
- * Softly asserts that two values are deeply equal.
8609
- * @param actualValue - The actual value.
8610
- * @param expectedValue - The expected value.
8611
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8612
- */
8613
- softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8614
- /**
8615
- * Softly asserts that two values are not deeply equal.
8616
- * @param actualValue - The actual value.
8617
- * @param expectedValue - The expected value.
8618
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8619
- */
8620
- softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8621
- /**
8622
- * Softly asserts that a value contains the expected value.
8623
- * @param actualValue - The actual value.
8624
- * @param expectedValueToContain - The value that should be contained within the actual value.
8625
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8626
- */
8627
- softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): Promise<any>;
8628
- /**
8629
- * Softly asserts that a value does not contain the expected value.
8630
- * @param actualValue - The actual value.
8631
- * @param expectedValueToNotContain - The value that should not be contained within the actual value.
8632
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8633
- */
8634
- softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): Promise<any>;
8635
- /**
8636
- * Softly asserts that a value starts with the expected value.
8637
- * @param actualValue - The actual value.
8638
- * @param expectedValueToStartWith - The value that the actual value should start with.
8639
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8640
- */
8641
- softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): Promise<any>;
8642
- /**
8643
- * Softly asserts that a value does not start with the expected value.
8644
- * @param actualValue - The actual value.
8645
- * @param expectedValueToNotStartWith - The value that the actual value should not start with.
8646
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8647
- */
8648
- softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): Promise<any>;
8649
- /**
8650
- * Softly asserts that a value ends with the expected value.
8651
- * @param actualValue - The actual value.
8652
- * @param expectedValueToEndWith - The value that the actual value should end with.
8653
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8654
- */
8655
- softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): Promise<any>;
8656
- /**
8657
- * Softly asserts that a value does not end with the expected value.
8658
- * @param actualValue - The actual value.
8659
- * @param expectedValueToNotEndWith - The value that the actual value should not end with.
8660
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8661
- */
8662
- softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): Promise<any>;
8663
- /**
8664
- * Softly asserts that the target data matches the given JSON schema.
8665
- * @param targetData - The data to validate.
8666
- * @param jsonSchema - The JSON schema to validate against.
8667
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8668
- */
8669
- softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): Promise<any>;
8670
- /**
8671
- * Softly asserts that the target data matches the given JSON schema using AJV.
8672
- * @param targetData - The data to validate.
8673
- * @param jsonSchema - The JSON schema to validate against.
8674
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8675
- * @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
8676
- */
8677
- softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): Promise<any>;
8678
- /**
8679
- * Softly asserts that the target data has the specified property.
8680
- * @param targetData - The data to check.
8681
- * @param propertyName - The property name to check for.
8682
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion
8683
- * fails.
8684
- */
8685
- softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
8686
8180
  /**
8687
- * Softly asserts that the target data has a property with the specified name.
8688
- * @param targetData - The data to check.
8689
- * @param propertyName - The property name to check for.
8690
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8691
- */
8692
- softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
8693
- /**
8694
- * Softly asserts that the target data is of a specific type.
8695
- * @param targetData - The data to check.
8696
- * @param type - The expected type (e.g., 'string', 'number').
8697
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8698
- */
8699
- softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
8700
- /**
8701
- * Softly asserts that the target data is of a specific type (alternative for articles).
8702
- * @param targetData - The data to check.
8703
- * @param type - The expected type (e.g., 'string', 'number').
8704
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8705
- */
8706
- softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
8707
- /**
8708
- * Softly asserts that the target data has a specified length.
8709
- * @param targetData - The data to check.
8710
- * @param length - The expected length.
8711
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8712
- */
8713
- softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): Promise<any>;
8714
- /**
8715
- * Softly asserts that the target data is empty.
8716
- * @param targetData - The data to check.
8717
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8718
- */
8719
- softExpectEmpty(targetData: any, customErrorMsg?: string): Promise<any>;
8720
- /**
8721
- * Softly asserts that the target data is true.
8722
- * @param targetData - The data to check.
8723
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8724
- */
8725
- softExpectTrue(targetData: any, customErrorMsg?: string): Promise<any>;
8726
- /**
8727
- * Softly asserts that the target data is false.
8728
- * @param targetData - The data to check.
8729
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8730
- */
8731
- softExpectFalse(targetData: any, customErrorMsg?: string): Promise<any>;
8732
- /**
8733
- * Softly asserts that the target data is above a specified value.
8734
- * @param targetData - The data to check.
8735
- * @param aboveThan - The value that the target data should be above.
8736
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8737
- */
8738
- softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): Promise<any>;
8739
- /**
8740
- * Softly asserts that the target data is below a specified value.
8741
- * @param targetData - The data to check.
8742
- * @param belowThan - The value that the target data should be below.
8743
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8744
- */
8745
- softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): Promise<any>;
8746
- /**
8747
- * Softly asserts that the length of the target data is above a specified value.
8748
- * @param targetData - The data to check.
8749
- * @param lengthAboveThan - The length that the target data should be above.
8750
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8751
- */
8752
- softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): Promise<any>;
8753
- /**
8754
- * Softly asserts that the length of the target data is below a specified value.
8755
- * @param targetData - The data to check.
8756
- * @param lengthBelowThan - The length that the target data should be below.
8757
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8758
- */
8759
- softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): Promise<any>;
8760
- /**
8761
- * Softly asserts that two values are equal, ignoring case.
8762
- * @param actualValue - The actual string value.
8763
- * @param expectedValue - The expected string value.
8764
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8765
- */
8766
- softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): Promise<any>;
8767
- /**
8768
- * Softly asserts that two arrays have deep equality, considering members in any order.
8769
- * @param actualValue - The actual array.
8770
- * @param expectedValue - The expected array.
8771
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8772
- */
8773
- softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): Promise<any>;
8774
- /**
8775
- * Softly asserts that an array (superset) deeply includes all members of another array (set).
8776
- * @param superset - The array that should contain the expected members.
8777
- * @param set - The array with members that should be included.
8778
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8779
- */
8780
- softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): Promise<any>;
8781
- /**
8782
- * Softly asserts that two objects are deeply equal, excluding specified fields.
8783
- * @param actualValue - The actual object.
8784
- * @param expectedValue - The expected object.
8785
- * @param fieldsToExclude - The fields to exclude from the comparison.
8786
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8787
- */
8788
- softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): Promise<any>;
8789
- /**
8790
- * Softly asserts that a value matches the expected pattern.
8791
- * @param actualValue - The actual value.
8792
- * @param expectedPattern - The pattern the value should match.
8793
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8181
+ * Sends DELETE request to API with payload.
8182
+ *
8183
+ * ```js
8184
+ * I.sendDeleteRequestWithPayload('/api/users/1', { author: 'john' });
8185
+ * ```
8186
+ * @param [payload = {}] - the payload to be sent. By default it is sent as an empty object
8187
+ * @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
8188
+ * @returns response
8794
8189
  */
8795
- softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): Promise<any>;
8190
+ sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
8796
8191
  }
8797
8192
  /**
8798
8193
  * Client Functions
@@ -9616,7 +9011,7 @@ declare namespace CodeceptJS {
9616
9011
  *
9617
9012
  * ```js
9618
9013
  * I.clearCookie();
9619
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
9014
+ * I.clearCookie('test');
9620
9015
  * ```
9621
9016
  * @param [cookie = null] - (optional, `null` by default) cookie name
9622
9017
  */
@@ -9726,6 +9121,7 @@ declare namespace CodeceptJS {
9726
9121
  * This helper should be configured in codecept.conf.js
9727
9122
  * @property url - base url of website to be tested.
9728
9123
  * @property browser - Browser in which to perform testing.
9124
+ * @property [bidiProtocol = false] - WebDriver Bidi Protocol. Default: false. More info: https://webdriver.io/docs/api/webdriverBidi/
9729
9125
  * @property [basicAuth] - (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
9730
9126
  * @property [host = localhost] - WebDriver host to connect.
9731
9127
  * @property [port = 4444] - WebDriver port to connect.
@@ -9745,15 +9141,12 @@ declare namespace CodeceptJS {
9745
9141
  * @property [timeouts] - [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
9746
9142
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
9747
9143
  * @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
9748
- * @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
9749
9144
  */
9750
9145
  // @ts-ignore
9751
- // @ts-ignore
9752
- // @ts-ignore
9753
- // @ts-ignore
9754
9146
  type WebDriverConfig = {
9755
9147
  url: string;
9756
9148
  browser: string;
9149
+ bidiProtocol?: boolean;
9757
9150
  basicAuth?: string;
9758
9151
  host?: string;
9759
9152
  port?: number;
@@ -9773,7 +9166,6 @@ declare namespace CodeceptJS {
9773
9166
  timeouts?: any;
9774
9167
  highlightElement?: boolean;
9775
9168
  logLevel?: string;
9776
- devtoolsProtocol?: boolean;
9777
9169
  };
9778
9170
  /**
9779
9171
  * WebDriver helper which wraps [webdriverio](http://webdriver.io/) library to
@@ -9879,7 +9271,6 @@ declare namespace CodeceptJS {
9879
9271
  * WebDriver : {
9880
9272
  * url: "http://localhost",
9881
9273
  * browser: "chrome",
9882
- * devtoolsProtocol: true,
9883
9274
  * desiredCapabilities: {
9884
9275
  * chromeOptions: {
9885
9276
  * args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
@@ -10222,6 +9613,17 @@ declare namespace CodeceptJS {
10222
9613
  * @returns WebElement of being used Web helper
10223
9614
  */
10224
9615
  grabWebElements(locator: CodeceptJS.LocatorOrString): Promise<any>;
9616
+ /**
9617
+ * Grab WebElement for given locator
9618
+ * Resumes test execution, so **should be used inside an async function with `await`** operator.
9619
+ *
9620
+ * ```js
9621
+ * const webElement = await I.grabWebElement('#button');
9622
+ * ```
9623
+ * @param locator - element located by CSS|XPath|strict locator.
9624
+ * @returns WebElement of being used Web helper
9625
+ */
9626
+ grabWebElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
10225
9627
  /**
10226
9628
  * Set [WebDriver timeouts](https://webdriver.io/docs/timeouts.html) in realtime.
10227
9629
  *
@@ -11023,7 +10425,7 @@ declare namespace CodeceptJS {
11023
10425
  *
11024
10426
  * ```js
11025
10427
  * I.clearCookie();
11026
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
10428
+ * I.clearCookie('test');
11027
10429
  * ```
11028
10430
  * @param [cookie = null] - (optional, `null` by default) cookie name
11029
10431
  */
@@ -11569,33 +10971,6 @@ declare namespace CodeceptJS {
11569
10971
  * @returns scroll position
11570
10972
  */
11571
10973
  grabPageScrollPosition(): Promise<PageScrollPosition>;
11572
- /**
11573
- * This method is **deprecated**.
11574
- *
11575
- *
11576
- * Set the current geo location
11577
- *
11578
- *
11579
- * ```js
11580
- * I.setGeoLocation(121.21, 11.56);
11581
- * I.setGeoLocation(121.21, 11.56, 10);
11582
- * ```
11583
- * @param latitude - to set.
11584
- * @param longitude - to set
11585
- * @param [altitude] - (optional, null by default) to set
11586
- */
11587
- setGeoLocation(latitude: number, longitude: number, altitude?: number): Promise<any>;
11588
- /**
11589
- * This method is **deprecated**.
11590
- *
11591
- * Return the current geo location
11592
- * Resumes test execution, so **should be used inside async function with `await`** operator.
11593
- *
11594
- * ```js
11595
- * let geoLocation = await I.grabGeoLocation();
11596
- * ```
11597
- */
11598
- grabGeoLocation(): Promise<{ latitude: number; longitude: number; altitude: number; }>;
11599
10974
  /**
11600
10975
  * Grab the width, height, location of given locator.
11601
10976
  * Provide `width` or `height`as second param to get your desired prop.
@@ -11622,119 +10997,15 @@ declare namespace CodeceptJS {
11622
10997
  /**
11623
10998
  * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
11624
10999
  */
11625
- runOnAndroid(caps: any, fn: any): Promise<any>;
11000
+ runOnIOS(caps: any, fn: any): Promise<any>;
11626
11001
  /**
11627
11002
  * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
11628
11003
  */
11629
- runInWeb(): Promise<any>;
11630
- /**
11631
- * _Note:_ Only works when devtoolsProtocol is enabled.
11632
- *
11633
- * Resets all recorded network requests.
11634
- *
11635
- * ```js
11636
- * I.flushNetworkTraffics();
11637
- * ```
11638
- */
11639
- flushNetworkTraffics(): Promise<any>;
11640
- /**
11641
- * _Note:_ Only works when devtoolsProtocol is enabled.
11642
- *
11643
- * Stops recording of network traffic. Recorded traffic is not flashed.
11644
- *
11645
- * ```js
11646
- * I.stopRecordingTraffic();
11647
- * ```
11648
- */
11649
- stopRecordingTraffic(): Promise<any>;
11650
- /**
11651
- * _Note:_ Only works when devtoolsProtocol is enabled.
11652
- *
11653
- * Starts recording the network traffics.
11654
- * This also resets recorded network requests.
11655
- *
11656
- * ```js
11657
- * I.startRecordingTraffic();
11658
- * ```
11659
- */
11660
- startRecordingTraffic(): Promise<any>;
11661
- /**
11662
- * _Note:_ Only works when devtoolsProtocol is enabled.
11663
- *
11664
- * Grab the recording network traffics
11665
- *
11666
- * ```js
11667
- * const traffics = await I.grabRecordedNetworkTraffics();
11668
- * expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
11669
- * expect(traffics[0].response.status).to.equal(200);
11670
- * expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
11671
- * ```
11672
- */
11673
- grabRecordedNetworkTraffics(): Promise<any>;
11674
- /**
11675
- * _Note:_ Only works when devtoolsProtocol is enabled.
11676
- *
11677
- * Verifies that a certain request is part of network traffic.
11678
- *
11679
- * ```js
11680
- * // checking the request url contains certain query strings
11681
- * I.amOnPage('https://openai.com/blog/chatgpt');
11682
- * I.startRecordingTraffic();
11683
- * await I.seeTraffic({
11684
- * name: 'sentry event',
11685
- * url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
11686
- * parameters: {
11687
- * width: '1919',
11688
- * height: '1138',
11689
- * },
11690
- * });
11691
- * ```
11692
- *
11693
- * ```js
11694
- * // checking the request url contains certain post data
11695
- * I.amOnPage('https://openai.com/blog/chatgpt');
11696
- * I.startRecordingTraffic();
11697
- * await I.seeTraffic({
11698
- * name: 'event',
11699
- * url: 'https://cloudflareinsights.com/cdn-cgi/rum',
11700
- * requestPostData: {
11701
- * st: 2,
11702
- * },
11703
- * });
11704
- * ```
11705
- * @param opts - options when checking the traffic network.
11706
- * @param opts.name - A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
11707
- * @param opts.url - Expected URL of request in network traffic
11708
- * @param [opts.parameters] - Expected parameters of that request in network traffic
11709
- * @param [opts.requestPostData] - Expected that request contains post data in network traffic
11710
- * @param [opts.timeout] - Timeout to wait for request in seconds. Default is 10 seconds.
11711
- */
11712
- seeTraffic(opts: {
11713
- name: string;
11714
- url: string;
11715
- parameters?: any;
11716
- requestPostData?: any;
11717
- timeout?: number;
11718
- }): Promise<any>;
11004
+ runOnAndroid(caps: any, fn: any): Promise<any>;
11719
11005
  /**
11720
- * _Note:_ Only works when devtoolsProtocol is enabled.
11721
- *
11722
- * Verifies that a certain request is not part of network traffic.
11723
- *
11724
- * Examples:
11725
- *
11726
- * ```js
11727
- * I.dontSeeTraffic({ name: 'Unexpected API Call', url: 'https://api.example.com' });
11728
- * I.dontSeeTraffic({ name: 'Unexpected API Call of "user" endpoint', url: /api.example.com.*user/ });
11729
- * ```
11730
- * @param opts - options when checking the traffic network.
11731
- * @param opts.name - A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
11732
- * @param opts.url - Expected URL of request in network traffic. Can be a string or a regular expression.
11006
+ * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
11733
11007
  */
11734
- dontSeeTraffic(opts: {
11735
- name: string;
11736
- url: string | RegExp;
11737
- }): Promise<any>;
11008
+ runInWeb(): Promise<any>;
11738
11009
  }
11739
11010
  }
11740
11011