codeceptjs 4.0.0-beta.3 → 4.0.0-beta.5

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 (155) hide show
  1. package/README.md +134 -119
  2. package/bin/codecept.js +12 -2
  3. package/bin/test-server.js +53 -0
  4. package/docs/webapi/clearCookie.mustache +1 -1
  5. package/lib/actor.js +66 -102
  6. package/lib/ai.js +130 -121
  7. package/lib/assert/empty.js +3 -5
  8. package/lib/assert/equal.js +4 -7
  9. package/lib/assert/include.js +4 -6
  10. package/lib/assert/throws.js +2 -4
  11. package/lib/assert/truth.js +2 -2
  12. package/lib/codecept.js +141 -86
  13. package/lib/command/check.js +201 -0
  14. package/lib/command/configMigrate.js +2 -4
  15. package/lib/command/definitions.js +8 -26
  16. package/lib/command/dryRun.js +30 -35
  17. package/lib/command/generate.js +10 -14
  18. package/lib/command/gherkin/snippets.js +75 -73
  19. package/lib/command/gherkin/steps.js +1 -1
  20. package/lib/command/info.js +42 -8
  21. package/lib/command/init.js +13 -12
  22. package/lib/command/interactive.js +10 -2
  23. package/lib/command/list.js +1 -1
  24. package/lib/command/run-multiple/chunk.js +48 -45
  25. package/lib/command/run-multiple.js +12 -35
  26. package/lib/command/run-workers.js +21 -58
  27. package/lib/command/utils.js +5 -6
  28. package/lib/command/workers/runTests.js +263 -222
  29. package/lib/container.js +386 -238
  30. package/lib/data/context.js +10 -13
  31. package/lib/data/dataScenarioConfig.js +8 -8
  32. package/lib/data/dataTableArgument.js +6 -6
  33. package/lib/data/table.js +5 -11
  34. package/lib/effects.js +223 -0
  35. package/lib/element/WebElement.js +327 -0
  36. package/lib/els.js +158 -0
  37. package/lib/event.js +21 -17
  38. package/lib/heal.js +88 -80
  39. package/lib/helper/AI.js +2 -1
  40. package/lib/helper/ApiDataFactory.js +4 -7
  41. package/lib/helper/Appium.js +50 -57
  42. package/lib/helper/FileSystem.js +3 -3
  43. package/lib/helper/GraphQLDataFactory.js +4 -4
  44. package/lib/helper/JSONResponse.js +75 -37
  45. package/lib/helper/Mochawesome.js +31 -9
  46. package/lib/helper/Nightmare.js +37 -58
  47. package/lib/helper/Playwright.js +267 -272
  48. package/lib/helper/Protractor.js +56 -87
  49. package/lib/helper/Puppeteer.js +247 -264
  50. package/lib/helper/REST.js +29 -17
  51. package/lib/helper/TestCafe.js +22 -47
  52. package/lib/helper/WebDriver.js +157 -368
  53. package/lib/helper/extras/PlaywrightPropEngine.js +2 -2
  54. package/lib/helper/extras/Popup.js +22 -22
  55. package/lib/helper/network/utils.js +1 -1
  56. package/lib/helper/testcafe/testcafe-utils.js +27 -28
  57. package/lib/listener/emptyRun.js +55 -0
  58. package/lib/listener/exit.js +7 -10
  59. package/lib/listener/{retry.js → globalRetry.js} +5 -5
  60. package/lib/listener/globalTimeout.js +165 -0
  61. package/lib/listener/helpers.js +15 -15
  62. package/lib/listener/mocha.js +1 -1
  63. package/lib/listener/result.js +12 -0
  64. package/lib/listener/retryEnhancer.js +85 -0
  65. package/lib/listener/steps.js +32 -18
  66. package/lib/listener/store.js +20 -0
  67. package/lib/locator.js +1 -1
  68. package/lib/mocha/asyncWrapper.js +231 -0
  69. package/lib/{interfaces → mocha}/bdd.js +3 -3
  70. package/lib/mocha/cli.js +308 -0
  71. package/lib/mocha/factory.js +104 -0
  72. package/lib/{interfaces → mocha}/featureConfig.js +32 -12
  73. package/lib/{interfaces → mocha}/gherkin.js +26 -28
  74. package/lib/mocha/hooks.js +112 -0
  75. package/lib/mocha/index.js +12 -0
  76. package/lib/mocha/inject.js +29 -0
  77. package/lib/{interfaces → mocha}/scenarioConfig.js +31 -7
  78. package/lib/mocha/suite.js +82 -0
  79. package/lib/mocha/test.js +181 -0
  80. package/lib/mocha/types.d.ts +42 -0
  81. package/lib/mocha/ui.js +232 -0
  82. package/lib/output.js +93 -65
  83. package/lib/pause.js +160 -138
  84. package/lib/plugin/analyze.js +396 -0
  85. package/lib/plugin/auth.js +435 -0
  86. package/lib/plugin/autoDelay.js +8 -8
  87. package/lib/plugin/autoLogin.js +3 -338
  88. package/lib/plugin/commentStep.js +6 -1
  89. package/lib/plugin/coverage.js +10 -22
  90. package/lib/plugin/customLocator.js +3 -3
  91. package/lib/plugin/customReporter.js +52 -0
  92. package/lib/plugin/eachElement.js +1 -1
  93. package/lib/plugin/fakerTransform.js +1 -1
  94. package/lib/plugin/heal.js +36 -9
  95. package/lib/plugin/htmlReporter.js +1947 -0
  96. package/lib/plugin/pageInfo.js +140 -0
  97. package/lib/plugin/retryFailedStep.js +17 -18
  98. package/lib/plugin/retryTo.js +2 -113
  99. package/lib/plugin/screenshotOnFail.js +17 -58
  100. package/lib/plugin/selenoid.js +15 -35
  101. package/lib/plugin/standardActingHelpers.js +4 -1
  102. package/lib/plugin/stepByStepReport.js +56 -17
  103. package/lib/plugin/stepTimeout.js +5 -12
  104. package/lib/plugin/subtitles.js +4 -4
  105. package/lib/plugin/tryTo.js +3 -102
  106. package/lib/plugin/wdio.js +8 -10
  107. package/lib/recorder.js +155 -124
  108. package/lib/rerun.js +43 -42
  109. package/lib/result.js +161 -0
  110. package/lib/secret.js +1 -2
  111. package/lib/step/base.js +239 -0
  112. package/lib/step/comment.js +10 -0
  113. package/lib/step/config.js +50 -0
  114. package/lib/step/func.js +46 -0
  115. package/lib/step/helper.js +50 -0
  116. package/lib/step/meta.js +99 -0
  117. package/lib/step/record.js +74 -0
  118. package/lib/step/retry.js +11 -0
  119. package/lib/step/section.js +55 -0
  120. package/lib/step.js +21 -332
  121. package/lib/steps.js +50 -0
  122. package/lib/store.js +37 -5
  123. package/lib/template/heal.js +2 -11
  124. package/lib/test-server.js +323 -0
  125. package/lib/timeout.js +66 -0
  126. package/lib/utils.js +351 -218
  127. package/lib/within.js +75 -55
  128. package/lib/workerStorage.js +2 -1
  129. package/lib/workers.js +386 -277
  130. package/package.json +81 -75
  131. package/translations/de-DE.js +5 -3
  132. package/translations/fr-FR.js +5 -4
  133. package/translations/index.js +1 -0
  134. package/translations/it-IT.js +4 -3
  135. package/translations/ja-JP.js +4 -3
  136. package/translations/nl-NL.js +76 -0
  137. package/translations/pl-PL.js +4 -3
  138. package/translations/pt-BR.js +4 -3
  139. package/translations/ru-RU.js +4 -3
  140. package/translations/utils.js +9 -0
  141. package/translations/zh-CN.js +4 -3
  142. package/translations/zh-TW.js +4 -3
  143. package/typings/index.d.ts +197 -187
  144. package/typings/promiseBasedTypes.d.ts +53 -903
  145. package/typings/types.d.ts +372 -1042
  146. package/lib/cli.js +0 -257
  147. package/lib/helper/ExpectHelper.js +0 -391
  148. package/lib/helper/MockServer.js +0 -221
  149. package/lib/helper/SoftExpectHelper.js +0 -381
  150. package/lib/listener/artifacts.js +0 -19
  151. package/lib/listener/timeout.js +0 -109
  152. package/lib/mochaFactory.js +0 -113
  153. package/lib/plugin/debugErrors.js +0 -67
  154. package/lib/scenario.js +0 -224
  155. package/lib/ui.js +0 -236
