codeceptjs 3.7.0-beta.6 → 3.7.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- 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/helper/Appium.js +4 -6
- package/lib/helper/WebDriver.js +20 -7
- 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/pause.js +0 -3
- 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 +12 -12
- package/typings/promiseBasedTypes.d.ts +6 -520
- package/typings/types.d.ts +115 -562
- package/lib/listener/artifacts.js +0 -19
- package/lib/plugin/debugErrors.js +0 -67
package/typings/types.d.ts
CHANGED
|
@@ -1203,242 +1203,6 @@ 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
|
-
class ExpectHelper {
|
|
1233
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1234
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1235
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1236
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1237
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1238
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1239
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1240
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1241
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1242
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1243
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1244
|
-
/**
|
|
1245
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1246
|
-
*/
|
|
1247
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1248
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1249
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1250
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1251
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1252
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1253
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1254
|
-
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1255
|
-
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1256
|
-
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1257
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1258
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1259
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1260
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1261
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1262
|
-
/**
|
|
1263
|
-
* expects members of two arrays are deeply equal
|
|
1264
|
-
*/
|
|
1265
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1266
|
-
/**
|
|
1267
|
-
* expects an array to be a superset of another array
|
|
1268
|
-
*/
|
|
1269
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1270
|
-
/**
|
|
1271
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1272
|
-
*/
|
|
1273
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1274
|
-
/**
|
|
1275
|
-
* expects a JSON object matches a provided pattern
|
|
1276
|
-
*/
|
|
1277
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1278
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1279
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1280
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1281
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1282
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1283
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1284
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1285
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1286
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1287
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1288
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1289
|
-
/**
|
|
1290
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1291
|
-
*/
|
|
1292
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1293
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1294
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1295
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1296
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1297
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1298
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1299
|
-
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1300
|
-
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1301
|
-
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1302
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1303
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1304
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1305
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1306
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1307
|
-
/**
|
|
1308
|
-
* expects members of two arrays are deeply equal
|
|
1309
|
-
*/
|
|
1310
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1311
|
-
/**
|
|
1312
|
-
* expects an array to be a superset of another array
|
|
1313
|
-
*/
|
|
1314
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1315
|
-
/**
|
|
1316
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1317
|
-
*/
|
|
1318
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1319
|
-
/**
|
|
1320
|
-
* expects a JSON object matches a provided pattern
|
|
1321
|
-
*/
|
|
1322
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1323
|
-
}
|
|
1324
|
-
/**
|
|
1325
|
-
* This helper allows performing assertions based on Chai.
|
|
1326
|
-
*
|
|
1327
|
-
* ### Examples
|
|
1328
|
-
*
|
|
1329
|
-
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
1330
|
-
*
|
|
1331
|
-
* ```js
|
|
1332
|
-
* // inside codecept.conf.js
|
|
1333
|
-
* {
|
|
1334
|
-
* helpers: {
|
|
1335
|
-
* Playwright: {...},
|
|
1336
|
-
* ExpectHelper: {},
|
|
1337
|
-
* }
|
|
1338
|
-
* }
|
|
1339
|
-
* ```
|
|
1340
|
-
*
|
|
1341
|
-
* ## Methods
|
|
1342
|
-
*/
|
|
1343
|
-
// @ts-ignore
|
|
1344
|
-
// @ts-ignore
|
|
1345
|
-
// @ts-ignore
|
|
1346
|
-
// @ts-ignore
|
|
1347
|
-
// @ts-ignore
|
|
1348
|
-
// @ts-ignore
|
|
1349
|
-
// @ts-ignore
|
|
1350
|
-
class ExpectHelper {
|
|
1351
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1352
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1353
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1354
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1355
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1356
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1357
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1358
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1359
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1360
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1361
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1362
|
-
/**
|
|
1363
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1364
|
-
*/
|
|
1365
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1366
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1367
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1368
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1369
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1370
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1371
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1372
|
-
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1373
|
-
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1374
|
-
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1375
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1376
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1377
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1378
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1379
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1380
|
-
/**
|
|
1381
|
-
* expects members of two arrays are deeply equal
|
|
1382
|
-
*/
|
|
1383
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1384
|
-
/**
|
|
1385
|
-
* expects an array to be a superset of another array
|
|
1386
|
-
*/
|
|
1387
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1388
|
-
/**
|
|
1389
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1390
|
-
*/
|
|
1391
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1392
|
-
/**
|
|
1393
|
-
* expects a JSON object matches a provided pattern
|
|
1394
|
-
*/
|
|
1395
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1396
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1397
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1398
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1399
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1400
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1401
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1402
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1403
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1404
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1405
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1406
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1407
|
-
/**
|
|
1408
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1409
|
-
*/
|
|
1410
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1411
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1412
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1413
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1414
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1415
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1416
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1417
|
-
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1418
|
-
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1419
|
-
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1420
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1421
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1422
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1423
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1424
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1425
|
-
/**
|
|
1426
|
-
* expects members of two arrays are deeply equal
|
|
1427
|
-
*/
|
|
1428
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1429
|
-
/**
|
|
1430
|
-
* expects an array to be a superset of another array
|
|
1431
|
-
*/
|
|
1432
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1433
|
-
/**
|
|
1434
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1435
|
-
*/
|
|
1436
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1437
|
-
/**
|
|
1438
|
-
* expects a JSON object matches a provided pattern
|
|
1439
|
-
*/
|
|
1440
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1441
|
-
}
|
|
1442
1206
|
/**
|
|
1443
1207
|
* Helper for testing filesystem.
|
|
1444
1208
|
* Can be easily used to check file structures:
|
|
@@ -2029,6 +1793,7 @@ declare namespace CodeceptJS {
|
|
|
2029
1793
|
// @ts-ignore
|
|
2030
1794
|
// @ts-ignore
|
|
2031
1795
|
// @ts-ignore
|
|
1796
|
+
// @ts-ignore
|
|
2032
1797
|
type MockServerConfig = {
|
|
2033
1798
|
port?: number;
|
|
2034
1799
|
host?: string;
|
|
@@ -2160,6 +1925,7 @@ declare namespace CodeceptJS {
|
|
|
2160
1925
|
// @ts-ignore
|
|
2161
1926
|
// @ts-ignore
|
|
2162
1927
|
// @ts-ignore
|
|
1928
|
+
// @ts-ignore
|
|
2163
1929
|
class MockServer {
|
|
2164
1930
|
/**
|
|
2165
1931
|
* Start the mock server
|
|
@@ -3215,46 +2981,6 @@ declare namespace CodeceptJS {
|
|
|
3215
2981
|
*/
|
|
3216
2982
|
grabPageScrollPosition(): Promise<PageScrollPosition>;
|
|
3217
2983
|
}
|
|
3218
|
-
/**
|
|
3219
|
-
* OpenAI Helper for CodeceptJS.
|
|
3220
|
-
*
|
|
3221
|
-
* 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.
|
|
3222
|
-
* This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
|
|
3223
|
-
*
|
|
3224
|
-
* ## Configuration
|
|
3225
|
-
*
|
|
3226
|
-
* This helper should be configured in codecept.json or codecept.conf.js
|
|
3227
|
-
*
|
|
3228
|
-
* * `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.
|
|
3229
|
-
*/
|
|
3230
|
-
class OpenAI {
|
|
3231
|
-
/**
|
|
3232
|
-
* Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
|
|
3233
|
-
*
|
|
3234
|
-
* ```js
|
|
3235
|
-
* I.askGptOnPage('what does this page do?');
|
|
3236
|
-
* ```
|
|
3237
|
-
* @param prompt - The question or prompt to ask the GPT model.
|
|
3238
|
-
* @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
|
|
3239
|
-
*/
|
|
3240
|
-
askGptOnPage(prompt: string): Promise<string>;
|
|
3241
|
-
/**
|
|
3242
|
-
* 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.
|
|
3243
|
-
*
|
|
3244
|
-
* ```js
|
|
3245
|
-
* I.askGptOnPageFragment('describe features of this screen', '.screen');
|
|
3246
|
-
* ```
|
|
3247
|
-
* @param prompt - The question or prompt to ask the GPT-3.5 model.
|
|
3248
|
-
* @param locator - The locator or selector used to identify the HTML fragment on the page.
|
|
3249
|
-
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
3250
|
-
*/
|
|
3251
|
-
askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
|
|
3252
|
-
/**
|
|
3253
|
-
* Send a general request to ChatGPT and return response.
|
|
3254
|
-
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
3255
|
-
*/
|
|
3256
|
-
askGptGeneralPrompt(prompt: string): Promise<string>;
|
|
3257
|
-
}
|
|
3258
2984
|
/**
|
|
3259
2985
|
* ## Configuration
|
|
3260
2986
|
*
|
|
@@ -3306,6 +3032,7 @@ declare namespace CodeceptJS {
|
|
|
3306
3032
|
// @ts-ignore
|
|
3307
3033
|
// @ts-ignore
|
|
3308
3034
|
// @ts-ignore
|
|
3035
|
+
// @ts-ignore
|
|
3309
3036
|
type PlaywrightConfig = {
|
|
3310
3037
|
url?: string;
|
|
3311
3038
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6840,6 +6567,7 @@ declare namespace CodeceptJS {
|
|
|
6840
6567
|
// @ts-ignore
|
|
6841
6568
|
// @ts-ignore
|
|
6842
6569
|
// @ts-ignore
|
|
6570
|
+
// @ts-ignore
|
|
6843
6571
|
type PuppeteerConfig = {
|
|
6844
6572
|
url: string;
|
|
6845
6573
|
basicAuth?: any;
|
|
@@ -8789,6 +8517,7 @@ declare namespace CodeceptJS {
|
|
|
8789
8517
|
// @ts-ignore
|
|
8790
8518
|
// @ts-ignore
|
|
8791
8519
|
// @ts-ignore
|
|
8520
|
+
// @ts-ignore
|
|
8792
8521
|
type RESTConfig = {
|
|
8793
8522
|
endpoint?: string;
|
|
8794
8523
|
prettyPrintJson?: boolean;
|
|
@@ -8981,250 +8710,6 @@ declare namespace CodeceptJS {
|
|
|
8981
8710
|
*/
|
|
8982
8711
|
sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
|
|
8983
8712
|
}
|
|
8984
|
-
/**
|
|
8985
|
-
* SoftAssertHelper is a utility class for performing soft assertions.
|
|
8986
|
-
* Unlike traditional assertions that stop the execution on failure,
|
|
8987
|
-
* soft assertions allow the execution to continue and report all failures at the end.
|
|
8988
|
-
*
|
|
8989
|
-
* ### Examples
|
|
8990
|
-
*
|
|
8991
|
-
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
8992
|
-
*
|
|
8993
|
-
* ```js
|
|
8994
|
-
* // inside codecept.conf.js
|
|
8995
|
-
* {
|
|
8996
|
-
* helpers: {
|
|
8997
|
-
* Playwright: {...},
|
|
8998
|
-
* SoftExpectHelper: {},
|
|
8999
|
-
* }
|
|
9000
|
-
* }
|
|
9001
|
-
* ```
|
|
9002
|
-
*
|
|
9003
|
-
* ```js
|
|
9004
|
-
* // in scenario
|
|
9005
|
-
* I.softExpectEqual('a', 'b')
|
|
9006
|
-
* I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
|
|
9007
|
-
* ```
|
|
9008
|
-
*
|
|
9009
|
-
* ## Methods
|
|
9010
|
-
*/
|
|
9011
|
-
class SoftAssertHelper {
|
|
9012
|
-
/**
|
|
9013
|
-
* Performs a soft assertion by executing the provided assertion function.
|
|
9014
|
-
* If the assertion fails, the error is caught and stored without halting the execution.
|
|
9015
|
-
* @param assertionFn - The assertion function to execute.
|
|
9016
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9017
|
-
*/
|
|
9018
|
-
softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): void;
|
|
9019
|
-
/**
|
|
9020
|
-
* Throws an error if any soft assertions have failed.
|
|
9021
|
-
* The error message contains all the accumulated failures.
|
|
9022
|
-
*/
|
|
9023
|
-
flushSoftAssertions(): void;
|
|
9024
|
-
/**
|
|
9025
|
-
* Softly asserts that two values are equal.
|
|
9026
|
-
* @param actualValue - The actual value.
|
|
9027
|
-
* @param expectedValue - The expected value.
|
|
9028
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9029
|
-
*/
|
|
9030
|
-
softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
9031
|
-
/**
|
|
9032
|
-
* Softly asserts that two values are not equal.
|
|
9033
|
-
* @param actualValue - The actual value.
|
|
9034
|
-
* @param expectedValue - The expected value.
|
|
9035
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9036
|
-
*/
|
|
9037
|
-
softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
9038
|
-
/**
|
|
9039
|
-
* Softly asserts that two values are deeply equal.
|
|
9040
|
-
* @param actualValue - The actual value.
|
|
9041
|
-
* @param expectedValue - The expected value.
|
|
9042
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9043
|
-
*/
|
|
9044
|
-
softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
9045
|
-
/**
|
|
9046
|
-
* Softly asserts that two values are not deeply equal.
|
|
9047
|
-
* @param actualValue - The actual value.
|
|
9048
|
-
* @param expectedValue - The expected value.
|
|
9049
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9050
|
-
*/
|
|
9051
|
-
softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
9052
|
-
/**
|
|
9053
|
-
* Softly asserts that a value contains the expected value.
|
|
9054
|
-
* @param actualValue - The actual value.
|
|
9055
|
-
* @param expectedValueToContain - The value that should be contained within the actual value.
|
|
9056
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9057
|
-
*/
|
|
9058
|
-
softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): void;
|
|
9059
|
-
/**
|
|
9060
|
-
* Softly asserts that a value does not contain the expected value.
|
|
9061
|
-
* @param actualValue - The actual value.
|
|
9062
|
-
* @param expectedValueToNotContain - The value that should not be contained within the actual value.
|
|
9063
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9064
|
-
*/
|
|
9065
|
-
softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): void;
|
|
9066
|
-
/**
|
|
9067
|
-
* Softly asserts that a value starts with the expected value.
|
|
9068
|
-
* @param actualValue - The actual value.
|
|
9069
|
-
* @param expectedValueToStartWith - The value that the actual value should start with.
|
|
9070
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9071
|
-
*/
|
|
9072
|
-
softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): void;
|
|
9073
|
-
/**
|
|
9074
|
-
* Softly asserts that a value does not start with the expected value.
|
|
9075
|
-
* @param actualValue - The actual value.
|
|
9076
|
-
* @param expectedValueToNotStartWith - The value that the actual value should not start with.
|
|
9077
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9078
|
-
*/
|
|
9079
|
-
softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): void;
|
|
9080
|
-
/**
|
|
9081
|
-
* Softly asserts that a value ends with the expected value.
|
|
9082
|
-
* @param actualValue - The actual value.
|
|
9083
|
-
* @param expectedValueToEndWith - The value that the actual value should end with.
|
|
9084
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9085
|
-
*/
|
|
9086
|
-
softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): void;
|
|
9087
|
-
/**
|
|
9088
|
-
* Softly asserts that a value does not end with the expected value.
|
|
9089
|
-
* @param actualValue - The actual value.
|
|
9090
|
-
* @param expectedValueToNotEndWith - The value that the actual value should not end with.
|
|
9091
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9092
|
-
*/
|
|
9093
|
-
softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): void;
|
|
9094
|
-
/**
|
|
9095
|
-
* Softly asserts that the target data matches the given JSON schema.
|
|
9096
|
-
* @param targetData - The data to validate.
|
|
9097
|
-
* @param jsonSchema - The JSON schema to validate against.
|
|
9098
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9099
|
-
*/
|
|
9100
|
-
softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): void;
|
|
9101
|
-
/**
|
|
9102
|
-
* Softly asserts that the target data matches the given JSON schema using AJV.
|
|
9103
|
-
* @param targetData - The data to validate.
|
|
9104
|
-
* @param jsonSchema - The JSON schema to validate against.
|
|
9105
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9106
|
-
* @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
|
|
9107
|
-
*/
|
|
9108
|
-
softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): void;
|
|
9109
|
-
/**
|
|
9110
|
-
* Softly asserts that the target data has the specified property.
|
|
9111
|
-
* @param targetData - The data to check.
|
|
9112
|
-
* @param propertyName - The property name to check for.
|
|
9113
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion
|
|
9114
|
-
* fails.
|
|
9115
|
-
*/
|
|
9116
|
-
softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): void;
|
|
9117
|
-
/**
|
|
9118
|
-
* Softly asserts that the target data has a property with the specified name.
|
|
9119
|
-
* @param targetData - The data to check.
|
|
9120
|
-
* @param propertyName - The property name to check for.
|
|
9121
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9122
|
-
*/
|
|
9123
|
-
softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): void;
|
|
9124
|
-
/**
|
|
9125
|
-
* Softly asserts that the target data is of a specific type.
|
|
9126
|
-
* @param targetData - The data to check.
|
|
9127
|
-
* @param type - The expected type (e.g., 'string', 'number').
|
|
9128
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9129
|
-
*/
|
|
9130
|
-
softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): void;
|
|
9131
|
-
/**
|
|
9132
|
-
* Softly asserts that the target data is of a specific type (alternative for articles).
|
|
9133
|
-
* @param targetData - The data to check.
|
|
9134
|
-
* @param type - The expected type (e.g., 'string', 'number').
|
|
9135
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9136
|
-
*/
|
|
9137
|
-
softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): void;
|
|
9138
|
-
/**
|
|
9139
|
-
* Softly asserts that the target data has a specified length.
|
|
9140
|
-
* @param targetData - The data to check.
|
|
9141
|
-
* @param length - The expected length.
|
|
9142
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9143
|
-
*/
|
|
9144
|
-
softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): void;
|
|
9145
|
-
/**
|
|
9146
|
-
* Softly asserts that the target data is empty.
|
|
9147
|
-
* @param targetData - The data to check.
|
|
9148
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9149
|
-
*/
|
|
9150
|
-
softExpectEmpty(targetData: any, customErrorMsg?: string): void;
|
|
9151
|
-
/**
|
|
9152
|
-
* Softly asserts that the target data is true.
|
|
9153
|
-
* @param targetData - The data to check.
|
|
9154
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9155
|
-
*/
|
|
9156
|
-
softExpectTrue(targetData: any, customErrorMsg?: string): void;
|
|
9157
|
-
/**
|
|
9158
|
-
* Softly asserts that the target data is false.
|
|
9159
|
-
* @param targetData - The data to check.
|
|
9160
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9161
|
-
*/
|
|
9162
|
-
softExpectFalse(targetData: any, customErrorMsg?: string): void;
|
|
9163
|
-
/**
|
|
9164
|
-
* Softly asserts that the target data is above a specified value.
|
|
9165
|
-
* @param targetData - The data to check.
|
|
9166
|
-
* @param aboveThan - The value that the target data should be above.
|
|
9167
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9168
|
-
*/
|
|
9169
|
-
softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): void;
|
|
9170
|
-
/**
|
|
9171
|
-
* Softly asserts that the target data is below a specified value.
|
|
9172
|
-
* @param targetData - The data to check.
|
|
9173
|
-
* @param belowThan - The value that the target data should be below.
|
|
9174
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9175
|
-
*/
|
|
9176
|
-
softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): void;
|
|
9177
|
-
/**
|
|
9178
|
-
* Softly asserts that the length of the target data is above a specified value.
|
|
9179
|
-
* @param targetData - The data to check.
|
|
9180
|
-
* @param lengthAboveThan - The length that the target data should be above.
|
|
9181
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9182
|
-
*/
|
|
9183
|
-
softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): void;
|
|
9184
|
-
/**
|
|
9185
|
-
* Softly asserts that the length of the target data is below a specified value.
|
|
9186
|
-
* @param targetData - The data to check.
|
|
9187
|
-
* @param lengthBelowThan - The length that the target data should be below.
|
|
9188
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9189
|
-
*/
|
|
9190
|
-
softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): void;
|
|
9191
|
-
/**
|
|
9192
|
-
* Softly asserts that two values are equal, ignoring case.
|
|
9193
|
-
* @param actualValue - The actual string value.
|
|
9194
|
-
* @param expectedValue - The expected string value.
|
|
9195
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9196
|
-
*/
|
|
9197
|
-
softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): void;
|
|
9198
|
-
/**
|
|
9199
|
-
* Softly asserts that two arrays have deep equality, considering members in any order.
|
|
9200
|
-
* @param actualValue - The actual array.
|
|
9201
|
-
* @param expectedValue - The expected array.
|
|
9202
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9203
|
-
*/
|
|
9204
|
-
softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): void;
|
|
9205
|
-
/**
|
|
9206
|
-
* Softly asserts that an array (superset) deeply includes all members of another array (set).
|
|
9207
|
-
* @param superset - The array that should contain the expected members.
|
|
9208
|
-
* @param set - The array with members that should be included.
|
|
9209
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9210
|
-
*/
|
|
9211
|
-
softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): void;
|
|
9212
|
-
/**
|
|
9213
|
-
* Softly asserts that two objects are deeply equal, excluding specified fields.
|
|
9214
|
-
* @param actualValue - The actual object.
|
|
9215
|
-
* @param expectedValue - The expected object.
|
|
9216
|
-
* @param fieldsToExclude - The fields to exclude from the comparison.
|
|
9217
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9218
|
-
*/
|
|
9219
|
-
softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): void;
|
|
9220
|
-
/**
|
|
9221
|
-
* Softly asserts that a value matches the expected pattern.
|
|
9222
|
-
* @param actualValue - The actual value.
|
|
9223
|
-
* @param expectedPattern - The pattern the value should match.
|
|
9224
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9225
|
-
*/
|
|
9226
|
-
softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): void;
|
|
9227
|
-
}
|
|
9228
8713
|
/**
|
|
9229
8714
|
* Client Functions
|
|
9230
8715
|
*/
|
|
@@ -10244,6 +9729,7 @@ declare namespace CodeceptJS {
|
|
|
10244
9729
|
// @ts-ignore
|
|
10245
9730
|
// @ts-ignore
|
|
10246
9731
|
// @ts-ignore
|
|
9732
|
+
// @ts-ignore
|
|
10247
9733
|
type WebDriverConfig = {
|
|
10248
9734
|
url: string;
|
|
10249
9735
|
browser: string;
|
|
@@ -12302,6 +11788,25 @@ declare namespace CodeceptJS {
|
|
|
12302
11788
|
[key: string]: any;
|
|
12303
11789
|
};
|
|
12304
11790
|
}
|
|
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
|
+
}
|
|
12305
11810
|
/**
|
|
12306
11811
|
* Dependency Injection Container
|
|
12307
11812
|
*/
|
|
@@ -12330,6 +11835,10 @@ declare namespace CodeceptJS {
|
|
|
12330
11835
|
* Get Mocha instance
|
|
12331
11836
|
*/
|
|
12332
11837
|
static mocha(): any;
|
|
11838
|
+
/**
|
|
11839
|
+
* Get result
|
|
11840
|
+
*/
|
|
11841
|
+
static result(): Result;
|
|
12333
11842
|
/**
|
|
12334
11843
|
* Append new services to container
|
|
12335
11844
|
*/
|
|
@@ -12346,7 +11855,7 @@ declare namespace CodeceptJS {
|
|
|
12346
11855
|
}, newPlugins: {
|
|
12347
11856
|
[key: string]: any;
|
|
12348
11857
|
}): void;
|
|
12349
|
-
static started(fn: (
|
|
11858
|
+
static started(fn: (...params: any[]) => any): Promise<void>;
|
|
12350
11859
|
/**
|
|
12351
11860
|
* Share data across worker threads
|
|
12352
11861
|
* @param options - set {local: true} to not share among workers
|
|
@@ -12603,20 +12112,6 @@ declare namespace CodeceptJS {
|
|
|
12603
12112
|
function pause(passedObject?: {
|
|
12604
12113
|
[key: string]: any;
|
|
12605
12114
|
}): void;
|
|
12606
|
-
/**
|
|
12607
|
-
* Creates a debug logger for a given namespace and optionally logs messages.
|
|
12608
|
-
* @example
|
|
12609
|
-
* // Log a message immediately
|
|
12610
|
-
* debugLog('codeceptjs:pause', 'This is a pause debug message.');
|
|
12611
|
-
* @example
|
|
12612
|
-
* // Create a reusable logger
|
|
12613
|
-
* const logger = debugLog('app:module');
|
|
12614
|
-
* logger('This is a reusable log for app:module.');
|
|
12615
|
-
* @param namespace - The namespace to use for the debug logger.
|
|
12616
|
-
* @param args - Additional arguments to log immediately.
|
|
12617
|
-
* @returns The debug logger instance for the given namespace.
|
|
12618
|
-
*/
|
|
12619
|
-
function debugLog(namespace: string, ...args: any[]): (...params: any[]) => any;
|
|
12620
12115
|
/**
|
|
12621
12116
|
* Singleton object to record all test steps as promises and run them in chain.
|
|
12622
12117
|
*/
|
|
@@ -12693,24 +12188,49 @@ declare namespace CodeceptJS {
|
|
|
12693
12188
|
function session(sessionName: CodeceptJS.LocatorOrString, config: ((...params: any[]) => any) | {
|
|
12694
12189
|
[key: string]: any;
|
|
12695
12190
|
}, fn?: (...params: any[]) => any): any;
|
|
12191
|
+
/**
|
|
12192
|
+
* StepConfig is a configuration object for a step.
|
|
12193
|
+
* It is used to create a new step that is a combination of other steps.
|
|
12194
|
+
*/
|
|
12195
|
+
class StepConfig {
|
|
12196
|
+
config: any;
|
|
12197
|
+
/**
|
|
12198
|
+
* Set the options for the step.
|
|
12199
|
+
* @param opts - The options for the step.
|
|
12200
|
+
* @returns - The step configuration object.
|
|
12201
|
+
*/
|
|
12202
|
+
opts(opts: any): StepConfig;
|
|
12203
|
+
/**
|
|
12204
|
+
* Set the timeout for the step.
|
|
12205
|
+
* @param timeout - The timeout for the step.
|
|
12206
|
+
* @returns - The step configuration object.
|
|
12207
|
+
*/
|
|
12208
|
+
timeout(timeout: number): StepConfig;
|
|
12209
|
+
/**
|
|
12210
|
+
* Set the retry for the step.
|
|
12211
|
+
* @param retry - The retry for the step.
|
|
12212
|
+
* @returns - The step configuration object.
|
|
12213
|
+
*/
|
|
12214
|
+
retry(retry: number): StepConfig;
|
|
12215
|
+
}
|
|
12696
12216
|
/**
|
|
12697
12217
|
* Each command in test executed through `I.` object is wrapped in Step.
|
|
12698
12218
|
* Step allows logging executed commands and triggers hook before and after step execution.
|
|
12699
12219
|
*/
|
|
12700
12220
|
class Step {
|
|
12701
|
-
constructor(
|
|
12702
|
-
actor: string;
|
|
12703
|
-
helper: CodeceptJS.Helper;
|
|
12221
|
+
constructor(name: string);
|
|
12704
12222
|
name: string;
|
|
12223
|
+
timeouts: Map<number, number>;
|
|
12224
|
+
args: any[];
|
|
12225
|
+
opts: Record<string, any>;
|
|
12226
|
+
actor: string;
|
|
12705
12227
|
helperMethod: string;
|
|
12706
12228
|
status: string;
|
|
12707
|
-
suffix: string;
|
|
12708
12229
|
prefix: string;
|
|
12709
12230
|
comment: string;
|
|
12710
|
-
|
|
12711
|
-
metaStep: MetaStep;
|
|
12231
|
+
metaStep: any;
|
|
12712
12232
|
stack: string;
|
|
12713
|
-
|
|
12233
|
+
timeout: any;
|
|
12714
12234
|
/**
|
|
12715
12235
|
* @param timeout - timeout in milliseconds or 0 if no timeout
|
|
12716
12236
|
* @param order - order defines the priority of timeout, timeouts set with lower order override those set with higher order.
|
|
@@ -12719,7 +12239,6 @@ declare namespace CodeceptJS {
|
|
|
12719
12239
|
setTimeout(timeout: number, order: number): void;
|
|
12720
12240
|
setTrace(): void;
|
|
12721
12241
|
setArguments(args: any[]): void;
|
|
12722
|
-
run(...args: any[]): any;
|
|
12723
12242
|
setStatus(status: string): void;
|
|
12724
12243
|
humanize(): string;
|
|
12725
12244
|
humanizeArgs(): string;
|
|
@@ -12728,11 +12247,6 @@ declare namespace CodeceptJS {
|
|
|
12728
12247
|
toCliStyled(): string;
|
|
12729
12248
|
toCode(): string;
|
|
12730
12249
|
hasBDDAncestor(): boolean;
|
|
12731
|
-
static MetaStep: typeof MetaStep;
|
|
12732
|
-
}
|
|
12733
|
-
class MetaStep extends Step {
|
|
12734
|
-
isBDD(): boolean;
|
|
12735
|
-
run(): any;
|
|
12736
12250
|
}
|
|
12737
12251
|
/**
|
|
12738
12252
|
* global values for current session
|
|
@@ -12743,6 +12257,7 @@ declare namespace CodeceptJS {
|
|
|
12743
12257
|
var dryRun: boolean;
|
|
12744
12258
|
var onPause: boolean;
|
|
12745
12259
|
var currentTest: CodeceptJS.Test | null;
|
|
12260
|
+
var currentStep: any;
|
|
12746
12261
|
}
|
|
12747
12262
|
/**
|
|
12748
12263
|
* Describe a "suite" with the given `title`
|
|
@@ -12769,6 +12284,10 @@ declare namespace CodeceptJS {
|
|
|
12769
12284
|
* Can inject values and add custom configuration.
|
|
12770
12285
|
*/
|
|
12771
12286
|
class FeatureConfig {
|
|
12287
|
+
/**
|
|
12288
|
+
* Set metadata for this suite
|
|
12289
|
+
*/
|
|
12290
|
+
meta(key: string, value: string): this;
|
|
12772
12291
|
/**
|
|
12773
12292
|
* Retry this test for number of times
|
|
12774
12293
|
*/
|
|
@@ -12803,6 +12322,10 @@ declare namespace CodeceptJS {
|
|
|
12803
12322
|
* Retry this test for x times
|
|
12804
12323
|
*/
|
|
12805
12324
|
retry(retries: number): this;
|
|
12325
|
+
/**
|
|
12326
|
+
* Set metadata for this test
|
|
12327
|
+
*/
|
|
12328
|
+
meta(key: string, value: string): this;
|
|
12806
12329
|
/**
|
|
12807
12330
|
* Set timeout for this test
|
|
12808
12331
|
*/
|
|
@@ -12834,6 +12357,46 @@ declare namespace CodeceptJS {
|
|
|
12834
12357
|
}): this;
|
|
12835
12358
|
}
|
|
12836
12359
|
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
|
+
}
|
|
12837
12400
|
function within(context: CodeceptJS.LocatorOrString, fn: (...params: any[]) => any): Promise<any> | undefined;
|
|
12838
12401
|
/**
|
|
12839
12402
|
* This is a wrapper on top of [Detox](https://github.com/wix/Detox) library, aimied to unify testing experience for CodeceptJS framework.
|
|
@@ -13435,22 +12998,12 @@ declare namespace CodeceptJS {
|
|
|
13435
12998
|
}
|
|
13436
12999
|
|
|
13437
13000
|
/**
|
|
13438
|
-
*
|
|
13439
|
-
*/
|
|
13440
|
-
declare var testOrSuite: any;
|
|
13441
|
-
|
|
13442
|
-
/**
|
|
13443
|
-
* 0-9 - designated for override of timeouts set from code, 5 is used by stepTimeout plugin when stepTimeout.config.overrideStepLimits=true
|
|
13444
|
-
*/
|
|
13445
|
-
declare var stepTimeoutHard: any;
|
|
13446
|
-
|
|
13447
|
-
/**
|
|
13448
|
-
* 10-19 - designated for timeouts set from code, 15 is order of I.setTimeout(t) operation
|
|
13001
|
+
* corresponding helper
|
|
13449
13002
|
*/
|
|
13450
|
-
declare var
|
|
13003
|
+
declare var helper: CodeceptJS.Helper;
|
|
13451
13004
|
|
|
13452
13005
|
/**
|
|
13453
|
-
*
|
|
13006
|
+
* name of method to be executed
|
|
13454
13007
|
*/
|
|
13455
|
-
declare var
|
|
13008
|
+
declare var helperMethod: string;
|
|
13456
13009
|
|