codeceptjs 3.6.10 → 3.7.0-beta.1

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 (105) hide show
  1. package/README.md +81 -110
  2. package/bin/codecept.js +2 -2
  3. package/docs/webapi/clearCookie.mustache +1 -1
  4. package/lib/actor.js +46 -36
  5. package/lib/assert/empty.js +3 -5
  6. package/lib/assert/equal.js +4 -7
  7. package/lib/assert/include.js +4 -6
  8. package/lib/assert/throws.js +2 -4
  9. package/lib/assert/truth.js +2 -2
  10. package/lib/codecept.js +87 -83
  11. package/lib/command/configMigrate.js +2 -4
  12. package/lib/command/definitions.js +5 -25
  13. package/lib/command/generate.js +10 -14
  14. package/lib/command/gherkin/snippets.js +10 -8
  15. package/lib/command/gherkin/steps.js +1 -1
  16. package/lib/command/info.js +1 -3
  17. package/lib/command/init.js +8 -12
  18. package/lib/command/interactive.js +1 -1
  19. package/lib/command/list.js +1 -1
  20. package/lib/command/run-multiple.js +12 -35
  21. package/lib/command/run-workers.js +10 -10
  22. package/lib/command/utils.js +5 -6
  23. package/lib/command/workers/runTests.js +14 -17
  24. package/lib/container.js +327 -237
  25. package/lib/data/context.js +10 -13
  26. package/lib/data/dataScenarioConfig.js +8 -8
  27. package/lib/data/dataTableArgument.js +6 -6
  28. package/lib/data/table.js +5 -11
  29. package/lib/els.js +177 -0
  30. package/lib/event.js +1 -0
  31. package/lib/heal.js +78 -80
  32. package/lib/helper/ApiDataFactory.js +3 -6
  33. package/lib/helper/Appium.js +15 -30
  34. package/lib/helper/FileSystem.js +3 -3
  35. package/lib/helper/GraphQLDataFactory.js +3 -3
  36. package/lib/helper/JSONResponse.js +57 -37
  37. package/lib/helper/Nightmare.js +35 -53
  38. package/lib/helper/Playwright.js +189 -251
  39. package/lib/helper/Protractor.js +54 -77
  40. package/lib/helper/Puppeteer.js +134 -232
  41. package/lib/helper/REST.js +5 -17
  42. package/lib/helper/TestCafe.js +21 -44
  43. package/lib/helper/WebDriver.js +103 -162
  44. package/lib/helper/testcafe/testcafe-utils.js +26 -27
  45. package/lib/listener/artifacts.js +2 -2
  46. package/lib/listener/emptyRun.js +58 -0
  47. package/lib/listener/exit.js +4 -4
  48. package/lib/listener/{retry.js → globalRetry.js} +5 -5
  49. package/lib/listener/{timeout.js → globalTimeout.js} +8 -8
  50. package/lib/listener/helpers.js +15 -15
  51. package/lib/listener/mocha.js +1 -1
  52. package/lib/listener/steps.js +17 -12
  53. package/lib/listener/store.js +12 -0
  54. package/lib/mocha/asyncWrapper.js +204 -0
  55. package/lib/{interfaces → mocha}/bdd.js +3 -3
  56. package/lib/mocha/cli.js +257 -0
  57. package/lib/mocha/factory.js +104 -0
  58. package/lib/{interfaces → mocha}/featureConfig.js +11 -12
  59. package/lib/{interfaces → mocha}/gherkin.js +26 -28
  60. package/lib/mocha/hooks.js +83 -0
  61. package/lib/mocha/index.js +12 -0
  62. package/lib/mocha/inject.js +24 -0
  63. package/lib/{interfaces → mocha}/scenarioConfig.js +10 -6
  64. package/lib/mocha/suite.js +55 -0
  65. package/lib/mocha/test.js +60 -0
  66. package/lib/mocha/types.d.ts +31 -0
  67. package/lib/mocha/ui.js +219 -0
  68. package/lib/output.js +28 -10
  69. package/lib/pause.js +159 -135
  70. package/lib/plugin/autoDelay.js +4 -4
  71. package/lib/plugin/autoLogin.js +6 -7
  72. package/lib/plugin/commentStep.js +1 -1
  73. package/lib/plugin/coverage.js +10 -19
  74. package/lib/plugin/customLocator.js +3 -3
  75. package/lib/plugin/debugErrors.js +2 -2
  76. package/lib/plugin/eachElement.js +1 -1
  77. package/lib/plugin/fakerTransform.js +1 -1
  78. package/lib/plugin/heal.js +6 -9
  79. package/lib/plugin/retryFailedStep.js +4 -4
  80. package/lib/plugin/retryTo.js +2 -2
  81. package/lib/plugin/screenshotOnFail.js +9 -36
  82. package/lib/plugin/selenoid.js +15 -35
  83. package/lib/plugin/stepByStepReport.js +51 -13
  84. package/lib/plugin/stepTimeout.js +4 -11
  85. package/lib/plugin/subtitles.js +4 -4
  86. package/lib/plugin/tryTo.js +1 -1
  87. package/lib/plugin/wdio.js +8 -10
  88. package/lib/recorder.js +142 -121
  89. package/lib/secret.js +1 -1
  90. package/lib/step.js +160 -144
  91. package/lib/store.js +6 -2
  92. package/lib/template/heal.js +2 -11
  93. package/lib/utils.js +224 -216
  94. package/lib/within.js +73 -55
  95. package/lib/workers.js +265 -261
  96. package/package.json +46 -47
  97. package/typings/index.d.ts +172 -184
  98. package/typings/promiseBasedTypes.d.ts +53 -516
  99. package/typings/types.d.ts +127 -587
  100. package/lib/cli.js +0 -256
  101. package/lib/helper/ExpectHelper.js +0 -391
  102. package/lib/helper/SoftExpectHelper.js +0 -381
  103. package/lib/mochaFactory.js +0 -113
  104. package/lib/scenario.js +0 -224
  105. package/lib/ui.js +0 -236
