codeceptjs 3.7.0-beta.6 → 3.7.0-beta.8

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 (49) hide show
  1. package/README.md +7 -7
  2. package/lib/actor.js +1 -2
  3. package/lib/ai.js +130 -121
  4. package/lib/codecept.js +4 -4
  5. package/lib/command/check.js +4 -0
  6. package/lib/command/run-workers.js +1 -53
  7. package/lib/command/workers/runTests.js +25 -189
  8. package/lib/container.js +16 -0
  9. package/lib/event.js +18 -17
  10. package/lib/helper/Appium.js +4 -6
  11. package/lib/helper/WebDriver.js +20 -7
  12. package/lib/listener/exit.js +5 -8
  13. package/lib/listener/globalTimeout.js +26 -9
  14. package/lib/listener/result.js +12 -0
  15. package/lib/listener/steps.js +0 -6
  16. package/lib/mocha/asyncWrapper.js +12 -2
  17. package/lib/mocha/cli.js +50 -24
  18. package/lib/mocha/hooks.js +32 -3
  19. package/lib/mocha/suite.js +27 -1
  20. package/lib/mocha/test.js +91 -7
  21. package/lib/mocha/types.d.ts +5 -0
  22. package/lib/output.js +1 -0
  23. package/lib/pause.js +0 -3
  24. package/lib/plugin/analyze.js +351 -0
  25. package/lib/plugin/commentStep.js +5 -0
  26. package/lib/plugin/customReporter.js +52 -0
  27. package/lib/plugin/heal.js +2 -2
  28. package/lib/plugin/pageInfo.js +143 -0
  29. package/lib/plugin/retryTo.js +10 -2
  30. package/lib/plugin/screenshotOnFail.js +4 -6
  31. package/lib/plugin/stepTimeout.js +1 -1
  32. package/lib/plugin/tryTo.js +9 -1
  33. package/lib/recorder.js +4 -4
  34. package/lib/rerun.js +43 -42
  35. package/lib/result.js +161 -0
  36. package/lib/step/base.js +52 -4
  37. package/lib/step/helper.js +3 -0
  38. package/lib/step/meta.js +9 -1
  39. package/lib/step/record.js +5 -5
  40. package/lib/step/section.js +55 -0
  41. package/lib/steps.js +28 -1
  42. package/lib/{step/timeout.js → timeout.js} +24 -0
  43. package/lib/utils.js +35 -0
  44. package/lib/workers.js +28 -38
  45. package/package.json +12 -12
  46. package/typings/promiseBasedTypes.d.ts +6 -520
  47. package/typings/types.d.ts +115 -562
  48. package/lib/listener/artifacts.js +0 -19
  49. package/lib/plugin/debugErrors.js +0 -67
@@ -1179,242 +1179,6 @@ 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
- }
1418
1182
  /**
1419
1183
  * Helper for testing filesystem.
1420
1184
  * Can be easily used to check file structures:
@@ -2002,6 +1766,7 @@ declare namespace CodeceptJS {
2002
1766
  // @ts-ignore
2003
1767
  // @ts-ignore
2004
1768
  // @ts-ignore
1769
+ // @ts-ignore
2005
1770
  type MockServerConfig = {
2006
1771
  port?: number;
2007
1772
  host?: string;
@@ -2133,6 +1898,7 @@ declare namespace CodeceptJS {
2133
1898
  // @ts-ignore
2134
1899
  // @ts-ignore
2135
1900
  // @ts-ignore
1901
+ // @ts-ignore
2136
1902
  class MockServer {
2137
1903
  /**
2138
1904
  * Start the mock server
@@ -3122,46 +2888,6 @@ declare namespace CodeceptJS {
3122
2888
  */
3123
2889
  grabPageScrollPosition(): Promise<PageScrollPosition>;
3124
2890
  }
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
- }
3165
2891
  /**
3166
2892
  * ## Configuration
3167
2893
  *
@@ -3213,6 +2939,7 @@ declare namespace CodeceptJS {
3213
2939
  // @ts-ignore
3214
2940
  // @ts-ignore
3215
2941
  // @ts-ignore
2942
+ // @ts-ignore
3216
2943
  type PlaywrightConfig = {
3217
2944
  url?: string;
3218
2945
  browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
@@ -6596,6 +6323,7 @@ declare namespace CodeceptJS {
6596
6323
  // @ts-ignore
6597
6324
  // @ts-ignore
6598
6325
  // @ts-ignore
6326
+ // @ts-ignore
6599
6327
  type PuppeteerConfig = {
6600
6328
  url: string;
6601
6329
  basicAuth?: any;
@@ -8409,6 +8137,7 @@ declare namespace CodeceptJS {
8409
8137
  // @ts-ignore
8410
8138
  // @ts-ignore
8411
8139
  // @ts-ignore
8140
+ // @ts-ignore
8412
8141
  type RESTConfig = {
8413
8142
  endpoint?: string;
8414
8143
  prettyPrintJson?: boolean;
@@ -8601,250 +8330,6 @@ declare namespace CodeceptJS {
8601
8330
  */
8602
8331
  sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
8603
8332
  }
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
- }
8848
8333
  /**
8849
8334
  * Client Functions
8850
8335
  */
@@ -9804,6 +9289,7 @@ declare namespace CodeceptJS {
9804
9289
  // @ts-ignore
9805
9290
  // @ts-ignore
9806
9291
  // @ts-ignore
9292
+ // @ts-ignore
9807
9293
  type WebDriverConfig = {
9808
9294
  url: string;
9809
9295
  browser: string;