codeceptjs 3.7.0-beta.4 → 3.7.0-beta.6

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 (47) hide show
  1. package/README.md +9 -10
  2. package/bin/codecept.js +7 -0
  3. package/lib/actor.js +47 -92
  4. package/lib/command/check.js +173 -0
  5. package/lib/command/definitions.js +2 -0
  6. package/lib/command/run-workers.js +1 -1
  7. package/lib/command/workers/runTests.js +112 -109
  8. package/lib/container.js +9 -0
  9. package/lib/effects.js +218 -0
  10. package/lib/heal.js +10 -0
  11. package/lib/helper/Appium.js +27 -16
  12. package/lib/helper/Playwright.js +15 -0
  13. package/lib/helper/Puppeteer.js +5 -0
  14. package/lib/helper/WebDriver.js +9 -1
  15. package/lib/listener/emptyRun.js +2 -5
  16. package/lib/listener/globalTimeout.js +15 -3
  17. package/lib/listener/steps.js +3 -0
  18. package/lib/mocha/cli.js +22 -5
  19. package/lib/mocha/featureConfig.js +13 -0
  20. package/lib/mocha/scenarioConfig.js +11 -0
  21. package/lib/mocha/test.js +15 -0
  22. package/lib/mocha/types.d.ts +6 -0
  23. package/lib/output.js +74 -73
  24. package/lib/pause.js +3 -7
  25. package/lib/plugin/heal.js +30 -0
  26. package/lib/plugin/retryTo.js +18 -126
  27. package/lib/plugin/stepTimeout.js +1 -1
  28. package/lib/plugin/tryTo.js +13 -111
  29. package/lib/recorder.js +1 -1
  30. package/lib/step/base.js +180 -0
  31. package/lib/step/config.js +50 -0
  32. package/lib/step/helper.js +47 -0
  33. package/lib/step/meta.js +91 -0
  34. package/lib/step/record.js +74 -0
  35. package/lib/step/retry.js +11 -0
  36. package/lib/step/timeout.js +42 -0
  37. package/lib/step.js +15 -348
  38. package/lib/steps.js +23 -0
  39. package/lib/store.js +2 -0
  40. package/lib/utils.js +58 -0
  41. package/lib/within.js +2 -2
  42. package/lib/workers.js +2 -12
  43. package/package.json +9 -7
  44. package/typings/index.d.ts +5 -4
  45. package/typings/promiseBasedTypes.d.ts +520 -6
  46. package/typings/types.d.ts +562 -44
  47. package/lib/step/section.js +0 -25
@@ -1179,6 +1179,242 @@ declare namespace CodeceptJS {
1179
1179
  */
1180
1180
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
1181
1181
  }
