codeceptjs 4.0.0-beta.4 → 4.0.0-beta.5
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 +134 -119
- package/bin/codecept.js +12 -2
- package/bin/test-server.js +53 -0
- package/docs/webapi/clearCookie.mustache +1 -1
- package/lib/actor.js +66 -102
- package/lib/ai.js +130 -121
- package/lib/assert/empty.js +3 -5
- package/lib/assert/equal.js +4 -7
- package/lib/assert/include.js +4 -6
- package/lib/assert/throws.js +2 -4
- package/lib/assert/truth.js +2 -2
- package/lib/codecept.js +139 -87
- package/lib/command/check.js +201 -0
- package/lib/command/configMigrate.js +2 -4
- package/lib/command/definitions.js +8 -26
- package/lib/command/generate.js +10 -14
- package/lib/command/gherkin/snippets.js +75 -73
- package/lib/command/gherkin/steps.js +1 -1
- package/lib/command/info.js +42 -8
- package/lib/command/init.js +13 -12
- package/lib/command/interactive.js +10 -2
- package/lib/command/list.js +1 -1
- package/lib/command/run-multiple/chunk.js +48 -45
- package/lib/command/run-multiple.js +12 -35
- package/lib/command/run-workers.js +21 -58
- package/lib/command/utils.js +5 -6
- package/lib/command/workers/runTests.js +262 -220
- package/lib/container.js +386 -238
- package/lib/data/context.js +10 -13
- package/lib/data/dataScenarioConfig.js +8 -8
- package/lib/data/dataTableArgument.js +6 -6
- package/lib/data/table.js +5 -11
- package/lib/effects.js +223 -0
- package/lib/element/WebElement.js +327 -0
- package/lib/els.js +158 -0
- package/lib/event.js +21 -17
- package/lib/heal.js +88 -80
- package/lib/helper/AI.js +2 -1
- package/lib/helper/ApiDataFactory.js +3 -6
- package/lib/helper/Appium.js +47 -51
- package/lib/helper/FileSystem.js +3 -3
- package/lib/helper/GraphQLDataFactory.js +3 -3
- package/lib/helper/JSONResponse.js +75 -37
- package/lib/helper/Mochawesome.js +31 -9
- package/lib/helper/Nightmare.js +35 -53
- package/lib/helper/Playwright.js +262 -267
- package/lib/helper/Protractor.js +54 -77
- package/lib/helper/Puppeteer.js +246 -260
- package/lib/helper/REST.js +5 -17
- package/lib/helper/TestCafe.js +21 -44
- package/lib/helper/WebDriver.js +151 -170
- package/lib/helper/extras/Popup.js +22 -22
- package/lib/helper/testcafe/testcafe-utils.js +26 -27
- package/lib/listener/emptyRun.js +55 -0
- package/lib/listener/exit.js +7 -10
- package/lib/listener/{retry.js → globalRetry.js} +5 -5
- package/lib/listener/globalTimeout.js +165 -0
- package/lib/listener/helpers.js +15 -15
- package/lib/listener/mocha.js +1 -1
- package/lib/listener/result.js +12 -0
- package/lib/listener/retryEnhancer.js +85 -0
- package/lib/listener/steps.js +32 -18
- package/lib/listener/store.js +20 -0
- package/lib/mocha/asyncWrapper.js +231 -0
- package/lib/{interfaces → mocha}/bdd.js +3 -3
- package/lib/mocha/cli.js +308 -0
- package/lib/mocha/factory.js +104 -0
- package/lib/{interfaces → mocha}/featureConfig.js +32 -12
- package/lib/{interfaces → mocha}/gherkin.js +26 -28
- package/lib/mocha/hooks.js +112 -0
- package/lib/mocha/index.js +12 -0
- package/lib/mocha/inject.js +29 -0
- package/lib/{interfaces → mocha}/scenarioConfig.js +31 -7
- package/lib/mocha/suite.js +82 -0
- package/lib/mocha/test.js +181 -0
- package/lib/mocha/types.d.ts +42 -0
- package/lib/mocha/ui.js +232 -0
- package/lib/output.js +82 -62
- package/lib/pause.js +160 -138
- package/lib/plugin/analyze.js +396 -0
- package/lib/plugin/auth.js +435 -0
- package/lib/plugin/autoDelay.js +8 -8
- package/lib/plugin/autoLogin.js +3 -338
- package/lib/plugin/commentStep.js +6 -1
- package/lib/plugin/coverage.js +10 -19
- package/lib/plugin/customLocator.js +3 -3
- package/lib/plugin/customReporter.js +52 -0
- package/lib/plugin/eachElement.js +1 -1
- package/lib/plugin/fakerTransform.js +1 -1
- package/lib/plugin/heal.js +36 -9
- package/lib/plugin/htmlReporter.js +1947 -0
- package/lib/plugin/pageInfo.js +140 -0
- package/lib/plugin/retryFailedStep.js +17 -18
- package/lib/plugin/retryTo.js +2 -113
- package/lib/plugin/screenshotOnFail.js +17 -58
- package/lib/plugin/selenoid.js +15 -35
- package/lib/plugin/standardActingHelpers.js +4 -1
- package/lib/plugin/stepByStepReport.js +56 -17
- package/lib/plugin/stepTimeout.js +5 -12
- package/lib/plugin/subtitles.js +4 -4
- package/lib/plugin/tryTo.js +3 -102
- package/lib/plugin/wdio.js +8 -10
- package/lib/recorder.js +155 -124
- package/lib/rerun.js +43 -42
- package/lib/result.js +161 -0
- package/lib/secret.js +1 -1
- package/lib/step/base.js +239 -0
- package/lib/step/comment.js +10 -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 +21 -332
- package/lib/steps.js +50 -0
- package/lib/store.js +37 -5
- package/lib/template/heal.js +2 -11
- package/lib/test-server.js +323 -0
- package/lib/timeout.js +66 -0
- package/lib/utils.js +351 -218
- package/lib/within.js +75 -55
- package/lib/workerStorage.js +2 -1
- package/lib/workers.js +386 -276
- package/package.json +76 -70
- package/translations/de-DE.js +4 -3
- package/translations/fr-FR.js +4 -3
- package/translations/index.js +1 -0
- package/translations/it-IT.js +4 -3
- package/translations/ja-JP.js +4 -3
- package/translations/nl-NL.js +76 -0
- package/translations/pl-PL.js +4 -3
- package/translations/pt-BR.js +4 -3
- package/translations/ru-RU.js +4 -3
- package/translations/utils.js +9 -0
- package/translations/zh-CN.js +4 -3
- package/translations/zh-TW.js +4 -3
- package/typings/index.d.ts +188 -186
- package/typings/promiseBasedTypes.d.ts +18 -705
- package/typings/types.d.ts +301 -804
- package/lib/cli.js +0 -256
- package/lib/helper/ExpectHelper.js +0 -391
- package/lib/helper/SoftExpectHelper.js +0 -381
- package/lib/listener/artifacts.js +0 -19
- package/lib/listener/timeout.js +0 -109
- package/lib/mochaFactory.js +0 -113
- package/lib/plugin/debugErrors.js +0 -67
- package/lib/scenario.js +0 -224
- package/lib/ui.js +0 -236
|
@@ -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(): Promise<any>;
|
|
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
|
|
@@ -1185,228 +1179,6 @@ declare namespace CodeceptJS {
|
|
|
1185
1179
|
*/
|
|
1186
1180
|
waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
|
|
1187
1181
|
}
|
|
1188
|
-
/**
|
|
1189
|
-
* This helper allows performing assertions based on Chai.
|
|
1190
|
-
*
|
|
1191
|
-
* ### Examples
|
|
1192
|
-
*
|
|
1193
|
-
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
1194
|
-
*
|
|
1195
|
-
* ```js
|
|
1196
|
-
* // inside codecept.conf.js
|
|
1197
|
-
* {
|
|
1198
|
-
* helpers: {
|
|
1199
|
-
* Playwright: {...},
|
|
1200
|
-
* ExpectHelper: {},
|
|
1201
|
-
* }
|
|
1202
|
-
* }
|
|
1203
|
-
* ```
|
|
1204
|
-
*
|
|
1205
|
-
* ## Methods
|
|
1206
|
-
*/
|
|
1207
|
-
class ExpectHelper {
|
|
1208
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1209
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1210
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1211
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1212
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1213
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1214
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1215
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1216
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1217
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1218
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1219
|
-
/**
|
|
1220
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1221
|
-
*/
|
|
1222
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1223
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1224
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1225
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1226
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1227
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1228
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1229
|
-
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1230
|
-
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1231
|
-
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1232
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1233
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1234
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1235
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1236
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1237
|
-
/**
|
|
1238
|
-
* expects members of two arrays are deeply equal
|
|
1239
|
-
*/
|
|
1240
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1241
|
-
/**
|
|
1242
|
-
* expects an array to be a superset of another array
|
|
1243
|
-
*/
|
|
1244
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1245
|
-
/**
|
|
1246
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1247
|
-
*/
|
|
1248
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1249
|
-
/**
|
|
1250
|
-
* expects a JSON object matches a provided pattern
|
|
1251
|
-
*/
|
|
1252
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1253
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1254
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1255
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1256
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1257
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1258
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1259
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1260
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1261
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1262
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1263
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1264
|
-
/**
|
|
1265
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1266
|
-
*/
|
|
1267
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1268
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1269
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1270
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1271
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1272
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1273
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1274
|
-
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1275
|
-
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1276
|
-
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1277
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1278
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1279
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1280
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1281
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1282
|
-
/**
|
|
1283
|
-
* expects members of two arrays are deeply equal
|
|
1284
|
-
*/
|
|
1285
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1286
|
-
/**
|
|
1287
|
-
* expects an array to be a superset of another array
|
|
1288
|
-
*/
|
|
1289
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1290
|
-
/**
|
|
1291
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1292
|
-
*/
|
|
1293
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1294
|
-
/**
|
|
1295
|
-
* expects a JSON object matches a provided pattern
|
|
1296
|
-
*/
|
|
1297
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1298
|
-
}
|
|
1299
|
-
/**
|
|
1300
|
-
* This helper allows performing assertions based on Chai.
|
|
1301
|
-
*
|
|
1302
|
-
* ### Examples
|
|
1303
|
-
*
|
|
1304
|
-
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
1305
|
-
*
|
|
1306
|
-
* ```js
|
|
1307
|
-
* // inside codecept.conf.js
|
|
1308
|
-
* {
|
|
1309
|
-
* helpers: {
|
|
1310
|
-
* Playwright: {...},
|
|
1311
|
-
* ExpectHelper: {},
|
|
1312
|
-
* }
|
|
1313
|
-
* }
|
|
1314
|
-
* ```
|
|
1315
|
-
*
|
|
1316
|
-
* ## Methods
|
|
1317
|
-
*/
|
|
1318
|
-
class ExpectHelper {
|
|
1319
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1320
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1321
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1322
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1323
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1324
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1325
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1326
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1327
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1328
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1329
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1330
|
-
/**
|
|
1331
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1332
|
-
*/
|
|
1333
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1334
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1335
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1336
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1337
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1338
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1339
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1340
|
-
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1341
|
-
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1342
|
-
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1343
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1344
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1345
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1346
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1347
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1348
|
-
/**
|
|
1349
|
-
* expects members of two arrays are deeply equal
|
|
1350
|
-
*/
|
|
1351
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1352
|
-
/**
|
|
1353
|
-
* expects an array to be a superset of another array
|
|
1354
|
-
*/
|
|
1355
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1356
|
-
/**
|
|
1357
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1358
|
-
*/
|
|
1359
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1360
|
-
/**
|
|
1361
|
-
* expects a JSON object matches a provided pattern
|
|
1362
|
-
*/
|
|
1363
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1364
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1365
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1366
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1367
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1368
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1369
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1370
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1371
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1372
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1373
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1374
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1375
|
-
/**
|
|
1376
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1377
|
-
*/
|
|
1378
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1379
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1380
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1381
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1382
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1383
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1384
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1385
|
-
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1386
|
-
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1387
|
-
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1388
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1389
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1390
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1391
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1392
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1393
|
-
/**
|
|
1394
|
-
* expects members of two arrays are deeply equal
|
|
1395
|
-
*/
|
|
1396
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1397
|
-
/**
|
|
1398
|
-
* expects an array to be a superset of another array
|
|
1399
|
-
*/
|
|
1400
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1401
|
-
/**
|
|
1402
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1403
|
-
*/
|
|
1404
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1405
|
-
/**
|
|
1406
|
-
* expects a JSON object matches a provided pattern
|
|
1407
|
-
*/
|
|
1408
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1409
|
-
}
|
|
1410
1182
|
/**
|
|
1411
1183
|
* Helper for testing filesystem.
|
|
1412
1184
|
* Can be easily used to check file structures:
|
|
@@ -1930,13 +1702,14 @@ declare namespace CodeceptJS {
|
|
|
1930
1702
|
*/
|
|
1931
1703
|
seeResponseContainsKeys(keys: any[]): Promise<any>;
|
|
1932
1704
|
/**
|
|
1933
|
-
* Executes a callback function passing in `response` object and
|
|
1705
|
+
* Executes a callback function passing in `response` object and assert
|
|
1934
1706
|
* Use it to perform custom checks of response data
|
|
1935
1707
|
*
|
|
1936
1708
|
* ```js
|
|
1937
|
-
* I.seeResponseValidByCallback(({ data, status
|
|
1938
|
-
*
|
|
1939
|
-
*
|
|
1709
|
+
* I.seeResponseValidByCallback(({ data, status }) => {
|
|
1710
|
+
* assert.strictEqual(status, 200);
|
|
1711
|
+
* assert('user' in data);
|
|
1712
|
+
* assert('company' in data);
|
|
1940
1713
|
* });
|
|
1941
1714
|
* ```
|
|
1942
1715
|
*/
|
|
@@ -1978,188 +1751,6 @@ declare namespace CodeceptJS {
|
|
|
1978
1751
|
*/
|
|
1979
1752
|
seeResponseMatchesJsonSchema(fnOrSchema: any): Promise<any>;
|
|
1980
1753
|
}
|
|
1981
|
-
/**
|
|
1982
|
-
* ## Configuration
|
|
1983
|
-
*
|
|
1984
|
-
* This helper should be configured in codecept.conf.(js|ts)
|
|
1985
|
-
* @property [port = 9393] - Mock server port
|
|
1986
|
-
* @property [host = "0.0.0.0"] - Mock server host
|
|
1987
|
-
* @property [httpsOpts] - key & cert values are the paths to .key and .crt files
|
|
1988
|
-
*/
|
|
1989
|
-
type MockServerConfig = {
|
|
1990
|
-
port?: number;
|
|
1991
|
-
host?: string;
|
|
1992
|
-
httpsOpts?: any;
|
|
1993
|
-
};
|
|
1994
|
-
/**
|
|
1995
|
-
* MockServer
|
|
1996
|
-
*
|
|
1997
|
-
* The MockServer Helper in CodeceptJS empowers you to mock any server or service via HTTP or HTTPS, making it an excellent tool for simulating REST endpoints and other HTTP-based APIs.
|
|
1998
|
-
*
|
|
1999
|
-
* <!-- configuration -->
|
|
2000
|
-
*
|
|
2001
|
-
* #### Examples
|
|
2002
|
-
*
|
|
2003
|
-
* You can seamlessly integrate MockServer with other helpers like REST or Playwright. Here's a configuration example inside the `codecept.conf.js` file:
|
|
2004
|
-
*
|
|
2005
|
-
* ```javascript
|
|
2006
|
-
* {
|
|
2007
|
-
* helpers: {
|
|
2008
|
-
* REST: {...},
|
|
2009
|
-
* MockServer: {
|
|
2010
|
-
* // default mock server config
|
|
2011
|
-
* port: 9393,
|
|
2012
|
-
* host: '0.0.0.0',
|
|
2013
|
-
* httpsOpts: {
|
|
2014
|
-
* key: '',
|
|
2015
|
-
* cert: '',
|
|
2016
|
-
* },
|
|
2017
|
-
* },
|
|
2018
|
-
* }
|
|
2019
|
-
* }
|
|
2020
|
-
* ```
|
|
2021
|
-
*
|
|
2022
|
-
* #### Adding Interactions
|
|
2023
|
-
*
|
|
2024
|
-
* Interactions add behavior to the mock server. Use the `I.addInteractionToMockServer()` method to include interactions. It takes an interaction object as an argument, containing request and response details.
|
|
2025
|
-
*
|
|
2026
|
-
* ```javascript
|
|
2027
|
-
* I.addInteractionToMockServer({
|
|
2028
|
-
* request: {
|
|
2029
|
-
* method: 'GET',
|
|
2030
|
-
* path: '/api/hello'
|
|
2031
|
-
* },
|
|
2032
|
-
* response: {
|
|
2033
|
-
* status: 200,
|
|
2034
|
-
* body: {
|
|
2035
|
-
* 'say': 'hello to mock server'
|
|
2036
|
-
* }
|
|
2037
|
-
* }
|
|
2038
|
-
* });
|
|
2039
|
-
* ```
|
|
2040
|
-
*
|
|
2041
|
-
* #### Request Matching
|
|
2042
|
-
*
|
|
2043
|
-
* When a real request is sent to the mock server, it matches the received request with the interactions. If a match is found, it returns the specified response; otherwise, a 404 status code is returned.
|
|
2044
|
-
*
|
|
2045
|
-
* - Strong match on HTTP Method, Path, Query Params & JSON body.
|
|
2046
|
-
* - Loose match on Headers.
|
|
2047
|
-
*
|
|
2048
|
-
* ##### Strong Match on Query Params
|
|
2049
|
-
*
|
|
2050
|
-
* You can send different responses based on query parameters:
|
|
2051
|
-
*
|
|
2052
|
-
* ```javascript
|
|
2053
|
-
* I.addInteractionToMockServer({
|
|
2054
|
-
* request: {
|
|
2055
|
-
* method: 'GET',
|
|
2056
|
-
* path: '/api/users',
|
|
2057
|
-
* queryParams: {
|
|
2058
|
-
* id: 1
|
|
2059
|
-
* }
|
|
2060
|
-
* },
|
|
2061
|
-
* response: {
|
|
2062
|
-
* status: 200,
|
|
2063
|
-
* body: 'user 1'
|
|
2064
|
-
* }
|
|
2065
|
-
* });
|
|
2066
|
-
*
|
|
2067
|
-
* I.addInteractionToMockServer({
|
|
2068
|
-
* request: {
|
|
2069
|
-
* method: 'GET',
|
|
2070
|
-
* path: '/api/users',
|
|
2071
|
-
* queryParams: {
|
|
2072
|
-
* id: 2
|
|
2073
|
-
* }
|
|
2074
|
-
* },
|
|
2075
|
-
* response: {
|
|
2076
|
-
* status: 200,
|
|
2077
|
-
* body: 'user 2'
|
|
2078
|
-
* }
|
|
2079
|
-
* });
|
|
2080
|
-
* ```
|
|
2081
|
-
*
|
|
2082
|
-
* - GET to `/api/users?id=1` will return 'user 1'.
|
|
2083
|
-
* - GET to `/api/users?id=2` will return 'user 2'.
|
|
2084
|
-
* - For all other requests, it returns a 404 status code.
|
|
2085
|
-
*
|
|
2086
|
-
* ##### Loose Match on Body
|
|
2087
|
-
*
|
|
2088
|
-
* When `strict` is set to false, it performs a loose match on query params and response body:
|
|
2089
|
-
*
|
|
2090
|
-
* ```javascript
|
|
2091
|
-
* I.addInteractionToMockServer({
|
|
2092
|
-
* strict: false,
|
|
2093
|
-
* request: {
|
|
2094
|
-
* method: 'POST',
|
|
2095
|
-
* path: '/api/users',
|
|
2096
|
-
* body: {
|
|
2097
|
-
* name: 'john'
|
|
2098
|
-
* }
|
|
2099
|
-
* },
|
|
2100
|
-
* response: {
|
|
2101
|
-
* status: 200
|
|
2102
|
-
* }
|
|
2103
|
-
* });
|
|
2104
|
-
* ```
|
|
2105
|
-
*
|
|
2106
|
-
* - POST to `/api/users` with the body containing `name` as 'john' will return a 200 status code.
|
|
2107
|
-
* - POST to `/api/users` without the `name` property in the body will return a 404 status code.
|
|
2108
|
-
*
|
|
2109
|
-
* Happy testing with MockServer in CodeceptJS! 🚀
|
|
2110
|
-
*
|
|
2111
|
-
* ## Methods
|
|
2112
|
-
*/
|
|
2113
|
-
class MockServer {
|
|
2114
|
-
/**
|
|
2115
|
-
* Start the mock server
|
|
2116
|
-
* @param [port] - start the mock server with given port
|
|
2117
|
-
*/
|
|
2118
|
-
startMockServer(port?: number): Promise<any>;
|
|
2119
|
-
/**
|
|
2120
|
-
* Stop the mock server
|
|
2121
|
-
*/
|
|
2122
|
-
stopMockServer(): Promise<any>;
|
|
2123
|
-
/**
|
|
2124
|
-
* An interaction adds behavior to the mock server
|
|
2125
|
-
*
|
|
2126
|
-
*
|
|
2127
|
-
* ```js
|
|
2128
|
-
* I.addInteractionToMockServer({
|
|
2129
|
-
* request: {
|
|
2130
|
-
* method: 'GET',
|
|
2131
|
-
* path: '/api/hello'
|
|
2132
|
-
* },
|
|
2133
|
-
* response: {
|
|
2134
|
-
* status: 200,
|
|
2135
|
-
* body: {
|
|
2136
|
-
* 'say': 'hello to mock server'
|
|
2137
|
-
* }
|
|
2138
|
-
* }
|
|
2139
|
-
* });
|
|
2140
|
-
* ```
|
|
2141
|
-
* ```js
|
|
2142
|
-
* // with query params
|
|
2143
|
-
* I.addInteractionToMockServer({
|
|
2144
|
-
* request: {
|
|
2145
|
-
* method: 'GET',
|
|
2146
|
-
* path: '/api/hello',
|
|
2147
|
-
* queryParams: {
|
|
2148
|
-
* id: 2
|
|
2149
|
-
* }
|
|
2150
|
-
* },
|
|
2151
|
-
* response: {
|
|
2152
|
-
* status: 200,
|
|
2153
|
-
* body: {
|
|
2154
|
-
* 'say': 'hello to mock server'
|
|
2155
|
-
* }
|
|
2156
|
-
* }
|
|
2157
|
-
* });
|
|
2158
|
-
* ```
|
|
2159
|
-
* @param interaction - add behavior to the mock server
|
|
2160
|
-
*/
|
|
2161
|
-
addInteractionToMockServer(interaction: CodeceptJS.MockInteraction | any): Promise<any>;
|
|
2162
|
-
}
|
|
2163
1754
|
/**
|
|
2164
1755
|
* Nightmare helper wraps [Nightmare](https://github.com/segmentio/nightmare) library to provide
|
|
2165
1756
|
* fastest headless testing using Electron engine. Unlike Selenium-based drivers this uses
|
|
@@ -2898,7 +2489,7 @@ declare namespace CodeceptJS {
|
|
|
2898
2489
|
*
|
|
2899
2490
|
* ```js
|
|
2900
2491
|
* I.clearCookie();
|
|
2901
|
-
* I.clearCookie('test');
|
|
2492
|
+
* I.clearCookie('test');
|
|
2902
2493
|
* ```
|
|
2903
2494
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
2904
2495
|
*/
|
|
@@ -3099,46 +2690,6 @@ declare namespace CodeceptJS {
|
|
|
3099
2690
|
*/
|
|
3100
2691
|
grabPageScrollPosition(): Promise<PageScrollPosition>;
|
|
3101
2692
|
}
|
|
3102
|
-
/**
|
|
3103
|
-
* OpenAI Helper for CodeceptJS.
|
|
3104
|
-
*
|
|
3105
|
-
* This helper class provides integration with the OpenAI GPT-3.5 or 4 language model for generating responses to questions or prompts within the context of web pages. It allows you to interact with the GPT-3.5 model to obtain intelligent responses based on HTML fragments or general prompts.
|
|
3106
|
-
* This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
|
|
3107
|
-
*
|
|
3108
|
-
* ## Configuration
|
|
3109
|
-
*
|
|
3110
|
-
* This helper should be configured in codecept.json or codecept.conf.js
|
|
3111
|
-
*
|
|
3112
|
-
* * `chunkSize`: (optional, default: 80000) - The maximum number of characters to send to the OpenAI API at once. We split HTML fragments by 8000 chars to not exceed token limit. Increase this value if you use GPT-4.
|
|
3113
|
-
*/
|
|
3114
|
-
class OpenAITs {
|
|
3115
|
-
/**
|
|
3116
|
-
* Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
|
|
3117
|
-
*
|
|
3118
|
-
* ```js
|
|
3119
|
-
* I.askGptOnPage('what does this page do?');
|
|
3120
|
-
* ```
|
|
3121
|
-
* @param prompt - The question or prompt to ask the GPT model.
|
|
3122
|
-
* @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
|
|
3123
|
-
*/
|
|
3124
|
-
askGptOnPage(prompt: string): Promise<string>;
|
|
3125
|
-
/**
|
|
3126
|
-
* Asks the OpenAI GPT-3.5 language model a question based on the provided prompt within the context of a specific HTML fragment on the current page.
|
|
3127
|
-
*
|
|
3128
|
-
* ```js
|
|
3129
|
-
* I.askGptOnPageFragment('describe features of this screen', '.screen');
|
|
3130
|
-
* ```
|
|
3131
|
-
* @param prompt - The question or prompt to ask the GPT-3.5 model.
|
|
3132
|
-
* @param locator - The locator or selector used to identify the HTML fragment on the page.
|
|
3133
|
-
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
3134
|
-
*/
|
|
3135
|
-
askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
|
|
3136
|
-
/**
|
|
3137
|
-
* Send a general request to ChatGPT and return response.
|
|
3138
|
-
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
3139
|
-
*/
|
|
3140
|
-
askGptGeneralPrompt(prompt: string): Promise<string>;
|
|
3141
|
-
}
|
|
3142
2693
|
/**
|
|
3143
2694
|
* ## Configuration
|
|
3144
2695
|
*
|
|
@@ -3183,6 +2734,7 @@ declare namespace CodeceptJS {
|
|
|
3183
2734
|
* @property [recordHar] - record HAR and will be saved to `output/har`. See more of [HAR options](https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har).
|
|
3184
2735
|
* @property [testIdAttribute = data-testid] - locate elements based on the testIdAttribute. See more of [locate by test id](https://playwright.dev/docs/locators#locate-by-test-id).
|
|
3185
2736
|
*/
|
|
2737
|
+
// @ts-ignore
|
|
3186
2738
|
type PlaywrightConfig = {
|
|
3187
2739
|
url?: string;
|
|
3188
2740
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -4536,7 +4088,7 @@ declare namespace CodeceptJS {
|
|
|
4536
4088
|
*
|
|
4537
4089
|
* ```js
|
|
4538
4090
|
* I.clearCookie();
|
|
4539
|
-
* I.clearCookie('test');
|
|
4091
|
+
* I.clearCookie('test');
|
|
4540
4092
|
* ```
|
|
4541
4093
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
4542
4094
|
*/
|
|
@@ -6138,7 +5690,7 @@ declare namespace CodeceptJS {
|
|
|
6138
5690
|
*
|
|
6139
5691
|
* ```js
|
|
6140
5692
|
* I.clearCookie();
|
|
6141
|
-
* I.clearCookie('test');
|
|
5693
|
+
* I.clearCookie('test');
|
|
6142
5694
|
* ```
|
|
6143
5695
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
6144
5696
|
*/
|
|
@@ -6559,6 +6111,7 @@ declare namespace CodeceptJS {
|
|
|
6559
6111
|
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions).
|
|
6560
6112
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6561
6113
|
*/
|
|
6114
|
+
// @ts-ignore
|
|
6562
6115
|
type PuppeteerConfig = {
|
|
6563
6116
|
url: string;
|
|
6564
6117
|
basicAuth?: any;
|
|
@@ -7712,7 +7265,7 @@ declare namespace CodeceptJS {
|
|
|
7712
7265
|
*
|
|
7713
7266
|
* ```js
|
|
7714
7267
|
* I.clearCookie();
|
|
7715
|
-
* I.clearCookie('test');
|
|
7268
|
+
* I.clearCookie('test');
|
|
7716
7269
|
* ```
|
|
7717
7270
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
7718
7271
|
*/
|
|
@@ -8365,6 +7918,7 @@ declare namespace CodeceptJS {
|
|
|
8365
7918
|
* @property [onResponse] - an async function which can update response object.
|
|
8366
7919
|
* @property [maxUploadFileSize] - set the max content file size in MB when performing api calls.
|
|
8367
7920
|
*/
|
|
7921
|
+
// @ts-ignore
|
|
8368
7922
|
type RESTConfig = {
|
|
8369
7923
|
endpoint?: string;
|
|
8370
7924
|
prettyPrintJson?: boolean;
|
|
@@ -8557,250 +8111,6 @@ declare namespace CodeceptJS {
|
|
|
8557
8111
|
*/
|
|
8558
8112
|
sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
|
|
8559
8113
|
}
|
|
8560
|
-
/**
|
|
8561
|
-
* SoftAssertHelper is a utility class for performing soft assertions.
|
|
8562
|
-
* Unlike traditional assertions that stop the execution on failure,
|
|
8563
|
-
* soft assertions allow the execution to continue and report all failures at the end.
|
|
8564
|
-
*
|
|
8565
|
-
* ### Examples
|
|
8566
|
-
*
|
|
8567
|
-
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
8568
|
-
*
|
|
8569
|
-
* ```js
|
|
8570
|
-
* // inside codecept.conf.js
|
|
8571
|
-
* {
|
|
8572
|
-
* helpers: {
|
|
8573
|
-
* Playwright: {...},
|
|
8574
|
-
* SoftExpectHelper: {},
|
|
8575
|
-
* }
|
|
8576
|
-
* }
|
|
8577
|
-
* ```
|
|
8578
|
-
*
|
|
8579
|
-
* ```js
|
|
8580
|
-
* // in scenario
|
|
8581
|
-
* I.softExpectEqual('a', 'b')
|
|
8582
|
-
* I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
|
|
8583
|
-
* ```
|
|
8584
|
-
*
|
|
8585
|
-
* ## Methods
|
|
8586
|
-
*/
|
|
8587
|
-
class SoftAssertHelperTs {
|
|
8588
|
-
/**
|
|
8589
|
-
* Performs a soft assertion by executing the provided assertion function.
|
|
8590
|
-
* If the assertion fails, the error is caught and stored without halting the execution.
|
|
8591
|
-
* @param assertionFn - The assertion function to execute.
|
|
8592
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8593
|
-
*/
|
|
8594
|
-
softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): Promise<any>;
|
|
8595
|
-
/**
|
|
8596
|
-
* Throws an error if any soft assertions have failed.
|
|
8597
|
-
* The error message contains all the accumulated failures.
|
|
8598
|
-
*/
|
|
8599
|
-
flushSoftAssertions(): Promise<any>;
|
|
8600
|
-
/**
|
|
8601
|
-
* Softly asserts that two values are equal.
|
|
8602
|
-
* @param actualValue - The actual value.
|
|
8603
|
-
* @param expectedValue - The expected value.
|
|
8604
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8605
|
-
*/
|
|
8606
|
-
softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8607
|
-
/**
|
|
8608
|
-
* Softly asserts that two values are not equal.
|
|
8609
|
-
* @param actualValue - The actual value.
|
|
8610
|
-
* @param expectedValue - The expected value.
|
|
8611
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8612
|
-
*/
|
|
8613
|
-
softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8614
|
-
/**
|
|
8615
|
-
* Softly asserts that two values are deeply equal.
|
|
8616
|
-
* @param actualValue - The actual value.
|
|
8617
|
-
* @param expectedValue - The expected value.
|
|
8618
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8619
|
-
*/
|
|
8620
|
-
softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8621
|
-
/**
|
|
8622
|
-
* Softly asserts that two values are not deeply equal.
|
|
8623
|
-
* @param actualValue - The actual value.
|
|
8624
|
-
* @param expectedValue - The expected value.
|
|
8625
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8626
|
-
*/
|
|
8627
|
-
softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8628
|
-
/**
|
|
8629
|
-
* Softly asserts that a value contains the expected value.
|
|
8630
|
-
* @param actualValue - The actual value.
|
|
8631
|
-
* @param expectedValueToContain - The value that should be contained within the actual value.
|
|
8632
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8633
|
-
*/
|
|
8634
|
-
softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): Promise<any>;
|
|
8635
|
-
/**
|
|
8636
|
-
* Softly asserts that a value does not contain the expected value.
|
|
8637
|
-
* @param actualValue - The actual value.
|
|
8638
|
-
* @param expectedValueToNotContain - The value that should not be contained within the actual value.
|
|
8639
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8640
|
-
*/
|
|
8641
|
-
softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): Promise<any>;
|
|
8642
|
-
/**
|
|
8643
|
-
* Softly asserts that a value starts with the expected value.
|
|
8644
|
-
* @param actualValue - The actual value.
|
|
8645
|
-
* @param expectedValueToStartWith - The value that the actual value should start with.
|
|
8646
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8647
|
-
*/
|
|
8648
|
-
softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): Promise<any>;
|
|
8649
|
-
/**
|
|
8650
|
-
* Softly asserts that a value does not start with the expected value.
|
|
8651
|
-
* @param actualValue - The actual value.
|
|
8652
|
-
* @param expectedValueToNotStartWith - The value that the actual value should not start with.
|
|
8653
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8654
|
-
*/
|
|
8655
|
-
softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): Promise<any>;
|
|
8656
|
-
/**
|
|
8657
|
-
* Softly asserts that a value ends with the expected value.
|
|
8658
|
-
* @param actualValue - The actual value.
|
|
8659
|
-
* @param expectedValueToEndWith - The value that the actual value should end with.
|
|
8660
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8661
|
-
*/
|
|
8662
|
-
softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): Promise<any>;
|
|
8663
|
-
/**
|
|
8664
|
-
* Softly asserts that a value does not end with the expected value.
|
|
8665
|
-
* @param actualValue - The actual value.
|
|
8666
|
-
* @param expectedValueToNotEndWith - The value that the actual value should not end with.
|
|
8667
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8668
|
-
*/
|
|
8669
|
-
softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): Promise<any>;
|
|
8670
|
-
/**
|
|
8671
|
-
* Softly asserts that the target data matches the given JSON schema.
|
|
8672
|
-
* @param targetData - The data to validate.
|
|
8673
|
-
* @param jsonSchema - The JSON schema to validate against.
|
|
8674
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8675
|
-
*/
|
|
8676
|
-
softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): Promise<any>;
|
|
8677
|
-
/**
|
|
8678
|
-
* Softly asserts that the target data matches the given JSON schema using AJV.
|
|
8679
|
-
* @param targetData - The data to validate.
|
|
8680
|
-
* @param jsonSchema - The JSON schema to validate against.
|
|
8681
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8682
|
-
* @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
|
|
8683
|
-
*/
|
|
8684
|
-
softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): Promise<any>;
|
|
8685
|
-
/**
|
|
8686
|
-
* Softly asserts that the target data has the specified property.
|
|
8687
|
-
* @param targetData - The data to check.
|
|
8688
|
-
* @param propertyName - The property name to check for.
|
|
8689
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion
|
|
8690
|
-
* fails.
|
|
8691
|
-
*/
|
|
8692
|
-
softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
|
|
8693
|
-
/**
|
|
8694
|
-
* Softly asserts that the target data has a property with the specified name.
|
|
8695
|
-
* @param targetData - The data to check.
|
|
8696
|
-
* @param propertyName - The property name to check for.
|
|
8697
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8698
|
-
*/
|
|
8699
|
-
softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
|
|
8700
|
-
/**
|
|
8701
|
-
* Softly asserts that the target data is of a specific type.
|
|
8702
|
-
* @param targetData - The data to check.
|
|
8703
|
-
* @param type - The expected type (e.g., 'string', 'number').
|
|
8704
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8705
|
-
*/
|
|
8706
|
-
softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
|
|
8707
|
-
/**
|
|
8708
|
-
* Softly asserts that the target data is of a specific type (alternative for articles).
|
|
8709
|
-
* @param targetData - The data to check.
|
|
8710
|
-
* @param type - The expected type (e.g., 'string', 'number').
|
|
8711
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8712
|
-
*/
|
|
8713
|
-
softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
|
|
8714
|
-
/**
|
|
8715
|
-
* Softly asserts that the target data has a specified length.
|
|
8716
|
-
* @param targetData - The data to check.
|
|
8717
|
-
* @param length - The expected length.
|
|
8718
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8719
|
-
*/
|
|
8720
|
-
softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): Promise<any>;
|
|
8721
|
-
/**
|
|
8722
|
-
* Softly asserts that the target data is empty.
|
|
8723
|
-
* @param targetData - The data to check.
|
|
8724
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8725
|
-
*/
|
|
8726
|
-
softExpectEmpty(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8727
|
-
/**
|
|
8728
|
-
* Softly asserts that the target data is true.
|
|
8729
|
-
* @param targetData - The data to check.
|
|
8730
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8731
|
-
*/
|
|
8732
|
-
softExpectTrue(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8733
|
-
/**
|
|
8734
|
-
* Softly asserts that the target data is false.
|
|
8735
|
-
* @param targetData - The data to check.
|
|
8736
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8737
|
-
*/
|
|
8738
|
-
softExpectFalse(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8739
|
-
/**
|
|
8740
|
-
* Softly asserts that the target data is above a specified value.
|
|
8741
|
-
* @param targetData - The data to check.
|
|
8742
|
-
* @param aboveThan - The value that the target data should be above.
|
|
8743
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8744
|
-
*/
|
|
8745
|
-
softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): Promise<any>;
|
|
8746
|
-
/**
|
|
8747
|
-
* Softly asserts that the target data is below a specified value.
|
|
8748
|
-
* @param targetData - The data to check.
|
|
8749
|
-
* @param belowThan - The value that the target data should be below.
|
|
8750
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8751
|
-
*/
|
|
8752
|
-
softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): Promise<any>;
|
|
8753
|
-
/**
|
|
8754
|
-
* Softly asserts that the length of the target data is above a specified value.
|
|
8755
|
-
* @param targetData - The data to check.
|
|
8756
|
-
* @param lengthAboveThan - The length that the target data should be above.
|
|
8757
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8758
|
-
*/
|
|
8759
|
-
softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): Promise<any>;
|
|
8760
|
-
/**
|
|
8761
|
-
* Softly asserts that the length of the target data is below a specified value.
|
|
8762
|
-
* @param targetData - The data to check.
|
|
8763
|
-
* @param lengthBelowThan - The length that the target data should be below.
|
|
8764
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8765
|
-
*/
|
|
8766
|
-
softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): Promise<any>;
|
|
8767
|
-
/**
|
|
8768
|
-
* Softly asserts that two values are equal, ignoring case.
|
|
8769
|
-
* @param actualValue - The actual string value.
|
|
8770
|
-
* @param expectedValue - The expected string value.
|
|
8771
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8772
|
-
*/
|
|
8773
|
-
softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): Promise<any>;
|
|
8774
|
-
/**
|
|
8775
|
-
* Softly asserts that two arrays have deep equality, considering members in any order.
|
|
8776
|
-
* @param actualValue - The actual array.
|
|
8777
|
-
* @param expectedValue - The expected array.
|
|
8778
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8779
|
-
*/
|
|
8780
|
-
softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): Promise<any>;
|
|
8781
|
-
/**
|
|
8782
|
-
* Softly asserts that an array (superset) deeply includes all members of another array (set).
|
|
8783
|
-
* @param superset - The array that should contain the expected members.
|
|
8784
|
-
* @param set - The array with members that should be included.
|
|
8785
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8786
|
-
*/
|
|
8787
|
-
softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): Promise<any>;
|
|
8788
|
-
/**
|
|
8789
|
-
* Softly asserts that two objects are deeply equal, excluding specified fields.
|
|
8790
|
-
* @param actualValue - The actual object.
|
|
8791
|
-
* @param expectedValue - The expected object.
|
|
8792
|
-
* @param fieldsToExclude - The fields to exclude from the comparison.
|
|
8793
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8794
|
-
*/
|
|
8795
|
-
softExpectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string[], customErrorMsg?: string): Promise<any>;
|
|
8796
|
-
/**
|
|
8797
|
-
* Softly asserts that a value matches the expected pattern.
|
|
8798
|
-
* @param actualValue - The actual value.
|
|
8799
|
-
* @param expectedPattern - The pattern the value should match.
|
|
8800
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8801
|
-
*/
|
|
8802
|
-
softExpectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: string): Promise<any>;
|
|
8803
|
-
}
|
|
8804
8114
|
/**
|
|
8805
8115
|
* Client Functions
|
|
8806
8116
|
*/
|
|
@@ -9623,7 +8933,7 @@ declare namespace CodeceptJS {
|
|
|
9623
8933
|
*
|
|
9624
8934
|
* ```js
|
|
9625
8935
|
* I.clearCookie();
|
|
9626
|
-
* I.clearCookie('test');
|
|
8936
|
+
* I.clearCookie('test');
|
|
9627
8937
|
* ```
|
|
9628
8938
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
9629
8939
|
*/
|
|
@@ -9733,6 +9043,7 @@ declare namespace CodeceptJS {
|
|
|
9733
9043
|
* This helper should be configured in codecept.conf.js
|
|
9734
9044
|
* @property url - base url of website to be tested.
|
|
9735
9045
|
* @property browser - Browser in which to perform testing.
|
|
9046
|
+
* @property [bidiProtocol = false] - WebDriver Bidi Protocol. Default: false. More info: https://webdriver.io/docs/api/webdriverBidi/
|
|
9736
9047
|
* @property [basicAuth] - (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
9737
9048
|
* @property [host = localhost] - WebDriver host to connect.
|
|
9738
9049
|
* @property [port = 4444] - WebDriver port to connect.
|
|
@@ -9753,9 +9064,11 @@ declare namespace CodeceptJS {
|
|
|
9753
9064
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
9754
9065
|
* @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
|
|
9755
9066
|
*/
|
|
9067
|
+
// @ts-ignore
|
|
9756
9068
|
type WebDriverConfig = {
|
|
9757
9069
|
url: string;
|
|
9758
9070
|
browser: string;
|
|
9071
|
+
bidiProtocol?: boolean;
|
|
9759
9072
|
basicAuth?: string;
|
|
9760
9073
|
host?: string;
|
|
9761
9074
|
port?: number;
|
|
@@ -11023,7 +10336,7 @@ declare namespace CodeceptJS {
|
|
|
11023
10336
|
*
|
|
11024
10337
|
* ```js
|
|
11025
10338
|
* I.clearCookie();
|
|
11026
|
-
* I.clearCookie('test');
|
|
10339
|
+
* I.clearCookie('test');
|
|
11027
10340
|
* ```
|
|
11028
10341
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
11029
10342
|
*/
|