codeceptjs 3.7.0-beta.8 → 3.7.0-beta.9

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.
@@ -1203,6 +1203,266 @@ declare namespace CodeceptJS {
1203
1203
  */
1204
1204
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
1205
1205
  }
1206
+ /**
1207
+ * This helper allows performing assertions based on Chai.
1208
+ *
1209
+ * ### Examples
1210
+ *
1211
+ * Zero-configuration when paired with other helpers like REST, Playwright:
1212
+ *
1213
+ * ```js
1214
+ * // inside codecept.conf.js
1215
+ * {
1216
+ * helpers: {
1217
+ * Playwright: {...},
1218
+ * ExpectHelper: {},
1219
+ * }
1220
+ * }
1221
+ * ```
1222
+ *
1223
+ * ## Methods
1224
+ */
1225
+ // @ts-ignore
1226
+ // @ts-ignore
1227
+ // @ts-ignore
1228
+ // @ts-ignore
1229
+ // @ts-ignore
1230
+ // @ts-ignore
1231
+ // @ts-ignore
1232
+ // @ts-ignore
1233
+ // @ts-ignore
1234
+ // @ts-ignore
1235
+ // @ts-ignore
1236
+ // @ts-ignore
1237
+ // @ts-ignore
1238
+ // @ts-ignore
1239
+ // @ts-ignore
1240
+ // @ts-ignore
1241
+ // @ts-ignore
1242
+ // @ts-ignore
1243
+ // @ts-ignore
1244
+ class ExpectHelper {
1245
+ expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1246
+ expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1247
+ expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1248
+ expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1249
+ expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
1250
+ expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
1251
+ expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
1252
+ expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
1253
+ expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
1254
+ expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
1255
+ expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
1256
+ /**
1257
+ * @param [ajvOptions] - Pass AJV options
1258
+ */
1259
+ expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
1260
+ expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
1261
+ expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
1262
+ expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
1263
+ expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
1264
+ expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
1265
+ expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
1266
+ expectEmpty(targetData: any, customErrorMsg?: any): void;
1267
+ expectTrue(targetData: any, customErrorMsg?: any): void;
1268
+ expectFalse(targetData: any, customErrorMsg?: any): void;
1269
+ expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
1270
+ expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
1271
+ expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
1272
+ expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
1273
+ expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1274
+ /**
1275
+ * expects members of two arrays are deeply equal
1276
+ */
1277
+ expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1278
+ /**
1279
+ * expects an array to be a superset of another array
1280
+ */
1281
+ expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
1282
+ /**
1283
+ * expects members of two JSON objects are deeply equal excluding some properties
1284
+ */
1285
+ expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
1286
+ /**
1287
+ * expects a JSON object matches a provided pattern
1288
+ */
1289
+ expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
1290
+ expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1291
+ expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1292
+ expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1293
+ expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1294
+ expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
1295
+ expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
1296
+ expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
1297
+ expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
1298
+ expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
1299
+ expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
1300
+ expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
1301
+ /**
1302
+ * @param [ajvOptions] - Pass AJV options
1303
+ */
1304
+ expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
1305
+ expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
1306
+ expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
1307
+ expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
1308
+ expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
1309
+ expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
1310
+ expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
1311
+ expectEmpty(targetData: any, customErrorMsg?: any): void;
1312
+ expectTrue(targetData: any, customErrorMsg?: any): void;
1313
+ expectFalse(targetData: any, customErrorMsg?: any): void;
1314
+ expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
1315
+ expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
1316
+ expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
1317
+ expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
1318
+ expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1319
+ /**
1320
+ * expects members of two arrays are deeply equal
1321
+ */
1322
+ expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1323
+ /**
1324
+ * expects an array to be a superset of another array
1325
+ */
1326
+ expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
1327
+ /**
1328
+ * expects members of two JSON objects are deeply equal excluding some properties
1329
+ */
1330
+ expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
1331
+ /**
1332
+ * expects a JSON object matches a provided pattern
1333
+ */
1334
+ expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
1335
+ }
1336
+ /**
1337
+ * This helper allows performing assertions based on Chai.
1338
+ *
1339
+ * ### Examples
1340
+ *
1341
+ * Zero-configuration when paired with other helpers like REST, Playwright:
1342
+ *
1343
+ * ```js
1344
+ * // inside codecept.conf.js
1345
+ * {
1346
+ * helpers: {
1347
+ * Playwright: {...},
1348
+ * ExpectHelper: {},
1349
+ * }
1350
+ * }
1351
+ * ```
1352
+ *
1353
+ * ## Methods
1354
+ */
1355
+ // @ts-ignore
1356
+ // @ts-ignore
1357
+ // @ts-ignore
1358
+ // @ts-ignore
1359
+ // @ts-ignore
1360
+ // @ts-ignore
1361
+ // @ts-ignore
1362
+ // @ts-ignore
1363
+ // @ts-ignore
1364
+ // @ts-ignore
1365
+ // @ts-ignore
1366
+ // @ts-ignore
1367
+ // @ts-ignore
1368
+ // @ts-ignore
1369
+ // @ts-ignore
1370
+ // @ts-ignore
1371
+ // @ts-ignore
1372
+ // @ts-ignore
1373
+ // @ts-ignore
1374
+ class ExpectHelper {
1375
+ expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1376
+ expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1377
+ expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1378
+ expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1379
+ expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
1380
+ expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
1381
+ expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
1382
+ expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
1383
+ expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
1384
+ expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
1385
+ expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
1386
+ /**
1387
+ * @param [ajvOptions] - Pass AJV options
1388
+ */
1389
+ expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
1390
+ expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
1391
+ expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
1392
+ expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
1393
+ expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
1394
+ expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
1395
+ expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
1396
+ expectEmpty(targetData: any, customErrorMsg?: any): void;
1397
+ expectTrue(targetData: any, customErrorMsg?: any): void;
1398
+ expectFalse(targetData: any, customErrorMsg?: any): void;
1399
+ expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
1400
+ expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
1401
+ expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
1402
+ expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
1403
+ expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1404
+ /**
1405
+ * expects members of two arrays are deeply equal
1406
+ */
1407
+ expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1408
+ /**
1409
+ * expects an array to be a superset of another array
1410
+ */
1411
+ expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
1412
+ /**
1413
+ * expects members of two JSON objects are deeply equal excluding some properties
1414
+ */
1415
+ expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
1416
+ /**
1417
+ * expects a JSON object matches a provided pattern
1418
+ */
1419
+ expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
1420
+ expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1421
+ expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1422
+ expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1423
+ expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1424
+ expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
1425
+ expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
1426
+ expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
1427
+ expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
1428
+ expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
1429
+ expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
1430
+ expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
1431
+ /**
1432
+ * @param [ajvOptions] - Pass AJV options
1433
+ */
1434
+ expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
1435
+ expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
1436
+ expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
1437
+ expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
1438
+ expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
1439
+ expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
1440
+ expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
1441
+ expectEmpty(targetData: any, customErrorMsg?: any): void;
1442
+ expectTrue(targetData: any, customErrorMsg?: any): void;
1443
+ expectFalse(targetData: any, customErrorMsg?: any): void;
1444
+ expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
1445
+ expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
1446
+ expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
1447
+ expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
1448
+ expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1449
+ /**
1450
+ * expects members of two arrays are deeply equal
1451
+ */
1452
+ expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
1453
+ /**
1454
+ * expects an array to be a superset of another array
1455
+ */
1456
+ expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
1457
+ /**
1458
+ * expects members of two JSON objects are deeply equal excluding some properties
1459
+ */
1460
+ expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
1461
+ /**
1462
+ * expects a JSON object matches a provided pattern
1463
+ */
1464
+ expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
1465
+ }
1206
1466
  /**
1207
1467
  * Helper for testing filesystem.
1208
1468
  * Can be easily used to check file structures:
@@ -1794,6 +2054,17 @@ declare namespace CodeceptJS {
1794
2054
  // @ts-ignore
1795
2055
  // @ts-ignore
1796
2056
  // @ts-ignore
2057
+ // @ts-ignore
2058
+ // @ts-ignore
2059
+ // @ts-ignore
2060
+ // @ts-ignore
2061
+ // @ts-ignore
2062
+ // @ts-ignore
2063
+ // @ts-ignore
2064
+ // @ts-ignore
2065
+ // @ts-ignore
2066
+ // @ts-ignore
2067
+ // @ts-ignore
1797
2068
  type MockServerConfig = {
1798
2069
  port?: number;
1799
2070
  host?: string;
@@ -1926,6 +2197,17 @@ declare namespace CodeceptJS {
1926
2197
  // @ts-ignore
1927
2198
  // @ts-ignore
1928
2199
  // @ts-ignore
2200
+ // @ts-ignore
2201
+ // @ts-ignore
2202
+ // @ts-ignore
2203
+ // @ts-ignore
2204
+ // @ts-ignore
2205
+ // @ts-ignore
2206
+ // @ts-ignore
2207
+ // @ts-ignore
2208
+ // @ts-ignore
2209
+ // @ts-ignore
2210
+ // @ts-ignore
1929
2211
  class MockServer {
1930
2212
  /**
1931
2213
  * Start the mock server
@@ -2981,6 +3263,46 @@ declare namespace CodeceptJS {
2981
3263
  */
