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
package/typings/types.d.ts
CHANGED
|
@@ -980,13 +980,13 @@ declare namespace CodeceptJS {
|
|
|
980
980
|
* I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
|
|
981
981
|
* ```
|
|
982
982
|
* @param locator - located by CSS|XPath|strict locator.
|
|
983
|
-
* @param scrollIntoViewOptions -
|
|
983
|
+
* @param scrollIntoViewOptions - either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
984
984
|
* @returns automatically synchronized promise through #recorder
|
|
985
985
|
*
|
|
986
986
|
*
|
|
987
987
|
* Supported only for web testing
|
|
988
988
|
*/
|
|
989
|
-
scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): void;
|
|
989
|
+
scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions | boolean): void;
|
|
990
990
|
/**
|
|
991
991
|
* Verifies that the specified checkbox is checked.
|
|
992
992
|
*
|
|
@@ -1131,7 +1131,7 @@ declare namespace CodeceptJS {
|
|
|
1131
1131
|
* {
|
|
1132
1132
|
* helpers: {
|
|
1133
1133
|
* Playwright: {...},
|
|
1134
|
-
*
|
|
1134
|
+
* Expect: {},
|
|
1135
1135
|
* }
|
|
1136
1136
|
* }
|
|
1137
1137
|
* ```
|
|
@@ -1139,57 +1139,51 @@ declare namespace CodeceptJS {
|
|
|
1139
1139
|
* ## Methods
|
|
1140
1140
|
*/
|
|
1141
1141
|
class ExpectHelper {
|
|
1142
|
-
expectEqual(actualValue: any, expectedValue: any, customErrorMsg
|
|
1143
|
-
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg
|
|
1144
|
-
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg
|
|
1145
|
-
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg
|
|
1146
|
-
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg
|
|
1147
|
-
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg
|
|
1148
|
-
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg
|
|
1149
|
-
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg
|
|
1150
|
-
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg
|
|
1151
|
-
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg
|
|
1152
|
-
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg
|
|
1142
|
+
expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1143
|
+
expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1144
|
+
expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1145
|
+
expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1146
|
+
expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: any): void;
|
|
1147
|
+
expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: any): void;
|
|
1148
|
+
expectStartsWith(actualValue: any, expectedValueToStartWith: any, customErrorMsg?: any): void;
|
|
1149
|
+
expectNotStartsWith(actualValue: any, expectedValueToNotStartWith: any, customErrorMsg?: any): void;
|
|
1150
|
+
expectEndsWith(actualValue: any, expectedValueToEndWith: any, customErrorMsg?: any): void;
|
|
1151
|
+
expectNotEndsWith(actualValue: any, expectedValueToNotEndWith: any, customErrorMsg?: any): void;
|
|
1152
|
+
expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: any): void;
|
|
1153
1153
|
/**
|
|
1154
1154
|
* @param ajvOptions - Pass AJV options
|
|
1155
1155
|
*/
|
|
1156
|
-
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg
|
|
1157
|
-
expectHasProperty(targetData: any, propertyName: any, customErrorMsg
|
|
1158
|
-
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg
|
|
1159
|
-
expectToBeA(targetData: any, type: any, customErrorMsg
|
|
1160
|
-
expectToBeAn(targetData: any, type: any, customErrorMsg
|
|
1161
|
-
expectMatchRegex(targetData: any, regex: any, customErrorMsg
|
|
1162
|
-
expectLengthOf(targetData: any, length: any, customErrorMsg
|
|
1163
|
-
expectEmpty(targetData: any, customErrorMsg
|
|
1164
|
-
expectTrue(targetData: any, customErrorMsg
|
|
1165
|
-
expectFalse(targetData: any, customErrorMsg
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
* @param belowThan - number | Date
|
|
1172
|
-
*/
|
|
1173
|
-
expectBelow(targetData: any, belowThan: any, customErrorMsg: any): void;
|
|
1174
|
-
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg: any): void;
|
|
1175
|
-
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg: any): void;
|
|
1176
|
-
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg: any): void;
|
|
1156
|
+
expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: any, ajvOptions: any): void;
|
|
1157
|
+
expectHasProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1158
|
+
expectHasAProperty(targetData: any, propertyName: any, customErrorMsg?: any): void;
|
|
1159
|
+
expectToBeA(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1160
|
+
expectToBeAn(targetData: any, type: any, customErrorMsg?: any): void;
|
|
1161
|
+
expectMatchRegex(targetData: any, regex: any, customErrorMsg?: any): void;
|
|
1162
|
+
expectLengthOf(targetData: any, length: any, customErrorMsg?: any): void;
|
|
1163
|
+
expectEmpty(targetData: any, customErrorMsg?: any): void;
|
|
1164
|
+
expectTrue(targetData: any, customErrorMsg?: any): void;
|
|
1165
|
+
expectFalse(targetData: any, customErrorMsg?: any): void;
|
|
1166
|
+
expectAbove(targetData: any, aboveThan: any, customErrorMsg?: any): void;
|
|
1167
|
+
expectBelow(targetData: any, belowThan: any, customErrorMsg?: any): void;
|
|
1168
|
+
expectLengthAboveThan(targetData: any, lengthAboveThan: any, customErrorMsg?: any): void;
|
|
1169
|
+
expectLengthBelowThan(targetData: any, lengthBelowThan: any, customErrorMsg?: any): void;
|
|
1170
|
+
expectEqualIgnoreCase(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1177
1171
|
/**
|
|
1178
1172
|
* expects members of two arrays are deeply equal
|
|
1179
1173
|
*/
|
|
1180
|
-
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg
|
|
1174
|
+
expectDeepMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): void;
|
|
1181
1175
|
/**
|
|
1182
1176
|
* expects an array to be a superset of another array
|
|
1183
1177
|
*/
|
|
1184
|
-
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg
|
|
1178
|
+
expectDeepIncludeMembers(superset: any, set: any, customErrorMsg?: any): void;
|
|
1185
1179
|
/**
|
|
1186
1180
|
* expects members of two JSON objects are deeply equal excluding some properties
|
|
1187
1181
|
*/
|
|
1188
|
-
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg
|
|
1182
|
+
expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: any, customErrorMsg?: any): void;
|
|
1189
1183
|
/**
|
|
1190
1184
|
* expects a JSON object matches a provided pattern
|
|
1191
1185
|
*/
|
|
1192
|
-
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg
|
|
1186
|
+
expectMatchesPattern(actualValue: any, expectedPattern: any, customErrorMsg?: any): void;
|
|
1193
1187
|
}
|
|
1194
1188
|
/**
|
|
1195
1189
|
* Helper for testing filesystem.
|
|
@@ -3120,7 +3114,7 @@ declare namespace CodeceptJS {
|
|
|
3120
3114
|
* });
|
|
3121
3115
|
* ```
|
|
3122
3116
|
* @param description - used to show in logs.
|
|
3123
|
-
* @param fn - async function that executed with Playwright helper as
|
|
3117
|
+
* @param fn - async function that executed with Playwright helper as arguments
|
|
3124
3118
|
*/
|
|
3125
3119
|
usePlaywrightTo(description: string, fn: (...params: any[]) => any): void;
|
|
3126
3120
|
/**
|
|
@@ -3207,15 +3201,8 @@ declare namespace CodeceptJS {
|
|
|
3207
3201
|
*/
|
|
3208
3202
|
amOnPage(url: string): void;
|
|
3209
3203
|
/**
|
|
3210
|
-
* Resize the current window to provided width and height.
|
|
3211
|
-
* First parameter can be set to `maximize`.
|
|
3212
|
-
* @param width - width in pixels or `maximize`.
|
|
3213
|
-
* @param height - height in pixels.
|
|
3214
|
-
* @returns automatically synchronized promise through #recorder
|
|
3215
|
-
*
|
|
3216
|
-
*
|
|
3217
3204
|
* Unlike other drivers Playwright changes the size of a viewport, not the window!
|
|
3218
|
-
* Playwright does not control the window of a browser so it can't adjust its real size.
|
|
3205
|
+
* Playwright does not control the window of a browser, so it can't adjust its real size.
|
|
3219
3206
|
* It also can't maximize a window.
|
|
3220
3207
|
*
|
|
3221
3208
|
* Update configuration to change real window size on start:
|
|
@@ -3225,6 +3212,12 @@ declare namespace CodeceptJS {
|
|
|
3225
3212
|
* // @codeceptjs/configure package must be installed
|
|
3226
3213
|
* { setWindowSize } = require('@codeceptjs/configure');
|
|
3227
3214
|
* ````
|
|
3215
|
+
*
|
|
3216
|
+
* Resize the current window to provided width and height.
|
|
3217
|
+
* First parameter can be set to `maximize`.
|
|
3218
|
+
* @param width - width in pixels or `maximize`.
|
|
3219
|
+
* @param height - height in pixels.
|
|
3220
|
+
* @returns automatically synchronized promise through #recorder
|
|
3228
3221
|
*/
|
|
3229
3222
|
resizeWindow(width: number, height: number): void;
|
|
3230
3223
|
/**
|
|
@@ -3300,6 +3293,13 @@ declare namespace CodeceptJS {
|
|
|
3300
3293
|
*/
|
|
3301
3294
|
grabDisabledElementStatus(locator: CodeceptJS.LocatorOrString, options?: any): Promise<boolean>;
|
|
3302
3295
|
/**
|
|
3296
|
+
* ```js
|
|
3297
|
+
* // specify coordinates for source position
|
|
3298
|
+
* I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
|
|
3299
|
+
* ```
|
|
3300
|
+
*
|
|
3301
|
+
* > 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`
|
|
3302
|
+
*
|
|
3303
3303
|
* Drag an item to a destination element.
|
|
3304
3304
|
*
|
|
3305
3305
|
* ```js
|
|
@@ -3308,13 +3308,6 @@ declare namespace CodeceptJS {
|
|
|
3308
3308
|
* @param srcElement - located by CSS|XPath|strict locator.
|
|
3309
3309
|
* @param destElement - located by CSS|XPath|strict locator.
|
|
3310
3310
|
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
|
|
3311
|
-
*
|
|
3312
|
-
* ```js
|
|
3313
|
-
* // specify coordinates for source position
|
|
3314
|
-
* I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
|
|
3315
|
-
* ```
|
|
3316
|
-
*
|
|
3317
|
-
* > 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`
|
|
3318
3311
|
* @returns automatically synchronized promise through #recorder
|
|
3319
3312
|
*/
|
|
3320
3313
|
dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString, options?: any): void;
|
|
@@ -3643,12 +3636,7 @@ declare namespace CodeceptJS {
|
|
|
3643
3636
|
* // using strict locator
|
|
3644
3637
|
* I.click({css: 'nav a.login'});
|
|
3645
3638
|
* ```
|
|
3646
|
-
* @
|
|
3647
|
-
* @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
3648
|
-
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
|
|
3649
|
-
*
|
|
3650
|
-
* Examples:
|
|
3651
|
-
*
|
|
3639
|
+
* @example
|
|
3652
3640
|
* ```js
|
|
3653
3641
|
* // click on element at position
|
|
3654
3642
|
* I.click('canvas', '.model', { position: { x: 20, y: 40 } })
|
|
@@ -3656,6 +3644,9 @@ declare namespace CodeceptJS {
|
|
|
3656
3644
|
* // make ctrl-click
|
|
3657
3645
|
* I.click('.edit', null, { modifiers: ['Ctrl'] } )
|
|
3658
3646
|
* ```
|
|
3647
|
+
* @param locator - clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
3648
|
+
* @param [context = null] - (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
3649
|
+
* @param [options] - [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
|
|
3659
3650
|
* @returns automatically synchronized promise through #recorder
|
|
3660
3651
|
*/
|
|
3661
3652
|
click(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString | null, options?: any): void;
|
|
@@ -3725,6 +3716,16 @@ declare namespace CodeceptJS {
|
|
|
3725
3716
|
*/
|
|
3726
3717
|
rightClick(locator: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
|
|
3727
3718
|
/**
|
|
3719
|
+
* [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
|
|
3720
|
+
*
|
|
3721
|
+
* Examples:
|
|
3722
|
+
*
|
|
3723
|
+
* ```js
|
|
3724
|
+
* // click on element at position
|
|
3725
|
+
* I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
3726
|
+
* ```
|
|
3727
|
+
* > ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
3728
|
+
*
|
|
3728
3729
|
* Selects a checkbox or radio button.
|
|
3729
3730
|
* Element is located by label or name or CSS or XPath.
|
|
3730
3731
|
*
|
|
@@ -3738,20 +3739,19 @@ declare namespace CodeceptJS {
|
|
|
3738
3739
|
* @param field - checkbox located by label | name | CSS | XPath | strict locator.
|
|
3739
3740
|
* @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
3740
3741
|
* @returns automatically synchronized promise through #recorder
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3742
|
+
*/
|
|
3743
|
+
checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
|
|
3744
|
+
/**
|
|
3745
|
+
* [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
|
|
3744
3746
|
*
|
|
3745
3747
|
* Examples:
|
|
3746
3748
|
*
|
|
3747
3749
|
* ```js
|
|
3748
3750
|
* // click on element at position
|
|
3749
|
-
* I.
|
|
3751
|
+
* I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
3750
3752
|
* ```
|
|
3751
3753
|
* > ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
3752
|
-
|
|
3753
|
-
checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
|
|
3754
|
-
/**
|
|
3754
|
+
*
|
|
3755
3755
|
* Unselects a checkbox or radio button.
|
|
3756
3756
|
* Element is located by label or name or CSS or XPath.
|
|
3757
3757
|
*
|
|
@@ -3765,17 +3765,6 @@ declare namespace CodeceptJS {
|
|
|
3765
3765
|
* @param field - checkbox located by label | name | CSS | XPath | strict locator.
|
|
3766
3766
|
* @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
3767
3767
|
* @returns automatically synchronized promise through #recorder
|
|
3768
|
-
*
|
|
3769
|
-
*
|
|
3770
|
-
* [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
|
|
3771
|
-
*
|
|
3772
|
-
* Examples:
|
|
3773
|
-
*
|
|
3774
|
-
* ```js
|
|
3775
|
-
* // click on element at position
|
|
3776
|
-
* I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
3777
|
-
* ```
|
|
3778
|
-
* > ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
3779
3768
|
*/
|
|
3780
3769
|
uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
|
|
3781
3770
|
/**
|
|
@@ -3831,6 +3820,8 @@ declare namespace CodeceptJS {
|
|
|
3831
3820
|
*/
|
|
3832
3821
|
pressKeyUp(key: string): void;
|
|
3833
3822
|
/**
|
|
3823
|
+
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
|
|
3824
|
+
*
|
|
3834
3825
|
* Presses a key in the browser (on a focused element).
|
|
3835
3826
|
*
|
|
3836
3827
|
* _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
|
|
@@ -3890,9 +3881,6 @@ declare namespace CodeceptJS {
|
|
|
3890
3881
|
* - `'Tab'`
|
|
3891
3882
|
* @param key - key or array of keys to press.
|
|
3892
3883
|
* @returns automatically synchronized promise through #recorder
|
|
3893
|
-
*
|
|
3894
|
-
*
|
|
3895
|
-
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
|
|
3896
3884
|
*/
|
|
3897
3885
|
pressKey(key: string | string[]): void;
|
|
3898
3886
|
/**
|
|
@@ -4240,6 +4228,8 @@ declare namespace CodeceptJS {
|
|
|
4240
4228
|
*/
|
|
4241
4229
|
dontSeeCookie(name: string): void;
|
|
4242
4230
|
/**
|
|
4231
|
+
* Returns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
4232
|
+
*
|
|
4243
4233
|
* Gets a cookie object by name.
|
|
4244
4234
|
* If none provided gets all cookies.
|
|
4245
4235
|
* Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
@@ -4250,9 +4240,6 @@ declare namespace CodeceptJS {
|
|
|
4250
4240
|
* ```
|
|
4251
4241
|
* @param [name = null] - cookie name.
|
|
4252
4242
|
* @returns attribute value
|
|
4253
|
-
*
|
|
4254
|
-
*
|
|
4255
|
-
* Returns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
4256
4243
|
*/
|
|
4257
4244
|
grabCookie(name?: string): any;
|
|
4258
4245
|
/**
|
|
@@ -4278,8 +4265,8 @@ declare namespace CodeceptJS {
|
|
|
4278
4265
|
* ```js
|
|
4279
4266
|
* I.executeScript(({x, y}) => x + y, {x, y});
|
|
4280
4267
|
* ```
|
|
4281
|
-
* You can pass only one parameter into a function
|
|
4282
|
-
*
|
|
4268
|
+
* You can pass only one parameter into a function,
|
|
4269
|
+
* or you can pass in array or object.
|
|
4283
4270
|
*
|
|
4284
4271
|
* ```js
|
|
4285
4272
|
* I.executeScript(([x, y]) => x + y, [x, y]);
|
|
@@ -4559,6 +4546,8 @@ declare namespace CodeceptJS {
|
|
|
4559
4546
|
*/
|
|
4560
4547
|
waitForElement(locator: CodeceptJS.LocatorOrString, sec?: number): void;
|
|
4561
4548
|
/**
|
|
4549
|
+
* This method accepts [React selectors](https://codecept.io/react).
|
|
4550
|
+
*
|
|
4562
4551
|
* Waits for an element to become visible on a page (by default waits for 1sec).
|
|
4563
4552
|
* Element can be located by CSS or XPath.
|
|
4564
4553
|
*
|
|
@@ -4568,9 +4557,6 @@ declare namespace CodeceptJS {
|
|
|
4568
4557
|
* @param locator - element located by CSS|XPath|strict locator.
|
|
4569
4558
|
* @param [sec = 1] - (optional, `1` by default) time in seconds to wait
|
|
4570
4559
|
* @returns automatically synchronized promise through #recorder
|
|
4571
|
-
*
|
|
4572
|
-
*
|
|
4573
|
-
* This method accepts [React selectors](https://codecept.io/react).
|
|
4574
4560
|
*/
|
|
4575
4561
|
waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
|
|
4576
4562
|
/**
|
|
@@ -6597,16 +6583,15 @@ declare namespace CodeceptJS {
|
|
|
6597
6583
|
*/
|
|
6598
6584
|
amOnPage(url: string): void;
|
|
6599
6585
|
/**
|
|
6586
|
+
* Unlike other drivers Puppeteer changes the size of a viewport, not the window!
|
|
6587
|
+
* Puppeteer does not control the window of a browser, so it can't adjust its real size.
|
|
6588
|
+
* It also can't maximize a window.
|
|
6589
|
+
*
|
|
6600
6590
|
* Resize the current window to provided width and height.
|
|
6601
6591
|
* First parameter can be set to `maximize`.
|
|
6602
6592
|
* @param width - width in pixels or `maximize`.
|
|
6603
6593
|
* @param height - height in pixels.
|
|
6604
6594
|
* @returns automatically synchronized promise through #recorder
|
|
6605
|
-
*
|
|
6606
|
-
*
|
|
6607
|
-
* Unlike other drivers Puppeteer changes the size of a viewport, not the window!
|
|
6608
|
-
* Puppeteer does not control the window of a browser so it can't adjust its real size.
|
|
6609
|
-
* It also can't maximize a window.
|
|
6610
6595
|
*/
|
|
6611
6596
|
resizeWindow(width: number, height: number): void;
|
|
6612
6597
|
/**
|
|
@@ -6785,7 +6770,7 @@ declare namespace CodeceptJS {
|
|
|
6785
6770
|
*/
|
|
6786
6771
|
_locate(): void;
|
|
6787
6772
|
/**
|
|
6788
|
-
* Find a checkbox by providing human
|
|
6773
|
+
* Find a checkbox by providing human-readable text:
|
|
6789
6774
|
* NOTE: Assumes the checkable element exists
|
|
6790
6775
|
*
|
|
6791
6776
|
* ```js
|
|
@@ -6794,7 +6779,7 @@ declare namespace CodeceptJS {
|
|
|
6794
6779
|
*/
|
|
6795
6780
|
_locateCheckable(): void;
|
|
6796
6781
|
/**
|
|
6797
|
-
* Find a clickable element by providing human
|
|
6782
|
+
* Find a clickable element by providing human-readable text:
|
|
6798
6783
|
*
|
|
6799
6784
|
* ```js
|
|
6800
6785
|
* this.helpers['Puppeteer']._locateClickable('Next page').then // ...
|
|
@@ -6802,7 +6787,7 @@ declare namespace CodeceptJS {
|
|
|
6802
6787
|
*/
|
|
6803
6788
|
_locateClickable(): void;
|
|
6804
6789
|
/**
|
|
6805
|
-
* Find field elements by providing human
|
|
6790
|
+
* Find field elements by providing human-readable text:
|
|
6806
6791
|
*
|
|
6807
6792
|
* ```js
|
|
6808
6793
|
* this.helpers['Puppeteer']._locateFields('Your email').then // ...
|
|
@@ -6999,7 +6984,7 @@ declare namespace CodeceptJS {
|
|
|
6999
6984
|
* Sets a directory to where save files. Allows to test file downloads.
|
|
7000
6985
|
* Should be used with [FileSystem helper](https://codecept.io/helpers/FileSystem) to check that file were downloaded correctly.
|
|
7001
6986
|
*
|
|
7002
|
-
* By default files are saved to `output/downloads`.
|
|
6987
|
+
* By default, files are saved to `output/downloads`.
|
|
7003
6988
|
* This directory is cleaned on every `handleDownloads` call, to ensure no old files are kept.
|
|
7004
6989
|
*
|
|
7005
6990
|
* ```js
|
|
@@ -7140,6 +7125,8 @@ declare namespace CodeceptJS {
|
|
|
7140
7125
|
*/
|
|
7141
7126
|
pressKeyUp(key: string): void;
|
|
7142
7127
|
/**
|
|
7128
|
+
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
|
|
7129
|
+
*
|
|
7143
7130
|
* Presses a key in the browser (on a focused element).
|
|
7144
7131
|
*
|
|
7145
7132
|
* _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
|
|
@@ -7199,9 +7186,6 @@ declare namespace CodeceptJS {
|
|
|
7199
7186
|
* - `'Tab'`
|
|
7200
7187
|
* @param key - key or array of keys to press.
|
|
7201
7188
|
* @returns automatically synchronized promise through #recorder
|
|
7202
|
-
*
|
|
7203
|
-
*
|
|
7204
|
-
* _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
|
|
7205
7189
|
*/
|
|
7206
7190
|
pressKey(key: string | string[]): void;
|
|
7207
7191
|
/**
|
|
@@ -7306,6 +7290,8 @@ declare namespace CodeceptJS {
|
|
|
7306
7290
|
*/
|
|
7307
7291
|
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
|
|
7308
7292
|
/**
|
|
7293
|
+
* > ⚠ 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.
|
|
7294
|
+
*
|
|
7309
7295
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
7310
7296
|
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
7311
7297
|
* File will be uploaded to remote system (if tests are running remotely).
|
|
@@ -7317,9 +7303,6 @@ declare namespace CodeceptJS {
|
|
|
7317
7303
|
* @param locator - field located by label|name|CSS|XPath|strict locator.
|
|
7318
7304
|
* @param pathToFile - local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
7319
7305
|
* @returns automatically synchronized promise through #recorder
|
|
7320
|
-
*
|
|
7321
|
-
*
|
|
7322
|
-
* > ⚠ 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.
|
|
7323
7306
|
*/
|
|
7324
7307
|
attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
|
|
7325
7308
|
/**
|
|
@@ -7590,6 +7573,8 @@ declare namespace CodeceptJS {
|
|
|
7590
7573
|
*/
|
|
7591
7574
|
clearCookie(cookie?: string): void;
|
|
7592
7575
|
/**
|
|
7576
|
+
* If a function returns a Promise, tt will wait for its resolution.
|
|
7577
|
+
*
|
|
7593
7578
|
* Executes sync script on a page.
|
|
7594
7579
|
* Pass arguments to function as additional parameters.
|
|
7595
7580
|
* Will return execution result to a test.
|
|
@@ -7615,12 +7600,10 @@ declare namespace CodeceptJS {
|
|
|
7615
7600
|
* @param fn - function to be executed in browser context.
|
|
7616
7601
|
* @param args - to be passed to function.
|
|
7617
7602
|
* @returns script return value
|
|
7618
|
-
*
|
|
7619
|
-
*
|
|
7620
|
-
* If a function returns a Promise It will wait for it resolution.
|
|
7621
7603
|
*/
|
|
7622
7604
|
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
7623
7605
|
/**
|
|
7606
|
+
* Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
7624
7607
|
* Executes async script on page.
|
|
7625
7608
|
* Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
7626
7609
|
*
|
|
@@ -7644,9 +7627,6 @@ declare namespace CodeceptJS {
|
|
|
7644
7627
|
* @param fn - function to be executed in browser context.
|
|
7645
7628
|
* @param args - to be passed to function.
|
|
7646
7629
|
* @returns script return value
|
|
7647
|
-
*
|
|
7648
|
-
*
|
|
7649
|
-
* Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
7650
7630
|
*/
|
|
7651
7631
|
executeAsyncScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
7652
7632
|
/**
|
|
@@ -7931,7 +7911,7 @@ declare namespace CodeceptJS {
|
|
|
7931
7911
|
* @returns automatically synchronized promise through #recorder
|
|
7932
7912
|
*
|
|
7933
7913
|
*
|
|
7934
|
-
*
|
|
7914
|
+
* {{ react }}
|
|
7935
7915
|
*/
|
|
7936
7916
|
waitForVisible(locator: CodeceptJS.LocatorOrString, sec?: number): void;
|
|
7937
7917
|
/**
|
|
@@ -8047,9 +8027,9 @@ declare namespace CodeceptJS {
|
|
|
8047
8027
|
*/
|
|
8048
8028
|
waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
|
|
8049
8029
|
/**
|
|
8050
|
-
* Waits for navigation to finish. By default takes configured `waitForNavigation` option.
|
|
8030
|
+
* Waits for navigation to finish. By default, takes configured `waitForNavigation` option.
|
|
8051
8031
|
*
|
|
8052
|
-
* See [
|
|
8032
|
+
* See [Puppeteer's reference](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
|
|
8053
8033
|
*/
|
|
8054
8034
|
waitForNavigation(opts: any): void;
|
|
8055
8035
|
/**
|
|
@@ -9920,6 +9900,8 @@ declare namespace CodeceptJS {
|
|
|
9920
9900
|
*/
|
|
9921
9901
|
selectOption(select: LocatorOrString, option: string | any[]): void;
|
|
9922
9902
|
/**
|
|
9903
|
+
* Appium: not tested
|
|
9904
|
+
*
|
|
9923
9905
|
* Attaches a file to element located by label, name, CSS or XPath
|
|
9924
9906
|
* Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
9925
9907
|
* File will be uploaded to remote system (if tests are running remotely).
|
|
@@ -9931,11 +9913,10 @@ declare namespace CodeceptJS {
|
|
|
9931
9913
|
* @param locator - field located by label|name|CSS|XPath|strict locator.
|
|
9932
9914
|
* @param pathToFile - local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
9933
9915
|
* @returns automatically synchronized promise through #recorder
|
|
9934
|
-
*
|
|
9935
|
-
* Appium: not tested
|
|
9936
9916
|
*/
|
|
9937
9917
|
attachFile(locator: CodeceptJS.LocatorOrString, pathToFile: string): void;
|
|
9938
9918
|
/**
|
|
9919
|
+
* Appium: not tested
|
|
9939
9920
|
* Selects a checkbox or radio button.
|
|
9940
9921
|
* Element is located by label or name or CSS or XPath.
|
|
9941
9922
|
*
|
|
@@ -9949,11 +9930,10 @@ declare namespace CodeceptJS {
|
|
|
9949
9930
|
* @param field - checkbox located by label | name | CSS | XPath | strict locator.
|
|
9950
9931
|
* @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
9951
9932
|
* @returns automatically synchronized promise through #recorder
|
|
9952
|
-
*
|
|
9953
|
-
* Appium: not tested
|
|
9954
9933
|
*/
|
|
9955
9934
|
checkOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
|
|
9956
9935
|
/**
|
|
9936
|
+
* Appium: not tested
|
|
9957
9937
|
* Unselects a checkbox or radio button.
|
|
9958
9938
|
* Element is located by label or name or CSS or XPath.
|
|
9959
9939
|
*
|
|
@@ -9967,8 +9947,6 @@ declare namespace CodeceptJS {
|
|
|
9967
9947
|
* @param field - checkbox located by label | name | CSS | XPath | strict locator.
|
|
9968
9948
|
* @param [context = null] - (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
9969
9949
|
* @returns automatically synchronized promise through #recorder
|
|
9970
|
-
*
|
|
9971
|
-
* Appium: not tested
|
|
9972
9950
|
*/
|
|
9973
9951
|
uncheckOption(field: CodeceptJS.LocatorOrString, context?: CodeceptJS.LocatorOrString): void;
|
|
9974
9952
|
/**
|
|
@@ -10203,6 +10181,7 @@ declare namespace CodeceptJS {
|
|
|
10203
10181
|
*/
|
|
10204
10182
|
dontSeeInField(field: CodeceptJS.LocatorOrString, value: CodeceptJS.StringOrSecret): void;
|
|
10205
10183
|
/**
|
|
10184
|
+
* Appium: not tested
|
|
10206
10185
|
* Verifies that the specified checkbox is checked.
|
|
10207
10186
|
*
|
|
10208
10187
|
* ```js
|
|
@@ -10212,11 +10191,10 @@ declare namespace CodeceptJS {
|
|
|
10212
10191
|
* ```
|
|
10213
10192
|
* @param field - located by label|name|CSS|XPath|strict locator.
|
|
10214
10193
|
* @returns automatically synchronized promise through #recorder
|
|
10215
|
-
*
|
|
10216
|
-
* Appium: not tested
|
|
10217
10194
|
*/
|
|
10218
10195
|
seeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
|
|
10219
10196
|
/**
|
|
10197
|
+
* Appium: not tested
|
|
10220
10198
|
* Verifies that the specified checkbox is not checked.
|
|
10221
10199
|
*
|
|
10222
10200
|
* ```js
|
|
@@ -10226,8 +10204,6 @@ declare namespace CodeceptJS {
|
|
|
10226
10204
|
* ```
|
|
10227
10205
|
* @param field - located by label|name|CSS|XPath|strict locator.
|
|
10228
10206
|
* @returns automatically synchronized promise through #recorder
|
|
10229
|
-
*
|
|
10230
|
-
* Appium: not tested
|
|
10231
10207
|
*/
|
|
10232
10208
|
dontSeeCheckboxIsChecked(field: CodeceptJS.LocatorOrString): void;
|
|
10233
10209
|
/**
|
|
@@ -10432,6 +10408,8 @@ declare namespace CodeceptJS {
|
|
|
10432
10408
|
*/
|
|
10433
10409
|
dontSeeCurrentUrlEquals(url: string): void;
|
|
10434
10410
|
/**
|
|
10411
|
+
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
10412
|
+
*
|
|
10435
10413
|
* Executes sync script on a page.
|
|
10436
10414
|
* Pass arguments to function as additional parameters.
|
|
10437
10415
|
* Will return execution result to a test.
|
|
@@ -10457,10 +10435,6 @@ declare namespace CodeceptJS {
|
|
|
10457
10435
|
* @param fn - function to be executed in browser context.
|
|
10458
10436
|
* @param args - to be passed to function.
|
|
10459
10437
|
* @returns script return value
|
|
10460
|
-
*
|
|
10461
|
-
*
|
|
10462
|
-
*
|
|
10463
|
-
* Wraps [execute](http://webdriver.io/api/protocol/execute.html) command.
|
|
10464
10438
|
*/
|
|
10465
10439
|
executeScript(fn: string | ((...params: any[]) => any), ...args: any[]): Promise<any>;
|
|
10466
10440
|
/**
|
|
@@ -10498,10 +10472,10 @@ declare namespace CodeceptJS {
|
|
|
10498
10472
|
* I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
|
|
10499
10473
|
* ```
|
|
10500
10474
|
* @param locator - located by CSS|XPath|strict locator.
|
|
10501
|
-
* @param scrollIntoViewOptions -
|
|
10475
|
+
* @param scrollIntoViewOptions - either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
10502
10476
|
* @returns automatically synchronized promise through #recorder
|
|
10503
10477
|
*/
|
|
10504
|
-
scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions): void;
|
|
10478
|
+
scrollIntoView(locator: LocatorOrString, scrollIntoViewOptions: ScrollIntoViewOptions | boolean): void;
|
|
10505
10479
|
/**
|
|
10506
10480
|
* Scrolls to element matched by locator.
|
|
10507
10481
|
* Extra shift can be set with offsetX and offsetY options.
|
|
@@ -10557,6 +10531,7 @@ declare namespace CodeceptJS {
|
|
|
10557
10531
|
*/
|
|
10558
10532
|
saveScreenshot(fileName: string, fullPage?: boolean): void;
|
|
10559
10533
|
/**
|
|
10534
|
+
* Uses Selenium's JSON [cookie format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
|
|
10560
10535
|
* Sets cookie(s).
|
|
10561
10536
|
*
|
|
10562
10537
|
* Can be a single cookie object or an array of cookies:
|
|
@@ -10572,11 +10547,6 @@ declare namespace CodeceptJS {
|
|
|
10572
10547
|
* ```
|
|
10573
10548
|
* @param cookie - a cookie object or array of cookie objects.
|
|
10574
10549
|
* @returns automatically synchronized promise through #recorder
|
|
10575
|
-
*
|
|
10576
|
-
*
|
|
10577
|
-
*
|
|
10578
|
-
* Uses Selenium's JSON [cookie
|
|
10579
|
-
* format](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object).
|
|
10580
10550
|
*/
|
|
10581
10551
|
setCookie(cookie: Cookie | Cookie[]): void;
|
|
10582
10552
|
/**
|
|
@@ -10630,7 +10600,7 @@ declare namespace CodeceptJS {
|
|
|
10630
10600
|
*/
|
|
10631
10601
|
acceptPopup(): void;
|
|
10632
10602
|
/**
|
|
10633
|
-
* Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt
|
|
10603
|
+
* Dismisses the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`.
|
|
10634
10604
|
*/
|
|
10635
10605
|
cancelPopup(): void;
|
|
10636
10606
|
/**
|
|
@@ -10675,6 +10645,8 @@ declare namespace CodeceptJS {
|
|
|
10675
10645
|
*/
|
|
10676
10646
|
pressKeyUp(key: string): void;
|
|
10677
10647
|
/**
|
|
10648
|
+
* _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.
|
|
10649
|
+
*
|
|
10678
10650
|
* Presses a key in the browser (on a focused element).
|
|
10679
10651
|
*
|
|
10680
10652
|
* _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`](#fillfield).
|
|
@@ -10734,9 +10706,6 @@ declare namespace CodeceptJS {
|
|
|
10734
10706
|
* - `'Tab'`
|
|
10735
10707
|
* @param key - key or array of keys to press.
|
|
10736
10708
|
* @returns automatically synchronized promise through #recorder
|
|
10737
|
-
*
|
|
10738
|
-
*
|
|
10739
|
-
* _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.
|
|
10740
10709
|
*/
|
|
10741
10710
|
pressKey(key: string | string[]): void;
|
|
10742
10711
|
/**
|
|
@@ -10763,13 +10732,13 @@ declare namespace CodeceptJS {
|
|
|
10763
10732
|
*/
|
|
10764
10733
|
type(key: string | string[], delay?: number): void;
|
|
10765
10734
|
/**
|
|
10735
|
+
* Appium: not tested in web, in apps doesn't work
|
|
10736
|
+
*
|
|
10766
10737
|
* Resize the current window to provided width and height.
|
|
10767
10738
|
* First parameter can be set to `maximize`.
|
|
10768
10739
|
* @param width - width in pixels or `maximize`.
|
|
10769
10740
|
* @param height - height in pixels.
|
|
10770
10741
|
* @returns automatically synchronized promise through #recorder
|
|
10771
|
-
*
|
|
10772
|
-
* Appium: not tested in web, in apps doesn't work
|
|
10773
10742
|
*/
|
|
10774
10743
|
resizeWindow(width: number, height: number): void;
|
|
10775
10744
|
/**
|
|
@@ -10808,6 +10777,7 @@ declare namespace CodeceptJS {
|
|
|
10808
10777
|
*/
|
|
10809
10778
|
blur(locator: CodeceptJS.LocatorOrString, options?: any): void;
|
|
10810
10779
|
/**
|
|
10780
|
+
* Appium: not tested
|
|
10811
10781
|
* Drag an item to a destination element.
|
|
10812
10782
|
*
|
|
10813
10783
|
* ```js
|
|
@@ -10816,8 +10786,6 @@ declare namespace CodeceptJS {
|
|
|
10816
10786
|
* @param srcElement - located by CSS|XPath|strict locator.
|
|
10817
10787
|
* @param destElement - located by CSS|XPath|strict locator.
|
|
10818
10788
|
* @returns automatically synchronized promise through #recorder
|
|
10819
|
-
*
|
|
10820
|
-
* Appium: not tested
|
|
10821
10789
|
*/
|
|
10822
10790
|
dragAndDrop(srcElement: LocatorOrString, destElement: LocatorOrString): void;
|
|
10823
10791
|
/**
|