@@ -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,244 +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
- // @ts-ignore
1188
- // @ts-ignore
1189
- // @ts-ignore
1190
- // @ts-ignore
1191
- class ExpectHelper {
1192
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1193
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1194
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1195
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1196
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1197
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1198
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1199
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1200
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1201
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1202
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1203
- /**
1204
- * @param [ajvOptions] - Pass AJV options
1205
- */
1206
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1207
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1208
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1209
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1210
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1211
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1212
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1213
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1214
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1215
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1216
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1217
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1218
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1219
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1220
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1221
- /**
1222
- * expects members of two arrays are deeply equal
1223
- */
1224
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1225
- /**
1226
- * expects an array to be a superset of another array
1227
- */
1228
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1229
- /**
1230
- * expects members of two JSON objects are deeply equal excluding some properties
1231
- */
1232
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1233
- /**
1234
- * expects a JSON object matches a provided pattern
1235
- */
1236
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1237
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1238
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1239
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1240
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1241
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1242
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1243
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1244
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1245
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1246
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1247
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1248
- /**
1249
- * @param [ajvOptions] - Pass AJV options
1250
- */
1251
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1252
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1253
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1254
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1255
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1256
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1257
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1258
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1259
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1260
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1261
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1262
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1263
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1264
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1265
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1266
- /**
1267
- * expects members of two arrays are deeply equal
1268
- */
1269
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1270
- /**
1271
- * expects an array to be a superset of another array
1272
- */
1273
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1274
- /**
1275
- * expects members of two JSON objects are deeply equal excluding some properties
1276
- */
1277
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1278
- /**
1279
- * expects a JSON object matches a provided pattern
1280
- */
1281
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1282
- }
1283
- /**
1284
- * This helper allows performing assertions based on Chai.
1285
- *
1286
- * ### Examples
1287
- *
1288
- * Zero-configuration when paired with other helpers like REST, Playwright:
1289
- *
1290
- * ```js
1291
- * // inside codecept.conf.js
1292
- * {
1293
- * helpers: {
1294
- * Playwright: {...},
1295
- * ExpectHelper: {},
1296
- * }
1297
- * }
1298
- * ```
1299
- *
1300
- * ## Methods
1301
- */
1302
- // @ts-ignore
1303
- // @ts-ignore
1304
- // @ts-ignore
1305
- // @ts-ignore
1306
- // @ts-ignore
1307
- // @ts-ignore
1308
- // @ts-ignore
1309
- // @ts-ignore
1310
- class ExpectHelper {
1311
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1312
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1313
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1314
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1315
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1316
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1317
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1318
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1319
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1320
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1321
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1322
- /**
1323
- * @param [ajvOptions] - Pass AJV options
1324
- */
1325
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1326
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1327
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1328
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1329
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1330
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1331
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1332
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1333
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1334
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1335
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1336
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1337
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1338
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1339
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1340
- /**
1341
- * expects members of two arrays are deeply equal
1342
- */
1343
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1344
- /**
1345
- * expects an array to be a superset of another array
1346
- */
1347
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1348
- /**
1349
- * expects members of two JSON objects are deeply equal excluding some properties
1350
- */
1351
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1352
- /**
1353
- * expects a JSON object matches a provided pattern
1354
- */
1355
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1356
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1357
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1358
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1359
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1360
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1361
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1362
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1363
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1364
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1365
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1366
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1367
- /**
1368
- * @param [ajvOptions] - Pass AJV options
1369
- */
1370
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1371
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1372
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1373
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1374
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1375
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1376
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1377
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1378
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1379
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1380
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1381
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1382
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1383
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1384
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1385
- /**
1386
- * expects members of two arrays are deeply equal
1387
- */
1388
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1389
- /**
1390
- * expects an array to be a superset of another array
1391
- */
1392
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1393
- /**
1394
- * expects members of two JSON objects are deeply equal excluding some properties
1395
- */
1396
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1397
- /**
1398
- * expects a JSON object matches a provided pattern
1399
- */
1400
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1401
- }
1402
1182
  /**
1403
1183
  * Helper for testing filesystem.
1404
1184
  * Can be easily used to check file structures:
@@ -1645,7 +1425,7 @@ declare namespace CodeceptJS {
1645
1425
  * input: { ...buildObj },
1646
1426
  * }))
1647
1427
  * // 'attr'-id can be left out depending on the GraphQl resolvers
1648
- * .attr('name', () => faker.name.findName())
1428
+ * .attr('name', () => faker.person.findName())
1649
1429
  * .attr('email', () => faker.interact.email())
1650
1430
  * ```
1651
1431
  * For more options see [rosie documentation](https://github.com/rosiejs/rosie).
@@ -1922,13 +1702,14 @@ declare namespace CodeceptJS {
1922
1702
  */