2982
3264
  grabPageScrollPosition(): Promise<PageScrollPosition>;
2983
3265
  }
3266
+ /**
3267
+ * OpenAI Helper for CodeceptJS.
3268
+ *
3269
+ * 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.
3270
+ * This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
3271
+ *
3272
+ * ## Configuration
3273
+ *
3274
+ * This helper should be configured in codecept.json or codecept.conf.js
3275
+ *
3276
+ * * `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.
3277
+ */
3278
+ class OpenAI {
3279
+ /**
3280
+ * Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
3281
+ *
3282
+ * ```js
3283
+ * I.askGptOnPage('what does this page do?');
3284
+ * ```
3285
+ * @param prompt - The question or prompt to ask the GPT model.
3286
+ * @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
3287
+ */
3288
+ askGptOnPage(prompt: string): Promise<string>;
3289
+ /**
3290
+ * 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.
3291
+ *
3292
+ * ```js
3293
+ * I.askGptOnPageFragment('describe features of this screen', '.screen');
3294
+ * ```
3295
+ * @param prompt - The question or prompt to ask the GPT-3.5 model.
3296
+ * @param locator - The locator or selector used to identify the HTML fragment on the page.
3297
+ * @returns - A Promise that resolves to the generated response from the GPT model.
3298
+ */
3299
+ askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
3300
+ /**
3301
+ * Send a general request to ChatGPT and return response.
3302
+ * @returns - A Promise that resolves to the generated response from the GPT model.
3303
+ */
3304
+ askGptGeneralPrompt(prompt: string): Promise<string>;
3305
+ }
2984
3306
  /**
2985
3307
  * ## Configuration
2986
3308
  *
@@ -3033,6 +3355,17 @@ declare namespace CodeceptJS {
3033
3355
  // @ts-ignore
3034
3356
  // @ts-ignore
3035
3357
  // @ts-ignore
3358
+ // @ts-ignore
3359
+ // @ts-ignore
3360
+ // @ts-ignore
3361
+ // @ts-ignore
3362
+ // @ts-ignore
3363
+ // @ts-ignore
3364
+ // @ts-ignore
3365
+ // @ts-ignore
3366
+ // @ts-ignore
3367
+ // @ts-ignore
3368
+ // @ts-ignore
3036
3369
  type PlaywrightConfig = {
3037
3370
  url?: string;
3038
3371
  browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
@@ -6568,6 +6901,17 @@ declare namespace CodeceptJS {
6568
6901
  // @ts-ignore
6569
6902
  // @ts-ignore
6570
6903
  // @ts-ignore
6904
+ // @ts-ignore
6905
+ // @ts-ignore
6906
+ // @ts-ignore
6907
+ // @ts-ignore
6908
+ // @ts-ignore
6909
+ // @ts-ignore
6910
+ // @ts-ignore
6911
+ // @ts-ignore
6912
+ // @ts-ignore
6913
+ // @ts-ignore
6914
+ // @ts-ignore
6571
6915
  type PuppeteerConfig = {
6572
6916
  url: string;
6573
6917
  basicAuth?: any;
@@ -8518,6 +8862,17 @@ declare namespace CodeceptJS {
8518
8862
  // @ts-ignore
8519
8863
  // @ts-ignore
8520
8864
  // @ts-ignore
8865
+ // @ts-ignore
8866
+ // @ts-ignore
8867
+ // @ts-ignore
8868
+ // @ts-ignore
8869
+ // @ts-ignore
8870
+ // @ts-ignore
8871
+ // @ts-ignore
8872
+ // @ts-ignore
8873
+ // @ts-ignore
8874
+ // @ts-ignore
8875
+ // @ts-ignore
8521
8876
  type RESTConfig = {
8522
8877
  endpoint?: string;
8523
8878
  prettyPrintJson?: boolean;
@@ -8710,6 +9065,250 @@ declare namespace CodeceptJS {
8710
9065
  */
