codeceptjs 3.7.0-beta.1 → 3.7.0-beta.11
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 +9 -10
- package/bin/codecept.js +7 -0
- package/lib/actor.js +46 -92
- package/lib/ai.js +130 -121
- package/lib/codecept.js +2 -2
- package/lib/command/check.js +186 -0
- package/lib/command/definitions.js +3 -1
- package/lib/command/interactive.js +1 -1
- package/lib/command/run-workers.js +2 -54
- package/lib/command/workers/runTests.js +64 -225
- package/lib/container.js +32 -0
- package/lib/effects.js +218 -0
- package/lib/els.js +87 -106
- package/lib/event.js +18 -17
- package/lib/heal.js +10 -0
- package/lib/helper/AI.js +2 -1
- package/lib/helper/Appium.js +31 -22
- package/lib/helper/Playwright.js +22 -1
- package/lib/helper/Puppeteer.js +5 -0
- package/lib/helper/WebDriver.js +29 -8
- package/lib/listener/emptyRun.js +2 -5
- package/lib/listener/exit.js +5 -8
- package/lib/listener/globalTimeout.js +66 -10
- package/lib/listener/result.js +12 -0
- package/lib/listener/steps.js +3 -6
- package/lib/listener/store.js +9 -1
- package/lib/mocha/asyncWrapper.js +15 -3
- package/lib/mocha/cli.js +79 -28
- package/lib/mocha/featureConfig.js +13 -0
- package/lib/mocha/hooks.js +32 -3
- package/lib/mocha/inject.js +5 -0
- package/lib/mocha/scenarioConfig.js +11 -0
- package/lib/mocha/suite.js +27 -1
- package/lib/mocha/test.js +102 -3
- package/lib/mocha/types.d.ts +11 -0
- package/lib/output.js +75 -73
- package/lib/pause.js +3 -10
- package/lib/plugin/analyze.js +349 -0
- package/lib/plugin/autoDelay.js +2 -2
- package/lib/plugin/commentStep.js +5 -0
- package/lib/plugin/customReporter.js +52 -0
- package/lib/plugin/heal.js +30 -0
- package/lib/plugin/pageInfo.js +140 -0
- package/lib/plugin/retryTo.js +18 -118
- package/lib/plugin/screenshotOnFail.js +12 -17
- package/lib/plugin/standardActingHelpers.js +4 -1
- package/lib/plugin/stepByStepReport.js +6 -5
- package/lib/plugin/stepTimeout.js +1 -1
- package/lib/plugin/tryTo.js +17 -107
- package/lib/recorder.js +5 -5
- package/lib/rerun.js +43 -42
- package/lib/result.js +161 -0
- package/lib/step/base.js +228 -0
- package/lib/step/config.js +50 -0
- package/lib/step/func.js +46 -0
- package/lib/step/helper.js +50 -0
- package/lib/step/meta.js +99 -0
- package/lib/step/record.js +74 -0
- package/lib/step/retry.js +11 -0
- package/lib/step/section.js +55 -0
- package/lib/step.js +20 -347
- package/lib/steps.js +50 -0
- package/lib/store.js +4 -0
- package/lib/timeout.js +66 -0
- package/lib/utils.js +93 -0
- package/lib/within.js +2 -2
- package/lib/workers.js +29 -49
- package/package.json +23 -20
- package/typings/index.d.ts +5 -4
- package/typings/promiseBasedTypes.d.ts +507 -49
- package/typings/types.d.ts +623 -73
- package/lib/listener/artifacts.js +0 -19
- package/lib/plugin/debugErrors.js +0 -67
package/typings/types.d.ts
CHANGED
|
@@ -608,17 +608,11 @@ declare namespace CodeceptJS {
|
|
|
608
608
|
* ```js
|
|
609
609
|
* // taps outside to hide keyboard per default
|
|
610
610
|
* I.hideDeviceKeyboard();
|
|
611
|
-
* I.hideDeviceKeyboard('tapOutside');
|
|
612
|
-
*
|
|
613
|
-
* // or by pressing key
|
|
614
|
-
* I.hideDeviceKeyboard('pressKey', 'Done');
|
|
615
611
|
* ```
|
|
616
612
|
*
|
|
617
613
|
* Appium: support Android and iOS
|
|
618
|
-
* @param [strategy] - Desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’)
|
|
619
|
-
* @param [key] - Optional key
|
|
620
614
|
*/
|
|
621
|
-
hideDeviceKeyboard(
|
|
615
|
+
hideDeviceKeyboard(): void;
|
|
622
616
|
/**
|
|
623
617
|
* Send a key event to the device.
|
|
624
618
|
* List of keys: https://developer.android.com/reference/android/view/KeyEvent.html
|
|
@@ -1209,6 +1203,228 @@ declare namespace CodeceptJS {
|
|
|
1209
1203
|
*/
|
|
1210
1204
|
waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): void;
|
|
1211
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
|
+
class ExpectHelper {
|
|
1226
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1227
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1228
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1229
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1230
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1231
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1232
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1233
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1234
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1235
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1236
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1237
|
+
/**
|
|
1238
|
+
* @param [ajvOptions] - Pass AJV options
|
|
1239
|
+
*/
|
|
1240
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1241
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1242
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1243
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1244
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1245
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1246
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1247
|
+
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1248
|
+
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1249
|
+
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1250
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1251
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1252
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1253
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1254
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1255
|
+
/**
|
|
1256
|
+
* expects members of two arrays are deeply equal
|
|
1257
|
+
*/
|
|
1258
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1259
|
+
/**
|
|
1260
|
+
* expects an array to be a superset of another array
|
|
1261
|
+
*/
|
|
1262
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1263
|
+
/**
|
|
1264
|
+
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1265
|
+
*/
|
|
1266
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1267
|
+
/**
|
|
1268
|
+
* expects a JSON object matches a provided pattern
|
|
1269
|
+
*/
|
|
1270
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1271
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1272
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1273
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1274
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1275
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1276
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1277
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1278
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1279
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1280
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1281
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1282
|
+
/**
|
|
1283
|
+
* @param [ajvOptions] - Pass AJV options
|
|
1284
|
+
*/
|
|
1285
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1286
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1287
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1288
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1289
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1290
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1291
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1292
|
+
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1293
|
+
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1294
|
+
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1295
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1296
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1297
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1298
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1299
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1300
|
+
/**
|
|
1301
|
+
* expects members of two arrays are deeply equal
|
|
1302
|
+
*/
|
|
1303
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1304
|
+
/**
|
|
1305
|
+
* expects an array to be a superset of another array
|
|
1306
|
+
*/
|
|
1307
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1308
|
+
/**
|
|
1309
|
+
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1310
|
+
*/
|
|
1311
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1312
|
+
/**
|
|
1313
|
+
* expects a JSON object matches a provided pattern
|
|
1314
|
+
*/
|
|
1315
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* This helper allows performing assertions based on Chai.
|
|
1319
|
+
*
|
|
1320
|
+
* ### Examples
|
|
1321
|
+
*
|
|
1322
|
+
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
1323
|
+
*
|
|
1324
|
+
* ```js
|
|
1325
|
+
* // inside codecept.conf.js
|
|
1326
|
+
* {
|
|
1327
|
+
* helpers: {
|
|
1328
|
+
* Playwright: {...},
|
|
1329
|
+
* ExpectHelper: {},
|
|
1330
|
+
* }
|
|
1331
|
+
* }
|
|
1332
|
+
* ```
|
|
1333
|
+
*
|
|
1334
|
+
* ## Methods
|
|
1335
|
+
*/
|
|
1336
|
+
class ExpectHelper {
|
|
1337
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1338
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1339
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1340
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1341
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1342
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1343
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1344
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1345
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1346
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1347
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1348
|
+
/**
|
|
1349
|
+
* @param [ajvOptions] - Pass AJV options
|
|
1350
|
+
*/
|
|
1351
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1352
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1353
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1354
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1355
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1356
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1357
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1358
|
+
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1359
|
+
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1360
|
+
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1361
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1362
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1363
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1364
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1365
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1366
|
+
/**
|
|
1367
|
+
* expects members of two arrays are deeply equal
|
|
1368
|
+
*/
|
|
1369
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1370
|
+
/**
|
|
1371
|
+
* expects an array to be a superset of another array
|
|
1372
|
+
*/
|
|
1373
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1374
|
+
/**
|
|
1375
|
+
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1376
|
+
*/
|
|
1377
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1378
|
+
/**
|
|
1379
|
+
* expects a JSON object matches a provided pattern
|
|
1380
|
+
*/
|
|
1381
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1382
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1383
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1384
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1385
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1386
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1387
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1388
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1389
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1390
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1391
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1392
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1393
|
+
/**
|
|
1394
|
+
* @param [ajvOptions] - Pass AJV options
|
|
1395
|
+
*/
|
|
1396
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): void;
|
|
1397
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1398
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1399
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1400
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1401
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1402
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1403
|
+
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1404
|
+
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1405
|
+
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1406
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1407
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1408
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1409
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1410
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1411
|
+
/**
|
|
1412
|
+
* expects members of two arrays are deeply equal
|
|
1413
|
+
*/
|
|
1414
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1415
|
+
/**
|
|
1416
|
+
* expects an array to be a superset of another array
|
|
1417
|
+
*/
|
|
1418
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1419
|
+
/**
|
|
1420
|
+
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1421
|
+
*/
|
|
1422
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1423
|
+
/**
|
|
1424
|
+
* expects a JSON object matches a provided pattern
|
|
1425
|
+
*/
|
|
1426
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1427
|
+
}
|
|
1212
1428
|
/**
|
|
1213
1429
|
* Helper for testing filesystem.
|
|
1214
1430
|
* Can be easily used to check file structures:
|
|
@@ -1792,13 +2008,6 @@ declare namespace CodeceptJS {
|
|
|
1792
2008
|
* @property [host = "0.0.0.0"] - Mock server host
|
|
1793
2009
|
* @property [httpsOpts] - key & cert values are the paths to .key and .crt files
|
|
1794
2010
|
*/
|
|
1795
|
-
// @ts-ignore
|
|
1796
|
-
// @ts-ignore
|
|
1797
|
-
// @ts-ignore
|
|
1798
|
-
// @ts-ignore
|
|
1799
|
-
// @ts-ignore
|
|
1800
|
-
// @ts-ignore
|
|
1801
|
-
// @ts-ignore
|
|
1802
2011
|
type MockServerConfig = {
|
|
1803
2012
|
port?: number;
|
|
1804
2013
|
host?: string;
|
|
@@ -1923,13 +2132,6 @@ declare namespace CodeceptJS {
|
|
|
1923
2132
|
*
|
|
1924
2133
|
* ## Methods
|
|
1925
2134
|
*/
|
|
1926
|
-
// @ts-ignore
|
|
1927
|
-
// @ts-ignore
|
|
1928
|
-
// @ts-ignore
|
|
1929
|
-
// @ts-ignore
|
|
1930
|
-
// @ts-ignore
|
|
1931
|
-
// @ts-ignore
|
|
1932
|
-
// @ts-ignore
|
|
1933
2135
|
class MockServer {
|
|
1934
2136
|
/**
|
|
1935
2137
|
* Start the mock server
|
|
@@ -2985,6 +3187,46 @@ declare namespace CodeceptJS {
|
|
|
2985
3187
|
*/
|
|
2986
3188
|
grabPageScrollPosition(): Promise<PageScrollPosition>;
|
|
2987
3189
|
}
|
|
3190
|
+
/**
|
|
3191
|
+
* OpenAI Helper for CodeceptJS.
|
|
3192
|
+
*
|
|
3193
|
+
* 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.
|
|
3194
|
+
* This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
|
|
3195
|
+
*
|
|
3196
|
+
* ## Configuration
|
|
3197
|
+
*
|
|
3198
|
+
* This helper should be configured in codecept.json or codecept.conf.js
|
|
3199
|
+
*
|
|
3200
|
+
* * `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.
|
|
3201
|
+
*/
|
|
3202
|
+
class OpenAI {
|
|
3203
|
+
/**
|
|
3204
|
+
* Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
|
|
3205
|
+
*
|
|
3206
|
+
* ```js
|
|
3207
|
+
* I.askGptOnPage('what does this page do?');
|
|
3208
|
+
* ```
|
|
3209
|
+
* @param prompt - The question or prompt to ask the GPT model.
|
|
3210
|
+
* @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
|
|
3211
|
+
*/
|
|
3212
|
+
askGptOnPage(prompt: string): Promise<string>;
|
|
3213
|
+
/**
|
|
3214
|
+
* 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.
|
|
3215
|
+
*
|
|
3216
|
+
* ```js
|
|
3217
|
+
* I.askGptOnPageFragment('describe features of this screen', '.screen');
|
|
3218
|
+
* ```
|
|
3219
|
+
* @param prompt - The question or prompt to ask the GPT-3.5 model.
|
|
3220
|
+
* @param locator - The locator or selector used to identify the HTML fragment on the page.
|
|
3221
|
+
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
3222
|
+
*/
|
|
3223
|
+
askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
|
|
3224
|
+
/**
|
|
3225
|
+
* Send a general request to ChatGPT and return response.
|
|
3226
|
+
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
3227
|
+
*/
|
|
3228
|
+
askGptGeneralPrompt(prompt: string): Promise<string>;
|
|
3229
|
+
}
|
|
2988
3230
|
/**
|
|
2989
3231
|
* ## Configuration
|
|
2990
3232
|
*
|
|
@@ -3029,13 +3271,6 @@ declare namespace CodeceptJS {
|
|
|
3029
3271
|
* @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).
|
|
3030
3272
|
* @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).
|
|
3031
3273
|
*/
|
|
3032
|
-
// @ts-ignore
|
|
3033
|
-
// @ts-ignore
|
|
3034
|
-
// @ts-ignore
|
|
3035
|
-
// @ts-ignore
|
|
3036
|
-
// @ts-ignore
|
|
3037
|
-
// @ts-ignore
|
|
3038
|
-
// @ts-ignore
|
|
3039
3274
|
type PlaywrightConfig = {
|
|
3040
3275
|
url?: string;
|
|
3041
3276
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -6563,13 +6798,6 @@ declare namespace CodeceptJS {
|
|
|
6563
6798
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
6564
6799
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6565
6800
|
*/
|
|
6566
|
-
// @ts-ignore
|
|
6567
|
-
// @ts-ignore
|
|
6568
|
-
// @ts-ignore
|
|
6569
|
-
// @ts-ignore
|
|
6570
|
-
// @ts-ignore
|
|
6571
|
-
// @ts-ignore
|
|
6572
|
-
// @ts-ignore
|
|
6573
6801
|
type PuppeteerConfig = {
|
|
6574
6802
|
url: string;
|
|
6575
6803
|
basicAuth?: any;
|
|
@@ -8512,13 +8740,6 @@ declare namespace CodeceptJS {
|
|
|
8512
8740
|
* @property [onResponse] - an async function which can update response object.
|
|
8513
8741
|
* @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
|
|
8514
8742
|
*/
|
|
8515
|
-
// @ts-ignore
|
|
8516
|
-
// @ts-ignore
|
|
8517
|
-
// @ts-ignore
|
|
8518
|
-
// @ts-ignore
|
|
8519
|
-
// @ts-ignore
|
|
8520
|
-
// @ts-ignore
|
|
8521
|
-
// @ts-ignore
|
|
8522
8743
|
type RESTConfig = {
|
|
8523
8744
|
endpoint?: string;
|
|
8524
8745
|
prettyPrintJson?: boolean;
|
|
@@ -8711,6 +8932,250 @@ declare namespace CodeceptJS {
|
|
|
8711
8932
|
*/
|
|
8712
8933
|
sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
|
|
8713
8934
|
}
|
|
8935
|
+
/**
|
|
8936
|
+
* SoftAssertHelper is a utility class for performing soft assertions.
|
|
8937
|
+
* Unlike traditional assertions that stop the execution on failure,
|
|
8938
|
+
* soft assertions allow the execution to continue and report all failures at the end.
|
|
8939
|
+
*
|
|
8940
|
+
* ### Examples
|
|
8941
|
+
*
|
|
8942
|
+
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
8943
|
+
*
|
|
8944
|
+
* ```js
|
|
8945
|
+
* // inside codecept.conf.js
|
|
8946
|
+
* {
|
|
8947
|
+
* helpers: {
|
|
8948
|
+
* Playwright: {...},
|
|
8949
|
+
* SoftExpectHelper: {},
|
|
8950
|
+
* }
|
|
8951
|
+
* }
|
|
8952
|
+
* ```
|
|
8953
|
+
*
|
|
8954
|
+
* ```js
|
|
8955
|
+
* // in scenario
|
|
8956
|
+
* I.softExpectEqual('a', 'b')
|
|
8957
|
+
* I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
|
|
8958
|
+
* ```
|
|
8959
|
+
*
|
|
8960
|
+
* ## Methods
|
|
8961
|
+
*/
|
|
8962
|
+
class SoftAssertHelper {
|
|
8963
|
+
/**
|
|
8964
|
+
* Performs a soft assertion by executing the provided assertion function.
|
|
8965
|
+
* If the assertion fails, the error is caught and stored without halting the execution.
|
|
8966
|
+
* @param assertionFn - The assertion function to execute.
|
|
8967
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8968
|
+
*/
|
|
8969
|
+
softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): void;
|
|
8970
|
+
/**
|
|
8971
|
+
* Throws an error if any soft assertions have failed.
|
|
8972
|
+
* The error message contains all the accumulated failures.
|
|
8973
|
+
*/
|
|
8974
|
+
flushSoftAssertions(): void;
|
|
8975
|
+
/**
|
|
8976
|
+
* Softly asserts that two values are equal.
|
|
8977
|
+
* @param actualValue - The actual value.
|
|
8978
|
+
* @param expectedValue - The expected value.
|
|
8979
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8980
|
+
*/
|
|
8981
|
+
softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
8982
|
+
/**
|
|
8983
|
+
* Softly asserts that two values are not equal.
|
|
8984
|
+
* @param actualValue - The actual value.
|
|
8985
|
+
* @param expectedValue - The expected value.
|
|
8986
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8987
|
+
*/
|
|
8988
|
+
softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
8989
|
+
/**
|
|
8990
|
+
* Softly asserts that two values are deeply equal.
|
|
8991
|
+
* @param actualValue - The actual value.
|
|
8992
|
+
* @param expectedValue - The expected value.
|
|
8993
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8994
|
+
*/
|
|
8995
|
+
softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
8996
|
+
/**
|
|
8997
|
+
* Softly asserts that two values are not deeply equal.
|
|
8998
|
+
* @param actualValue - The actual value.
|
|
8999
|
+
* @param expectedValue - The expected value.
|
|
9000
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9001
|
+
*/
|
|
9002
|
+
softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void;
|
|
9003
|
+
/**
|
|
9004
|
+
* Softly asserts that a value contains the expected value.
|
|
9005
|
+
* @param actualValue - The actual value.
|
|
9006
|
+
* @param expectedValueToContain - The value that should be contained within the actual value.
|
|
9007
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9008
|
+
*/
|
|
9009
|
+
softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): void;
|
|
9010
|
+
/**
|
|
9011
|
+
* Softly asserts that a value does not contain the expected value.
|
|
9012
|
+
* @param actualValue - The actual value.
|
|
9013
|
+
* @param expectedValueToNotContain - The value that should not be contained within the actual value.
|
|
9014
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9015
|
+
*/
|
|
9016
|
+
softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): void;
|
|
9017
|
+
/**
|
|
9018
|
+
* Softly asserts that a value starts with the expected value.
|
|
9019
|
+
* @param actualValue - The actual value.
|
|
9020
|
+
* @param expectedValueToStartWith - The value that the actual value should start with.
|
|
9021
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9022
|
+
*/
|
|
9023
|
+
softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): void;
|
|
9024
|
+
/**
|
|
9025
|
+
* Softly asserts that a value does not start with the expected value.
|
|
9026
|
+
* @param actualValue - The actual value.
|
|
9027
|
+
* @param expectedValueToNotStartWith - The value that the actual value should not start with.
|
|
9028
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9029
|
+
*/
|
|
9030
|
+
softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): void;
|
|
9031
|
+
/**
|
|
9032
|
+
* Softly asserts that a value ends with the expected value.
|
|
9033
|
+
* @param actualValue - The actual value.
|
|
9034
|
+
* @param expectedValueToEndWith - The value that the actual value should end with.
|
|
9035
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9036
|
+
*/
|
|
9037
|
+
softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): void;
|
|
9038
|
+
/**
|
|
9039
|
+
* Softly asserts that a value does not end with the expected value.
|
|
9040
|
+
* @param actualValue - The actual value.
|
|
9041
|
+
* @param expectedValueToNotEndWith - The value that the actual value should not end with.
|
|
9042
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9043
|
+
*/
|
|
9044
|
+
softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): void;
|
|
9045
|
+
/**
|
|
9046
|
+
* Softly asserts that the target data matches the given JSON schema.
|
|
9047
|
+
* @param targetData - The data to validate.
|
|
9048
|
+
* @param jsonSchema - The JSON schema to validate against.
|
|
9049
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9050
|
+
*/
|
|
9051
|
+
softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): void;
|
|
9052
|
+
/**
|
|
9053
|
+
* Softly asserts that the target data matches the given JSON schema using AJV.
|
|
9054
|
+
* @param targetData - The data to validate.
|
|
9055
|
+
* @param jsonSchema - The JSON schema to validate against.
|
|
9056
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9057
|
+
* @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
|
|
9058
|
+
*/
|
|
9059
|
+
softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): void;
|
|
9060
|
+
/**
|
|
9061
|
+
* Softly asserts that the target data has the specified property.
|
|
9062
|
+
* @param targetData - The data to check.
|
|
9063
|
+
* @param propertyName - The property name to check for.
|
|
9064
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion
|
|
9065
|
+
* fails.
|
|
9066
|
+
*/
|
|
9067
|
+
softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): void;
|
|
9068
|
+
/**
|
|
9069
|
+
* Softly asserts that the target data has a property with the specified name.
|
|
9070
|
+
* @param targetData - The data to check.
|
|
9071
|
+
* @param propertyName - The property name to check for.
|
|
9072
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9073
|
+
*/
|
|
9074
|
+
softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): void;
|
|
9075
|
+
/**
|
|
9076
|
+
* Softly asserts that the target data is of a specific type.
|
|
9077
|
+
* @param targetData - The data to check.
|
|
9078
|
+
* @param type - The expected type (e.g., 'string', 'number').
|
|
9079
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9080
|
+
*/
|
|
9081
|
+
softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): void;
|
|
9082
|
+
/**
|
|
9083
|
+
* Softly asserts that the target data is of a specific type (alternative for articles).
|
|
9084
|
+
* @param targetData - The data to check.
|
|
9085
|
+
* @param type - The expected type (e.g., 'string', 'number').
|
|
9086
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9087
|
+
*/
|
|
9088
|
+
softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): void;
|
|
9089
|
+
/**
|
|
9090
|
+
* Softly asserts that the target data has a specified length.
|
|
9091
|
+
* @param targetData - The data to check.
|
|
9092
|
+
* @param length - The expected length.
|
|
9093
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9094
|
+
*/
|
|
9095
|
+
softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): void;
|
|
9096
|
+
/**
|
|
9097
|
+
* Softly asserts that the target data is empty.
|
|
9098
|
+
* @param targetData - The data to check.
|
|
9099
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9100
|
+
*/
|
|
9101
|
+
softExpectEmpty(targetData: any, customErrorMsg?: string): void;
|
|
9102
|
+
/**
|
|
9103
|
+
* Softly asserts that the target data is true.
|
|
9104
|
+
* @param targetData - The data to check.
|
|
9105
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9106
|
+
*/
|
|
9107
|
+
softExpectTrue(targetData: any, customErrorMsg?: string): void;
|
|
9108
|
+
/**
|
|
9109
|
+
* Softly asserts that the target data is false.
|
|
9110
|
+
* @param targetData - The data to check.
|
|
9111
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9112
|
+
*/
|
|
9113
|
+
softExpectFalse(targetData: any, customErrorMsg?: string): void;
|
|
9114
|
+
/**
|
|
9115
|
+
* Softly asserts that the target data is above a specified value.
|
|
9116
|
+
* @param targetData - The data to check.
|
|
9117
|
+
* @param aboveThan - The value that the target data should be above.
|
|
9118
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9119
|
+
*/
|
|
9120
|
+
softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): void;
|
|
9121
|
+
/**
|
|
9122
|
+
* Softly asserts that the target data is below a specified value.
|
|
9123
|
+
* @param targetData - The data to check.
|
|
9124
|
+
* @param belowThan - The value that the target data should be below.
|
|
9125
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9126
|
+
*/
|
|
9127
|
+
softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): void;
|
|
9128
|
+
/**
|
|
9129
|
+
* Softly asserts that the length of the target data is above a specified value.
|
|
9130
|
+
* @param targetData - The data to check.
|
|
9131
|
+
* @param lengthAboveThan - The length that the target data should be above.
|
|
9132
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9133
|
+
*/
|
|
9134
|
+
softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): void;
|
|
9135
|
+
/**
|
|
9136
|
+
* Softly asserts that the length of the target data is below a specified value.
|
|
9137
|
+
* @param targetData - The data to check.
|
|
9138
|
+
* @param lengthBelowThan - The length that the target data should be below.
|
|
9139
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9140
|
+
*/
|
|
9141
|
+
softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): void;
|
|
9142
|
+
/**
|
|
9143
|
+
* Softly asserts that two values are equal, ignoring case.
|
|
9144
|
+
* @param actualValue - The actual string value.
|
|
9145
|
+
* @param expectedValue - The expected string value.
|
|
9146
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9147
|
+
*/
|
|
9148
|
+
softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): void;
|
|
9149
|
+
/**
|
|
9150
|
+
* Softly asserts that two arrays have deep equality, considering members in any order.
|
|
9151
|
+
* @param actualValue - The actual array.
|
|
9152
|
+
* @param expectedValue - The expected array.
|
|
9153
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9154
|
+
*/
|
|
9155
|
+
softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): void;
|
|
9156
|
+
/**
|
|
9157
|
+
* Softly asserts that an array (superset) deeply includes all members of another array (set).
|
|
9158
|
+
* @param superset - The array that should contain the expected members.
|
|
9159
|
+
* @param set - The array with members that should be included.
|
|
9160
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9161
|
+
*/
|
|
9162
|
+
softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): void;
|
|
9163
|
+
/**
|
|
9164
|
+
* Softly asserts that two objects are deeply equal, excluding specified fields.
|
|
9165
|
+
* @param actualValue - The actual object.
|
|
9166
|
+
* @param expectedValue - The expected object.
|
|
9167
|
+
* @param fieldsToExclude - The fields to exclude from the comparison.
|
|
9168
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9169
|
+
*/
|
|
9170
|
+
softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): void;
|
|
9171
|
+
/**
|
|
9172
|
+
* Softly asserts that a value matches the expected pattern.
|
|
9173
|
+
* @param actualValue - The actual value.
|
|
9174
|
+
* @param expectedPattern - The pattern the value should match.
|
|
9175
|
+
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
9176
|
+
*/
|
|
9177
|
+
softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): void;
|
|
9178
|
+
}
|
|
8714
9179
|
/**
|
|
8715
9180
|
* Client Functions
|
|
8716
9181
|
*/
|
|
@@ -9723,13 +10188,6 @@ declare namespace CodeceptJS {
|
|
|
9723
10188
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
9724
10189
|
* @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
|
|
9725
10190
|
*/
|
|
9726
|
-
// @ts-ignore
|
|
9727
|
-
// @ts-ignore
|
|
9728
|
-
// @ts-ignore
|
|
9729
|
-
// @ts-ignore
|
|
9730
|
-
// @ts-ignore
|
|
9731
|
-
// @ts-ignore
|
|
9732
|
-
// @ts-ignore
|
|
9733
10191
|
type WebDriverConfig = {
|
|
9734
10192
|
url: string;
|
|
9735
10193
|
browser: string;
|
|
@@ -11788,10 +12246,33 @@ declare namespace CodeceptJS {
|
|
|
11788
12246
|
[key: string]: any;
|
|
11789
12247
|
};
|
|
11790
12248
|
}
|
|
12249
|
+
/**
|
|
12250
|
+
* Result of the test run
|
|
12251
|
+
*/
|
|
12252
|
+
type Stats = {
|
|
12253
|
+
passes: number;
|
|
12254
|
+
failures: number;
|
|
12255
|
+
tests: number;
|
|
12256
|
+
pending: number;
|
|
12257
|
+
failedHooks: number;
|
|
12258
|
+
start: Date;
|
|
12259
|
+
end: Date;
|
|
12260
|
+
duration: number;
|
|
12261
|
+
};
|
|
12262
|
+
/**
|
|
12263
|
+
* Create Result of the test run
|
|
12264
|
+
*/
|
|
12265
|
+
class Result {
|
|
12266
|
+
constructor();
|
|
12267
|
+
}
|
|
11791
12268
|
/**
|
|
11792
12269
|
* Dependency Injection Container
|
|
11793
12270
|
*/
|
|
11794
12271
|
class Container {
|
|
12272
|
+
/**
|
|
12273
|
+
* Get the standard acting helpers of CodeceptJS Container
|
|
12274
|
+
*/
|
|
12275
|
+
static STANDARD_ACTING_HELPERS: any;
|
|
11795
12276
|
/**
|
|
11796
12277
|
* Create container with all required helpers and support objects
|
|
11797
12278
|
*/
|
|
@@ -11816,6 +12297,10 @@ declare namespace CodeceptJS {
|
|
|
11816
12297
|
* Get Mocha instance
|
|
11817
12298
|
*/
|
|
11818
12299
|
static mocha(): any;
|
|
12300
|
+
/**
|
|
12301
|
+
* Get result
|
|
12302
|
+
*/
|
|
12303
|
+
static result(): Result;
|
|
11819
12304
|
/**
|
|
11820
12305
|
* Append new services to container
|
|
11821
12306
|
*/
|
|
@@ -12165,24 +12650,49 @@ declare namespace CodeceptJS {
|
|
|
12165
12650
|
function session(sessionName: CodeceptJS.LocatorOrString, config: ((...params: any[]) => any) | {
|
|
12166
12651
|
[key: string]: any;
|
|
12167
12652
|
}, fn?: (...params: any[]) => any): any;
|
|
12653
|
+
/**
|
|
12654
|
+
* StepConfig is a configuration object for a step.
|
|
12655
|
+
* It is used to create a new step that is a combination of other steps.
|
|
12656
|
+
*/
|
|
12657
|
+
class StepConfig {
|
|
12658
|
+
config: any;
|
|
12659
|
+
/**
|
|
12660
|
+
* Set the options for the step.
|
|
12661
|
+
* @param opts - The options for the step.
|
|
12662
|
+
* @returns - The step configuration object.
|
|
12663
|
+
*/
|
|
12664
|
+
opts(opts: any): StepConfig;
|
|
12665
|
+
/**
|
|
12666
|
+
* Set the timeout for the step.
|
|
12667
|
+
* @param timeout - The timeout for the step.
|
|
12668
|
+
* @returns - The step configuration object.
|
|
12669
|
+
*/
|
|
12670
|
+
timeout(timeout: number): StepConfig;
|
|
12671
|
+
/**
|
|
12672
|
+
* Set the retry for the step.
|
|
12673
|
+
* @param retry - The retry for the step.
|
|
12674
|
+
* @returns - The step configuration object.
|
|
12675
|
+
*/
|
|
12676
|
+
retry(retry: number): StepConfig;
|
|
12677
|
+
}
|
|
12168
12678
|
/**
|
|
12169
12679
|
* Each command in test executed through `I.` object is wrapped in Step.
|
|
12170
12680
|
* Step allows logging executed commands and triggers hook before and after step execution.
|
|
12171
12681
|
*/
|
|
12172
12682
|
class Step {
|
|
12173
|
-
constructor(
|
|
12174
|
-
actor: string;
|
|
12175
|
-
helper: CodeceptJS.Helper;
|
|
12683
|
+
constructor(name: string);
|
|
12176
12684
|
name: string;
|
|
12685
|
+
timeouts: Map<number, number>;
|
|
12686
|
+
args: any[];
|
|
12687
|
+
opts: Record<string, any>;
|
|
12688
|
+
actor: string;
|
|
12177
12689
|
helperMethod: string;
|
|
12178
12690
|
status: string;
|
|
12179
|
-
suffix: string;
|
|
12180
12691
|
prefix: string;
|
|
12181
12692
|
comment: string;
|
|
12182
|
-
|
|
12183
|
-
metaStep: MetaStep;
|
|
12693
|
+
metaStep: any;
|
|
12184
12694
|
stack: string;
|
|
12185
|
-
|
|
12695
|
+
timeout: any;
|
|
12186
12696
|
/**
|
|
12187
12697
|
* @param timeout - timeout in milliseconds or 0 if no timeout
|
|
12188
12698
|
* @param order - order defines the priority of timeout, timeouts set with lower order override those set with higher order.
|
|
@@ -12191,7 +12701,6 @@ declare namespace CodeceptJS {
|
|
|
12191
12701
|
setTimeout(timeout: number, order: number): void;
|
|
12192
12702
|
setTrace(): void;
|
|
12193
12703
|
setArguments(args: any[]): void;
|
|
12194
|
-
run(...args: any[]): any;
|
|
12195
12704
|
setStatus(status: string): void;
|
|
12196
12705
|
humanize(): string;
|
|
12197
12706
|
humanizeArgs(): string;
|
|
@@ -12200,11 +12709,6 @@ declare namespace CodeceptJS {
|
|
|
12200
12709
|
toCliStyled(): string;
|
|
12201
12710
|
toCode(): string;
|
|
12202
12711
|
hasBDDAncestor(): boolean;
|
|
12203
|
-
static MetaStep: typeof MetaStep;
|
|
12204
|
-
}
|
|
12205
|
-
class MetaStep extends Step {
|
|
12206
|
-
isBDD(): boolean;
|
|
12207
|
-
run(): any;
|
|
12208
12712
|
}
|
|
12209
12713
|
/**
|
|
12210
12714
|
* global values for current session
|
|
@@ -12213,7 +12717,10 @@ declare namespace CodeceptJS {
|
|
|
12213
12717
|
var debugMode: boolean;
|
|
12214
12718
|
var timeouts: boolean;
|
|
12215
12719
|
var dryRun: boolean;
|
|
12720
|
+
var onPause: boolean;
|
|
12216
12721
|
var currentTest: CodeceptJS.Test | null;
|
|
12722
|
+
var currentStep: any;
|
|
12723
|
+
var currentSuite: CodeceptJS.Suite | null;
|
|
12217
12724
|
}
|
|
12218
12725
|
/**
|
|
12219
12726
|
* Describe a "suite" with the given `title`
|
|
@@ -12240,6 +12747,10 @@ declare namespace CodeceptJS {
|
|
|
12240
12747
|
* Can inject values and add custom configuration.
|
|
12241
12748
|
*/
|
|
12242
12749
|
class FeatureConfig {
|
|
12750
|
+
/**
|
|
12751
|
+
* Set metadata for this suite
|
|
12752
|
+
*/
|
|
12753
|
+
meta(key: string, value: string): this;
|
|
12243
12754
|
/**
|
|
12244
12755
|
* Retry this test for number of times
|
|
12245
12756
|
*/
|
|
@@ -12274,6 +12785,10 @@ declare namespace CodeceptJS {
|
|
|
12274
12785
|
* Retry this test for x times
|
|
12275
12786
|
*/
|
|
12276
12787
|
retry(retries: number): this;
|
|
12788
|
+
/**
|
|
12789
|
+
* Set metadata for this test
|
|
12790
|
+
*/
|
|
12791
|
+
meta(key: string, value: string): this;
|
|
12277
12792
|
/**
|
|
12278
12793
|
* Set timeout for this test
|
|
12279
12794
|
*/
|
|
@@ -12305,6 +12820,46 @@ declare namespace CodeceptJS {
|
|
|
12305
12820
|
}): this;
|
|
12306
12821
|
}
|
|
12307
12822
|
function addStep(step: any, fn: any): void;
|
|
12823
|
+
/**
|
|
12824
|
+
* Creates a new Hook instance
|
|
12825
|
+
* @property suite - The test suite this hook belongs to
|
|
12826
|
+
* @property test - The test object associated with this hook
|
|
12827
|
+
* @property runnable - The current test being executed
|
|
12828
|
+
* @property ctx - The context object
|
|
12829
|
+
* @property err - The error that occurred during hook execution, if any
|
|
12830
|
+
* @param context - The context object containing suite and test information
|
|
12831
|
+
* @param context.suite - The test suite
|
|
12832
|
+
* @param context.test - The test object
|
|
12833
|
+
* @param context.ctx - The context object
|
|
12834
|
+
* @param error - The error object if hook execution failed
|
|
12835
|
+
*/
|
|
12836
|
+
class Hook {
|
|
12837
|
+
constructor(context: {
|
|
12838
|
+
suite: any;
|
|
12839
|
+
test: any;
|
|
12840
|
+
ctx: any;
|
|
12841
|
+
}, error: Error);
|
|
12842
|
+
/**
|
|
12843
|
+
* The test suite this hook belongs to
|
|
12844
|
+
*/
|
|
12845
|
+
suite: any;
|
|
12846
|
+
/**
|
|
12847
|
+
* The test object associated with this hook
|
|
12848
|
+
*/
|
|
12849
|
+
test: any;
|
|
12850
|
+
/**
|
|
12851
|
+
* The current test being executed
|
|
12852
|
+
*/
|
|
12853
|
+
runnable: any;
|
|
12854
|
+
/**
|
|
12855
|
+
* The context object
|
|
12856
|
+
*/
|
|
12857
|
+
ctx: any;
|
|
12858
|
+
/**
|
|
12859
|
+
* The error that occurred during hook execution, if any
|
|
12860
|
+
*/
|
|
12861
|
+
err: Error | null;
|
|
12862
|
+
}
|
|
12308
12863
|
function within(context: CodeceptJS.LocatorOrString, fn: (...params: any[]) => any): Promise<any> | undefined;
|
|
12309
12864
|
/**
|
|
12310
12865
|
* This is a wrapper on top of [Detox](https://github.com/wix/Detox) library, aimied to unify testing experience for CodeceptJS framework.
|
|
@@ -12906,22 +13461,17 @@ declare namespace CodeceptJS {
|
|
|
12906
13461
|
}
|
|
12907
13462
|
|
|
12908
13463
|
/**
|
|
12909
|
-
*
|
|
12910
|
-
*/
|
|
12911
|
-
declare var testOrSuite: any;
|
|
12912
|
-
|
|
12913
|
-
/**
|
|
12914
|
-
* 0-9 - designated for override of timeouts set from code, 5 is used by stepTimeout plugin when stepTimeout.config.overrideStepLimits=true
|
|
13464
|
+
* corresponding helper
|
|
12915
13465
|
*/
|
|
12916
|
-
declare var
|
|
13466
|
+
declare var helper: CodeceptJS.Helper;
|
|
12917
13467
|
|
|
12918
13468
|
/**
|
|
12919
|
-
*
|
|
13469
|
+
* name of method to be executed
|
|
12920
13470
|
*/
|
|
12921
|
-
declare var
|
|
13471
|
+
declare var helperMethod: string;
|
|
12922
13472
|
|
|
12923
13473
|
/**
|
|
12924
|
-
*
|
|
13474
|
+
* hide children steps from output
|
|
12925
13475
|
*/
|
|
12926
|
-
declare var
|
|
13476
|
+
declare var collsapsed: boolean;
|
|
12927
13477
|
|