@@ -1185,228 +1185,6 @@ declare namespace CodeceptJS {
1185
1185
  */
1186
1186
  waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
1187
1187
  }
1188
- /**
1189
- * This helper allows performing assertions based on Chai.
1190
- *
1191
- * ### Examples
1192
- *
1193
- * Zero-configuration when paired with other helpers like REST, Playwright:
1194
- *
1195
- * ```js
1196
- * // inside codecept.conf.js
1197
- * {
1198
- * helpers: {
1199
- * Playwright: {...},
1200
- * ExpectHelper: {},
1201
- * }
1202
- * }
1203
- * ```
1204
- *
1205
- * ## Methods
1206
- */
1207
- class ExpectHelper {
1208
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1209
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1210
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1211
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1212
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1213
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1214
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1215
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1216
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1217
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1218
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1219
- /**
1220
- * @param [ajvOptions] - Pass AJV options
1221
- */
1222
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1223
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1224
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1225
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1226
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1227
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1228
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1229
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1230
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1231
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1232
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1233
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1234
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1235
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1236
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1237
- /**
1238
- * expects members of two arrays are deeply equal
1239
- */
1240
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1241
- /**
1242
- * expects an array to be a superset of another array
1243
- */
1244
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1245
- /**
1246
- * expects members of two JSON objects are deeply equal excluding some properties
1247
- */
1248
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1249
- /**
1250
- * expects a JSON object matches a provided pattern
1251
- */
1252
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1253
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1254
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1255
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1256
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1257
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1258
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1259
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1260
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1261
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1262
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1263
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1264
- /**
1265
- * @param [ajvOptions] - Pass AJV options
1266
- */
1267
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1268
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1269
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1270
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1271
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1272
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1273
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1274
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1275
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1276
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1277
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1278
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1279
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1280
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1281
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1282
- /**
1283
- * expects members of two arrays are deeply equal
1284
- */
1285
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1286
- /**
1287
- * expects an array to be a superset of another array
1288
- */
1289
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1290
- /**
1291
- * expects members of two JSON objects are deeply equal excluding some properties
1292
- */
1293
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1294
- /**
1295
- * expects a JSON object matches a provided pattern
1296
- */
1297
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1298
- }
1299
- /**
1300
- * This helper allows performing assertions based on Chai.
1301
- *
1302
- * ### Examples
1303
- *
1304
- * Zero-configuration when paired with other helpers like REST, Playwright:
1305
- *
1306
- * ```js
1307
- * // inside codecept.conf.js
1308
- * {
1309
- * helpers: {
1310
- * Playwright: {...},
1311
- * ExpectHelper: {},
1312
- * }
1313
- * }
1314
- * ```
1315
- *
1316
- * ## Methods
1317
- */
1318
- class ExpectHelper {
1319
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1320
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1321
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1322
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1323
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1324
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1325
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1326
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1327
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1328
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1329
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1330
- /**
1331
- * @param [ajvOptions] - Pass AJV options
1332
- */
1333
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1334
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1335
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1336
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1337
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1338
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1339
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1340
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1341
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1342
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1343
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1344
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1345
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1346
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1347
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1348
- /**
1349
- * expects members of two arrays are deeply equal
1350
- */
1351
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1352
- /**
1353
- * expects an array to be a superset of another array
1354
- */
1355
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1356
- /**
1357
- * expects members of two JSON objects are deeply equal excluding some properties
1358
- */
1359
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1360
- /**
1361
- * expects a JSON object matches a provided pattern
1362
- */
1363
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1364
- expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1365
- expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1366
- expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1367
- expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1368
- expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
1369
- expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
1370
- expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
1371
- expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
1372
- expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
1373
- expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
1374
- expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
1375
- /**
1376
- * @param [ajvOptions] - Pass AJV options
1377
- */
1378
- expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
1379
- expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1380
- expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
1381
- expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1382
- expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
1383
- expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
1384
- expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
1385
- expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
1386
- expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
1387
- expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
1388
- expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
1389
- expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
1390
- expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
1391
- expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
1392
- expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1393
- /**
1394
- * expects members of two arrays are deeply equal
1395
- */
1396
- expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
1397
- /**
1398
- * expects an array to be a superset of another array
1399
- */
1400
- expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
1401
- /**
1402
- * expects members of two JSON objects are deeply equal excluding some properties
1403
- */
1404
- expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
1405
- /**
1406
- * expects a JSON object matches a provided pattern
1407
- */
1408
- expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
1409
- }
1410
1188
  /**
1411
1189
  * Helper for testing filesystem.
1412
1190
  * Can be easily used to check file structures:
@@ -1930,13 +1708,14 @@ declare namespace CodeceptJS {
1930
1708
  */