1923
1703
  seeResponseContainsKeys(keys: any[]): Promise<any>;
1924
1704
  /**
1925
- * Executes a callback function passing in `response` object and chai assertions with `expect`
1705
+ * Executes a callback function passing in `response` object and assert
1926
1706
  * Use it to perform custom checks of response data
1927
1707
  *
1928
1708
  * ```js
1929
- * I.seeResponseValidByCallback(({ data, status, expect }) => {
1930
- * expect(status).to.eql(200);
1931
- * 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);
1932
1713
  * });
1933
1714
  * ```
1934
1715
  */
@@ -1970,204 +1751,6 @@ declare namespace CodeceptJS {
1970
1751
  */
1971
1752
  seeResponseMatchesJsonSchema(fnOrSchema: any): Promise<any>;
1972
1753
  }
1973
- /**
1974
- * ## Configuration
1975
- *
1976
- * This helper should be configured in codecept.conf.(js|ts)
1977
- * @property [port = 9393] - Mock server port
1978
- * @property [host = "0.0.0.0"] - Mock server host
1979
- * @property [httpsOpts] - key & cert values are the paths to .key and .crt files
1980
- */
1981
- // @ts-ignore
1982
- // @ts-ignore
1983
- // @ts-ignore
1984
- // @ts-ignore
1985
- // @ts-ignore
1986
- // @ts-ignore
1987
- // @ts-ignore
1988
- // @ts-ignore
1989
- type MockServerConfig = {
1990
- port?: number;
1991
- host?: string;
1992
- httpsOpts?: any;
1993
- };
1994
- /**
1995
- * MockServer
1996
- *
1997
- * 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.
1998
- *
1999
- * <!-- configuration -->
2000
- *
2001
- * #### Examples
2002
- *
2003
- * You can seamlessly integrate MockServer with other helpers like REST or Playwright. Here's a configuration example inside the `codecept.conf.js` file:
2004
- *
2005
- * ```javascript
2006
- * {
2007
- * helpers: {
2008
- * REST: {...},
2009
- * MockServer: {
2010
- * // default mock server config
2011
- * port: 9393,
2012
- * host: '0.0.0.0',
2013
- * httpsOpts: {
2014
- * key: '',
2015
- * cert: '',
2016
- * },
2017
- * },
2018
- * }
2019
- * }
2020
- * ```
2021
- *
2022
- * #### Adding Interactions
2023
- *
2024
- * 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.
2025
- *
2026
- * ```javascript
2027
- * I.addInteractionToMockServer({
2028
- * request: {
2029
- * method: 'GET',
2030
- * path: '/api/hello'
2031
- * },
2032
- * response: {
2033
- * status: 200,
2034
- * body: {
2035
- * 'say': 'hello to mock server'
2036
- * }
2037
- * }
2038
- * });
2039
- * ```
2040
- *
2041
- * #### Request Matching
2042
- *
2043
- * 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.
2044
- *
2045
- * - Strong match on HTTP Method, Path, Query Params & JSON body.
2046
- * - Loose match on Headers.
2047
- *
2048
- * ##### Strong Match on Query Params
2049
- *
2050
- * You can send different responses based on query parameters:
2051
- *
2052
- * ```javascript
2053
- * I.addInteractionToMockServer({
2054
- * request: {
2055
- * method: 'GET',
2056
- * path: '/api/users',
2057
- * queryParams: {
2058
- * id: 1
2059
- * }
2060
- * },
2061
- * response: {
2062
- * status: 200,
2063
- * body: 'user 1'
2064
- * }
2065
- * });
2066
- *
2067
- * I.addInteractionToMockServer({
2068
- * request: {
2069
- * method: 'GET',
2070
- * path: '/api/users',
2071
- * queryParams: {
2072
- * id: 2
2073
- * }
2074
- * },
2075
- * response: {
2076
- * status: 200,
2077
- * body: 'user 2'
2078
- * }
2079
- * });
2080
- * ```
2081
- *
2082
- * - GET to `/api/users?id=1` will return 'user 1'.
2083
- * - GET to `/api/users?id=2` will return 'user 2'.
2084
- * - For all other requests, it returns a 404 status code.
2085
- *
2086
- * ##### Loose Match on Body
2087
- *
2088
- * When `strict` is set to false, it performs a loose match on query params and response body:
2089
- *
2090
- * ```javascript
2091
- * I.addInteractionToMockServer({
2092
- * strict: false,
2093
- * request: {
2094
- * method: 'POST',
2095
- * path: '/api/users',
2096
- * body: {
2097
- * name: 'john'
2098
- * }
2099
- * },
2100
- * response: {
2101
- * status: 200
2102
- * }
2103
- * });
2104
- * ```
2105
- *
2106
- * - POST to `/api/users` with the body containing `name` as 'john' will return a 200 status code.
2107
- * - POST to `/api/users` without the `name` property in the body will return a 404 status code.
2108
- *
2109
- * Happy testing with MockServer in CodeceptJS! 🚀
2110
- *
2111
- * ## Methods
2112
- */
2113
- // @ts-ignore
2114
- // @ts-ignore
2115
- // @ts-ignore
2116
- // @ts-ignore
2117
- // @ts-ignore
2118
- // @ts-ignore
2119
- // @ts-ignore
2120
- // @ts-ignore
2121
- class MockServer {
2122
- /**
2123
- * Start the mock server
2124
- * @param [port] - start the mock server with given port
2125
- */
2126
- startMockServer(port?: number): Promise<any>;
2127
- /**
2128
- * Stop the mock server
2129
- */
2130
- stopMockServer(): Promise<any>;
2131
- /**
2132
- * An interaction adds behavior to the mock server
2133
- *
2134
- *
2135
- * ```js
2136
- * I.addInteractionToMockServer({
2137
- * request: {
2138
- * method: 'GET',
2139
- * path: '/api/hello'
2140
- * },
2141
- * response: {
2142
- * status: 200,
2143
- * body: {
2144
- * 'say': 'hello to mock server'
2145
- * }
2146
- * }
2147
- * });
2148
- * ```
2149
- * ```js
2150
- * // with query params
2151
- * I.addInteractionToMockServer({
2152
- * request: {
2153
- * method: 'GET',
2154
- * path: '/api/hello',
2155
- * queryParams: {
2156
- * id: 2
2157
- * }
2158
- * },
2159
- * response: {
2160
- * status: 200,
2161
- * body: {
2162
- * 'say': 'hello to mock server'
2163
- * }
2164
- * }
2165
- * });
2166
- * ```
2167
- * @param interaction - add behavior to the mock server
2168
- */
2169
- addInteractionToMockServer(interaction: CodeceptJS.MockInteraction | any): Promise<any>;
2170
- }
2171
1754
  /**
2172
1755
  * Nightmare helper wraps [Nightmare](https://github.com/segmentio/nightmare) library to provide
2173
1756
  * fastest headless testing using Electron engine. Unlike Selenium-based drivers this uses
@@ -2906,7 +2489,7 @@ declare namespace CodeceptJS {
2906
2489
  *
2907
2490
  * ```js
2908
2491
  * I.clearCookie();
2909
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
2492
+ * I.clearCookie('test');
2910
2493
  * ```
2911
2494
  * @param [cookie = null] - (optional, `null` by default) cookie name
2912
2495
  */