8711
9066
  sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
8712
9067
  }
9068
+ /**
9069
+ * SoftAssertHelper is a utility class for performing soft assertions.
9070
+ * Unlike traditional assertions that stop the execution on failure,
9071
+ * soft assertions allow the execution to continue and report all failures at the end.
9072
+ *
9073
+ * ### Examples
9074
+ *
9075
+ * Zero-configuration when paired with other helpers like REST, Playwright:
9076
+ *
9077
+ * ```js
9078
+ * // inside codecept.conf.js
9079
+ * {
9080
+ * helpers: {
9081
+ * Playwright: {...},
9082
+ * SoftExpectHelper: {},
9083
+ * }
9084
+ * }
9085
+ * ```
9086
+ *
9087
+ * ```js
9088
+ * // in scenario
9089
+ * I.softExpectEqual('a', 'b')
9090
+ * I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
9091
+ * ```
9092
+ *
9093
+ * ## Methods
9094
+ */
9095
+ class SoftAssertHelper {
9096
+ /**
9097
+ * Performs a soft assertion by executing the provided assertion function.
9098
+ * If the assertion fails, the error is caught and stored without halting the execution.
9099
+ * @param assertionFn - The assertion function to execute.
9100
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9101
+ */
9102
+ softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): void;
9103
+ /**
9104
+ * Throws an error if any soft assertions have failed.
9105
+ * The error message contains all the accumulated failures.
9106
+ */
9107
+ flushSoftAssertions(): void;
9108
+ /**
9109
+ * Softly asserts that two values are equal.
9110
+ * @param actualValue - The actual value.
9111
+ * @param expectedValue - The expected value.
9112
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9113
+ */
9114
+ softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
9115
+ /**
9116
+ * Softly asserts that two values are not equal.
9117
+ * @param actualValue - The actual value.
9118
+ * @param expectedValue - The expected value.
9119
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9120
+ */
9121
+ softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
9122
+ /**
9123
+ * Softly asserts that two values are deeply equal.
9124
+ * @param actualValue - The actual value.
9125
+ * @param expectedValue - The expected value.
9126
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9127
+ */
9128
+ softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
9129
+ /**
9130
+ * Softly asserts that two values are not deeply equal.
9131
+ * @param actualValue - The actual value.
9132
+ * @param expectedValue - The expected value.
9133
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9134
+ */
9135
+ softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
9136
+ /**
9137
+ * Softly asserts that a value contains the expected value.
9138
+ * @param actualValue - The actual value.
9139
+ * @param expectedValueToContain - The value that should be contained within the actual value.
9140
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9141
+ */
9142
+ softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): void;
9143
+ /**
9144
+ * Softly asserts that a value does not contain the expected value.
9145
+ * @param actualValue - The actual value.
9146
+ * @param expectedValueToNotContain - The value that should not be contained within the actual value.
9147
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9148
+ */
9149
+ softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): void;
9150
+ /**
9151
+ * Softly asserts that a value starts with the expected value.
9152
+ * @param actualValue - The actual value.
9153
+ * @param expectedValueToStartWith - The value that the actual value should start with.
9154
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9155
+ */
9156
+ softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): void;
9157
+ /**
9158
+ * Softly asserts that a value does not start with the expected value.
9159
+ * @param actualValue - The actual value.
9160
+ * @param expectedValueToNotStartWith - The value that the actual value should not start with.
9161
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9162
+ */
9163
+ softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): void;
9164
+ /**
9165
+ * Softly asserts that a value ends with the expected value.
9166
+ * @param actualValue - The actual value.
9167
+ * @param expectedValueToEndWith - The value that the actual value should end with.
9168
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9169
+ */
9170
+ softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): void;
9171
+ /**
9172
+ * Softly asserts that a value does not end with the expected value.
9173
+ * @param actualValue - The actual value.
9174
+ * @param expectedValueToNotEndWith - The value that the actual value should not end with.
9175
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9176
+ */
9177
+ softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): void;
9178
+ /**
9179
+ * Softly asserts that the target data matches the given JSON schema.
9180
+ * @param targetData - The data to validate.
9181
+ * @param jsonSchema - The JSON schema to validate against.
9182
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9183
+ */
9184
+ softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): void;
9185
+ /**
9186
+ * Softly asserts that the target data matches the given JSON schema using AJV.
9187
+ * @param targetData - The data to validate.
9188
+ * @param jsonSchema - The JSON schema to validate against.
9189
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9190
+ * @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
9191
+ */
9192
+ softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): void;
9193
+ /**
9194
+ * Softly asserts that the target data has the specified property.
9195
+ * @param targetData - The data to check.
9196
+ * @param propertyName - The property name to check for.
9197
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion
9198
+ * fails.
9199
+ */
9200
+ softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): void;
9201
+ /**
9202
+ * Softly asserts that the target data has a property with the specified name.
9203
+ * @param targetData - The data to check.
9204
+ * @param propertyName - The property name to check for.
9205
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9206
+ */
9207
+ softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): void;
9208
+ /**
9209
+ * Softly asserts that the target data is of a specific type.
9210
+ * @param targetData - The data to check.
9211
+ * @param type - The expected type (e.g., 'string', 'number').
9212
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9213
+ */
9214
+ softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): void;
9215
+ /**
9216
+ * Softly asserts that the target data is of a specific type (alternative for articles).
9217
+ * @param targetData - The data to check.
9218
+ * @param type - The expected type (e.g., 'string', 'number').
9219
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9220
+ */
9221
+ softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): void;
9222
+ /**
9223
+ * Softly asserts that the target data has a specified length.
9224
+ * @param targetData - The data to check.
9225
+ * @param length - The expected length.
9226
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9227
+ */
9228
+ softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): void;
9229
+ /**
9230
+ * Softly asserts that the target data is empty.
9231
+ * @param targetData - The data to check.
9232
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9233
+ */
9234
+ softExpectEmpty(targetData: any, customErrorMsg?: string): void;
9235
+ /**
9236
+ * Softly asserts that the target data is true.
9237
+ * @param targetData - The data to check.
9238
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9239
+ */
9240
+ softExpectTrue(targetData: any, customErrorMsg?: string): void;
9241
+ /**
9242
+ * Softly asserts that the target data is false.
9243
+ * @param targetData - The data to check.
9244
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9245
+ */
9246
+ softExpectFalse(targetData: any, customErrorMsg?: string): void;
9247
+ /**
9248
+ * Softly asserts that the target data is above a specified value.
9249
+ * @param targetData - The data to check.
9250
+ * @param aboveThan - The value that the target data should be above.
9251
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9252
+ */
9253
+ softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): void;
9254
+ /**
9255
+ * Softly asserts that the target data is below a specified value.
9256
+ * @param targetData - The data to check.
9257
+ * @param belowThan - The value that the target data should be below.
9258
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9259
+ */
9260
+ softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): void;
9261
+ /**
9262
+ * Softly asserts that the length of the target data is above a specified value.
9263
+ * @param targetData - The data to check.
9264
+ * @param lengthAboveThan - The length that the target data should be above.
9265
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9266
+ */
9267
+ softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): void;
9268
+ /**
9269
+ * Softly asserts that the length of the target data is below a specified value.
9270
+ * @param targetData - The data to check.
9271
+ * @param lengthBelowThan - The length that the target data should be below.
9272
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9273
+ */
9274
+ softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): void;
9275
+ /**
9276
+ * Softly asserts that two values are equal, ignoring case.
9277
+ * @param actualValue - The actual string value.
9278
+ * @param expectedValue - The expected string value.
9279
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9280
+ */
9281
+ softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): void;
9282
+ /**
9283
+ * Softly asserts that two arrays have deep equality, considering members in any order.
9284
+ * @param actualValue - The actual array.
9285
+ * @param expectedValue - The expected array.
9286
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9287
+ */
9288
+ softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): void;
9289
+ /**
9290
+ * Softly asserts that an array (superset) deeply includes all members of another array (set).
9291
+ * @param superset - The array that should contain the expected members.
9292
+ * @param set - The array with members that should be included.
9293
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9294
+ */
9295
+ softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): void;
9296
+ /**
9297
+ * Softly asserts that two objects are deeply equal, excluding specified fields.
9298
+ * @param actualValue - The actual object.
9299
+ * @param expectedValue - The expected object.
9300
+ * @param fieldsToExclude - The fields to exclude from the comparison.
9301
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9302
+ */
9303
+ softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): void;
9304
+ /**
9305
+ * Softly asserts that a value matches the expected pattern.
9306
+ * @param actualValue - The actual value.
9307
+ * @param expectedPattern - The pattern the value should match.
9308
+ * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
9309
+ */
9310
+ softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): void;
9311
+ }
8713
9312
  /**
8714
9313
  * Client Functions
8715
9314
  */