1182
+ /**
1183
+ * This helper allows performing assertions based on Chai.
1184
+ *
1185
+ * ### Examples
1186
+ *
1187
+ * Zero-configuration when paired with other helpers like REST, Playwright:
1188
+ *
1189
+ * ```js
1190
+ * // inside codecept.conf.js
1191
+ * {
1192
+ * helpers: {
1193
+ * Playwright: {...},
1194
+ * ExpectHelper: {},
1195
+ * }
1196
+ * }
1197
+ * ```
1198
+ *
1199
+ * ## Methods
1200
+ */
1201
+ // @ts-ignore
1202
+ // @ts-ignore
1203
+ // @ts-ignore
1204
+ // @ts-ignore
1205
+ // @ts-ignore
1206
+ // @ts-ignore
1207
+ // @ts-ignore
1208
+ class ExpectHelper {
1209
+ expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1210
+ expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1211
+ expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1212
+ expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1213
+ expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1214
+ expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1215
+ expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1216
+ expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1217
+ expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1218
+ expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1219
+ expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1220
+ /**
1221
+ * @param [ajvOptions] - Pass AJV options
1222
+ */
1223
+ expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1224
+ expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1225
+ expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1226
+ expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1227
+ expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1228
+ expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1229
+ expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1230
+ expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1231
+ expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1232
+ expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1233
+ expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1234
+ expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1235
+ expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1236
+ expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1237
+ expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1238
+ /**
1239
+ * expects members of two arrays are deeply equal
1240
+ */
1241
+ expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1242
+ /**
1243
+ * expects an array to be a superset of another array
1244
+ */
1245
+ expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1246
+ /**
1247
+ * expects members of two JSON objects are deeply equal excluding some properties
1248
+ */
1249
+ expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1250
+ /**
1251
+ * expects a JSON object matches a provided pattern
1252
+ */
1253
+ expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1254
+ expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1255
+ expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1256
+ expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1257
+ expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1258
+ expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1259
+ expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1260
+ expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1261
+ expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1262
+ expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1263
+ expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1264
+ expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1265
+ /**
1266
+ * @param [ajvOptions] - Pass AJV options
1267
+ */
1268
+ expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1269
+ expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1270
+ expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1271
+ expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1272
+ expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1273
+ expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1274
+ expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1275
+ expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1276
+ expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1277
+ expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1278
+ expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1279
+ expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1280
+ expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1281
+ expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1282
+ expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1283
+ /**
1284
+ * expects members of two arrays are deeply equal
1285
+ */
1286
+ expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1287
+ /**
1288
+ * expects an array to be a superset of another array
1289
+ */
1290
+ expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1291
+ /**
1292
+ * expects members of two JSON objects are deeply equal excluding some properties
1293
+ */
1294
+ expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1295
+ /**
1296
+ * expects a JSON object matches a provided pattern
1297
+ */
1298
+ expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1299
+ }
1300
+ /**
1301
+ * This helper allows performing assertions based on Chai.
1302
+ *
1303
+ * ### Examples
1304
+ *
1305
+ * Zero-configuration when paired with other helpers like REST, Playwright:
1306
+ *
1307
+ * ```js
1308
+ * // inside codecept.conf.js
1309
+ * {
1310
+ * helpers: {
1311
+ * Playwright: {...},
1312
+ * ExpectHelper: {},
1313
+ * }
1314
+ * }
1315
+ * ```
1316
+ *
1317
+ * ## Methods
1318
+ */
1319
+ // @ts-ignore
1320
+ // @ts-ignore
1321
+ // @ts-ignore
1322
+ // @ts-ignore
1323
+ // @ts-ignore
1324
+ // @ts-ignore
1325
+ // @ts-ignore
1326
+ class ExpectHelper {
1327
+ expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1328
+ expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1329
+ expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1330
+ expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1331
+ expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1332
+ expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1333
+ expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1334
+ expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1335
+ expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1336
+ expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1337
+ expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1338
+ /**
1339
+ * @param [ajvOptions] - Pass AJV options
1340
+ */
1341
+ expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1342
+ expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1343
+ expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1344
+ expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1345
+ expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1346
+ expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1347
+ expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1348
+ expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1349
+ expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1350
+ expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1351
+ expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1352
+ expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1353
+ expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1354
+ expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1355
+ expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1356
+ /**
1357
+ * expects members of two arrays are deeply equal
1358
+ */
1359
+ expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1360
+ /**
1361
+ * expects an array to be a superset of another array
1362
+ */
1363
+ expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1364
+ /**
1365
+ * expects members of two JSON objects are deeply equal excluding some properties
1366
+ */
1367
+ expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1368
+ /**
1369
+ * expects a JSON object matches a provided pattern
1370
+ */
1371
+ expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1372
+ expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1373
+ expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1374
+ expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1375
+ expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1376
+ expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1377
+ expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1378
+ expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1379
+ expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1380
+ expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1381
+ expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1382
+ expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1383
+ /**
1384
+ * @param [ajvOptions] - Pass AJV options
1385
+ */
1386
+ expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1387
+ expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1388
+ expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1389
+ expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1390
+ expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1391
+ expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1392
+ expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1393
+ expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1394
+ expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1395
+ expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1396
+ expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1397
+ expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1398
+ expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1399
+ expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1400
+ expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1401
+ /**
1402
+ * expects members of two arrays are deeply equal
1403
+ */
1404
+ expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1405
+ /**
1406
+ * expects an array to be a superset of another array
1407
+ */
1408
+ expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1409
+ /**
1410
+ * expects members of two JSON objects are deeply equal excluding some properties
1411
+ */
1412
+ expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1413
+ /**
1414
+ * expects a JSON object matches a provided pattern
1415
+ */
1416
+ expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1417
+ }
1182
1418
  /**
1183
1419
  * Helper for testing filesystem.
1184
1420
  * Can be easily used to check file structures:
@@ -1766,7 +2002,6 @@ declare namespace CodeceptJS {
1766
2002
  // @ts-ignore
1767
2003
  // @ts-ignore
1768
2004
  // @ts-ignore
1769
- // @ts-ignore
1770
2005
  type MockServerConfig = {
1771
2006
  port?: number;
1772
2007
  host?: string;
@@ -1898,7 +2133,6 @@ declare namespace CodeceptJS {
1898
2133
  // @ts-ignore
1899
2134
  // @ts-ignore
1900
2135
  // @ts-ignore
1901
- // @ts-ignore
1902
2136
  class MockServer {
1903
2137
  /**
1904
2138
  * Start the mock server
@@ -2888,6 +3122,46 @@ declare namespace CodeceptJS {
2888
3122
  */