@@ -3107,46 +2690,6 @@ declare namespace CodeceptJS {
3107
2690
  */
3108
2691
  grabPageScrollPosition(): Promise<PageScrollPosition>;
3109
2692
  }
3110
- /**
3111
- * OpenAI Helper for CodeceptJS.
3112
- *
3113
- * 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.
3114
- * This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
3115
- *
3116
- * ## Configuration
3117
- *
3118
- * This helper should be configured in codecept.json or codecept.conf.js
3119
- *
3120
- * * `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.
3121
- */
3122
- class OpenAITs {
3123
- /**
3124
- * Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
3125
- *
3126
- * ```js
3127
- * I.askGptOnPage('what does this page do?');
3128
- * ```
3129
- * @param prompt - The question or prompt to ask the GPT model.
3130
- * @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
3131
- */
3132
- askGptOnPage(prompt: string): Promise<string>;
3133
- /**
3134
- * 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.
3135
- *
3136
- * ```js
3137
- * I.askGptOnPageFragment('describe features of this screen', '.screen');
3138
- * ```
3139
- * @param prompt - The question or prompt to ask the GPT-3.5 model.
3140
- * @param locator - The locator or selector used to identify the HTML fragment on the page.
3141
- * @returns - A Promise that resolves to the generated response from the GPT model.
3142
- */
3143
- askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
3144
- /**
3145
- * Send a general request to ChatGPT and return response.
3146
- * @returns - A Promise that resolves to the generated response from the GPT model.
3147
- */
3148
- askGptGeneralPrompt(prompt: string): Promise<string>;
3149
- }
3150
2693
  /**
3151
2694
  * ## Configuration
3152
2695
  *
@@ -3192,13 +2735,6 @@ declare namespace CodeceptJS {
3192
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).
3193
2736
  */