@@ -9730,6 +10329,17 @@ declare namespace CodeceptJS {
9730
10329
  // @ts-ignore
9731
10330
  // @ts-ignore
9732
10331
  // @ts-ignore
10332
+ // @ts-ignore
10333
+ // @ts-ignore
10334
+ // @ts-ignore
10335
+ // @ts-ignore
10336
+ // @ts-ignore
10337
+ // @ts-ignore
10338
+ // @ts-ignore
10339
+ // @ts-ignore
10340
+ // @ts-ignore
10341
+ // @ts-ignore
10342
+ // @ts-ignore
9733
10343
  type WebDriverConfig = {
9734
10344
  url: string;
9735
10345
  browser: string;
@@ -11788,25 +12398,6 @@ declare namespace CodeceptJS {
11788
12398
  [key: string]: any;
11789
12399
  };
11790
12400
  }
11791
- /**
11792
- * Result of the test run
11793
- */
11794
- type Stats = {
11795
- passes: number;
11796
- failures: number;
11797
- tests: number;
11798
- pending: number;
11799
- failedHooks: number;
11800
- start: Date;
11801
- end: Date;
11802
- duration: number;
11803
- };
11804
- /**
11805
- * Create Result of the test run
11806
- */
11807
- class Result {
11808
- constructor();
11809
- }
11810
12401
  /**
11811
12402
  * Dependency Injection Container
11812
12403
  */
@@ -11835,10 +12426,6 @@ declare namespace CodeceptJS {
11835
12426
  * Get Mocha instance
11836
12427
  */
11837
12428
  static mocha(): any;
11838
- /**
11839
- * Get result
11840
- */
11841
- static result(): Result;
11842
12429
  /**
11843
12430
  * Append new services to container
11844
12431
  */
@@ -12357,46 +12944,6 @@ declare namespace CodeceptJS {
12357
12944
  }): this;
12358
12945
  }
