codeceptjs 4.0.0-beta.2 → 4.0.0-beta.21
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 +133 -120
- package/bin/codecept.js +107 -96
- package/bin/test-server.js +64 -0
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/click.mustache +5 -1
- package/lib/actor.js +73 -103
- package/lib/ai.js +159 -188
- package/lib/assert/empty.js +22 -24
- package/lib/assert/equal.js +30 -37
- package/lib/assert/error.js +14 -14
- package/lib/assert/include.js +43 -48
- package/lib/assert/throws.js +11 -11
- package/lib/assert/truth.js +22 -22
- package/lib/assert.js +20 -18
- package/lib/codecept.js +262 -162
- package/lib/colorUtils.js +50 -52
- package/lib/command/check.js +206 -0
- package/lib/command/configMigrate.js +56 -51
- package/lib/command/definitions.js +96 -109
- package/lib/command/dryRun.js +77 -79
- package/lib/command/generate.js +234 -194
- package/lib/command/gherkin/init.js +42 -33
- package/lib/command/gherkin/snippets.js +76 -74
- package/lib/command/gherkin/steps.js +20 -17
- package/lib/command/info.js +74 -38
- package/lib/command/init.js +301 -290
- package/lib/command/interactive.js +41 -32
- package/lib/command/list.js +28 -27
- package/lib/command/run-multiple/chunk.js +51 -48
- package/lib/command/run-multiple/collection.js +5 -5
- package/lib/command/run-multiple/run.js +5 -1
- package/lib/command/run-multiple.js +97 -97
- package/lib/command/run-rerun.js +19 -25
- package/lib/command/run-workers.js +68 -92
- package/lib/command/run.js +39 -27
- package/lib/command/utils.js +80 -64
- package/lib/command/workers/runTests.js +388 -226
- package/lib/config.js +109 -50
- package/lib/container.js +765 -261
- package/lib/data/context.js +60 -61
- package/lib/data/dataScenarioConfig.js +47 -47
- package/lib/data/dataTableArgument.js +32 -32
- package/lib/data/table.js +22 -22
- package/lib/effects.js +307 -0
- package/lib/element/WebElement.js +327 -0
- package/lib/els.js +160 -0
- package/lib/event.js +173 -163
- package/lib/globals.js +141 -0
- package/lib/heal.js +89 -85
- package/lib/helper/AI.js +131 -41
- package/lib/helper/ApiDataFactory.js +107 -75
- package/lib/helper/Appium.js +542 -404
- package/lib/helper/FileSystem.js +100 -79
- package/lib/helper/GraphQL.js +44 -43
- package/lib/helper/GraphQLDataFactory.js +52 -52
- package/lib/helper/JSONResponse.js +126 -88
- package/lib/helper/Mochawesome.js +54 -29
- package/lib/helper/Playwright.js +2547 -1316
- package/lib/helper/Puppeteer.js +1578 -1181
- package/lib/helper/REST.js +209 -68
- package/lib/helper/WebDriver.js +1482 -1342
- package/lib/helper/errors/ConnectionRefused.js +6 -6
- package/lib/helper/errors/ElementAssertion.js +11 -16
- package/lib/helper/errors/ElementNotFound.js +5 -9
- package/lib/helper/errors/RemoteBrowserConnectionRefused.js +5 -5
- package/lib/helper/extras/Console.js +11 -11
- package/lib/helper/extras/PlaywrightLocator.js +110 -0
- package/lib/helper/extras/PlaywrightPropEngine.js +18 -18
- package/lib/helper/extras/PlaywrightReactVueLocator.js +17 -8
- package/lib/helper/extras/PlaywrightRestartOpts.js +25 -11
- package/lib/helper/extras/Popup.js +22 -22
- package/lib/helper/extras/React.js +27 -28
- package/lib/helper/network/actions.js +36 -42
- package/lib/helper/network/utils.js +78 -84
- package/lib/helper/scripts/blurElement.js +5 -5
- package/lib/helper/scripts/focusElement.js +5 -5
- package/lib/helper/scripts/highlightElement.js +8 -8
- package/lib/helper/scripts/isElementClickable.js +34 -34
- package/lib/helper.js +2 -3
- package/lib/history.js +23 -19
- package/lib/hooks.js +8 -8
- package/lib/html.js +94 -104
- package/lib/index.js +38 -27
- package/lib/listener/config.js +30 -23
- package/lib/listener/emptyRun.js +54 -0
- package/lib/listener/enhancedGlobalRetry.js +110 -0
- package/lib/listener/exit.js +16 -18
- package/lib/listener/globalRetry.js +70 -0
- package/lib/listener/globalTimeout.js +181 -0
- package/lib/listener/helpers.js +76 -51
- package/lib/listener/mocha.js +10 -11
- package/lib/listener/result.js +11 -0
- package/lib/listener/retryEnhancer.js +85 -0
- package/lib/listener/steps.js +71 -59
- package/lib/listener/store.js +20 -0
- package/lib/locator.js +214 -197
- package/lib/mocha/asyncWrapper.js +274 -0
- package/lib/mocha/bdd.js +167 -0
- package/lib/mocha/cli.js +341 -0
- package/lib/mocha/factory.js +163 -0
- package/lib/mocha/featureConfig.js +89 -0
- package/lib/mocha/gherkin.js +231 -0
- package/lib/mocha/hooks.js +121 -0
- package/lib/mocha/index.js +21 -0
- package/lib/mocha/inject.js +46 -0
- package/lib/{interfaces → mocha}/scenarioConfig.js +58 -34
- package/lib/mocha/suite.js +89 -0
- package/lib/mocha/test.js +184 -0
- package/lib/mocha/types.d.ts +42 -0
- package/lib/mocha/ui.js +242 -0
- package/lib/output.js +141 -71
- package/lib/parser.js +54 -44
- package/lib/pause.js +173 -145
- package/lib/plugin/analyze.js +403 -0
- package/lib/plugin/{autoLogin.js → auth.js} +178 -79
- package/lib/plugin/autoDelay.js +36 -40
- package/lib/plugin/coverage.js +131 -78
- package/lib/plugin/customLocator.js +22 -21
- package/lib/plugin/customReporter.js +53 -0
- package/lib/plugin/enhancedRetryFailedStep.js +99 -0
- package/lib/plugin/heal.js +101 -110
- package/lib/plugin/htmlReporter.js +3648 -0
- package/lib/plugin/pageInfo.js +140 -0
- package/lib/plugin/pauseOnFail.js +12 -11
- package/lib/plugin/retryFailedStep.js +82 -47
- package/lib/plugin/screenshotOnFail.js +111 -92
- package/lib/plugin/stepByStepReport.js +159 -101
- package/lib/plugin/stepTimeout.js +20 -25
- package/lib/plugin/subtitles.js +38 -38
- package/lib/recorder.js +193 -130
- package/lib/rerun.js +94 -49
- package/lib/result.js +238 -0
- package/lib/retryCoordinator.js +207 -0
- package/lib/secret.js +20 -18
- package/lib/session.js +95 -89
- 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 +18 -329
- package/lib/steps.js +54 -0
- package/lib/store.js +38 -7
- package/lib/template/heal.js +3 -12
- package/lib/template/prompts/generatePageObject.js +31 -0
- package/lib/template/prompts/healStep.js +13 -0
- package/lib/template/prompts/writeStep.js +9 -0
- package/lib/test-server.js +334 -0
- package/lib/timeout.js +60 -0
- package/lib/transform.js +8 -8
- package/lib/translation.js +34 -21
- package/lib/utils/loaderCheck.js +124 -0
- package/lib/utils/mask_data.js +47 -0
- package/lib/utils/typescript.js +237 -0
- package/lib/utils.js +411 -228
- package/lib/workerStorage.js +37 -34
- package/lib/workers.js +532 -296
- package/package.json +124 -95
- package/translations/de-DE.js +5 -3
- package/translations/fr-FR.js +5 -4
- package/translations/index.js +22 -12
- 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 +10 -0
- package/translations/zh-CN.js +4 -3
- package/translations/zh-TW.js +4 -3
- package/typings/index.d.ts +546 -185
- package/typings/promiseBasedTypes.d.ts +150 -875
- package/typings/types.d.ts +547 -992
- package/lib/cli.js +0 -249
- package/lib/dirname.js +0 -5
- package/lib/helper/Expect.js +0 -425
- package/lib/helper/ExpectHelper.js +0 -399
- package/lib/helper/MockServer.js +0 -223
- package/lib/helper/Nightmare.js +0 -1411
- package/lib/helper/Protractor.js +0 -1835
- package/lib/helper/SoftExpectHelper.js +0 -381
- package/lib/helper/TestCafe.js +0 -1410
- package/lib/helper/clientscripts/nightmare.js +0 -213
- package/lib/helper/testcafe/testControllerHolder.js +0 -42
- package/lib/helper/testcafe/testcafe-utils.js +0 -63
- package/lib/interfaces/bdd.js +0 -98
- package/lib/interfaces/featureConfig.js +0 -69
- package/lib/interfaces/gherkin.js +0 -195
- package/lib/listener/artifacts.js +0 -19
- package/lib/listener/retry.js +0 -68
- package/lib/listener/timeout.js +0 -109
- package/lib/mochaFactory.js +0 -110
- package/lib/plugin/allure.js +0 -15
- package/lib/plugin/commentStep.js +0 -136
- package/lib/plugin/debugErrors.js +0 -67
- package/lib/plugin/eachElement.js +0 -127
- package/lib/plugin/fakerTransform.js +0 -49
- package/lib/plugin/retryTo.js +0 -121
- package/lib/plugin/selenoid.js +0 -371
- package/lib/plugin/standardActingHelpers.js +0 -9
- package/lib/plugin/tryTo.js +0 -105
- package/lib/plugin/wdio.js +0 -246
- package/lib/scenario.js +0 -222
- package/lib/ui.js +0 -238
- package/lib/within.js +0 -70
|
@@ -113,7 +113,7 @@ declare namespace CodeceptJS {
|
|
|
113
113
|
*
|
|
114
114
|
* module.exports = new Factory()
|
|
115
115
|
* // no need to set id, it will be set by REST API
|
|
116
|
-
* .attr('author', () => faker.
|
|
116
|
+
* .attr('author', () => faker.person.findName())
|
|
117
117
|
* .attr('title', () => faker.lorem.sentence())
|
|
118
118
|
* .attr('body', () => faker.lorem.paragraph());
|
|
119
119
|
* ```
|
|
@@ -354,6 +354,17 @@ declare namespace CodeceptJS {
|
|
|
354
354
|
* ```
|
|
355
355
|
*/
|
|
356
356
|
runOnAndroid(caps: any, fn: any): Promise<any>;
|
|
357
|
+
/**
|
|
358
|
+
* Execute code only in Web mode.
|
|
359
|
+
*
|
|
360
|
+
* ```js
|
|
361
|
+
* I.runInWeb(() => {
|
|
362
|
+
* I.waitForElement('#data');
|
|
363
|
+
* I.seeInCurrentUrl('/data');
|
|
364
|
+
* });
|
|
365
|
+
* ```
|
|
366
|
+
*/
|
|
367
|
+
runInWeb(): Promise<any>;
|
|
357
368
|
/**
|
|
358
369
|
* Returns app installation status.
|
|
359
370
|
*
|
|
@@ -597,17 +608,11 @@ declare namespace CodeceptJS {
|
|
|
597
608
|
* ```js
|
|
598
609
|
* // taps outside to hide keyboard per default
|
|
599
610
|
* I.hideDeviceKeyboard();
|
|
600
|
-
* I.hideDeviceKeyboard('tapOutside');
|
|
601
|
-
*
|
|
602
|
-
* // or by pressing key
|
|
603
|
-
* I.hideDeviceKeyboard('pressKey', 'Done');
|
|
604
611
|
* ```
|
|
605
612
|
*
|
|
606
613
|
* Appium: support Android and iOS
|
|
607
|
-
* @param [strategy] - Desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’)
|
|
608
|
-
* @param [key] - Optional key
|
|
609
614
|
*/
|
|
610
|
-
hideDeviceKeyboard(
|
|
615
|
+
hideDeviceKeyboard(): Promise<any>;
|
|
611
616
|
/**
|
|
612
617
|
* Send a key event to the device.
|
|
613
618
|
* List of keys: https://developer.android.com/reference/android/view/KeyEvent.html
|
|
@@ -651,6 +656,19 @@ declare namespace CodeceptJS {
|
|
|
651
656
|
* Shortcut for `makeTouchAction`
|
|
652
657
|
*/
|
|
653
658
|
tap(locator: any): Promise<void>;
|
|
659
|
+
/**
|
|
660
|
+
* Perform a swipe on the screen or an element.
|
|
661
|
+
*
|
|
662
|
+
* ```js
|
|
663
|
+
* let locator = "#io.selendroid.testapp:id/LinearLayout1";
|
|
664
|
+
* I.swipe(locator, 800, 1200, 1000);
|
|
665
|
+
* ```
|
|
666
|
+
*
|
|
667
|
+
* [See complete reference](http://webdriver.io/api/mobile/swipe.html)
|
|
668
|
+
* @param [speed = 1000] - (optional), 1000 by default
|
|
669
|
+
* @returns Appium: support Android and iOS
|
|
670
|
+
*/
|
|
671
|
+
swipe(locator: CodeceptJS.LocatorOrString, xoffset: number, yoffset: number, speed?: number): Promise<void>;
|
|
654
672
|
/**
|
|
655
673
|
* Perform a swipe on the screen.
|
|
656
674
|
*
|
|
@@ -1161,236 +1179,6 @@ declare namespace CodeceptJS {
|
|
|
1161
1179
|
*/
|
|
1162
1180
|
waitForText(text: string, sec?: number, context?: CodeceptJS.LocatorOrString): Promise<any>;
|
|
1163
1181
|
}
|
|
1164
|
-
/**
|
|
1165
|
-
* This helper allows performing assertions based on Chai.
|
|
1166
|
-
*
|
|
1167
|
-
* ### Examples
|
|
1168
|
-
*
|
|
1169
|
-
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
1170
|
-
*
|
|
1171
|
-
* ```js
|
|
1172
|
-
* // inside codecept.conf.js
|
|
1173
|
-
* {
|
|
1174
|
-
* helpers: {
|
|
1175
|
-
* Playwright: {...},
|
|
1176
|
-
* ExpectHelper: {},
|
|
1177
|
-
* }
|
|
1178
|
-
* }
|
|
1179
|
-
* ```
|
|
1180
|
-
*
|
|
1181
|
-
* ## Methods
|
|
1182
|
-
*/
|
|
1183
|
-
// @ts-ignore
|
|
1184
|
-
// @ts-ignore
|
|
1185
|
-
// @ts-ignore
|
|
1186
|
-
// @ts-ignore
|
|
1187
|
-
class ExpectHelper {
|
|
1188
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1189
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1190
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1191
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1192
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1193
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1194
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1195
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1196
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1197
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1198
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1199
|
-
/**
|
|
1200
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1201
|
-
*/
|
|
1202
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1203
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1204
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1205
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1206
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1207
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1208
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1209
|
-
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1210
|
-
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1211
|
-
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1212
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1213
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1214
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1215
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1216
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1217
|
-
/**
|
|
1218
|
-
* expects members of two arrays are deeply equal
|
|
1219
|
-
*/
|
|
1220
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1221
|
-
/**
|
|
1222
|
-
* expects an array to be a superset of another array
|
|
1223
|
-
*/
|
|
1224
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1225
|
-
/**
|
|
1226
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1227
|
-
*/
|
|
1228
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1229
|
-
/**
|
|
1230
|
-
* expects a JSON object matches a provided pattern
|
|
1231
|
-
*/
|
|
1232
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1233
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1234
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1235
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1236
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1237
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1238
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1239
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1240
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1241
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1242
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1243
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1244
|
-
/**
|
|
1245
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1246
|
-
*/
|
|
1247
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1248
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1249
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1250
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1251
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1252
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1253
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1254
|
-
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1255
|
-
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1256
|
-
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1257
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1258
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1259
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1260
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1261
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1262
|
-
/**
|
|
1263
|
-
* expects members of two arrays are deeply equal
|
|
1264
|
-
*/
|
|
1265
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1266
|
-
/**
|
|
1267
|
-
* expects an array to be a superset of another array
|
|
1268
|
-
*/
|
|
1269
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1270
|
-
/**
|
|
1271
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1272
|
-
*/
|
|
1273
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1274
|
-
/**
|
|
1275
|
-
* expects a JSON object matches a provided pattern
|
|
1276
|
-
*/
|
|
1277
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1278
|
-
}
|
|
1279
|
-
/**
|
|
1280
|
-
* This helper allows performing assertions based on Chai.
|
|
1281
|
-
*
|
|
1282
|
-
* ### Examples
|
|
1283
|
-
*
|
|
1284
|
-
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
1285
|
-
*
|
|
1286
|
-
* ```js
|
|
1287
|
-
* // inside codecept.conf.js
|
|
1288
|
-
* {
|
|
1289
|
-
* helpers: {
|
|
1290
|
-
* Playwright: {...},
|
|
1291
|
-
* ExpectHelper: {},
|
|
1292
|
-
* }
|
|
1293
|
-
* }
|
|
1294
|
-
* ```
|
|
1295
|
-
*
|
|
1296
|
-
* ## Methods
|
|
1297
|
-
*/
|
|
1298
|
-
// @ts-ignore
|
|
1299
|
-
// @ts-ignore
|
|
1300
|
-
// @ts-ignore
|
|
1301
|
-
// @ts-ignore
|
|
1302
|
-
class ExpectHelper {
|
|
1303
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1304
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1305
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1306
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1307
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1308
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1309
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1310
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1311
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1312
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1313
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1314
|
-
/**
|
|
1315
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1316
|
-
*/
|
|
1317
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1318
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1319
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1320
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1321
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1322
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1323
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1324
|
-
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1325
|
-
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1326
|
-
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1327
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1328
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1329
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1330
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1331
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1332
|
-
/**
|
|
1333
|
-
* expects members of two arrays are deeply equal
|
|
1334
|
-
*/
|
|
1335
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1336
|
-
/**
|
|
1337
|
-
* expects an array to be a superset of another array
|
|
1338
|
-
*/
|
|
1339
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1340
|
-
/**
|
|
1341
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1342
|
-
*/
|
|
1343
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1344
|
-
/**
|
|
1345
|
-
* expects a JSON object matches a provided pattern
|
|
1346
|
-
*/
|
|
1347
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1348
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1349
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1350
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1351
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1352
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1353
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1354
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1355
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1356
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1357
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1358
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1359
|
-
/**
|
|
1360
|
-
* @param [ajvOptions] - Pass AJV options
|
|
1361
|
-
*/
|
|
1362
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions?: any): Promise<any>;
|
|
1363
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1364
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1365
|
-
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1366
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1367
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1368
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1369
|
-
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1370
|
-
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1371
|
-
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1372
|
-
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1373
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1374
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1375
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1376
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1377
|
-
/**
|
|
1378
|
-
* expects members of two arrays are deeply equal
|
|
1379
|
-
*/
|
|
1380
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1381
|
-
/**
|
|
1382
|
-
* expects an array to be a superset of another array
|
|
1383
|
-
*/
|
|
1384
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1385
|
-
/**
|
|
1386
|
-
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1387
|
-
*/
|
|
1388
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1389
|
-
/**
|
|
1390
|
-
* expects a JSON object matches a provided pattern
|
|
1391
|
-
*/
|
|
1392
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1393
|
-
}
|
|
1394
1182
|
/**
|
|
1395
1183
|
* Helper for testing filesystem.
|
|
1396
1184
|
* Can be easily used to check file structures:
|
|
@@ -1637,7 +1425,7 @@ declare namespace CodeceptJS {
|
|
|
1637
1425
|
* input: { ...buildObj },
|
|
1638
1426
|
* }))
|
|
1639
1427
|
* // 'attr'-id can be left out depending on the GraphQl resolvers
|
|
1640
|
-
* .attr('name', () => faker.
|
|
1428
|
+
* .attr('name', () => faker.person.findName())
|
|
1641
1429
|
* .attr('email', () => faker.interact.email())
|
|
1642
1430
|
* ```
|
|
1643
1431
|
* For more options see [rosie documentation](https://github.com/rosiejs/rosie).
|
|
@@ -1914,13 +1702,14 @@ declare namespace CodeceptJS {
|
|
|
1914
1702
|
*/
|
|
1915
1703
|
seeResponseContainsKeys(keys: any[]): Promise<any>;
|
|
1916
1704
|
/**
|
|
1917
|
-
* Executes a callback function passing in `response` object and
|
|
1705
|
+
* Executes a callback function passing in `response` object and assert
|
|
1918
1706
|
* Use it to perform custom checks of response data
|
|
1919
1707
|
*
|
|
1920
1708
|
* ```js
|
|
1921
|
-
* I.seeResponseValidByCallback(({ data, status
|
|
1922
|
-
*
|
|
1923
|
-
*
|
|
1709
|
+
* I.seeResponseValidByCallback(({ data, status }) => {
|
|
1710
|
+
* assert.strictEqual(status, 200);
|
|
1711
|
+
* assert('user' in data);
|
|
1712
|
+
* assert('company' in data);
|
|
1924
1713
|
* });
|
|
1925
1714
|
* ```
|
|
1926
1715
|
*/
|
|
@@ -1962,196 +1751,6 @@ declare namespace CodeceptJS {
|
|
|
1962
1751
|
*/
|
|
1963
1752
|
seeResponseMatchesJsonSchema(fnOrSchema: any): Promise<any>;
|
|
1964
1753
|
}
|
|
1965
|
-
/**
|
|
1966
|
-
* ## Configuration
|
|
1967
|
-
*
|
|
1968
|
-
* This helper should be configured in codecept.conf.(js|ts)
|
|
1969
|
-
* @property [port = 9393] - Mock server port
|
|
1970
|
-
* @property [host = "0.0.0.0"] - Mock server host
|
|
1971
|
-
* @property [httpsOpts] - key & cert values are the paths to .key and .crt files
|
|
1972
|
-
*/
|
|
1973
|
-
// @ts-ignore
|
|
1974
|
-
// @ts-ignore
|
|
1975
|
-
// @ts-ignore
|
|
1976
|
-
// @ts-ignore
|
|
1977
|
-
type MockServerConfig = {
|
|
1978
|
-
port?: number;
|
|
1979
|
-
host?: string;
|
|
1980
|
-
httpsOpts?: any;
|
|
1981
|
-
};
|
|
1982
|
-
/**
|
|
1983
|
-
* MockServer
|
|
1984
|
-
*
|
|
1985
|
-
* 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.
|
|
1986
|
-
*
|
|
1987
|
-
* <!-- configuration -->
|
|
1988
|
-
*
|
|
1989
|
-
* #### Examples
|
|
1990
|
-
*
|
|
1991
|
-
* You can seamlessly integrate MockServer with other helpers like REST or Playwright. Here's a configuration example inside the `codecept.conf.js` file:
|
|
1992
|
-
*
|
|
1993
|
-
* ```javascript
|
|
1994
|
-
* {
|
|
1995
|
-
* helpers: {
|
|
1996
|
-
* REST: {...},
|
|
1997
|
-
* MockServer: {
|
|
1998
|
-
* // default mock server config
|
|
1999
|
-
* port: 9393,
|
|
2000
|
-
* host: '0.0.0.0',
|
|
2001
|
-
* httpsOpts: {
|
|
2002
|
-
* key: '',
|
|
2003
|
-
* cert: '',
|
|
2004
|
-
* },
|
|
2005
|
-
* },
|
|
2006
|
-
* }
|
|
2007
|
-
* }
|
|
2008
|
-
* ```
|
|
2009
|
-
*
|
|
2010
|
-
* #### Adding Interactions
|
|
2011
|
-
*
|
|
2012
|
-
* 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.
|
|
2013
|
-
*
|
|
2014
|
-
* ```javascript
|
|
2015
|
-
* I.addInteractionToMockServer({
|
|
2016
|
-
* request: {
|
|
2017
|
-
* method: 'GET',
|
|
2018
|
-
* path: '/api/hello'
|
|
2019
|
-
* },
|
|
2020
|
-
* response: {
|
|
2021
|
-
* status: 200,
|
|
2022
|
-
* body: {
|
|
2023
|
-
* 'say': 'hello to mock server'
|
|
2024
|
-
* }
|
|
2025
|
-
* }
|
|
2026
|
-
* });
|
|
2027
|
-
* ```
|
|
2028
|
-
*
|
|
2029
|
-
* #### Request Matching
|
|
2030
|
-
*
|
|
2031
|
-
* 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.
|
|
2032
|
-
*
|
|
2033
|
-
* - Strong match on HTTP Method, Path, Query Params & JSON body.
|
|
2034
|
-
* - Loose match on Headers.
|
|
2035
|
-
*
|
|
2036
|
-
* ##### Strong Match on Query Params
|
|
2037
|
-
*
|
|
2038
|
-
* You can send different responses based on query parameters:
|
|
2039
|
-
*
|
|
2040
|
-
* ```javascript
|
|
2041
|
-
* I.addInteractionToMockServer({
|
|
2042
|
-
* request: {
|
|
2043
|
-
* method: 'GET',
|
|
2044
|
-
* path: '/api/users',
|
|
2045
|
-
* queryParams: {
|
|
2046
|
-
* id: 1
|
|
2047
|
-
* }
|
|
2048
|
-
* },
|
|
2049
|
-
* response: {
|
|
2050
|
-
* status: 200,
|
|
2051
|
-
* body: 'user 1'
|
|
2052
|
-
* }
|
|
2053
|
-
* });
|
|
2054
|
-
*
|
|
2055
|
-
* I.addInteractionToMockServer({
|
|
2056
|
-
* request: {
|
|
2057
|
-
* method: 'GET',
|
|
2058
|
-
* path: '/api/users',
|
|
2059
|
-
* queryParams: {
|
|
2060
|
-
* id: 2
|
|
2061
|
-
* }
|
|
2062
|
-
* },
|
|
2063
|
-
* response: {
|
|
2064
|
-
* status: 200,
|
|
2065
|
-
* body: 'user 2'
|
|
2066
|
-
* }
|
|
2067
|
-
* });
|
|
2068
|
-
* ```
|
|
2069
|
-
*
|
|
2070
|
-
* - GET to `/api/users?id=1` will return 'user 1'.
|
|
2071
|
-
* - GET to `/api/users?id=2` will return 'user 2'.
|
|
2072
|
-
* - For all other requests, it returns a 404 status code.
|
|
2073
|
-
*
|
|
2074
|
-
* ##### Loose Match on Body
|
|
2075
|
-
*
|
|
2076
|
-
* When `strict` is set to false, it performs a loose match on query params and response body:
|
|
2077
|
-
*
|
|
2078
|
-
* ```javascript
|
|
2079
|
-
* I.addInteractionToMockServer({
|
|
2080
|
-
* strict: false,
|
|
2081
|
-
* request: {
|
|
2082
|
-
* method: 'POST',
|
|
2083
|
-
* path: '/api/users',
|
|
2084
|
-
* body: {
|
|
2085
|
-
* name: 'john'
|
|
2086
|
-
* }
|
|
2087
|
-
* },
|
|
2088
|
-
* response: {
|
|
2089
|
-
* status: 200
|
|
2090
|
-
* }
|
|
2091
|
-
* });
|
|
2092
|
-
* ```
|
|
2093
|
-
*
|
|
2094
|
-
* - POST to `/api/users` with the body containing `name` as 'john' will return a 200 status code.
|
|
2095
|
-
* - POST to `/api/users` without the `name` property in the body will return a 404 status code.
|
|
2096
|
-
*
|
|
2097
|
-
* Happy testing with MockServer in CodeceptJS! 🚀
|
|
2098
|
-
*
|
|
2099
|
-
* ## Methods
|
|
2100
|
-
*/
|
|
2101
|
-
// @ts-ignore
|
|
2102
|
-
// @ts-ignore
|
|
2103
|
-
// @ts-ignore
|
|
2104
|
-
// @ts-ignore
|
|
2105
|
-
class MockServer {
|
|
2106
|
-
/**
|
|
2107
|
-
* Start the mock server
|
|
2108
|
-
* @param [port] - start the mock server with given port
|
|
2109
|
-
*/
|
|
2110
|
-
startMockServer(port?: number): Promise<any>;
|
|
2111
|
-
/**
|
|
2112
|
-
* Stop the mock server
|
|
2113
|
-
*/
|
|
2114
|
-
stopMockServer(): Promise<any>;
|
|
2115
|
-
/**
|
|
2116
|
-
* An interaction adds behavior to the mock server
|
|
2117
|
-
*
|
|
2118
|
-
*
|
|
2119
|
-
* ```js
|
|
2120
|
-
* I.addInteractionToMockServer({
|
|
2121
|
-
* request: {
|
|
2122
|
-
* method: 'GET',
|
|
2123
|
-
* path: '/api/hello'
|
|
2124
|
-
* },
|
|
2125
|
-
* response: {
|
|
2126
|
-
* status: 200,
|
|
2127
|
-
* body: {
|
|
2128
|
-
* 'say': 'hello to mock server'
|
|
2129
|
-
* }
|
|
2130
|
-
* }
|
|
2131
|
-
* });
|
|
2132
|
-
* ```
|
|
2133
|
-
* ```js
|
|
2134
|
-
* // with query params
|
|
2135
|
-
* I.addInteractionToMockServer({
|
|
2136
|
-
* request: {
|
|
2137
|
-
* method: 'GET',
|
|
2138
|
-
* path: '/api/hello',
|
|
2139
|
-
* queryParams: {
|
|
2140
|
-
* id: 2
|
|
2141
|
-
* }
|
|
2142
|
-
* },
|
|
2143
|
-
* response: {
|
|
2144
|
-
* status: 200,
|
|
2145
|
-
* body: {
|
|
2146
|
-
* 'say': 'hello to mock server'
|
|
2147
|
-
* }
|
|
2148
|
-
* }
|
|
2149
|
-
* });
|
|
2150
|
-
* ```
|
|
2151
|
-
* @param interaction - add behavior to the mock server
|
|
2152
|
-
*/
|
|
2153
|
-
addInteractionToMockServer(interaction: CodeceptJS.MockInteraction | any): Promise<any>;
|
|
2154
|
-
}
|
|
2155
1754
|
/**
|
|
2156
1755
|
* Nightmare helper wraps [Nightmare](https://github.com/segmentio/nightmare) library to provide
|
|
2157
1756
|
* fastest headless testing using Electron engine. Unlike Selenium-based drivers this uses
|
|
@@ -2890,7 +2489,7 @@ declare namespace CodeceptJS {
|
|
|
2890
2489
|
*
|
|
2891
2490
|
* ```js
|
|
2892
2491
|
* I.clearCookie();
|
|
2893
|
-
* I.clearCookie('test');
|
|
2492
|
+
* I.clearCookie('test');
|
|
2894
2493
|
* ```
|
|
2895
2494
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
2896
2495
|
*/
|
|
@@ -3091,46 +2690,6 @@ declare namespace CodeceptJS {
|
|
|
3091
2690
|
*/
|
|
3092
2691
|
grabPageScrollPosition(): Promise<PageScrollPosition>;
|
|
3093
2692
|
}
|
|
3094
|
-
/**
|
|
3095
|
-
* OpenAI Helper for CodeceptJS.
|
|
3096
|
-
*
|
|
3097
|
-
* 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.
|
|
3098
|
-
* This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
|
|
3099
|
-
*
|
|
3100
|
-
* ## Configuration
|
|
3101
|
-
*
|
|
3102
|
-
* This helper should be configured in codecept.json or codecept.conf.js
|
|
3103
|
-
*
|
|
3104
|
-
* * `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.
|
|
3105
|
-
*/
|
|
3106
|
-
class OpenAITs {
|
|
3107
|
-
/**
|
|
3108
|
-
* Asks the OpenAI GPT language model a question based on the provided prompt within the context of the current page's HTML.
|
|
3109
|
-
*
|
|
3110
|
-
* ```js
|
|
3111
|
-
* I.askGptOnPage('what does this page do?');
|
|
3112
|
-
* ```
|
|
3113
|
-
* @param prompt - The question or prompt to ask the GPT model.
|
|
3114
|
-
* @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
|
|
3115
|
-
*/
|
|
3116
|
-
askGptOnPage(prompt: string): Promise<string>;
|
|
3117
|
-
/**
|
|
3118
|
-
* 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.
|
|
3119
|
-
*
|
|
3120
|
-
* ```js
|
|
3121
|
-
* I.askGptOnPageFragment('describe features of this screen', '.screen');
|
|
3122
|
-
* ```
|
|
3123
|
-
* @param prompt - The question or prompt to ask the GPT-3.5 model.
|
|
3124
|
-
* @param locator - The locator or selector used to identify the HTML fragment on the page.
|
|
3125
|
-
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
3126
|
-
*/
|
|
3127
|
-
askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
|
|
3128
|
-
/**
|
|
3129
|
-
* Send a general request to ChatGPT and return response.
|
|
3130
|
-
* @returns - A Promise that resolves to the generated response from the GPT model.
|
|
3131
|
-
*/
|
|
3132
|
-
askGptGeneralPrompt(prompt: string): Promise<string>;
|
|
3133
|
-
}
|
|
3134
2693
|
/**
|
|
3135
2694
|
* ## Configuration
|
|
3136
2695
|
*
|
|
@@ -3174,11 +2733,16 @@ declare namespace CodeceptJS {
|
|
|
3174
2733
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
3175
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).
|
|
3176
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).
|
|
2736
|
+
* @property [customLocatorStrategies] - custom locator strategies. An object with keys as strategy names and values as JavaScript functions. Example: `{ byRole: (selector, root) => { return root.querySelector(`[role="${selector}"]`) } }`
|
|
2737
|
+
* @property [storageState] - Playwright storage state (path to JSON file or object)
|
|
2738
|
+
* passed directly to `browser.newContext`.
|
|
2739
|
+
* If a Scenario is declared with a `cookies` option (e.g. `Scenario('name', { cookies: [...] }, fn)`),
|
|
2740
|
+
* those cookies are used instead and the configured `storageState` is ignored (no merge).
|
|
2741
|
+
* May include session cookies, auth tokens, localStorage and (if captured with
|
|
2742
|
+
* `grabStorageState({ indexedDB: true })`) IndexedDB data; treat as sensitive and do not commit.
|
|
3177
2743
|
*/
|
|
3178
2744
|
// @ts-ignore
|
|
3179
2745
|
// @ts-ignore
|
|
3180
|
-
// @ts-ignore
|
|
3181
|
-
// @ts-ignore
|
|
3182
2746
|
type PlaywrightConfig = {
|
|
3183
2747
|
url?: string;
|
|
3184
2748
|
browser?: 'chromium' | 'firefox' | 'webkit' | 'electron';
|
|
@@ -3216,6 +2780,8 @@ declare namespace CodeceptJS {
|
|
|
3216
2780
|
highlightElement?: boolean;
|
|
3217
2781
|
recordHar?: any;
|
|
3218
2782
|
testIdAttribute?: string;
|
|
2783
|
+
customLocatorStrategies?: any;
|
|
2784
|
+
storageState?: string | any;
|
|
3219
2785
|
};
|
|
3220
2786
|
/**
|
|
3221
2787
|
* Uses [Playwright](https://github.com/microsoft/playwright) library to run tests inside:
|
|
@@ -4127,7 +3693,7 @@ declare namespace CodeceptJS {
|
|
|
4127
3693
|
*/
|
|
4128
3694
|
pressKeyUp(key: string): Promise<any>;
|
|
4129
3695
|
/**
|
|
4130
|
-
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([
|
|
3696
|
+
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([puppeteer/puppeteer#1313](https://github.com/puppeteer/puppeteer/issues/1313)).
|
|
4131
3697
|
*
|
|
4132
3698
|
* Presses a key in the browser (on a focused element).
|
|
4133
3699
|
*
|
|
@@ -4526,13 +4092,34 @@ declare namespace CodeceptJS {
|
|
|
4526
4092
|
* @param [name = null] - cookie name.
|
|
4527
4093
|
*/
|
|
4528
4094
|
grabCookie(name?: string): Promise<any>;
|
|
4095
|
+
/**
|
|
4096
|
+
* Grab the current storage state (cookies, localStorage, etc.) via Playwright's `browserContext.storageState()`.
|
|
4097
|
+
* Returns the raw object that Playwright provides.
|
|
4098
|
+
*
|
|
4099
|
+
* Security: The returned object can contain authentication tokens, session cookies
|
|
4100
|
+
* and (when `indexedDB: true` is used) data that may include user PII. Treat it as a secret.
|
|
4101
|
+
* Avoid committing it to source control and prefer storing it in a protected secrets store / CI artifact vault.
|
|
4102
|
+
* @param [options.indexedDB] - set to true to include IndexedDB in snapshot (Playwright >=1.51)
|
|
4103
|
+
*
|
|
4104
|
+
* ```js
|
|
4105
|
+
* // basic usage
|
|
4106
|
+
* const state = await I.grabStorageState();
|
|
4107
|
+
* require('fs').writeFileSync('authState.json', JSON.stringify(state));
|
|
4108
|
+
*
|
|
4109
|
+
* // include IndexedDB when using Firebase Auth, etc.
|
|
4110
|
+
* const stateWithIDB = await I.grabStorageState({ indexedDB: true });
|
|
4111
|
+
* ```
|
|
4112
|
+
*/
|
|
4113
|
+
grabStorageState(options?: {
|
|
4114
|
+
indexedDB?: boolean;
|
|
4115
|
+
}): Promise<any>;
|
|
4529
4116
|
/**
|
|
4530
4117
|
* Clears a cookie by name,
|
|
4531
4118
|
* if none provided clears all cookies.
|
|
4532
4119
|
*
|
|
4533
4120
|
* ```js
|
|
4534
4121
|
* I.clearCookie();
|
|
4535
|
-
* I.clearCookie('test');
|
|
4122
|
+
* I.clearCookie('test');
|
|
4536
4123
|
* ```
|
|
4537
4124
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
4538
4125
|
*/
|
|
@@ -4956,7 +4543,7 @@ declare namespace CodeceptJS {
|
|
|
4956
4543
|
/**
|
|
4957
4544
|
* Waits for navigation to finish. By default, it takes configured `waitForNavigation` option.
|
|
4958
4545
|
*
|
|
4959
|
-
* See [Playwright's reference](https://playwright.dev/docs/api/class-page
|
|
4546
|
+
* See [Playwright's reference](https://playwright.dev/docs/api/class-page#page-wait-for-navigation)
|
|
4960
4547
|
*/
|
|
4961
4548
|
waitForNavigation(options: any): Promise<any>;
|
|
4962
4549
|
/**
|
|
@@ -6134,7 +5721,7 @@ declare namespace CodeceptJS {
|
|
|
6134
5721
|
*
|
|
6135
5722
|
* ```js
|
|
6136
5723
|
* I.clearCookie();
|
|
6137
|
-
* I.clearCookie('test');
|
|
5724
|
+
* I.clearCookie('test');
|
|
6138
5725
|
* ```
|
|
6139
5726
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
6140
5727
|
*/
|
|
@@ -6544,7 +6131,7 @@ declare namespace CodeceptJS {
|
|
|
6544
6131
|
* @property [keepBrowserState = false] - keep browser state between tests when `restart` is set to false.
|
|
6545
6132
|
* @property [keepCookies = false] - keep cookies between tests when `restart` is set to false.
|
|
6546
6133
|
* @property [waitForAction = 100] - how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
6547
|
-
* @property [waitForNavigation = load] - when to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle0`, `networkidle2`. See [Puppeteer API](https://github.com/
|
|
6134
|
+
* @property [waitForNavigation = load] - when to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle0`, `networkidle2`. See [Puppeteer API](https://github.com/puppeteer/puppeteer/blob/main/docs/api/puppeteer.waitforoptions.md). Array values are accepted as well.
|
|
6548
6135
|
* @property [pressKeyDelay = 10] - delay between key presses in ms. Used when calling Puppeteers page.type(...) in fillField/appendField
|
|
6549
6136
|
* @property [getPageTimeout = 30000] - config option to set maximum navigation time in milliseconds. If the timeout is set to 0, then timeout will be disabled.
|
|
6550
6137
|
* @property [waitForTimeout = 1000] - default wait* timeout in ms.
|
|
@@ -6552,13 +6139,11 @@ declare namespace CodeceptJS {
|
|
|
6552
6139
|
* @property [userAgent] - user-agent string.
|
|
6553
6140
|
* @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
|
|
6554
6141
|
* @property [browser = chrome] - can be changed to `firefox` when using [puppeteer-firefox](https://codecept.io/helpers/Puppeteer-firefox).
|
|
6555
|
-
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/
|
|
6142
|
+
* @property [chrome] - pass additional [Puppeteer run options](https://github.com/puppeteer/puppeteer/blob/main/docs/api/puppeteer.launchoptions.md).
|
|
6556
6143
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
6557
6144
|
*/
|
|
6558
6145
|
// @ts-ignore
|
|
6559
6146
|
// @ts-ignore
|
|
6560
|
-
// @ts-ignore
|
|
6561
|
-
// @ts-ignore
|
|
6562
6147
|
type PuppeteerConfig = {
|
|
6563
6148
|
url: string;
|
|
6564
6149
|
basicAuth?: any;
|
|
@@ -6572,7 +6157,7 @@ declare namespace CodeceptJS {
|
|
|
6572
6157
|
keepBrowserState?: boolean;
|
|
6573
6158
|
keepCookies?: boolean;
|
|
6574
6159
|
waitForAction?: number;
|
|
6575
|
-
waitForNavigation?: string;
|
|
6160
|
+
waitForNavigation?: string | string[];
|
|
6576
6161
|
pressKeyDelay?: number;
|
|
6577
6162
|
getPageTimeout?: number;
|
|
6578
6163
|
waitForTimeout?: number;
|
|
@@ -6584,7 +6169,7 @@ declare namespace CodeceptJS {
|
|
|
6584
6169
|
highlightElement?: boolean;
|
|
6585
6170
|
};
|
|
6586
6171
|
/**
|
|
6587
|
-
* Uses [Google Chrome's Puppeteer](https://github.com/
|
|
6172
|
+
* Uses [Google Chrome's Puppeteer](https://github.com/puppeteer/puppeteer) library to run tests inside headless Chrome.
|
|
6588
6173
|
* Browser control is executed via DevTools Protocol (instead of Selenium).
|
|
6589
6174
|
* This helper works with a browser out of the box with no additional tools required to install.
|
|
6590
6175
|
*
|
|
@@ -6982,6 +6567,17 @@ declare namespace CodeceptJS {
|
|
|
6982
6567
|
* {{ react }}
|
|
6983
6568
|
*/
|
|
6984
6569
|
_locate(): Promise<any>;
|
|
6570
|
+
/**
|
|
6571
|
+
* Get single element by different locator types, including strict locator
|
|
6572
|
+
* Should be used in custom helpers:
|
|
6573
|
+
*
|
|
6574
|
+
* ```js
|
|
6575
|
+
* const element = await this.helpers['Puppeteer']._locateElement({name: 'password'});
|
|
6576
|
+
* ```
|
|
6577
|
+
*
|
|
6578
|
+
* {{ react }}
|
|
6579
|
+
*/
|
|
6580
|
+
_locateElement(): Promise<any>;
|
|
6985
6581
|
/**
|
|
6986
6582
|
* Find a checkbox by providing human-readable text:
|
|
6987
6583
|
* NOTE: Assumes the checkable element exists
|
|
@@ -7018,6 +6614,17 @@ declare namespace CodeceptJS {
|
|
|
7018
6614
|
* @returns WebElement of being used Web helper
|
|
7019
6615
|
*/
|
|
7020
6616
|
grabWebElements(locator: CodeceptJS.LocatorOrString): Promise<any>;
|
|
6617
|
+
/**
|
|
6618
|
+
* Grab WebElement for given locator
|
|
6619
|
+
* Resumes test execution, so **should be used inside an async function with `await`** operator.
|
|
6620
|
+
*
|
|
6621
|
+
* ```js
|
|
6622
|
+
* const webElement = await I.grabWebElement('#button');
|
|
6623
|
+
* ```
|
|
6624
|
+
* @param locator - element located by CSS|XPath|strict locator.
|
|
6625
|
+
* @returns WebElement of being used Web helper
|
|
6626
|
+
*/
|
|
6627
|
+
grabWebElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
|
|
7021
6628
|
/**
|
|
7022
6629
|
* Switch focus to a particular tab by its number. It waits tabs loading and then switch tab
|
|
7023
6630
|
*
|
|
@@ -7304,7 +6911,7 @@ declare namespace CodeceptJS {
|
|
|
7304
6911
|
*/
|
|
7305
6912
|
pressKeyUp(key: string): Promise<any>;
|
|
7306
6913
|
/**
|
|
7307
|
-
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([
|
|
6914
|
+
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([puppeteer/puppeteer#1313](https://github.com/puppeteer/puppeteer/issues/1313)).
|
|
7308
6915
|
*
|
|
7309
6916
|
* Presses a key in the browser (on a focused element).
|
|
7310
6917
|
*
|
|
@@ -7712,7 +7319,7 @@ declare namespace CodeceptJS {
|
|
|
7712
7319
|
*
|
|
7713
7320
|
* ```js
|
|
7714
7321
|
* I.clearCookie();
|
|
7715
|
-
* I.clearCookie('test');
|
|
7322
|
+
* I.clearCookie('test');
|
|
7716
7323
|
* ```
|
|
7717
7324
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
7718
7325
|
*/
|
|
@@ -8152,7 +7759,7 @@ declare namespace CodeceptJS {
|
|
|
8152
7759
|
/**
|
|
8153
7760
|
* Waits for navigation to finish. By default, takes configured `waitForNavigation` option.
|
|
8154
7761
|
*
|
|
8155
|
-
* See [Puppeteer's reference](https://github.com/
|
|
7762
|
+
* See [Puppeteer's reference](https://github.com/puppeteer/puppeteer/blob/main/docs/api/puppeteer.page.waitfornavigation.md)
|
|
8156
7763
|
*/
|
|
8157
7764
|
waitForNavigation(opts: any): Promise<any>;
|
|
8158
7765
|
/**
|
|
@@ -8353,6 +7960,22 @@ declare namespace CodeceptJS {
|
|
|
8353
7960
|
*/
|
|
8354
7961
|
flushWebSocketMessages(): Promise<any>;
|
|
8355
7962
|
}
|
|
7963
|
+
/**
|
|
7964
|
+
* Find elements using Puppeteer's native element discovery methods
|
|
7965
|
+
* Note: Unlike Playwright, Puppeteer's Locator API doesn't have .all() method for multiple elements
|
|
7966
|
+
* @param matcher - Puppeteer context to search within
|
|
7967
|
+
* @param locator - Locator specification
|
|
7968
|
+
* @returns Array of ElementHandle objects
|
|
7969
|
+
*/
|
|
7970
|
+
function findElements(matcher: any, locator: any | string): Promise<any[]>;
|
|
7971
|
+
/**
|
|
7972
|
+
* Find a single element using Puppeteer's native element discovery methods
|
|
7973
|
+
* Note: Puppeteer Locator API doesn't have .first() method like Playwright
|
|
7974
|
+
* @param matcher - Puppeteer context to search within
|
|
7975
|
+
* @param locator - Locator specification
|
|
7976
|
+
* @returns Single ElementHandle object
|
|
7977
|
+
*/
|
|
7978
|
+
function findElement(matcher: any, locator: any | string): Promise<object>;
|
|
8356
7979
|
/**
|
|
8357
7980
|
* ## Configuration
|
|
8358
7981
|
* @property [endpoint] - API base URL
|
|
@@ -8367,8 +7990,6 @@ declare namespace CodeceptJS {
|
|
|
8367
7990
|
*/
|
|
8368
7991
|
// @ts-ignore
|
|
8369
7992
|
// @ts-ignore
|
|
8370
|
-
// @ts-ignore
|
|
8371
|
-
// @ts-ignore
|
|
8372
7993
|
type RESTConfig = {
|
|
8373
7994
|
endpoint?: string;
|
|
8374
7995
|
prettyPrintJson?: boolean;
|
|
@@ -8494,6 +8115,16 @@ declare namespace CodeceptJS {
|
|
|
8494
8115
|
* @returns response
|
|
8495
8116
|
*/
|
|
8496
8117
|
sendGetRequest(url: any, headers?: any): Promise<any>;
|
|
8118
|
+
/**
|
|
8119
|
+
* Send HEAD request to REST API
|
|
8120
|
+
*
|
|
8121
|
+
* ```js
|
|
8122
|
+
* I.sendHeadRequest('/api/users.json');
|
|
8123
|
+
* ```
|
|
8124
|
+
* @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
|
|
8125
|
+
* @returns response
|
|
8126
|
+
*/
|
|
8127
|
+
sendHeadRequest(url: any, headers?: any): Promise<any>;
|
|
8497
8128
|
/**
|
|
8498
8129
|
* Sends POST request to API.
|
|
8499
8130
|
*
|
|
@@ -8549,250 +8180,17 @@ declare namespace CodeceptJS {
|
|
|
8549
8180
|
* @returns response
|
|
8550
8181
|
*/
|
|
8551
8182
|
sendDeleteRequest(url: any, headers?: any): Promise<any>;
|
|
8552
|
-
}
|
|
8553
|
-
/**
|
|
8554
|
-
* SoftAssertHelper is a utility class for performing soft assertions.
|
|
8555
|
-
* Unlike traditional assertions that stop the execution on failure,
|
|
8556
|
-
* soft assertions allow the execution to continue and report all failures at the end.
|
|
8557
|
-
*
|
|
8558
|
-
* ### Examples
|
|
8559
|
-
*
|
|
8560
|
-
* Zero-configuration when paired with other helpers like REST, Playwright:
|
|
8561
|
-
*
|
|
8562
|
-
* ```js
|
|
8563
|
-
* // inside codecept.conf.js
|
|
8564
|
-
* {
|
|
8565
|
-
* helpers: {
|
|
8566
|
-
* Playwright: {...},
|
|
8567
|
-
* SoftExpectHelper: {},
|
|
8568
|
-
* }
|
|
8569
|
-
* }
|
|
8570
|
-
* ```
|
|
8571
|
-
*
|
|
8572
|
-
* ```js
|
|
8573
|
-
* // in scenario
|
|
8574
|
-
* I.softExpectEqual('a', 'b')
|
|
8575
|
-
* I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
|
|
8576
|
-
* ```
|
|
8577
|
-
*
|
|
8578
|
-
* ## Methods
|
|
8579
|
-
*/
|
|
8580
|
-
class SoftAssertHelperTs {
|
|
8581
|
-
/**
|
|
8582
|
-
* Performs a soft assertion by executing the provided assertion function.
|
|
8583
|
-
* If the assertion fails, the error is caught and stored without halting the execution.
|
|
8584
|
-
* @param assertionFn - The assertion function to execute.
|
|
8585
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8586
|
-
*/
|
|
8587
|
-
softAssert(assertionFn: (...params: any[]) => any, customErrorMsg?: string): Promise<any>;
|
|
8588
|
-
/**
|
|
8589
|
-
* Throws an error if any soft assertions have failed.
|
|
8590
|
-
* The error message contains all the accumulated failures.
|
|
8591
|
-
*/
|
|
8592
|
-
flushSoftAssertions(): Promise<any>;
|
|
8593
|
-
/**
|
|
8594
|
-
* Softly asserts that two values are equal.
|
|
8595
|
-
* @param actualValue - The actual value.
|
|
8596
|
-
* @param expectedValue - The expected value.
|
|
8597
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8598
|
-
*/
|
|
8599
|
-
softExpectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8600
|
-
/**
|
|
8601
|
-
* Softly asserts that two values are not 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
|
-
softExpectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8607
|
-
/**
|
|
8608
|
-
* Softly asserts that two values are deeply 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
|
-
softExpectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8614
|
-
/**
|
|
8615
|
-
* Softly asserts that two values are not 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
|
-
softExpectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): Promise<any>;
|
|
8621
|
-
/**
|
|
8622
|
-
* Softly asserts that a value contains the expected value.
|
|
8623
|
-
* @param actualValue - The actual value.
|
|
8624
|
-
* @param expectedValueToContain - The value that should be contained within the actual value.
|
|
8625
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8626
|
-
*/
|
|
8627
|
-
softExpectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): Promise<any>;
|
|
8628
|
-
/**
|
|
8629
|
-
* Softly asserts that a value does not contain the expected value.
|
|
8630
|
-
* @param actualValue - The actual value.
|
|
8631
|
-
* @param expectedValueToNotContain - The value that should not be contained within the actual value.
|
|
8632
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8633
|
-
*/
|
|
8634
|
-
softExpectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): Promise<any>;
|
|
8635
|
-
/**
|
|
8636
|
-
* Softly asserts that a value starts with the expected value.
|
|
8637
|
-
* @param actualValue - The actual value.
|
|
8638
|
-
* @param expectedValueToStartWith - The value that the actual value should start with.
|
|
8639
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8640
|
-
*/
|
|
8641
|
-
softExpectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: string): Promise<any>;
|
|
8642
|
-
/**
|
|
8643
|
-
* Softly asserts that a value does not start with the expected value.
|
|
8644
|
-
* @param actualValue - The actual value.
|
|
8645
|
-
* @param expectedValueToNotStartWith - The value that the actual value should not start with.
|
|
8646
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8647
|
-
*/
|
|
8648
|
-
softExpectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: string): Promise<any>;
|
|
8649
|
-
/**
|
|
8650
|
-
* Softly asserts that a value ends with the expected value.
|
|
8651
|
-
* @param actualValue - The actual value.
|
|
8652
|
-
* @param expectedValueToEndWith - The value that the actual value should end with.
|
|
8653
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8654
|
-
*/
|
|
8655
|
-
softExpectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: string): Promise<any>;
|
|
8656
|
-
/**
|
|
8657
|
-
* Softly asserts that a value does not end with the expected value.
|
|
8658
|
-
* @param actualValue - The actual value.
|
|
8659
|
-
* @param expectedValueToNotEndWith - The value that the actual value should not end with.
|
|
8660
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8661
|
-
*/
|
|
8662
|
-
softExpectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: string): Promise<any>;
|
|
8663
|
-
/**
|
|
8664
|
-
* Softly asserts that the target data matches the given JSON schema.
|
|
8665
|
-
* @param targetData - The data to validate.
|
|
8666
|
-
* @param jsonSchema - The JSON schema to validate against.
|
|
8667
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8668
|
-
*/
|
|
8669
|
-
softExpectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): Promise<any>;
|
|
8670
|
-
/**
|
|
8671
|
-
* Softly asserts that the target data matches the given JSON schema using AJV.
|
|
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
|
-
* @param [ajvOptions = { allErrors: true }] - Options to pass to AJV.
|
|
8676
|
-
*/
|
|
8677
|
-
softExpectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): Promise<any>;
|
|
8678
|
-
/**
|
|
8679
|
-
* Softly asserts that the target data has the specified property.
|
|
8680
|
-
* @param targetData - The data to check.
|
|
8681
|
-
* @param propertyName - The property name to check for.
|
|
8682
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion
|
|
8683
|
-
* fails.
|
|
8684
|
-
*/
|
|
8685
|
-
softExpectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
|
|
8686
|
-
/**
|
|
8687
|
-
* Softly asserts that the target data has a property with the specified name.
|
|
8688
|
-
* @param targetData - The data to check.
|
|
8689
|
-
* @param propertyName - The property name to check for.
|
|
8690
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8691
|
-
*/
|
|
8692
|
-
softExpectHasAProperty(targetData: any, propertyName: string, customErrorMsg?: string): Promise<any>;
|
|
8693
|
-
/**
|
|
8694
|
-
* Softly asserts that the target data is of a specific type.
|
|
8695
|
-
* @param targetData - The data to check.
|
|
8696
|
-
* @param type - The expected type (e.g., 'string', 'number').
|
|
8697
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8698
|
-
*/
|
|
8699
|
-
softExpectToBeA(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
|
|
8700
|
-
/**
|
|
8701
|
-
* Softly asserts that the target data is of a specific type (alternative for articles).
|
|
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
|
-
softExpectToBeAn(targetData: any, type: string, customErrorMsg?: string): Promise<any>;
|
|
8707
|
-
/**
|
|
8708
|
-
* Softly asserts that the target data has a specified length.
|
|
8709
|
-
* @param targetData - The data to check.
|
|
8710
|
-
* @param length - The expected length.
|
|
8711
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8712
|
-
*/
|
|
8713
|
-
softExpectLengthOf(targetData: any, length: number, customErrorMsg?: string): Promise<any>;
|
|
8714
|
-
/**
|
|
8715
|
-
* Softly asserts that the target data is empty.
|
|
8716
|
-
* @param targetData - The data to check.
|
|
8717
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8718
|
-
*/
|
|
8719
|
-
softExpectEmpty(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8720
|
-
/**
|
|
8721
|
-
* Softly asserts that the target data is true.
|
|
8722
|
-
* @param targetData - The data to check.
|
|
8723
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8724
|
-
*/
|
|
8725
|
-
softExpectTrue(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8726
|
-
/**
|
|
8727
|
-
* Softly asserts that the target data is false.
|
|
8728
|
-
* @param targetData - The data to check.
|
|
8729
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8730
|
-
*/
|
|
8731
|
-
softExpectFalse(targetData: any, customErrorMsg?: string): Promise<any>;
|
|
8732
|
-
/**
|
|
8733
|
-
* Softly asserts that the target data is above a specified value.
|
|
8734
|
-
* @param targetData - The data to check.
|
|
8735
|
-
* @param aboveThan - The value that the target data should be above.
|
|
8736
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8737
|
-
*/
|
|
8738
|
-
softExpectAbove(targetData: any, aboveThan: any, customErrorMsg?: string): Promise<any>;
|
|
8739
|
-
/**
|
|
8740
|
-
* Softly asserts that the target data is below a specified value.
|
|
8741
|
-
* @param targetData - The data to check.
|
|
8742
|
-
* @param belowThan - The value that the target data should be below.
|
|
8743
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8744
|
-
*/
|
|
8745
|
-
softExpectBelow(targetData: any, belowThan: any, customErrorMsg?: string): Promise<any>;
|
|
8746
|
-
/**
|
|
8747
|
-
* Softly asserts that the length of the target data is above a specified value.
|
|
8748
|
-
* @param targetData - The data to check.
|
|
8749
|
-
* @param lengthAboveThan - The length that the target data should be above.
|
|
8750
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8751
|
-
*/
|
|
8752
|
-
softExpectLengthAboveThan(targetData: any, lengthAboveThan: number, customErrorMsg?: string): Promise<any>;
|
|
8753
|
-
/**
|
|
8754
|
-
* Softly asserts that the length of the target data is below a specified value.
|
|
8755
|
-
* @param targetData - The data to check.
|
|
8756
|
-
* @param lengthBelowThan - The length that the target data should be below.
|
|
8757
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8758
|
-
*/
|
|
8759
|
-
softExpectLengthBelowThan(targetData: any, lengthBelowThan: number, customErrorMsg?: string): Promise<any>;
|
|
8760
|
-
/**
|
|
8761
|
-
* Softly asserts that two values are equal, ignoring case.
|
|
8762
|
-
* @param actualValue - The actual string value.
|
|
8763
|
-
* @param expectedValue - The expected string value.
|
|
8764
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8765
|
-
*/
|
|
8766
|
-
softExpectEqualIgnoreCase(actualValue: string, expectedValue: string, customErrorMsg?: string): Promise<any>;
|
|
8767
|
-
/**
|
|
8768
|
-
* Softly asserts that two arrays have deep equality, considering members in any order.
|
|
8769
|
-
* @param actualValue - The actual array.
|
|
8770
|
-
* @param expectedValue - The expected array.
|
|
8771
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8772
|
-
*/
|
|
8773
|
-
softExpectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): Promise<any>;
|
|
8774
|
-
/**
|
|
8775
|
-
* Softly asserts that an array (superset) deeply includes all members of another array (set).
|
|
8776
|
-
* @param superset - The array that should contain the expected members.
|
|
8777
|
-
* @param set - The array with members that should be included.
|
|
8778
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8779
|
-
*/
|
|
8780
|
-
softExpectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): Promise<any>;
|
|
8781
8183
|
/**
|
|
8782
|
-
*
|
|
8783
|
-
*
|
|
8784
|
-
*
|
|
8785
|
-
*
|
|
8786
|
-
*
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
* Softly asserts that a value matches the expected pattern.
|
|
8791
|
-
* @param actualValue - The actual value.
|
|
8792
|
-
* @param expectedPattern - The pattern the value should match.
|
|
8793
|
-
* @param [customErrorMsg = ''] - A custom error message to display if the assertion fails.
|
|
8184
|
+
* Sends DELETE request to API with payload.
|
|
8185
|
+
*
|
|
8186
|
+
* ```js
|
|
8187
|
+
* I.sendDeleteRequestWithPayload('/api/users/1', { author: 'john' });
|
|
8188
|
+
* ```
|
|
8189
|
+
* @param [payload = {}] - the payload to be sent. By default it is sent as an empty object
|
|
8190
|
+
* @param [headers = {}] - the headers object to be sent. By default, it is sent as an empty object
|
|
8191
|
+
* @returns response
|
|
8794
8192
|
*/
|
|
8795
|
-
|
|
8193
|
+
sendDeleteRequestWithPayload(url: any, payload?: any, headers?: any): Promise<any>;
|
|
8796
8194
|
}
|
|
8797
8195
|
/**
|
|
8798
8196
|
* Client Functions
|
|
@@ -9616,7 +9014,7 @@ declare namespace CodeceptJS {
|
|
|
9616
9014
|
*
|
|
9617
9015
|
* ```js
|
|
9618
9016
|
* I.clearCookie();
|
|
9619
|
-
* I.clearCookie('test');
|
|
9017
|
+
* I.clearCookie('test');
|
|
9620
9018
|
* ```
|
|
9621
9019
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
9622
9020
|
*/
|
|
@@ -9726,6 +9124,7 @@ declare namespace CodeceptJS {
|
|
|
9726
9124
|
* This helper should be configured in codecept.conf.js
|
|
9727
9125
|
* @property url - base url of website to be tested.
|
|
9728
9126
|
* @property browser - Browser in which to perform testing.
|
|
9127
|
+
* @property [bidiProtocol = false] - WebDriver Bidi Protocol. Default: false. More info: https://webdriver.io/docs/api/webdriverBidi/
|
|
9729
9128
|
* @property [basicAuth] - (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
9730
9129
|
* @property [host = localhost] - WebDriver host to connect.
|
|
9731
9130
|
* @property [port = 4444] - WebDriver port to connect.
|
|
@@ -9745,15 +9144,13 @@ declare namespace CodeceptJS {
|
|
|
9745
9144
|
* @property [timeouts] - [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
|
|
9746
9145
|
* @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
9747
9146
|
* @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
|
|
9748
|
-
* @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
|
|
9749
9147
|
*/
|
|
9750
9148
|
// @ts-ignore
|
|
9751
9149
|
// @ts-ignore
|
|
9752
|
-
// @ts-ignore
|
|
9753
|
-
// @ts-ignore
|
|
9754
9150
|
type WebDriverConfig = {
|
|
9755
9151
|
url: string;
|
|
9756
9152
|
browser: string;
|
|
9153
|
+
bidiProtocol?: boolean;
|
|
9757
9154
|
basicAuth?: string;
|
|
9758
9155
|
host?: string;
|
|
9759
9156
|
port?: number;
|
|
@@ -9773,7 +9170,6 @@ declare namespace CodeceptJS {
|
|
|
9773
9170
|
timeouts?: any;
|
|
9774
9171
|
highlightElement?: boolean;
|
|
9775
9172
|
logLevel?: string;
|
|
9776
|
-
devtoolsProtocol?: boolean;
|
|
9777
9173
|
};
|
|
9778
9174
|
/**
|
|
9779
9175
|
* WebDriver helper which wraps [webdriverio](http://webdriver.io/) library to
|
|
@@ -9879,7 +9275,6 @@ declare namespace CodeceptJS {
|
|
|
9879
9275
|
* WebDriver : {
|
|
9880
9276
|
* url: "http://localhost",
|
|
9881
9277
|
* browser: "chrome",
|
|
9882
|
-
* devtoolsProtocol: true,
|
|
9883
9278
|
* desiredCapabilities: {
|
|
9884
9279
|
* chromeOptions: {
|
|
9885
9280
|
* args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
|
|
@@ -10222,6 +9617,17 @@ declare namespace CodeceptJS {
|
|
|
10222
9617
|
* @returns WebElement of being used Web helper
|
|
10223
9618
|
*/
|
|
10224
9619
|
grabWebElements(locator: CodeceptJS.LocatorOrString): Promise<any>;
|
|
9620
|
+
/**
|
|
9621
|
+
* Grab WebElement for given locator
|
|
9622
|
+
* Resumes test execution, so **should be used inside an async function with `await`** operator.
|
|
9623
|
+
*
|
|
9624
|
+
* ```js
|
|
9625
|
+
* const webElement = await I.grabWebElement('#button');
|
|
9626
|
+
* ```
|
|
9627
|
+
* @param locator - element located by CSS|XPath|strict locator.
|
|
9628
|
+
* @returns WebElement of being used Web helper
|
|
9629
|
+
*/
|
|
9630
|
+
grabWebElement(locator: CodeceptJS.LocatorOrString): Promise<any>;
|
|
10225
9631
|
/**
|
|
10226
9632
|
* Set [WebDriver timeouts](https://webdriver.io/docs/timeouts.html) in realtime.
|
|
10227
9633
|
*
|
|
@@ -11023,7 +10429,7 @@ declare namespace CodeceptJS {
|
|
|
11023
10429
|
*
|
|
11024
10430
|
* ```js
|
|
11025
10431
|
* I.clearCookie();
|
|
11026
|
-
* I.clearCookie('test');
|
|
10432
|
+
* I.clearCookie('test');
|
|
11027
10433
|
* ```
|
|
11028
10434
|
* @param [cookie = null] - (optional, `null` by default) cookie name
|
|
11029
10435
|
*/
|
|
@@ -11569,33 +10975,6 @@ declare namespace CodeceptJS {
|
|
|
11569
10975
|
* @returns scroll position
|
|
11570
10976
|
*/
|
|
11571
10977
|
grabPageScrollPosition(): Promise<PageScrollPosition>;
|
|
11572
|
-
/**
|
|
11573
|
-
* This method is **deprecated**.
|
|
11574
|
-
*
|
|
11575
|
-
*
|
|
11576
|
-
* Set the current geo location
|
|
11577
|
-
*
|
|
11578
|
-
*
|
|
11579
|
-
* ```js
|
|
11580
|
-
* I.setGeoLocation(121.21, 11.56);
|
|
11581
|
-
* I.setGeoLocation(121.21, 11.56, 10);
|
|
11582
|
-
* ```
|
|
11583
|
-
* @param latitude - to set.
|
|
11584
|
-
* @param longitude - to set
|
|
11585
|
-
* @param [altitude] - (optional, null by default) to set
|
|
11586
|
-
*/
|
|
11587
|
-
setGeoLocation(latitude: number, longitude: number, altitude?: number): Promise<any>;
|
|
11588
|
-
/**
|
|
11589
|
-
* This method is **deprecated**.
|
|
11590
|
-
*
|
|
11591
|
-
* Return the current geo location
|
|
11592
|
-
* Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
11593
|
-
*
|
|
11594
|
-
* ```js
|
|
11595
|
-
* let geoLocation = await I.grabGeoLocation();
|
|
11596
|
-
* ```
|
|
11597
|
-
*/
|
|
11598
|
-
grabGeoLocation(): Promise<{ latitude: number; longitude: number; altitude: number; }>;
|
|
11599
10978
|
/**
|
|
11600
10979
|
* Grab the width, height, location of given locator.
|
|
11601
10980
|
* Provide `width` or `height`as second param to get your desired prop.
|
|
@@ -11622,119 +11001,15 @@ declare namespace CodeceptJS {
|
|
|
11622
11001
|
/**
|
|
11623
11002
|
* Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
|
|
11624
11003
|
*/
|
|
11625
|
-
|
|
11004
|
+
runOnIOS(caps: any, fn: any): Promise<any>;
|
|
11626
11005
|
/**
|
|
11627
11006
|
* Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
|
|
11628
11007
|
*/
|
|
11629
|
-
|
|
11630
|
-
/**
|
|
11631
|
-
* _Note:_ Only works when devtoolsProtocol is enabled.
|
|
11632
|
-
*
|
|
11633
|
-
* Resets all recorded network requests.
|
|
11634
|
-
*
|
|
11635
|
-
* ```js
|
|
11636
|
-
* I.flushNetworkTraffics();
|
|
11637
|
-
* ```
|
|
11638
|
-
*/
|
|
11639
|
-
flushNetworkTraffics(): Promise<any>;
|
|
11640
|
-
/**
|
|
11641
|
-
* _Note:_ Only works when devtoolsProtocol is enabled.
|
|
11642
|
-
*
|
|
11643
|
-
* Stops recording of network traffic. Recorded traffic is not flashed.
|
|
11644
|
-
*
|
|
11645
|
-
* ```js
|
|
11646
|
-
* I.stopRecordingTraffic();
|
|
11647
|
-
* ```
|
|
11648
|
-
*/
|
|
11649
|
-
stopRecordingTraffic(): Promise<any>;
|
|
11650
|
-
/**
|
|
11651
|
-
* _Note:_ Only works when devtoolsProtocol is enabled.
|
|
11652
|
-
*
|
|
11653
|
-
* Starts recording the network traffics.
|
|
11654
|
-
* This also resets recorded network requests.
|
|
11655
|
-
*
|
|
11656
|
-
* ```js
|
|
11657
|
-
* I.startRecordingTraffic();
|
|
11658
|
-
* ```
|
|
11659
|
-
*/
|
|
11660
|
-
startRecordingTraffic(): Promise<any>;
|
|
11661
|
-
/**
|
|
11662
|
-
* _Note:_ Only works when devtoolsProtocol is enabled.
|
|
11663
|
-
*
|
|
11664
|
-
* Grab the recording network traffics
|
|
11665
|
-
*
|
|
11666
|
-
* ```js
|
|
11667
|
-
* const traffics = await I.grabRecordedNetworkTraffics();
|
|
11668
|
-
* expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
|
|
11669
|
-
* expect(traffics[0].response.status).to.equal(200);
|
|
11670
|
-
* expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
|
|
11671
|
-
* ```
|
|
11672
|
-
*/
|
|
11673
|
-
grabRecordedNetworkTraffics(): Promise<any>;
|
|
11674
|
-
/**
|
|
11675
|
-
* _Note:_ Only works when devtoolsProtocol is enabled.
|
|
11676
|
-
*
|
|
11677
|
-
* Verifies that a certain request is part of network traffic.
|
|
11678
|
-
*
|
|
11679
|
-
* ```js
|
|
11680
|
-
* // checking the request url contains certain query strings
|
|
11681
|
-
* I.amOnPage('https://openai.com/blog/chatgpt');
|
|
11682
|
-
* I.startRecordingTraffic();
|
|
11683
|
-
* await I.seeTraffic({
|
|
11684
|
-
* name: 'sentry event',
|
|
11685
|
-
* url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
|
|
11686
|
-
* parameters: {
|
|
11687
|
-
* width: '1919',
|
|
11688
|
-
* height: '1138',
|
|
11689
|
-
* },
|
|
11690
|
-
* });
|
|
11691
|
-
* ```
|
|
11692
|
-
*
|
|
11693
|
-
* ```js
|
|
11694
|
-
* // checking the request url contains certain post data
|
|
11695
|
-
* I.amOnPage('https://openai.com/blog/chatgpt');
|
|
11696
|
-
* I.startRecordingTraffic();
|
|
11697
|
-
* await I.seeTraffic({
|
|
11698
|
-
* name: 'event',
|
|
11699
|
-
* url: 'https://cloudflareinsights.com/cdn-cgi/rum',
|
|
11700
|
-
* requestPostData: {
|
|
11701
|
-
* st: 2,
|
|
11702
|
-
* },
|
|
11703
|
-
* });
|
|
11704
|
-
* ```
|
|
11705
|
-
* @param opts - options when checking the traffic network.
|
|
11706
|
-
* @param opts.name - A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
|
|
11707
|
-
* @param opts.url - Expected URL of request in network traffic
|
|
11708
|
-
* @param [opts.parameters] - Expected parameters of that request in network traffic
|
|
11709
|
-
* @param [opts.requestPostData] - Expected that request contains post data in network traffic
|
|
11710
|
-
* @param [opts.timeout] - Timeout to wait for request in seconds. Default is 10 seconds.
|
|
11711
|
-
*/
|
|
11712
|
-
seeTraffic(opts: {
|
|
11713
|
-
name: string;
|
|
11714
|
-
url: string;
|
|
11715
|
-
parameters?: any;
|
|
11716
|
-
requestPostData?: any;
|
|
11717
|
-
timeout?: number;
|
|
11718
|
-
}): Promise<any>;
|
|
11008
|
+
runOnAndroid(caps: any, fn: any): Promise<any>;
|
|
11719
11009
|
/**
|
|
11720
|
-
*
|
|
11721
|
-
*
|
|
11722
|
-
* Verifies that a certain request is not part of network traffic.
|
|
11723
|
-
*
|
|
11724
|
-
* Examples:
|
|
11725
|
-
*
|
|
11726
|
-
* ```js
|
|
11727
|
-
* I.dontSeeTraffic({ name: 'Unexpected API Call', url: 'https://api.example.com' });
|
|
11728
|
-
* I.dontSeeTraffic({ name: 'Unexpected API Call of "user" endpoint', url: /api.example.com.*user/ });
|
|
11729
|
-
* ```
|
|
11730
|
-
* @param opts - options when checking the traffic network.
|
|
11731
|
-
* @param opts.name - A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
|
|
11732
|
-
* @param opts.url - Expected URL of request in network traffic. Can be a string or a regular expression.
|
|
11010
|
+
* Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
|
|
11733
11011
|
*/
|
|
11734
|
-
|
|
11735
|
-
name: string;
|
|
11736
|
-
url: string | RegExp;
|
|
11737
|
-
}): Promise<any>;
|
|
11012
|
+
runInWeb(): Promise<any>;
|
|
11738
11013
|
}
|
|
11739
11014
|
}
|
|
11740
11015
|
|