codeceptjs 3.5.10 → 3.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/build/Appium.js +36 -36
- package/docs/build/Expect.js +33 -33
- package/docs/build/Nightmare.js +50 -50
- package/docs/build/Playwright.js +126 -122
- package/docs/build/Protractor.js +59 -59
- package/docs/build/Puppeteer.js +93 -89
- package/docs/build/TestCafe.js +48 -48
- package/docs/build/WebDriver.js +90 -92
- package/docs/helpers/Appium.md +1 -1
- package/docs/helpers/Expect.md +33 -33
- package/docs/helpers/Playwright.md +73 -35
- package/docs/helpers/Puppeteer.md +35 -24
- package/docs/helpers/WebDriver.md +26 -13
- package/docs/parallel.md +2 -2
- package/docs/plugins.md +3 -3
- package/docs/react.md +2 -1
- package/docs/vue.md +22 -0
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/lib/command/workers/runTests.js +17 -1
- package/lib/helper/Expect.js +33 -33
- package/lib/helper/Playwright.js +28 -24
- package/lib/helper/Puppeteer.js +23 -19
- package/lib/helper/WebDriver.js +15 -17
- package/lib/helper/extras/PlaywrightReactVueLocator.js +38 -0
- package/lib/plugin/retryFailedStep.js +2 -2
- package/lib/plugin/tryTo.js +5 -4
- package/package.json +15 -15
- package/typings/index.d.ts +1 -1
- package/typings/promiseBasedTypes.d.ts +119 -74
- package/typings/types.d.ts +111 -143
- package/lib/helper/extras/PlaywrightReact.js +0 -9
|
@@ -972,9 +972,9 @@ declare namespace CodeceptJS {
|
|
|
972
972
|
* I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
|
|
973
973
|
* ```
|
|
974
974
|
* @param locator - located by CSS|XPath|strict locator.
|
|
975
|
-
* @param scrollIntoViewOptions -
|
|
975
|
+
* @param scrollIntoViewOptions - either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
976
976
|
*/
|
|
977
|
-
scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): Promise<any>;
|
|
977
|
+
scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions | boolean): Promise<any>;
|
|
978
978
|
/**
|
|
979
979
|
* Verifies that the specified checkbox is checked.
|
|
980
980
|
*
|
|
@@ -1107,7 +1107,7 @@ declare namespace CodeceptJS {
|
|
|
1107
1107
|
* {
|
|
1108
1108
|
* helpers: {
|
|
1109
1109
|
* Playwright: {...},
|
|
1110
|
-
*
|
|
1110
|
+
* Expect: {},
|
|
1111
1111
|
* }
|
|
1112
1112
|
* }
|
|
1113
1113
|
* ```
|
|
@@ -1115,57 +1115,51 @@ declare namespace CodeceptJS {
|
|
|
1115
1115
|
* ## Methods
|
|
1116
1116
|
*/
|
|
1117
1117
|
class ExpectHelper {
|
|
1118
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg
|
|
1119
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg
|
|
1120
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg
|
|
1121
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg
|
|
1122
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg
|
|
1123
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg
|
|
1124
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg
|
|
1125
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg
|
|
1126
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg
|
|
1127
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg
|
|
1128
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg
|
|
1118
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1119
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1120
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1121
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1122
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): Promise<any>;
|
|
1123
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): Promise<any>;
|
|
1124
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1125
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): Promise<any>;
|
|
1126
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1127
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): Promise<any>;
|
|
1128
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): Promise<any>;
|
|
1129
1129
|
/**
|
|
1130
1130
|
* @param ajvOptions - Pass AJV options
|
|
1131
1131
|
*/
|
|
1132
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg
|
|
1133
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg
|
|
1134
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg
|
|
1135
|
-
expectToBeA(targetData: any, type: any, customErrorMsg
|
|
1136
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg
|
|
1137
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg
|
|
1138
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg
|
|
1139
|
-
expectEmpty(targetData: any, customErrorMsg
|
|
1140
|
-
expectTrue(targetData: any, customErrorMsg
|
|
1141
|
-
expectFalse(targetData: any, customErrorMsg
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
* @param belowThan - number | Date
|
|
1148
|
-
*/
|
|
1149
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg: any): Promise<any>;
|
|
1150
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg: any): Promise<any>;
|
|
1151
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg: any): Promise<any>;
|
|
1152
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg: any): Promise<any>;
|
|
1132
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions: any): Promise<any>;
|
|
1133
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1134
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): Promise<any>;
|
|
1135
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1136
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): Promise<any>;
|
|
1137
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): Promise<any>;
|
|
1138
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): Promise<any>;
|
|
1139
|
+
expectEmpty(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1140
|
+
expectTrue(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1141
|
+
expectFalse(targetData: any, customErrorMsg?: any): Promise<any>;
|
|
1142
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1143
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1144
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): Promise<any>;
|
|
1145
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): Promise<any>;
|
|
1146
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1153
1147
|
/**
|
|
1154
1148
|
* expects members of two arrays are deeply equal
|
|
1155
1149
|
*/
|
|
1156
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg
|
|
1150
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): Promise<any>;
|
|
1157
1151
|
/**
|
|
1158
1152
|
* expects an array to be a superset of another array
|
|
1159
1153
|
*/
|
|
1160
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg
|
|
1154
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): Promise<any>;
|
|
1161
1155
|
/**
|
|
1162
1156
|
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1163
1157
|
*/
|
|
1164
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg
|
|
1158
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): Promise<any>;
|
|
1165
1159
|
/**
|
|
1166
1160
|
* expects a JSON object matches a provided pattern
|
|
1167
1161
|
*/
|
|
1168
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg
|
|
1162
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): Promise<any>;
|
|
1169
1163
|
}
|
|
1170
1164
|
/**
|
|
1171
1165
|
* Helper for testing filesystem.
|
|
@@ -2950,7 +2944,7 @@ declare namespace CodeceptJS {
|
|
|
2950
2944
|
* });
|
|
2951
2945
|
* ```
|
|
2952
2946
|
* @param description - used to show in logs.
|
|
2953
|
-
* @param fn - async function that executed with Playwright helper as
|
|
2947
|
+
* @param fn - async function that executed with Playwright helper as arguments
|
|
2954
2948
|
*/
|
|
2955
2949
|
usePlaywrightTo(description: string, fn: (...params: any[]) => any): Promise<any>;
|
|
2956
2950
|
/**
|
|
@@ -3035,6 +3029,18 @@ declare namespace CodeceptJS {
|
|
|
3035
3029
|
*/
|
|
3036
3030
|
amOnPage(url: string): Promise<any>;
|
|
3037
3031
|
/**
|
|
3032
|
+
* Unlike other drivers Playwright changes the size of a viewport, not the window!
|
|
3033
|
+
* Playwright does not control the window of a browser, so it can't adjust its real size.
|
|
3034
|
+
* It also can't maximize a window.
|
|
3035
|
+
*
|
|
3036
|
+
* Update configuration to change real window size on start:
|
|
3037
|
+
*
|
|
3038
|
+
* ```js
|
|
3039
|
+
* // inside codecept.conf.js
|
|
3040
|
+
* // @codeceptjs/configure package must be installed
|
|
3041
|
+
* { setWindowSize } = require('@codeceptjs/configure');
|
|
3042
|
+
* ````
|
|
3043
|
+
*
|
|
3038
3044
|
* Resize the current window to provided width and height.
|
|
3039
3045
|
* First parameter can be set to `maximize`.
|
|
3040
3046
|
* @param width - width in pixels or `maximize`.
|
|
@@ -3111,6 +3117,13 @@ declare namespace CodeceptJS {
|
|
|
3111
3117
|
*/
|
|
3112
3118
|
grabDisabledElementStatus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<boolean>;
|
|
3113
3119
|
/**
|
|
3120
|
+
* ```js
|
|
3121
|
+
* // specify coordinates for source position
|
|
3122
|
+
* I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
|
|
3123
|
+
* ```
|
|
3124
|
+
*
|
|
3125
|
+
* > When no option is set, custom drag and drop would be used, to use the dragAndDrop API from Playwright, please set options, for example `force: true`
|
|
3126
|
+
*
|
|
3114
3127
|
* Drag an item to a destination element.
|
|
3115
3128
|
*
|
|
3116
3129
|
* ```js
|
|
@@ -3119,13 +3132,6 @@ declare namespace CodeceptJS {
|
|
|
3119
3132
|
* @param srcElement - located by CSS|XPath|strict locator.
|
|
3120
3133
|
* @param destElement - located by CSS|XPath|strict locator.
|
|
3121
3134
|
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
|
|
3122
|
-
*
|
|
3123
|
-
* ```js
|
|
3124
|
-
* // specify coordinates for source position
|
|
3125
|
-
* I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
|
|
3126
|
-
* ```
|
|
3127
|
-
*
|
|
3128
|
-
* > When no option is set, custom drag and drop would be used, to use the dragAndDrop API from Playwright, please set options, for example `force: true`
|
|
3129
3135
|
*/
|
|
3130
3136
|
dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString, options?: any): Promise<any>;
|
|
3131
3137
|
/**
|
|
@@ -3441,12 +3447,7 @@ declare namespace CodeceptJS {
|
|
|
3441
3447
|
* // using strict locator
|
|
3442
3448
|
* I.click({css: 'nav a.login'});
|
|
3443
3449
|
* ```
|
|
3444
|
-
* @
|
|
3445
|
-
* @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
3446
|
-
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
|
|
3447
|
-
*
|
|
3448
|
-
* Examples:
|
|
3449
|
-
*
|
|
3450
|
+
* @example
|
|
3450
3451
|
* ```js
|
|
3451
3452
|
* // click on element at position
|
|
3452
3453
|
* I.click('canvas', '.model', { position: { x: 20, y: 40 } })
|
|
@@ -3454,6 +3455,9 @@ declare namespace CodeceptJS {
|
|
|
3454
3455
|
* // make ctrl-click
|
|
3455
3456
|
* I.click('.edit', null, { modifiers: ['Ctrl'] } )
|
|
3456
3457
|
* ```
|
|
3458
|
+
* @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
3459
|
+
* @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
3460
|
+
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
|
|
3457
3461
|
*/
|
|
3458
3462
|
click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, options?: any): Promise<any>;
|
|
3459
3463
|
/**
|
|
@@ -3519,6 +3523,16 @@ declare namespace CodeceptJS {
|
|
|
3519
3523
|
*/
|
|
3520
3524
|
rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
|
|
3521
3525
|
/**
|
|
3526
|
+
* [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
|
|
3527
|
+
*
|
|
3528
|
+
* Examples:
|
|
3529
|
+
*
|
|
3530
|
+
* ```js
|
|
3531
|
+
* // click on element at position
|
|
3532
|
+
* I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
3533
|
+
* ```
|
|
3534
|
+
* > ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
3535
|
+
*
|
|
3522
3536
|
* Selects a checkbox or radio button.
|
|
3523
3537
|
* Element is located by label or name or CSS or XPath.
|
|
3524
3538
|
*
|
|
@@ -3534,6 +3548,16 @@ declare namespace CodeceptJS {
|
|
|
3534
3548
|
*/
|
|
3535
3549
|
checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
|
|
3536
3550
|
/**
|
|
3551
|
+
* [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
|
|
3552
|
+
*
|
|
3553
|
+
* Examples:
|
|
3554
|
+
*
|
|
3555
|
+
* ```js
|
|
3556
|
+
* // click on element at position
|
|
3557
|
+
* I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
3558
|
+
* ```
|
|
3559
|
+
* > ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
3560
|
+
*
|
|
3537
3561
|
* Unselects a checkbox or radio button.
|
|
3538
3562
|
* Element is located by label or name or CSS or XPath.
|
|
3539
3563
|
*
|
|
@@ -3597,6 +3621,8 @@ declare namespace CodeceptJS {
|
|
|
3597
3621
|
*/
|
|
3598
3622
|
pressKeyUp(key: string): Promise<any>;
|
|
3599
3623
|
/**
|
|
3624
|
+
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
|
|
3625
|
+
*
|
|
3600
3626
|
* Presses a key in the browser (on a focused element).
|
|
3601
3627
|
*
|
|
3602
3628
|
* _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
|
|
@@ -3981,6 +4007,8 @@ declare namespace CodeceptJS {
|
|
|
3981
4007
|
*/
|
|
3982
4008
|
dontSeeCookie(name: string): Promise<any>;
|
|
3983
4009
|
/**
|
|
4010
|
+
* Returns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
4011
|
+
*
|
|
3984
4012
|
* Gets a cookie object by name.
|
|
3985
4013
|
* If none provided gets all cookies.
|
|
3986
4014
|
* Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
@@ -4015,8 +4043,8 @@ declare namespace CodeceptJS {
|
|
|
4015
4043
|
* ```js
|
|
4016
4044
|
* I.executeScript(({x, y}) => x + y, {x, y});
|
|
4017
4045
|
* ```
|
|
4018
|
-
* You can pass only one parameter into a function
|
|
4019
|
-
*
|
|
4046
|
+
* You can pass only one parameter into a function,
|
|
4047
|
+
* or you can pass in array or object.
|
|
4020
4048
|
*
|
|
4021
4049
|
* ```js
|
|
4022
4050
|
* I.executeScript(([x, y]) => x + y, [x, y]);
|
|
@@ -4285,6 +4313,8 @@ declare namespace CodeceptJS {
|
|
|
4285
4313
|
*/
|
|
4286
4314
|
waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
|
|
4287
4315
|
/**
|
|
4316
|
+
* This method accepts [React selectors](https://codecept.io/react).
|
|
4317
|
+
*
|
|
4288
4318
|
* Waits for an element to become visible on a page (by default waits for 1sec).
|
|
4289
4319
|
* Element can be located by CSS or XPath.
|
|
4290
4320
|
*
|
|
@@ -6188,6 +6218,10 @@ declare namespace CodeceptJS {
|
|
|
6188
6218
|
*/
|
|
6189
6219
|
amOnPage(url: string): Promise<any>;
|
|
6190
6220
|
/**
|
|
6221
|
+
* Unlike other drivers Puppeteer changes the size of a viewport, not the window!
|
|
6222
|
+
* Puppeteer does not control the window of a browser, so it can't adjust its real size.
|
|
6223
|
+
* It also can't maximize a window.
|
|
6224
|
+
*
|
|
6191
6225
|
* Resize the current window to provided width and height.
|
|
6192
6226
|
* First parameter can be set to `maximize`.
|
|
6193
6227
|
* @param width - width in pixels or `maximize`.
|
|
@@ -6357,7 +6391,7 @@ declare namespace CodeceptJS {
|
|
|
6357
6391
|
*/
|
|
6358
6392
|
_locate(): Promise<any>;
|
|
6359
6393
|
/**
|
|
6360
|
-
* Find a checkbox by providing human
|
|
6394
|
+
* Find a checkbox by providing human-readable text:
|
|
6361
6395
|
* NOTE: Assumes the checkable element exists
|
|
6362
6396
|
*
|
|
6363
6397
|
* ```js
|
|
@@ -6366,7 +6400,7 @@ declare namespace CodeceptJS {
|
|
|
6366
6400
|
*/
|
|
6367
6401
|
_locateCheckable(): Promise<any>;
|
|
6368
6402
|
/**
|
|
6369
|
-
* Find a clickable element by providing human
|
|
6403
|
+
* Find a clickable element by providing human-readable text:
|
|
6370
6404
|
*
|
|
6371
6405
|
* ```js
|
|
6372
6406
|
* this.helpers['Puppeteer']._locateClickable('Next page').then // ...
|
|
@@ -6374,7 +6408,7 @@ declare namespace CodeceptJS {
|
|
|
6374
6408
|
*/
|
|
6375
6409
|
_locateClickable(): Promise<any>;
|
|
6376
6410
|
/**
|
|
6377
|
-
* Find field elements by providing human
|
|
6411
|
+
* Find field elements by providing human-readable text:
|
|
6378
6412
|
*
|
|
6379
6413
|
* ```js
|
|
6380
6414
|
* this.helpers['Puppeteer']._locateFields('Your email').then // ...
|
|
@@ -6551,7 +6585,7 @@ declare namespace CodeceptJS {
|
|
|
6551
6585
|
* Sets a directory to where save files. Allows to test file downloads.
|
|
6552
6586
|
* Should be used with [FileSystem helper](https://codecept.io/helpers/FileSystem) to check that file were downloaded correctly.
|
|
6553
6587
|
*
|
|
6554
|
-
* By default files are saved to `output/downloads`.
|
|
6588
|
+
* By default, files are saved to `output/downloads`.
|
|
6555
6589
|
* This directory is cleaned on every `handleDownloads` call, to ensure no old files are kept.
|
|
6556
6590
|
*
|
|
6557
6591
|
* ```js
|
|
@@ -6678,6 +6712,8 @@ declare namespace CodeceptJS {
|
|
|
6678
6712
|
*/
|
|
6679
6713
|
pressKeyUp(key: string): Promise<any>;
|
|
6680
6714
|
/**
|
|
6715
|
+
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
|
|
6716
|
+
*
|
|
6681
6717
|
* Presses a key in the browser (on a focused element).
|
|
6682
6718
|
*
|
|
6683
6719
|
* _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
|
|
@@ -6829,6 +6865,8 @@ declare namespace CodeceptJS {
|
|
|
6829
6865
|
*/
|
|
6830
6866
|
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
6831
6867
|
/**
|
|
6868
|
+
* > ⚠ There is an [issue with file upload in Puppeteer 2.1.0 & 2.1.1](https://github.com/puppeteer/puppeteer/issues/5420), downgrade to 2.0.0 if you face it.
|
|
6869
|
+
*
|
|
6832
6870
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
6833
6871
|
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
6834
6872
|
* File will be uploaded to remote system (if tests are running remotely).
|
|
@@ -7078,6 +7116,8 @@ declare namespace CodeceptJS {
|
|
|
7078
7116
|
*/
|
|
7079
7117
|
clearCookie(cookie?: string): Promise<any>;
|
|
7080
7118
|
/**
|
|
7119
|
+
* If a function returns a Promise, tt will wait for its resolution.
|
|
7120
|
+
*
|
|
7081
7121
|
* Executes sync script on a page.
|
|
7082
7122
|
* Pass arguments to function as additional parameters.
|
|
7083
7123
|
* Will return execution result to a test.
|
|
@@ -7103,12 +7143,10 @@ declare namespace CodeceptJS {
|
|
|
7103
7143
|
* @param fn - function to be executed in browser context.
|
|
7104
7144
|
* @param args - to be passed to function.
|
|
7105
7145
|
* @returns script return value
|
|
7106
|
-
*
|
|
7107
|
-
*
|
|
7108
|
-
* If a function returns a Promise It will wait for it resolution.
|
|
7109
7146
|
*/
|
|
7110
7147
|
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
7111
7148
|
/**
|
|
7149
|
+
* Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
7112
7150
|
* Executes async script on page.
|
|
7113
7151
|
* Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
7114
7152
|
*
|
|
@@ -7132,9 +7170,6 @@ declare namespace CodeceptJS {
|
|
|
7132
7170
|
* @param fn - function to be executed in browser context.
|
|
7133
7171
|
* @param args - to be passed to function.
|
|
7134
7172
|
* @returns script return value
|
|
7135
|
-
*
|
|
7136
|
-
*
|
|
7137
|
-
* Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
7138
7173
|
*/
|
|
7139
7174
|
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
7140
7175
|
/**
|
|
@@ -7503,9 +7538,9 @@ declare namespace CodeceptJS {
|
|
|
7503
7538
|
*/
|
|
7504
7539
|
waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
|
|
7505
7540
|
/**
|
|
7506
|
-
* Waits for navigation to finish. By default takes configured `waitForNavigation` option.
|
|
7541
|
+
* Waits for navigation to finish. By default, takes configured `waitForNavigation` option.
|
|
7507
7542
|
*
|
|
7508
|
-
* See [
|
|
7543
|
+
* See [Puppeteer's reference](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
|
|
7509
7544
|
*/
|
|
7510
7545
|
waitForNavigation(opts: any): Promise<any>;
|
|
7511
7546
|
/**
|
|
@@ -9218,6 +9253,8 @@ declare namespace CodeceptJS {
|
|
|
9218
9253
|
*/
|
|
9219
9254
|
selectOption(select: LocatorOrString, option: string | any[]): Promise<any>;
|
|
9220
9255
|
/**
|
|
9256
|
+
* Appium: not tested
|
|
9257
|
+
*
|
|
9221
9258
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
9222
9259
|
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
9223
9260
|
* File will be uploaded to remote system (if tests are running remotely).
|
|
@@ -9231,6 +9268,7 @@ declare namespace CodeceptJS {
|
|
|
9231
9268
|
*/
|
|
9232
9269
|
attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): Promise<any>;
|
|
9233
9270
|
/**
|
|
9271
|
+
* Appium: not tested
|
|
9234
9272
|
* Selects a checkbox or radio button.
|
|
9235
9273
|
* Element is located by label or name or CSS or XPath.
|
|
9236
9274
|
*
|
|
@@ -9246,6 +9284,7 @@ declare namespace CodeceptJS {
|
|
|
9246
9284
|
*/
|
|
9247
9285
|
checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): Promise<any>;
|
|
9248
9286
|
/**
|
|
9287
|
+
* Appium: not tested
|
|
9249
9288
|
* Unselects a checkbox or radio button.
|
|
9250
9289
|
* Element is located by label or name or CSS or XPath.
|
|
9251
9290
|
*
|
|
@@ -9478,6 +9517,7 @@ declare namespace CodeceptJS {
|
|
|
9478
9517
|
*/
|
|
9479
9518
|
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): Promise<any>;
|
|
9480
9519
|
/**
|
|
9520
|
+
* Appium: not tested
|
|
9481
9521
|
* Verifies that the specified checkbox is checked.
|
|
9482
9522
|
*
|
|
9483
9523
|
* ```js
|
|
@@ -9489,6 +9529,7 @@ declare namespace CodeceptJS {
|
|
|
9489
9529
|
*/
|
|
9490
9530
|
seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): Promise<any>;
|
|
9491
9531
|
/**
|
|
9532
|
+
* Appium: not tested
|
|
9492
9533
|
* Verifies that the specified checkbox is not checked.
|
|
9493
9534
|
*
|
|
9494
9535
|
* ```js
|
|
@@ -9679,6 +9720,8 @@ declare namespace CodeceptJS {
|
|
|
9679
9720
|
*/
|
|
9680
9721
|
dontSeeCurrentUrlEquals(url: string): Promise<any>;
|
|
9681
9722
|
/**
|
|
9723
|
+
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
9724
|
+
*
|
|
9682
9725
|
* Executes sync script on a page.
|
|
9683
9726
|
* Pass arguments to function as additional parameters.
|
|
9684
9727
|
* Will return execution result to a test.
|
|
@@ -9704,10 +9747,6 @@ declare namespace CodeceptJS {
|
|
|
9704
9747
|
* @param fn - function to be executed in browser context.
|
|
9705
9748
|
* @param args - to be passed to function.
|
|
9706
9749
|
* @returns script return value
|
|
9707
|
-
*
|
|
9708
|
-
*
|
|
9709
|
-
*
|
|
9710
|
-
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
9711
9750
|
*/
|
|
9712
9751
|
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
9713
9752
|
/**
|
|
@@ -9745,9 +9784,9 @@ declare namespace CodeceptJS {
|
|
|
9745
9784
|
* I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
|
|
9746
9785
|
* ```
|
|
9747
9786
|
* @param locator - located by CSS|XPath|strict locator.
|
|
9748
|
-
* @param scrollIntoViewOptions -
|
|
9787
|
+
* @param scrollIntoViewOptions - either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
9749
9788
|
*/
|
|
9750
|
-
scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): Promise<any>;
|
|
9789
|
+
scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions | boolean): Promise<any>;
|
|
9751
9790
|
/**
|
|
9752
9791
|
* Scrolls to element matched by locator.
|
|
9753
9792
|
* Extra shift can be set with offsetX and offsetY options.
|
|
@@ -9799,6 +9838,7 @@ declare namespace CodeceptJS {
|
|
|
9799
9838
|
*/
|
|
9800
9839
|
saveScreenshot(fileName: string, fullPage?: boolean): Promise<any>;
|
|
9801
9840
|
/**
|
|
9841
|
+
* Uses Selenium's JSON [cookie format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
|
|
9802
9842
|
* Sets cookie(s).
|
|
9803
9843
|
*
|
|
9804
9844
|
* Can be a single cookie object or an array of cookies:
|
|
@@ -9863,7 +9903,7 @@ declare namespace CodeceptJS {
|
|
|
9863
9903
|
*/
|
|
9864
9904
|
acceptPopup(): Promise<any>;
|
|
9865
9905
|
/**
|
|
9866
|
-
* Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt
|
|
9906
|
+
* Dismisses the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`.
|
|
9867
9907
|
*/
|
|
9868
9908
|
cancelPopup(): Promise<any>;
|
|
9869
9909
|
/**
|
|
@@ -9906,6 +9946,8 @@ declare namespace CodeceptJS {
|
|
|
9906
9946
|
*/
|
|
9907
9947
|
pressKeyUp(key: string): Promise<any>;
|
|
9908
9948
|
/**
|
|
9949
|
+
* _Note:_ In case a text field or textarea is focused be aware that some browsers do not respect active modifier when combining modifier keys with other keys.
|
|
9950
|
+
*
|
|
9909
9951
|
* Presses a key in the browser (on a focused element).
|
|
9910
9952
|
*
|
|
9911
9953
|
* _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
|
|
@@ -9989,6 +10031,8 @@ declare namespace CodeceptJS {
|
|
|
9989
10031
|
*/
|
|
9990
10032
|
type(key: string | string[], delay?: number): Promise<any>;
|
|
9991
10033
|
/**
|
|
10034
|
+
* Appium: not tested in web, in apps doesn't work
|
|
10035
|
+
*
|
|
9992
10036
|
* Resize the current window to provided width and height.
|
|
9993
10037
|
* First parameter can be set to `maximize`.
|
|
9994
10038
|
* @param width - width in pixels or `maximize`.
|
|
@@ -10029,6 +10073,7 @@ declare namespace CodeceptJS {
|
|
|
10029
10073
|
*/
|
|
10030
10074
|
blur(locator: CodeceptJS.LocatorOrString, options?: any): Promise<any>;
|
|
10031
10075
|
/**
|
|
10076
|
+
* Appium: not tested
|
|
10032
10077
|
* Drag an item to a destination element.
|
|
10033
10078
|
*
|
|
10034
10079
|
* ```js
|