3194
2737
  // @ts-ignore
3195
- // @ts-ignore
3196
- // @ts-ignore
3197
- // @ts-ignore
3198
- // @ts-ignore
3199
- // @ts-ignore
3200
- // @ts-ignore
3201
- // @ts-ignore
3202
2738
  type PlaywrightConfig = {
3203
2739
  url?: string;
3204
2740
  browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
@@ -4552,7 +4088,7 @@ declare namespace CodeceptJS {
4552
4088
  *
4553
4089
  * ```js
4554
4090
  * I.clearCookie();
4555
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
4091
+ * I.clearCookie('test');
4556
4092
  * ```
4557
4093
  * @param [cookie = null] - (optional, `null` by default) cookie name
4558
4094
  */
@@ -6154,7 +5690,7 @@ declare namespace CodeceptJS {
6154
5690
  *
6155
5691
  * ```js
6156
5692
  * I.clearCookie();
6157
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
5693
+ * I.clearCookie('test');
6158
5694
  * ```
6159
5695
  * @param [cookie = null] - (optional, `null` by default) cookie name
6160
5696
  */
@@ -6576,13 +6112,6 @@ declare namespace CodeceptJS {
6576
6112
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
6577
6113
  */
6578
6114
  // @ts-ignore
6579
- // @ts-ignore
6580
- // @ts-ignore
6581
- // @ts-ignore
6582
- // @ts-ignore
6583
- // @ts-ignore
6584
- // @ts-ignore
6585
- // @ts-ignore
6586
6115
  type PuppeteerConfig = {
6587
6116
  url: string;
6588
6117
  basicAuth?: any;
@@ -7736,7 +7265,7 @@ declare namespace CodeceptJS {
7736
7265
  *
7737
7266
  * ```js
7738
7267
  * I.clearCookie();
7739
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
7268
+ * I.clearCookie('test');
7740
7269
  * ```
7741
7270
  * @param [cookie = null] - (optional, `null` by default) cookie name
7742
7271
  */
@@ -8390,13 +7919,6 @@ declare namespace CodeceptJS {
8390
7919
  * @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
8391
7920
  */
8392
7921
  // @ts-ignore
8393
- // @ts-ignore
8394
- // @ts-ignore
8395
- // @ts-ignore
8396
- // @ts-ignore
8397
- // @ts-ignore
8398
- // @ts-ignore
8399
- // @ts-ignore
8400
7922
  type RESTConfig = {
8401
7923
  endpoint?: string;
8402
7924
  prettyPrintJson?: boolean;
@@ -8577,250 +8099,17 @@ declare namespace CodeceptJS {
8577
8099
  * @returns response
8578
8100
  */
8579
8101
  sendDeleteRequest(url: any, headers?: any): Promise<any>;
8580
- }
8581
- /**
8582
- * SoftAssertHelper is a utility class for performing soft assertions.
8583
- * Unlike traditional assertions that stop the execution on failure,
8584
- * soft assertions allow the execution to continue and report all failures at the end.
8585
- *
8586
- * ### Examples
8587
- *
8588
- * Zero-configuration when paired with other helpers like REST, Playwright:
8589
- *
8590
- * ```js
8591
- * // inside codecept.conf.js
8592
- * {
8593
- * helpers: {
8594
- * Playwright: {...},
8595
- * SoftExpectHelper: {},
8596
- * }
8597
- * }
8598
- * ```
8599
- *
8600
- * ```js
8601
- * // in scenario
8602
- * I.softExpectEqual('a', 'b')
8603
- * I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
8604
- * ```
8605
- *
8606
- * ## Methods
8607
- */
8608
- class SoftAssertHelperTs {
8609
- /**
8610
- * Performs a soft assertion by executing the provided assertion function.
8611
- * If the assertion fails, the error is caught and stored without halting the execution.
8612
- * @param assertionFn - The assertion function to execute.
8613
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8614
- */
8615
- softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): Promise<any>;
8616
- /**
8617
- * Throws an error if any soft assertions have failed.
8618
- * The error message contains all the accumulated failures.
8619
- */
8620
- flushSoftAssertions(): Promise<any>;
8621
- /**
8622
- * Softly asserts that two values are equal.
8623
- * @param actualValue - The actual value.
8624
- * @param expectedValue - The expected value.
8625
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8626
- */
8627
- softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8628
- /**
8629
- * Softly asserts that two values are not equal.
8630
- * @param actualValue - The actual value.
8631
- * @param expectedValue - The expected value.
8632
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8633
- */
8634
- softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8635
- /**
8636
- * Softly asserts that two values are deeply equal.
8637
- * @param actualValue - The actual value.
8638
- * @param expectedValue - The expected value.
8639
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8640
- */
8641
- softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8642
8102
  /**
8643
- * Softly asserts that two values are not deeply equal.
8644
- * @param actualValue - The actual value.
8645
- * @param expectedValue - The expected value.
8646
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8647
- */
8648
- softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8649
- /**
8650
- * Softly asserts that a value contains the expected value.
8651
- * @param actualValue - The actual value.
8652
- * @param expectedValueToContain - The value that should be contained within the actual value.
8653
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8654
- */
8655
- softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): Promise<any>;
8656
- /**
8657
- * Softly asserts that a value does not contain the expected value.
8658
- * @param actualValue - The actual value.
8659
- * @param expectedValueToNotContain - The value that should not be contained within the actual value.
8660
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8661
- */
8662
- softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): Promise<any>;
8663
- /**
8664
- * Softly asserts that a value starts with the expected value.
8665
- * @param actualValue - The actual value.
8666
- * @param expectedValueToStartWith - The value that the actual value should start with.
8667
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8668
- */
8669
- softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): Promise<any>;
8670
- /**
8671
- * Softly asserts that a value does not start with the expected value.
8672
- * @param actualValue - The actual value.
8673
- * @param expectedValueToNotStartWith - The value that the actual value should not start with.
8674
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8675
- */
8676
- softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): Promise<any>;
8677
- /**
8678
- * Softly asserts that a value ends with the expected value.
8679
- * @param actualValue - The actual value.
8680
- * @param expectedValueToEndWith - The value that the actual value should end with.
8681
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8682
- */
8683
- softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): Promise<any>;
8684
- /**
8685
- * Softly asserts that a value does not end with the expected value.
8686
- * @param actualValue - The actual value.
8687
- * @param expectedValueToNotEndWith - The value that the actual value should not end with.
8688
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8689
- */
8690
- softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): Promise<any>;
8691
- /**
8692
- * Softly asserts that the target data matches the given JSON schema.
8693
- * @param targetData - The data to validate.
8694
- * @param jsonSchema - The JSON schema to validate against.
8695
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8696
- */
8697
- softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): Promise<any>;
8698
- /**
8699
- * Softly asserts that the target data matches the given JSON schema using AJV.
8700
- * @param targetData - The data to validate.
8701
- * @param jsonSchema - The JSON schema to validate against.
8702
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8703
- * @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
8704
- */
8705
- softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): Promise<any>;
8706
- /**
8707
- * Softly asserts that the target data has the specified property.
8708
- * @param targetData - The data to check.
8709
- * @param propertyName - The property name to check for.
8710
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion
8711
- * fails.
8712
- */
8713
- softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
8714
- /**
8715
- * Softly asserts that the target data has a property with the specified name.
8716
- * @param targetData - The data to check.
8717
- * @param propertyName - The property name to check for.
8718
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8719
- */
8720
- softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
8721
- /**
8722
- * Softly asserts that the target data is of a specific type.
8723
- * @param targetData - The data to check.
8724
- * @param type - The expected type (e.g., 'string', 'number').
8725
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8726
- */
8727
- softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
8728
- /**
8729
- * Softly asserts that the target data is of a specific type (alternative for articles).
8730
- * @param targetData - The data to check.
8731
- * @param type - The expected type (e.g., 'string', 'number').
8732
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8733
- */
8734
- softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
8735
- /**
8736
- * Softly asserts that the target data has a specified length.
8737
- * @param targetData - The data to check.
8738
- * @param length - The expected length.
8739
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8740
- */
8741
- softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): Promise<any>;
8742
- /**
8743
- * Softly asserts that the target data is empty.
8744
- * @param targetData - The data to check.
8745
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8746
- */
8747
- softExpectEmpty(targetData: any, customErrorMsg?: string): Promise<any>;
8748
- /**
8749
- * Softly asserts that the target data is true.
8750
- * @param targetData - The data to check.
8751
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8752
- */
8753
- softExpectTrue(targetData: any, customErrorMsg?: string): Promise<any>;
8754
- /**
8755
- * Softly asserts that the target data is false.
8756
- * @param targetData - The data to check.
8757
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8758
- */
8759
- softExpectFalse(targetData: any, customErrorMsg?: string): Promise<any>;
8760
- /**
8761
- * Softly asserts that the target data is above a specified value.
8762
- * @param targetData - The data to check.
8763
- * @param aboveThan - The value that the target data should be above.
8764
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8765
- */
8766
- softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): Promise<any>;
8767
- /**
8768
- * Softly asserts that the target data is below a specified value.
8769
- * @param targetData - The data to check.
8770
- * @param belowThan - The value that the target data should be below.
8771
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8772
- */
8773
- softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): Promise<any>;
8774
- /**
8775
- * Softly asserts that the length of the target data is above a specified value.
8776
- * @param targetData - The data to check.
8777
- * @param lengthAboveThan - The length that the target data should be above.
8778
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8779
- */
8780
- softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): Promise<any>;
8781
- /**
8782
- * Softly asserts that the length of the target data is below a specified value.
8783
- * @param targetData - The data to check.
8784
- * @param lengthBelowThan - The length that the target data should be below.
8785
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8786
- */
8787
- softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): Promise<any>;
8788
- /**
8789
- * Softly asserts that two values are equal, ignoring case.
8790
- * @param actualValue - The actual string value.
8791
- * @param expectedValue - The expected string value.
8792
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8793
- */
8794
- softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): Promise<any>;
8795
- /**
8796
- * Softly asserts that two arrays have deep equality, considering members in any order.
8797
- * @param actualValue - The actual array.
8798
- * @param expectedValue - The expected array.
8799
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8800
- */
8801
- softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): Promise<any>;
8802
- /**
8803
- * Softly asserts that an array (superset) deeply includes all members of another array (set).
8804
- * @param superset - The array that should contain the expected members.
8805
- * @param set - The array with members that should be included.
8806
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8807
- */
8808
- softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): Promise<any>;
8809
- /**
8810
- * Softly asserts that two objects are deeply equal, excluding specified fields.
8811
- * @param actualValue - The actual object.
8812
- * @param expectedValue - The expected object.
8813
- * @param fieldsToExclude - The fields to exclude from the comparison.
8814
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8815
- */
8816
- softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): Promise<any>;
8817
- /**
8818
- * Softly asserts that a value matches the expected pattern.
8819
- * @param actualValue - The actual value.
8820
- * @param expectedPattern - The pattern the value should match.
8821
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8103
+ * Sends DELETE request to API with payload.
8104
+ *
8105
+ * ```js
8106
+ * I.sendDeleteRequestWithPayload('/api/users/1', { author: 'john' });
8107
+ * ```
8108
+ * @param [payload = {}] - the payload to be sent. By default it is sent as an empty object
8109
+ * @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
8110
+ * @returns response
8822
8111
  */