2889
3123
  grabPageScrollPosition(): Promise<PageScrollPosition>;
2890
3124
  }
3125
+ /**
3126
+ * OpenAI Helper for CodeceptJS.
3127
+ *
3128
+ * 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.
3129
+ * This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
3130
+ *
3131
+ * ## Configuration
3132
+ *
3133
+ * This helper should be configured in codecept.json or codecept.conf.js
3134
+ *
3135
+ * * `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.
3136
+ */
3137
+ class OpenAITs {
3138
+ /**
3139
+ * Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
3140
+ *
3141
+ * ```js
3142
+ * I.askGptOnPage('what does this page do?');
3143
+ * ```
3144
+ * @param prompt - The question or prompt to ask the GPT model.
3145
+ * @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
3146
+ */
3147
+ askGptOnPage(prompt: string): Promise<string>;
3148
+ /**
3149
+ * 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.
3150
+ *
3151
+ * ```js
3152
+ * I.askGptOnPageFragment('describe features of this screen', '.screen');
3153
+ * ```
3154
+ * @param prompt - The question or prompt to ask the GPT-3.5 model.
3155
+ * @param locator - The locator or selector used to identify the HTML fragment on the page.
3156
+ * @returns - A Promise that resolves to the generated response from the GPT model.
3157
+ */
3158
+ askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
3159
+ /**
3160
+ * Send a general request to ChatGPT and return response.
3161
+ * @returns - A Promise that resolves to the generated response from the GPT model.
3162
+ */
3163
+ askGptGeneralPrompt(prompt: string): Promise<string>;
3164
+ }
2891
3165
  /**
2892
3166
  * ## Configuration
2893
3167
  *
@@ -2939,7 +3213,6 @@ declare namespace CodeceptJS {
2939
3213
  // @ts-ignore
2940
3214
  // @ts-ignore
2941
3215
  // @ts-ignore
2942
- // @ts-ignore
2943
3216
  type PlaywrightConfig = {
2944
3217
  url?: string;
2945
3218
  browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
@@ -6323,7 +6596,6 @@ declare namespace CodeceptJS {
6323
6596
  // @ts-ignore
6324
6597
  // @ts-ignore
6325
6598
  // @ts-ignore
6326
- // @ts-ignore
6327
6599
  type PuppeteerConfig = {
6328
6600
  url: string;
6329
6601
  basicAuth?: any;
@@ -8137,7 +8409,6 @@ declare namespace CodeceptJS {
8137
8409
  // @ts-ignore
8138
8410
  // @ts-ignore
8139
8411
  // @ts-ignore
8140
- // @ts-ignore
8141
8412
  type RESTConfig = {
8142
8413
  endpoint?: string;
8143
8414
  prettyPrintJson?: boolean;
@@ -8330,6 +8601,250 @@ declare namespace CodeceptJS {
8330
8601
  */
8331
8602
  sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
8332
8603
  }
