codeceptjs 3.7.0-beta.7 → 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.
- package/lib/actor.js +1 -2
- package/lib/ai.js +130 -121
- package/lib/codecept.js +4 -4
- package/lib/command/check.js +4 -0
- package/lib/command/run-workers.js +1 -53
- package/lib/command/workers/runTests.js +25 -189
- package/lib/container.js +16 -0
- package/lib/event.js +18 -17
- package/lib/listener/exit.js +5 -8
- package/lib/listener/globalTimeout.js +26 -9
- package/lib/listener/result.js +12 -0
- package/lib/listener/steps.js +0 -6
- package/lib/mocha/asyncWrapper.js +12 -2
- package/lib/mocha/cli.js +50 -24
- package/lib/mocha/hooks.js +32 -3
- package/lib/mocha/suite.js +27 -1
- package/lib/mocha/test.js +91 -7
- package/lib/mocha/types.d.ts +5 -0
- package/lib/output.js +1 -0
- package/lib/plugin/analyze.js +351 -0
- package/lib/plugin/commentStep.js +5 -0
- package/lib/plugin/customReporter.js +52 -0
- package/lib/plugin/heal.js +2 -2
- package/lib/plugin/pageInfo.js +143 -0
- package/lib/plugin/retryTo.js +10 -2
- package/lib/plugin/screenshotOnFail.js +4 -6
- package/lib/plugin/stepTimeout.js +1 -1
- package/lib/plugin/tryTo.js +9 -1
- package/lib/recorder.js +4 -4
- package/lib/rerun.js +43 -42
- package/lib/result.js +161 -0
- package/lib/step/base.js +52 -4
- package/lib/step/helper.js +3 -0
- package/lib/step/meta.js +9 -1
- package/lib/step/record.js +5 -5
- package/lib/step/section.js +55 -0
- package/lib/steps.js +28 -1
- package/lib/{step/timeout.js → timeout.js} +24 -0
- package/lib/utils.js +35 -0
- package/lib/workers.js +28 -38
- package/package.json +2 -2
- package/typings/promiseBasedTypes.d.ts +12 -518
- package/typings/types.d.ts +75 -518
- package/lib/listener/artifacts.js +0 -19
- package/lib/plugin/debugErrors.js +0 -67
|
@@ -1179,240 +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
|
-
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
|
-
// @ts-ignore
|
|
1319
|
-
// @ts-ignore
|
|
1320
|
-
// @ts-ignore
|
|
1321
|
-
// @ts-ignore
|
|
1322
|
-
// @ts-ignore
|
|
1323
|
-
// @ts-ignore
|
|
1324
|
-
class ExpectHelper {
|
|
1325
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1326
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1327
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1328
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1329
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1330
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1331
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1332
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1333
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1334
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1335
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1336
|
-
/**
|
|
1337
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1338
|
-
*/
|
|
1339
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1340
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1341
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1342
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1343
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1344
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1345
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1346
|
-
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1347
|
-
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1348
|
-
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1349
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1350
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1351
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1352
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1353
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1354
|
-
/**
|
|
1355
|
-
* expects members of two arrays are deeply equal
|
|
1356
|
-
*/
|
|
1357
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1358
|
-
/**
|
|
1359
|
-
* expects an array to be a superset of another array
|
|
1360
|
-
*/
|
|
1361
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1362
|
-
/**
|
|
1363
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1364
|
-
*/
|
|
1365
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1366
|
-
/**
|
|
1367
|
-
* expects a JSON object matches a provided pattern
|
|
1368
|
-
*/
|
|
1369
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1370
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1371
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1372
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1373
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1374
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1375
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1376
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1377
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1378
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1379
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1380
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1381
|
-
/**
|
|
1382
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1383
|
-
*/
|
|
1384
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1385
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1386
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1387
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1388
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1389
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1390
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1391
|
-
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1392
|
-
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1393
|
-
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1394
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1395
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1396
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1397
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1398
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1399
|
-
/**
|
|
1400
|
-
* expects members of two arrays are deeply equal
|
|
1401
|
-
*/
|
|
1402
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1403
|
-
/**
|
|
1404
|
-
* expects an array to be a superset of another array
|
|
1405
|
-
*/
|
|
1406
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1407
|
-
/**
|
|
1408
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1409
|
-
*/
|
|
1410
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1411
|
-
/**
|
|
1412
|
-
* expects a JSON object matches a provided pattern
|
|
1413
|
-
*/
|
|
1414
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1415
|
-
}
|
|
1416
1182
|
/**
|
|
1417
1183
|
* Helper for testing filesystem.
|
|
1418
1184
|
* Can be easily used to check file structures:
|
|
@@ -1999,6 +1765,8 @@ declare namespace CodeceptJS {
|
|
|
1999
1765
|
// @ts-ignore
|
|
2000
1766
|
// @ts-ignore
|
|
2001
1767
|
// @ts-ignore
|
|
1768
|
+
// @ts-ignore
|
|
1769
|
+
// @ts-ignore
|
|
2002
1770
|
type MockServerConfig = {
|
|
2003
1771
|
port?: number;
|
|
2004
1772
|
host?: string;
|
|
@@ -2129,6 +1897,8 @@ declare namespace CodeceptJS {
|
|
|
2129
1897
|
// @ts-ignore
|
|
2130
1898
|
// @ts-ignore
|
|
2131
1899
|
// @ts-ignore
|
|
1900
|
+
// @ts-ignore
|
|
1901
|
+
// @ts-ignore
|
|
2132
1902
|
class MockServer {
|
|
2133
1903
|
/**
|
|
2134
1904
|
* Start the mock server
|
|
@@ -3118,46 +2888,6 @@ declare namespace CodeceptJS {
|
|
|
3118
2888
|
*/
|
|
3119
2889
|
grabPageScrollPosition(): Promise<PageScrollPosition>;
|
|
3120
2890
|
}
|
|
3121
|
-
/**
|
|
3122
|
-
* OpenAI Helper for CodeceptJS.
|
|
3123
|
-
*
|
|
3124
|
-
* 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.
|
|
3125
|
-
* This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
|
|
3126
|
-
*
|
|
3127
|
-
* ## Configuration
|
|
3128
|
-
*
|
|
3129
|
-
* This helper should be configured in codecept.json or codecept.conf.js
|
|
3130
|
-
*
|
|
3131
|
-
* * `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.
|
|
3132
|
-
*/
|
|
3133
|
-
class OpenAITs {
|
|
3134
|
-
/**
|
|
3135
|
-
* Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
|
|
3136
|
-
*
|
|
3137
|
-
* ```js
|
|
3138
|
-
* I.askGptOnPage('what does this page do?');
|
|
3139
|
-
* ```
|
|
3140
|
-
* @param prompt - The question or prompt to ask the GPT model.
|
|
3141
|
-
* @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
|
|
3142
|
-
*/
|
|
3143
|
-
askGptOnPage(prompt: string): Promise<string>;
|
|
3144
|
-
/**
|
|
3145
|
-
* 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.
|
|
3146
|
-
*
|
|
3147
|
-
* ```js
|
|
3148
|
-
* I.askGptOnPageFragment('describe features of this screen', '.screen');
|
|
3149
|
-
* ```
|
|
3150
|
-
* @param prompt - The question or prompt to ask the GPT-3.5 model.
|
|
3151
|
-
* @param locator - The locator or selector used to identify the HTML fragment on the page.
|
|
3152
|
-
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
3153
|
-
*/
|
|
3154
|
-
askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
|
|
3155
|
-
/**
|
|
3156
|
-
* Send a general request to ChatGPT and return response.
|
|
3157
|
-
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
3158
|
-
*/
|
|
3159
|
-
askGptGeneralPrompt(prompt: string): Promise<string>;
|
|
3160
|
-
}
|
|
3161
2891
|
/**
|
|
3162
2892
|
* ## Configuration
|
|
3163
2893
|
*
|
|
@@ -3208,6 +2938,8 @@ declare namespace CodeceptJS {
|
|
|
3208
2938
|
// @ts-ignore
|
|
3209
2939
|
// @ts-ignore
|
|
3210
2940
|
// @ts-ignore
|
|
2941
|
+
// @ts-ignore
|
|
2942
|
+
// @ts-ignore
|
|
3211
2943
|
type PlaywrightConfig = {
|
|
3212
2944
|
url?: string;
|
|
3213
2945
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6590,6 +6322,8 @@ declare namespace CodeceptJS {
|
|
|
6590
6322
|
// @ts-ignore
|
|
6591
6323
|
// @ts-ignore
|
|
6592
6324
|
// @ts-ignore
|
|
6325
|
+
// @ts-ignore
|
|
6326
|
+
// @ts-ignore
|
|
6593
6327
|
type PuppeteerConfig = {
|
|
6594
6328
|
url: string;
|
|
6595
6329
|
basicAuth?: any;
|
|
@@ -8402,6 +8136,8 @@ declare namespace CodeceptJS {
|
|
|
8402
8136
|
// @ts-ignore
|
|
8403
8137
|
// @ts-ignore
|
|
8404
8138
|
// @ts-ignore
|
|
8139
|
+
// @ts-ignore
|
|
8140
|
+
// @ts-ignore
|
|
8405
8141
|
type RESTConfig = {
|
|
8406
8142
|
endpoint?: string;
|
|
8407
8143
|
prettyPrintJson?: boolean;
|
|
@@ -8594,250 +8330,6 @@ declare namespace CodeceptJS {
|
|
|
8594
8330
|
*/
|
|
8595
8331
|
sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
|
|
8596
8332
|
}
|
|
8597
|
-
/**
|
|
8598
|
-
* SoftAssertHelper is a utility class for performing soft assertions.
|
|
8599
|
-
* Unlike traditional assertions that stop the execution on failure,
|
|
8600
|
-
* soft assertions allow the execution to continue and report all failures at the end.
|
|
8601
|
-
*
|
|
8602
|
-
* ### Examples
|
|
8603
|
-
*
|
|
8604
|
-
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
8605
|
-
*
|
|
8606
|
-
* ```js
|
|
8607
|
-
* // inside codecept.conf.js
|
|
8608
|
-
* {
|
|
8609
|
-
* helpers: {
|
|
8610
|
-
* Playwright: {...},
|
|
8611
|
-
* SoftExpectHelper: {},
|
|
8612
|
-
* }
|
|
8613
|
-
* }
|
|
8614
|
-
* ```
|
|
8615
|
-
*
|
|
8616
|
-
* ```js
|
|
8617
|
-
* // in scenario
|
|
8618
|
-
* I.softExpectEqual('a', 'b')
|
|
8619
|
-
* I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
|
|
8620
|
-
* ```
|
|
8621
|
-
*
|
|
8622
|
-
* ## Methods
|
|
8623
|
-
*/
|
|
8624
|
-
class SoftAssertHelperTs {
|
|
8625
|
-
/**
|
|
8626
|
-
* Performs a soft assertion by executing the provided assertion function.
|
|
8627
|
-
* If the assertion fails, the error is caught and stored without halting the execution.
|
|
8628
|
-
* @param assertionFn - The assertion function to execute.
|
|
8629
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8630
|
-
*/
|
|
8631
|
-
softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): Promise<any>;
|
|
8632
|
-
/**
|
|
8633
|
-
* Throws an error if any soft assertions have failed.
|
|
8634
|
-
* The error message contains all the accumulated failures.
|
|
8635
|
-
*/
|
|
8636
|
-
flushSoftAssertions(): Promise<any>;
|
|
8637
|
-
/**
|
|
8638
|
-
* Softly asserts that two values are equal.
|
|
8639
|
-
* @param actualValue - The actual value.
|
|
8640
|
-
* @param expectedValue - The expected value.
|
|
8641
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8642
|
-
*/
|
|
8643
|
-
softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8644
|
-
/**
|
|
8645
|
-
* Softly asserts that two values are not 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
|
-
softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8651
|
-
/**
|
|
8652
|
-
* Softly asserts that two values are deeply 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
|
-
softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8658
|
-
/**
|
|
8659
|
-
* Softly asserts that two values are not 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
|
-
softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8665
|
-
/**
|
|
8666
|
-
* Softly asserts that a value contains the expected value.
|
|
8667
|
-
* @param actualValue - The actual value.
|
|
8668
|
-
* @param expectedValueToContain - The value that should be contained within the actual value.
|
|
8669
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8670
|
-
*/
|
|
8671
|
-
softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): Promise<any>;
|
|
8672
|
-
/**
|
|
8673
|
-
* Softly asserts that a value does not contain the expected value.
|
|
8674
|
-
* @param actualValue - The actual value.
|
|
8675
|
-
* @param expectedValueToNotContain - The value that should not be contained within the actual value.
|
|
8676
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8677
|
-
*/
|
|
8678
|
-
softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): Promise<any>;
|
|
8679
|
-
/**
|
|
8680
|
-
* Softly asserts that a value starts with the expected value.
|
|
8681
|
-
* @param actualValue - The actual value.
|
|
8682
|
-
* @param expectedValueToStartWith - The value that the actual value should start with.
|
|
8683
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8684
|
-
*/
|
|
8685
|
-
softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): Promise<any>;
|
|
8686
|
-
/**
|
|
8687
|
-
* Softly asserts that a value does not start with the expected value.
|
|
8688
|
-
* @param actualValue - The actual value.
|
|
8689
|
-
* @param expectedValueToNotStartWith - The value that the actual value should not start with.
|
|
8690
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8691
|
-
*/
|
|
8692
|
-
softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): Promise<any>;
|
|
8693
|
-
/**
|
|
8694
|
-
* Softly asserts that a value ends with the expected value.
|
|
8695
|
-
* @param actualValue - The actual value.
|
|
8696
|
-
* @param expectedValueToEndWith - The value that the actual value should end with.
|
|
8697
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8698
|
-
*/
|
|
8699
|
-
softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): Promise<any>;
|
|
8700
|
-
/**
|
|
8701
|
-
* Softly asserts that a value does not end with the expected value.
|
|
8702
|
-
* @param actualValue - The actual value.
|
|
8703
|
-
* @param expectedValueToNotEndWith - The value that the actual value should not end with.
|
|
8704
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8705
|
-
*/
|
|
8706
|
-
softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): Promise<any>;
|
|
8707
|
-
/**
|
|
8708
|
-
* Softly asserts that the target data matches the given JSON schema.
|
|
8709
|
-
* @param targetData - The data to validate.
|
|
8710
|
-
* @param jsonSchema - The JSON schema to validate against.
|
|
8711
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8712
|
-
*/
|
|
8713
|
-
softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): Promise<any>;
|
|
8714
|
-
/**
|
|
8715
|
-
* Softly asserts that the target data matches the given JSON schema using AJV.
|
|
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
|
-
* @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
|
|
8720
|
-
*/
|
|
8721
|
-
softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): Promise<any>;
|
|
8722
|
-
/**
|
|
8723
|
-
* Softly asserts that the target data has the specified property.
|
|
8724
|
-
* @param targetData - The data to check.
|
|
8725
|
-
* @param propertyName - The property name to check for.
|
|
8726
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion
|
|
8727
|
-
* fails.
|
|
8728
|
-
*/
|
|
8729
|
-
softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
|
|
8730
|
-
/**
|
|
8731
|
-
* Softly asserts that the target data has a property with the specified name.
|
|
8732
|
-
* @param targetData - The data to check.
|
|
8733
|
-
* @param propertyName - The property name to check for.
|
|
8734
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8735
|
-
*/
|
|
8736
|
-
softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
|
|
8737
|
-
/**
|
|
8738
|
-
* Softly asserts that the target data is of a specific type.
|
|
8739
|
-
* @param targetData - The data to check.
|
|
8740
|
-
* @param type - The expected type (e.g., 'string', 'number').
|
|
8741
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8742
|
-
*/
|
|
8743
|
-
softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
|
|
8744
|
-
/**
|
|
8745
|
-
* Softly asserts that the target data is of a specific type (alternative for articles).
|
|
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
|
-
softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
|
|
8751
|
-
/**
|
|
8752
|
-
* Softly asserts that the target data has a specified length.
|
|
8753
|
-
* @param targetData - The data to check.
|
|
8754
|
-
* @param length - The expected length.
|
|
8755
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8756
|
-
*/
|
|
8757
|
-
softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): Promise<any>;
|
|
8758
|
-
/**
|
|
8759
|
-
* Softly asserts that the target data is empty.
|
|
8760
|
-
* @param targetData - The data to check.
|
|
8761
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8762
|
-
*/
|
|
8763
|
-
softExpectEmpty(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8764
|
-
/**
|
|
8765
|
-
* Softly asserts that the target data is true.
|
|
8766
|
-
* @param targetData - The data to check.
|
|
8767
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8768
|
-
*/
|
|
8769
|
-
softExpectTrue(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8770
|
-
/**
|
|
8771
|
-
* Softly asserts that the target data is false.
|
|
8772
|
-
* @param targetData - The data to check.
|
|
8773
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8774
|
-
*/
|
|
8775
|
-
softExpectFalse(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8776
|
-
/**
|
|
8777
|
-
* Softly asserts that the target data is above a specified value.
|
|
8778
|
-
* @param targetData - The data to check.
|
|
8779
|
-
* @param aboveThan - The value that the target data should be above.
|
|
8780
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8781
|
-
*/
|
|
8782
|
-
softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): Promise<any>;
|
|
8783
|
-
/**
|
|
8784
|
-
* Softly asserts that the target data is below a specified value.
|
|
8785
|
-
* @param targetData - The data to check.
|
|
8786
|
-
* @param belowThan - The value that the target data should be below.
|
|
8787
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8788
|
-
*/
|
|
8789
|
-
softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): Promise<any>;
|
|
8790
|
-
/**
|
|
8791
|
-
* Softly asserts that the length of the target data is above a specified value.
|
|
8792
|
-
* @param targetData - The data to check.
|
|
8793
|
-
* @param lengthAboveThan - The length that the target data should be above.
|
|
8794
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8795
|
-
*/
|
|
8796
|
-
softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): Promise<any>;
|
|
8797
|
-
/**
|
|
8798
|
-
* Softly asserts that the length of the target data is below a specified value.
|
|
8799
|
-
* @param targetData - The data to check.
|
|
8800
|
-
* @param lengthBelowThan - The length that the target data should be below.
|
|
8801
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8802
|
-
*/
|
|
8803
|
-
softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): Promise<any>;
|
|
8804
|
-
/**
|
|
8805
|
-
* Softly asserts that two values are equal, ignoring case.
|
|
8806
|
-
* @param actualValue - The actual string value.
|
|
8807
|
-
* @param expectedValue - The expected string value.
|
|
8808
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8809
|
-
*/
|
|
8810
|
-
softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): Promise<any>;
|
|
8811
|
-
/**
|
|
8812
|
-
* Softly asserts that two arrays have deep equality, considering members in any order.
|
|
8813
|
-
* @param actualValue - The actual array.
|
|
8814
|
-
* @param expectedValue - The expected array.
|
|
8815
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8816
|
-
*/
|
|
8817
|
-
softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): Promise<any>;
|
|
8818
|
-
/**
|
|
8819
|
-
* Softly asserts that an array (superset) deeply includes all members of another array (set).
|
|
8820
|
-
* @param superset - The array that should contain the expected members.
|
|
8821
|
-
* @param set - The array with members that should be included.
|
|
8822
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8823
|
-
*/
|
|
8824
|
-
softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): Promise<any>;
|
|
8825
|
-
/**
|
|
8826
|
-
* Softly asserts that two objects are deeply equal, excluding specified fields.
|
|
8827
|
-
* @param actualValue - The actual object.
|
|
8828
|
-
* @param expectedValue - The expected object.
|
|
8829
|
-
* @param fieldsToExclude - The fields to exclude from the comparison.
|
|
8830
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8831
|
-
*/
|
|
8832
|
-
softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): Promise<any>;
|
|
8833
|
-
/**
|
|
8834
|
-
* Softly asserts that a value matches the expected pattern.
|
|
8835
|
-
* @param actualValue - The actual value.
|
|
8836
|
-
* @param expectedPattern - The pattern the value should match.
|
|
8837
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8838
|
-
*/
|
|
8839
|
-
softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): Promise<any>;
|
|
8840
|
-
}
|
|
8841
8333
|
/**
|
|
8842
8334
|
* Client Functions
|
|
8843
8335
|
*/
|
|
@@ -9796,6 +9288,8 @@ declare namespace CodeceptJS {
|
|
|
9796
9288
|
// @ts-ignore
|
|
9797
9289
|
// @ts-ignore
|
|
9798
9290
|
// @ts-ignore
|
|
9291
|
+
// @ts-ignore
|
|
9292
|
+
// @ts-ignore
|
|
9799
9293
|
type WebDriverConfig = {
|
|
9800
9294
|
url: string;
|
|
9801
9295
|
browser: string;
|