8823
- softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): Promise<any>;
8112
+ sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
8824
8113
  }
8825
8114
  /**
8826
8115
  * Client Functions
@@ -9644,7 +8933,7 @@ declare namespace CodeceptJS {
9644
8933
  *
9645
8934
  * ```js
9646
8935
  * I.clearCookie();
9647
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
8936
+ * I.clearCookie('test');
9648
8937
  * ```
9649
8938
  * @param [cookie = null] - (optional, `null` by default) cookie name
9650
8939
  */
@@ -9754,6 +9043,7 @@ declare namespace CodeceptJS {
9754
9043
  * This helper should be configured in codecept.conf.js
9755
9044
  * @property url - base url of website to be tested.
9756
9045
  * @property browser - Browser in which to perform testing.
9046
+ * @property [bidiProtocol = false] - WebDriver Bidi Protocol. Default: false. More info: https://webdriver.io/docs/api/webdriverBidi/
9757
9047
  * @property [basicAuth] - (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
9758
9048
  * @property [host = localhost] - WebDriver host to connect.
9759
9049
  * @property [port = 4444] - WebDriver port to connect.
@@ -9773,19 +9063,12 @@ declare namespace CodeceptJS {
9773
9063
  * @property [timeouts] - [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
9774
9064
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
9775
9065
  * @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
9776
- * @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
9777
9066
  */
9778
9067
  // @ts-ignore
9779
- // @ts-ignore
9780
- // @ts-ignore
9781
- // @ts-ignore
9782
- // @ts-ignore
9783
- // @ts-ignore
9784
- // @ts-ignore
9785
- // @ts-ignore
9786
9068
  type WebDriverConfig = {
9787
9069
  url: string;
9788
9070
  browser: string;
9071
+ bidiProtocol?: boolean;
9789
9072
  basicAuth?: string;
9790
9073
  host?: string;
9791
9074
  port?: number;
@@ -9805,7 +9088,6 @@ declare namespace CodeceptJS {
9805
9088
  timeouts?: any;
9806
9089
  highlightElement?: boolean;
9807
9090
  logLevel?: string;
9808
- devtoolsProtocol?: boolean;
9809
9091
  };
9810
9092
  /**
9811
9093
  * WebDriver helper which wraps [webdriverio](http://webdriver.io/) library to
@@ -9911,7 +9193,6 @@ declare namespace CodeceptJS {
9911
9193
  * WebDriver : {
9912
9194
  * url: "http://localhost",
9913
9195
  * browser: "chrome",
9914
- * devtoolsProtocol: true,
9915
9196
  * desiredCapabilities: {
9916
9197
  * chromeOptions: {
9917
9198
  * args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
@@ -11055,7 +10336,7 @@ declare namespace CodeceptJS {
11055
10336
  *
11056
10337
  * ```js
11057
10338
  * I.clearCookie();
11058
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
10339
+ * I.clearCookie('test');
11059
10340
  * ```
11060
10341
  * @param [cookie = null] - (optional, `null` by default) cookie name
11061
10342
  */
@@ -11601,33 +10882,6 @@ declare namespace CodeceptJS {
11601
10882
  * @returns scroll position
11602
10883
  */
11603
10884
  grabPageScrollPosition(): Promise<PageScrollPosition>;
11604
- /**
11605
- * This method is **deprecated**.
11606
- *
11607
- *
11608
- * Set the current geo location
11609
- *
11610
- *
11611
- * ```js
11612
- * I.setGeoLocation(121.21, 11.56);
11613
- * I.setGeoLocation(121.21, 11.56, 10);
11614
- * ```
11615
- * @param latitude - to set.
11616
- * @param longitude - to set
11617
- * @param [altitude] - (optional, null by default) to set
11618
- */
11619
- setGeoLocation(latitude: number, longitude: number, altitude?: number): Promise<any>;
11620
- /**
11621
- * This method is **deprecated**.
11622
- *
11623
- * Return the current geo location
11624
- * Resumes test execution, so **should be used inside async function with `await`** operator.
11625
- *
11626
- * ```js
11627
- * let geoLocation = await I.grabGeoLocation();
11628
- * ```
11629
- */
11630
- grabGeoLocation(): Promise<{ latitude: number; longitude: number; altitude: number; }>;
11631
10885
  /**
11632
10886
  * Grab the width, height, location of given locator.
11633
10887
  * Provide `width` or `height`as second param to get your desired prop.
@@ -11654,119 +10908,15 @@ declare namespace CodeceptJS {
11654
10908
  /**
11655
10909
  * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
11656
10910
  */
11657
- runOnAndroid(caps: any, fn: any): Promise<any>;
10911
+ runOnIOS(caps: any, fn: any): Promise<any>;
11658
10912
  /**
11659
10913
  * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
11660
10914
  */
11661
- runInWeb(): Promise<any>;
11662
- /**
11663
- * _Note:_ Only works when devtoolsProtocol is enabled.
11664
- *
11665
- * Resets all recorded network requests.
11666
- *
11667
- * ```js
11668
- * I.flushNetworkTraffics();
11669
- * ```
11670
- */
11671
- flushNetworkTraffics(): Promise<any>;
11672
- /**
11673
- * _Note:_ Only works when devtoolsProtocol is enabled.
11674
- *
11675
- * Stops recording of network traffic. Recorded traffic is not flashed.
11676
- *
11677
- * ```js
11678
- * I.stopRecordingTraffic();
11679
- * ```
11680
- */
11681
- stopRecordingTraffic(): Promise<any>;
11682
- /**
11683
- * _Note:_ Only works when devtoolsProtocol is enabled.
11684
- *
11685
- * Starts recording the network traffics.
11686
- * This also resets recorded network requests.
11687
- *
11688
- * ```js
11689
- * I.startRecordingTraffic();
11690
- * ```
11691
- */
11692
- startRecordingTraffic(): Promise<any>;
11693
- /**
11694
- * _Note:_ Only works when devtoolsProtocol is enabled.
11695
- *
11696
- * Grab the recording network traffics
11697
- *
11698
- * ```js
11699
- * const traffics = await I.grabRecordedNetworkTraffics();
11700
- * expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
11701
- * expect(traffics[0].response.status).to.equal(200);
11702
- * expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
11703
- * ```
11704
- */
11705
- grabRecordedNetworkTraffics(): Promise<any>;
11706
- /**
11707
- * _Note:_ Only works when devtoolsProtocol is enabled.
11708
- *
11709
- * Verifies that a certain request is part of network traffic.
11710
- *
11711
- * ```js
11712
- * // checking the request url contains certain query strings
11713
- * I.amOnPage('https://openai.com/blog/chatgpt');
11714
- * I.startRecordingTraffic();
11715
- * await I.seeTraffic({
11716
- * name: 'sentry event',
11717
- * url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
11718
- * parameters: {
11719
- * width: '1919',
11720
- * height: '1138',
11721
- * },
11722
- * });
11723
- * ```
11724
- *
11725
- * ```js
11726
- * // checking the request url contains certain post data
11727
- * I.amOnPage('https://openai.com/blog/chatgpt');
11728
- * I.startRecordingTraffic();
11729
- * await I.seeTraffic({
11730
- * name: 'event',
11731
- * url: 'https://cloudflareinsights.com/cdn-cgi/rum',
11732
- * requestPostData: {
11733
- * st: 2,
11734
- * },
11735
- * });
11736
- * ```
11737
- * @param opts - options when checking the traffic network.
11738
- * @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.
11739
- * @param opts.url - Expected URL of request in network traffic
11740
- * @param [opts.parameters] - Expected parameters of that request in network traffic
11741
- * @param [opts.requestPostData] - Expected that request contains post data in network traffic
11742
- * @param [opts.timeout] - Timeout to wait for request in seconds. Default is 10 seconds.
11743
- */
11744
- seeTraffic(opts: {
11745
- name: string;
11746
- url: string;
11747
- parameters?: any;
11748
- requestPostData?: any;
11749
- timeout?: number;
11750
- }): Promise<any>;
10915
+ runOnAndroid(caps: any, fn: any): Promise<any>;
11751
10916
  /**
11752
- * _Note:_ Only works when devtoolsProtocol is enabled.
11753
- *
11754
- * Verifies that a certain request is not part of network traffic.
11755
- *
11756
- * Examples:
11757
- *
11758
- * ```js
11759
- * I.dontSeeTraffic({ name: 'Unexpected API Call', url: 'https://api.example.com' });
11760
- * I.dontSeeTraffic({ name: 'Unexpected API Call of "user" endpoint', url: /api.example.com.*user/ });
11761
- * ```
11762
- * @param opts - options when checking the traffic network.
11763
- * @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.
11764
- * @param opts.url - Expected URL of request in network traffic. Can be a string or a regular expression.
10917
+ * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
11765
10918
  */
11766
- dontSeeTraffic(opts: {
11767
- name: string;
11768
- url: string | RegExp;
11769
- }): Promise<any>;
10919
+ runInWeb(): Promise<any>;
11770
10920
  }
11771
10921
  }
11772
10922