1931
1709
  seeResponseContainsKeys(keys: any[]): Promise<any>;
1932
1710
  /**
1933
- * Executes a callback function passing in `response` object and chai assertions with `expect`
1711
+ * Executes a callback function passing in `response` object and assert
1934
1712
  * Use it to perform custom checks of response data
1935
1713
  *
1936
1714
  * ```js
1937
- * I.seeResponseValidByCallback(({ data, status, expect }) => {
1938
- * expect(status).to.eql(200);
1939
- * expect(data).keys.to.include(['user', 'company']);
1715
+ * I.seeResponseValidByCallback(({ data, status }) => {
1716
+ * assert.strictEqual(status, 200);
1717
+ * assert('user' in data);
1718
+ * assert('company' in data);
1940
1719
  * });
1941
1720
  * ```
1942
1721
  */
@@ -1986,6 +1765,13 @@ declare namespace CodeceptJS {
1986
1765
  * @property [host = "0.0.0.0"] - Mock server host
1987
1766
  * @property [httpsOpts] - key & cert values are the paths to .key and .crt files
1988
1767
  */
1768
+ // @ts-ignore
1769
+ // @ts-ignore
1770
+ // @ts-ignore
1771
+ // @ts-ignore
1772
+ // @ts-ignore
1773
+ // @ts-ignore
1774
+ // @ts-ignore
1989
1775
  type MockServerConfig = {
1990
1776
  port?: number;
1991
1777
  host?: string;
@@ -2110,6 +1896,13 @@ declare namespace CodeceptJS {
2110
1896
  *
2111
1897
  * ## Methods
2112
1898
  */
1899
+ // @ts-ignore
1900
+ // @ts-ignore
1901
+ // @ts-ignore
1902
+ // @ts-ignore
1903
+ // @ts-ignore
1904
+ // @ts-ignore
1905
+ // @ts-ignore
2113
1906
  class MockServer {
2114
1907
  /**
2115
1908
  * Start the mock server
@@ -2898,7 +2691,7 @@ declare namespace CodeceptJS {
2898
2691
  *
2899
2692
  * ```js
2900
2693
  * I.clearCookie();
2901
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
2694
+ * I.clearCookie('test');
2902
2695
  * ```
2903
2696
  * @param [cookie = null] - (optional, `null` by default) cookie name
2904
2697
  */
@@ -3099,46 +2892,6 @@ declare namespace CodeceptJS {
3099
2892
  */
3100
2893
  grabPageScrollPosition(): Promise<PageScrollPosition>;
3101
2894
  }
3102
- /**
3103
- * OpenAI Helper for CodeceptJS.
3104
- *
3105
- * 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.
3106
- * This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
3107
- *
3108
- * ## Configuration
3109
- *
3110
- * This helper should be configured in codecept.json or codecept.conf.js
3111
- *
3112
- * * `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.
3113
- */
3114
- class OpenAITs {
3115
- /**
3116
- * Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
3117
- *
3118
- * ```js
3119
- * I.askGptOnPage('what does this page do?');
3120
- * ```
3121
- * @param prompt - The question or prompt to ask the GPT model.
3122
- * @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
3123
- */
3124
- askGptOnPage(prompt: string): Promise<string>;
3125
- /**
3126
- * 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.
3127
- *
3128
- * ```js
3129
- * I.askGptOnPageFragment('describe features of this screen', '.screen');
3130
- * ```
3131
- * @param prompt - The question or prompt to ask the GPT-3.5 model.
3132
- * @param locator - The locator or selector used to identify the HTML fragment on the page.
3133
- * @returns - A Promise that resolves to the generated response from the GPT model.
3134
- */
3135
- askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
3136
- /**
3137
- * Send a general request to ChatGPT and return response.
3138
- * @returns - A Promise that resolves to the generated response from the GPT model.
3139
- */
3140
- askGptGeneralPrompt(prompt: string): Promise<string>;
3141
- }
3142
2895
  /**
3143
2896
  * ## Configuration
3144
2897
  *
@@ -3183,6 +2936,13 @@ declare namespace CodeceptJS {
3183
2936
  * @property [recordHar] - record HAR and will be saved to `output/har`. See more of [HAR options](https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har).
3184
2937
  * @property [testIdAttribute = data-testid] - locate elements based on the testIdAttribute. See more of [locate by test id](https://playwright.dev/docs/locators#locate-by-test-id).
3185
2938
  */
2939
+ // @ts-ignore
2940
+ // @ts-ignore
2941
+ // @ts-ignore
2942
+ // @ts-ignore
2943
+ // @ts-ignore
2944
+ // @ts-ignore
2945
+ // @ts-ignore
3186
2946
  type PlaywrightConfig = {
3187
2947
  url?: string;
3188
2948
  browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
@@ -4536,7 +4296,7 @@ declare namespace CodeceptJS {
4536
4296
  *
4537
4297
  * ```js
4538
4298
  * I.clearCookie();
4539
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
4299
+ * I.clearCookie('test');
4540
4300
  * ```
4541
4301
  * @param [cookie = null] - (optional, `null` by default) cookie name
4542
4302
  */
@@ -6138,7 +5898,7 @@ declare namespace CodeceptJS {
6138
5898
  *
6139
5899
  * ```js
6140
5900
  * I.clearCookie();
6141
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
5901
+ * I.clearCookie('test');
6142
5902
  * ```
6143
5903
  * @param [cookie = null] - (optional, `null` by default) cookie name
6144
5904
  */
@@ -6559,6 +6319,13 @@ declare namespace CodeceptJS {
6559
6319
  * @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
6560
6320
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
6561
6321
  */
6322
+ // @ts-ignore
6323
+ // @ts-ignore
6324
+ // @ts-ignore
6325
+ // @ts-ignore
6326
+ // @ts-ignore
6327
+ // @ts-ignore
6328
+ // @ts-ignore
6562
6329
  type PuppeteerConfig = {
6563
6330
  url: string;
6564
6331
  basicAuth?: any;
@@ -7712,7 +7479,7 @@ declare namespace CodeceptJS {
7712
7479
  *
7713
7480
  * ```js
7714
7481
  * I.clearCookie();
7715
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
7482
+ * I.clearCookie('test');
7716
7483
  * ```
7717
7484
  * @param [cookie = null] - (optional, `null` by default) cookie name
7718
7485
  */
@@ -8365,6 +8132,13 @@ declare namespace CodeceptJS {
8365
8132
  * @property [onResponse] - an async function which can update response object.
8366
8133
  * @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
8367
8134
  */
8135
+ // @ts-ignore
8136
+ // @ts-ignore
8137
+ // @ts-ignore
8138
+ // @ts-ignore
8139
+ // @ts-ignore
8140
+ // @ts-ignore
8141
+ // @ts-ignore
8368
8142
  type RESTConfig = {
8369
8143
  endpoint?: string;
8370
8144
  prettyPrintJson?: boolean;
@@ -8557,250 +8331,6 @@ declare namespace CodeceptJS {
8557
8331
  */
8558
8332
  sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
8559
8333
  }
8560
- /**
8561
- * SoftAssertHelper is a utility class for performing soft assertions.
8562
- * Unlike traditional assertions that stop the execution on failure,
8563
- * soft assertions allow the execution to continue and report all failures at the end.
8564
- *
8565
- * ### Examples
8566
- *
8567
- * Zero-configuration when paired with other helpers like REST, Playwright:
8568
- *
8569
- * ```js
8570
- * // inside codecept.conf.js
8571
- * {
8572
- * helpers: {
8573
- * Playwright: {...},
8574
- * SoftExpectHelper: {},
8575
- * }
8576
- * }
8577
- * ```
8578
- *
8579
- * ```js
8580
- * // in scenario
8581
- * I.softExpectEqual('a', 'b')
8582
- * I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
8583
- * ```
8584
- *
8585
- * ## Methods
8586
- */
8587
- class SoftAssertHelperTs {
8588
- /**
8589
- * Performs a soft assertion by executing the provided assertion function.
8590
- * If the assertion fails, the error is caught and stored without halting the execution.
8591
- * @param assertionFn - The assertion function to execute.
8592
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8593
- */
8594
- softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): Promise<any>;
8595
- /**
8596
- * Throws an error if any soft assertions have failed.
8597
- * The error message contains all the accumulated failures.
8598
- */
8599
- flushSoftAssertions(): Promise<any>;
8600
- /**
8601
- * Softly asserts that two values are equal.
8602
- * @param actualValue - The actual value.
8603
- * @param expectedValue - The expected value.
8604
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8605
- */
8606
- softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8607
- /**
8608
- * Softly asserts that two values are not equal.
8609
- * @param actualValue - The actual value.
8610
- * @param expectedValue - The expected value.
8611
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8612
- */
8613
- softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8614
- /**
8615
- * Softly asserts that two values are deeply equal.
8616
- * @param actualValue - The actual value.
8617
- * @param expectedValue - The expected value.
8618
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8619
- */
8620
- softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8621
- /**
8622
- * Softly asserts that two values are not deeply equal.
8623
- * @param actualValue - The actual value.
8624
- * @param expectedValue - The expected value.
8625
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8626
- */
8627
- softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
8628
- /**
8629
- * Softly asserts that a value contains the expected value.
8630
- * @param actualValue - The actual value.
8631
- * @param expectedValueToContain - The value that should be contained within the actual value.
8632
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8633
- */
8634
- softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): Promise<any>;
8635
- /**
8636
- * Softly asserts that a value does not contain the expected value.
8637
- * @param actualValue - The actual value.
8638
- * @param expectedValueToNotContain - The value that should not be contained within the actual value.
8639
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8640
- */
8641
- softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): Promise<any>;
8642
- /**
8643
- * Softly asserts that a value starts with the expected value.
8644
- * @param actualValue - The actual value.
8645
- * @param expectedValueToStartWith - The value that the actual value should start with.
8646
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8647
- */
8648
- softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): Promise<any>;
8649
- /**
8650
- * Softly asserts that a value does not start with the expected value.
8651
- * @param actualValue - The actual value.
8652
- * @param expectedValueToNotStartWith - The value that the actual value should not start with.
8653
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8654
- */
8655
- softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): Promise<any>;
8656
- /**
8657
- * Softly asserts that a value ends with the expected value.
8658
- * @param actualValue - The actual value.
8659
- * @param expectedValueToEndWith - The value that the actual value should end with.
8660
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8661
- */
8662
- softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): Promise<any>;
8663
- /**
8664
- * Softly asserts that a value does not end with the expected value.
8665
- * @param actualValue - The actual value.
8666
- * @param expectedValueToNotEndWith - The value that the actual value should not end with.
8667
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8668
- */
8669
- softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): Promise<any>;
8670
- /**
8671
- * Softly asserts that the target data matches the given JSON schema.
8672
- * @param targetData - The data to validate.
8673
- * @param jsonSchema - The JSON schema to validate against.
8674
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8675
- */
8676
- softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): Promise<any>;
8677
- /**
8678
- * Softly asserts that the target data matches the given JSON schema using AJV.
8679
- * @param targetData - The data to validate.
8680
- * @param jsonSchema - The JSON schema to validate against.
8681
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8682
- * @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
8683
- */
8684
- softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): Promise<any>;
8685
- /**
8686
- * Softly asserts that the target data has the specified property.
8687
- * @param targetData - The data to check.
8688
- * @param propertyName - The property name to check for.
8689
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion
8690
- * fails.
8691
- */
8692
- softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
8693
- /**
8694
- * Softly asserts that the target data has a property with the specified name.
8695
- * @param targetData - The data to check.
8696
- * @param propertyName - The property name to check for.
8697
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8698
- */
8699
- softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
8700
- /**
8701
- * Softly asserts that the target data is of a specific type.
8702
- * @param targetData - The data to check.
8703
- * @param type - The expected type (e.g., 'string', 'number').
8704
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8705
- */
8706
- softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
8707
- /**
8708
- * Softly asserts that the target data is of a specific type (alternative for articles).
8709
- * @param targetData - The data to check.
8710
- * @param type - The expected type (e.g., 'string', 'number').
8711
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8712
- */
8713
- softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
8714
- /**
8715
- * Softly asserts that the target data has a specified length.
8716
- * @param targetData - The data to check.
8717
- * @param length - The expected length.
8718
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8719
- */
8720
- softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): Promise<any>;
8721
- /**
8722
- * Softly asserts that the target data is empty.
8723
- * @param targetData - The data to check.
8724
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8725
- */
8726
- softExpectEmpty(targetData: any, customErrorMsg?: string): Promise<any>;
8727
- /**
8728
- * Softly asserts that the target data is true.
8729
- * @param targetData - The data to check.
8730
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8731
- */
8732
- softExpectTrue(targetData: any, customErrorMsg?: string): Promise<any>;
8733
- /**
8734
- * Softly asserts that the target data is false.
8735
- * @param targetData - The data to check.
8736
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8737
- */
8738
- softExpectFalse(targetData: any, customErrorMsg?: string): Promise<any>;
8739
- /**
8740
- * Softly asserts that the target data is above a specified value.
8741
- * @param targetData - The data to check.
8742
- * @param aboveThan - The value that the target data should be above.
8743
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8744
- */
8745
- softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): Promise<any>;
8746
- /**
8747
- * Softly asserts that the target data is below a specified value.
8748
- * @param targetData - The data to check.
8749
- * @param belowThan - The value that the target data should be below.
8750
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8751
- */
8752
- softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): Promise<any>;
8753
- /**
8754
- * Softly asserts that the length of the target data is above a specified value.
8755
- * @param targetData - The data to check.
8756
- * @param lengthAboveThan - The length that the target data should be above.
8757
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8758
- */
8759
- softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): Promise<any>;
8760
- /**
8761
- * Softly asserts that the length of the target data is below a specified value.
8762
- * @param targetData - The data to check.
8763
- * @param lengthBelowThan - The length that the target data should be below.
8764
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8765
- */
8766
- softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): Promise<any>;
8767
- /**
8768
- * Softly asserts that two values are equal, ignoring case.
8769
- * @param actualValue - The actual string value.
8770
- * @param expectedValue - The expected string value.
8771
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8772
- */
8773
- softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): Promise<any>;
8774
- /**
8775
- * Softly asserts that two arrays have deep equality, considering members in any order.
8776
- * @param actualValue - The actual array.
8777
- * @param expectedValue - The expected array.
8778
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8779
- */
8780
- softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): Promise<any>;
8781
- /**
8782
- * Softly asserts that an array (superset) deeply includes all members of another array (set).
8783
- * @param superset - The array that should contain the expected members.
8784
- * @param set - The array with members that should be included.
8785
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8786
- */
8787
- softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): Promise<any>;
8788
- /**
8789
- * Softly asserts that two objects are deeply equal, excluding specified fields.
8790
- * @param actualValue - The actual object.
8791
- * @param expectedValue - The expected object.
8792
- * @param fieldsToExclude - The fields to exclude from the comparison.
8793
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8794
- */
8795
- softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): Promise<any>;
8796
- /**
8797
- * Softly asserts that a value matches the expected pattern.
8798
- * @param actualValue - The actual value.
8799
- * @param expectedPattern - The pattern the value should match.
8800
- * @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
8801
- */
8802
- softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): Promise<any>;
8803
- }
8804
8334
  /**
8805
8335
  * Client Functions
8806
8336
  */
@@ -9623,7 +9153,7 @@ declare namespace CodeceptJS {
9623
9153
  *
9624
9154
  * ```js
9625
9155
  * I.clearCookie();
9626
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
9156
+ * I.clearCookie('test');
9627
9157
  * ```
9628
9158
  * @param [cookie = null] - (optional, `null` by default) cookie name
9629
9159
  */
@@ -9753,6 +9283,13 @@ declare namespace CodeceptJS {
9753
9283
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
9754
9284
  * @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
9755
9285
  */
9286
+ // @ts-ignore
9287
+ // @ts-ignore
9288
+ // @ts-ignore
9289
+ // @ts-ignore
9290
+ // @ts-ignore
9291
+ // @ts-ignore
9292
+ // @ts-ignore
9756
9293
  type WebDriverConfig = {
9757
9294
  url: string;
9758
9295
  browser: string;
@@ -11023,7 +10560,7 @@ declare namespace CodeceptJS {
11023
10560
  *
11024
10561
  * ```js
11025
10562
  * I.clearCookie();
11026
- * I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
10563
+ * I.clearCookie('test');
11027
10564
  * ```
11028
10565
  * @param [cookie = null] - (optional, `null` by default) cookie name
11029
10566
  */