12359
12946
  function addStep(step: any, fn: any): void;
12360
- /**
12361
- * Creates a new Hook instance
12362
- * @property suite - The test suite this hook belongs to
12363
- * @property test - The test object associated with this hook
12364
- * @property runnable - The current test being executed
12365
- * @property ctx - The context object
12366
- * @property err - The error that occurred during hook execution, if any
12367
- * @param context - The context object containing suite and test information
12368
- * @param context.suite - The test suite
12369
- * @param context.test - The test object
12370
- * @param context.ctx - The context object
12371
- * @param error - The error object if hook execution failed
12372
- */
12373
- class Hook {
12374
- constructor(context: {
12375
- suite: any;
12376
- test: any;
12377
- ctx: any;
12378
- }, error: Error);
12379
- /**
12380
- * The test suite this hook belongs to
12381
- */
12382
- suite: any;
12383
- /**
12384
- * The test object associated with this hook
12385
- */
12386
- test: any;
12387
- /**
12388
- * The current test being executed
12389
- */
12390
- runnable: any;
12391
- /**
12392
- * The context object
12393
- */
12394
- ctx: any;
12395
- /**
12396
- * The error that occurred during hook execution, if any
12397
- */
12398
- err: Error | null;
12399
- }
12400
12947
  function within(context: CodeceptJS.LocatorOrString, fn: (...params: any[]) => any): Promise<any> | undefined;
12401
12948
  /**
12402
12949
  * This is a wrapper on top of [Detox](https://github.com/wix/Detox) library, aimied to unify testing experience for CodeceptJS framework.