8604
+ /**
8605
+ * SoftAssertHelper is a utility class for performing soft assertions.
8606
+ * Unlike traditional assertions that stop the execution on failure,
8607
+ * soft assertions allow the execution to continue and report all failures at the end.
8608
+ *
8609
+ * ### Examples
8610
+ *
8611
+ * Zero-configuration when paired with other helpers like REST, Playwright:
8612
+ *
8613
+ * ```js
8614
+ * // inside codecept.conf.js
8615
+ * {
8616
+ * helpers: {
8617
+ * Playwright: {...},
8618
+ * SoftExpectHelper: {},
8619
+ * }
8620
+ * }
8621
+ * ```
8622
+ *
8623
+ * ```js
8624
+ * // in scenario
8625
+ * I.softExpectEqual('a', 'b')
8626
+ * I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
8627
+ * ```
8628
+ *
8629
+ * ## Methods
8630
+ */
8631
+ class SoftAssertHelperTs {
8632
+ /**
8633
+ * Performs a soft assertion by executing the provided assertion function.
8634
+ * If the assertion fails, the error is caught and stored without halting the execution.
8635
+ * @param assertionFn - The assertion function to execute.
8636
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8637
+ */
8638
+ softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): Promise<any>;
8639
+ /**
8640
+ * Throws an error if any soft assertions have failed.
8641
+ * The error message contains all the accumulated failures.
8642
+ */
8643
+ flushSoftAssertions(): Promise<any>;
8644
+ /**
8645
+ * Softly asserts that two values are equal.
8646
+ * @param actualValue - The actual value.
8647
+ * @param expectedValue - The expected value.
8648
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8649
+ */
8650
+ softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8651
+ /**
8652
+ * Softly asserts that two values are not equal.
8653
+ * @param actualValue - The actual value.
8654
+ * @param expectedValue - The expected value.
8655
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8656
+ */
8657
+ softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8658
+ /**
8659
+ * Softly asserts that two values are deeply equal.
8660
+ * @param actualValue - The actual value.
8661
+ * @param expectedValue - The expected value.
8662
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8663
+ */
8664
+ softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8665
+ /**
8666
+ * Softly asserts that two values are not deeply equal.
8667
+ * @param actualValue - The actual value.
8668
+ * @param expectedValue - The expected value.
8669
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8670
+ */
8671
+ softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8672
+ /**
8673
+ * Softly asserts that a value contains the expected value.
8674
+ * @param actualValue - The actual value.
8675
+ * @param expectedValueToContain - The value that should be contained within the actual value.
8676
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8677
+ */
8678
+ softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): Promise<any>;
8679
+ /**
8680
+ * Softly asserts that a value does not contain the expected value.
8681
+ * @param actualValue - The actual value.
8682
+ * @param expectedValueToNotContain - The value that should not be contained within the actual value.
8683
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8684
+ */
8685
+ softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): Promise<any>;
8686
+ /**
8687
+ * Softly asserts that a value starts with the expected value.
8688
+ * @param actualValue - The actual value.
8689
+ * @param expectedValueToStartWith - The value that the actual value should start with.
8690
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8691
+ */
8692
+ softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): Promise<any>;
8693
+ /**
8694
+ * Softly asserts that a value does not start with the expected value.
8695
+ * @param actualValue - The actual value.
8696
+ * @param expectedValueToNotStartWith - The value that the actual value should not start with.
8697
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8698
+ */
8699
+ softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): Promise<any>;
8700
+ /**
8701
+ * Softly asserts that a value ends with the expected value.
8702
+ * @param actualValue - The actual value.
8703
+ * @param expectedValueToEndWith - The value that the actual value should end with.
8704
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8705
+ */
8706
+ softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): Promise<any>;
8707
+ /**
8708
+ * Softly asserts that a value does not end with the expected value.
8709
+ * @param actualValue - The actual value.
8710
+ * @param expectedValueToNotEndWith - The value that the actual value should not end with.
8711
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8712
+ */
8713
+ softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): Promise<any>;
8714
+ /**
8715
+ * Softly asserts that the target data matches the given JSON schema.
8716
+ * @param targetData - The data to validate.
8717
+ * @param jsonSchema - The JSON schema to validate against.
8718
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8719
+ */
8720
+ softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): Promise<any>;
8721
+ /**
8722
+ * Softly asserts that the target data matches the given JSON schema using AJV.
8723
+ * @param targetData - The data to validate.
8724
+ * @param jsonSchema - The JSON schema to validate against.
8725
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8726
+ * @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
8727
+ */
8728
+ softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): Promise<any>;
8729
+ /**
8730
+ * Softly asserts that the target data has the specified property.
8731
+ * @param targetData - The data to check.
8732
+ * @param propertyName - The property name to check for.
8733
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion
8734
+ * fails.
8735
+ */
8736
+ softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
8737
+ /**
8738
+ * Softly asserts that the target data has a property with the specified name.
8739
+ * @param targetData - The data to check.
8740
+ * @param propertyName - The property name to check for.
8741
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8742
+ */
8743
+ softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
8744
+ /**
8745
+ * Softly asserts that the target data is of a specific type.
8746
+ * @param targetData - The data to check.
8747
+ * @param type - The expected type (e.g., 'string', 'number').
8748
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8749
+ */
8750
+ softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
8751
+ /**
8752
+ * Softly asserts that the target data is of a specific type (alternative for articles).
8753
+ * @param targetData - The data to check.
8754
+ * @param type - The expected type (e.g., 'string', 'number').
8755
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8756
+ */
8757
+ softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
8758
+ /**
8759
+ * Softly asserts that the target data has a specified length.
8760
+ * @param targetData - The data to check.
8761
+ * @param length - The expected length.
8762
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8763
+ */
8764
+ softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): Promise<any>;
8765
+ /**
8766
+ * Softly asserts that the target data is empty.
8767
+ * @param targetData - The data to check.
8768
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8769
+ */
8770
+ softExpectEmpty(targetData: any, customErrorMsg?: string): Promise<any>;
8771
+ /**
8772
+ * Softly asserts that the target data is true.
8773
+ * @param targetData - The data to check.
8774
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8775
+ */
8776
+ softExpectTrue(targetData: any, customErrorMsg?: string): Promise<any>;
8777
+ /**
8778
+ * Softly asserts that the target data is false.
8779
+ * @param targetData - The data to check.
8780
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8781
+ */
8782
+ softExpectFalse(targetData: any, customErrorMsg?: string): Promise<any>;
8783
+ /**
8784
+ * Softly asserts that the target data is above a specified value.
8785
+ * @param targetData - The data to check.
8786
+ * @param aboveThan - The value that the target data should be above.
8787
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8788
+ */
8789
+ softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): Promise<any>;
8790
+ /**
8791
+ * Softly asserts that the target data is below a specified value.
8792
+ * @param targetData - The data to check.
8793
+ * @param belowThan - The value that the target data should be below.
8794
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8795
+ */
8796
+ softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): Promise<any>;
8797
+ /**
8798
+ * Softly asserts that the length of the target data is above a specified value.
8799
+ * @param targetData - The data to check.
8800
+ * @param lengthAboveThan - The length that the target data should be above.
8801
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8802
+ */
8803
+ softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): Promise<any>;
8804
+ /**
8805
+ * Softly asserts that the length of the target data is below a specified value.
8806
+ * @param targetData - The data to check.
8807
+ * @param lengthBelowThan - The length that the target data should be below.
8808
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8809
+ */
8810
+ softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): Promise<any>;
8811
+ /**
8812
+ * Softly asserts that two values are equal, ignoring case.
8813
+ * @param actualValue - The actual string value.
8814
+ * @param expectedValue - The expected string value.
8815
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8816
+ */
8817
+ softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): Promise<any>;
8818
+ /**
8819
+ * Softly asserts that two arrays have deep equality, considering members in any order.
8820
+ * @param actualValue - The actual array.
8821
+ * @param expectedValue - The expected array.
8822
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8823
+ */
8824
+ softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): Promise<any>;
8825
+ /**
8826
+ * Softly asserts that an array (superset) deeply includes all members of another array (set).
8827
+ * @param superset - The array that should contain the expected members.
8828
+ * @param set - The array with members that should be included.
8829
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8830
+ */
8831
+ softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): Promise<any>;
8832
+ /**
8833
+ * Softly asserts that two objects are deeply equal, excluding specified fields.
8834
+ * @param actualValue - The actual object.
8835
+ * @param expectedValue - The expected object.
8836
+ * @param fieldsToExclude - The fields to exclude from the comparison.
8837
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8838
+ */
8839
+ softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): Promise<any>;
8840
+ /**
8841
+ * Softly asserts that a value matches the expected pattern.
8842
+ * @param actualValue - The actual value.
8843
+ * @param expectedPattern - The pattern the value should match.
8844
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8845
+ */
8846
+ softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): Promise<any>;
8847
+ }
8333
8848
  /**
8334
8849
  * Client Functions
8335
8850
  */
@@ -9289,7 +9804,6 @@ declare namespace CodeceptJS {
9289
9804
  // @ts-ignore
9290
9805
  // @ts-ignore
9291
9806
  // @ts-ignore
9292
- // @ts-ignore
9293
9807
  type WebDriverConfig = {
9294
9808
  url: string;
9295
9809
  browser: string;