codeceptjs 3.5.5 → 3.5.7-beta.1
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/CHANGELOG.md +63 -0
- package/docs/bdd.md +11 -7
- package/docs/build/ApiDataFactory.js +2 -1
- package/docs/build/Appium.js +25 -23
- package/docs/build/Expect.js +422 -0
- package/docs/build/FileSystem.js +1 -1
- package/docs/build/Nightmare.js +53 -56
- package/docs/build/Playwright.js +209 -135
- package/docs/build/Protractor.js +66 -69
- package/docs/build/Puppeteer.js +83 -83
- package/docs/build/TestCafe.js +56 -55
- package/docs/build/WebDriver.js +85 -86
- package/docs/changelog.md +63 -0
- package/docs/commands.md +12 -0
- package/docs/helpers/Appium.md +50 -32
- package/docs/helpers/Expect.md +275 -0
- package/docs/helpers/FileSystem.md +1 -1
- package/docs/helpers/Nightmare.md +141 -94
- package/docs/helpers/Playwright.md +281 -212
- package/docs/helpers/Protractor.md +229 -169
- package/docs/helpers/Puppeteer.md +257 -186
- package/docs/helpers/TestCafe.md +201 -149
- package/docs/helpers/WebDriver.md +253 -179
- package/docs/mobile.md +17 -21
- package/docs/plugins.md +35 -1
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- package/docs/webapi/blur.mustache +1 -0
- package/docs/webapi/checkOption.mustache +1 -1
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +1 -1
- package/docs/webapi/clickLink.mustache +1 -1
- package/docs/webapi/closeCurrentTab.mustache +1 -1
- package/docs/webapi/closeOtherTabs.mustache +1 -1
- package/docs/webapi/dontSee.mustache +1 -1
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeCookie.mustache +1 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -1
- package/docs/webapi/dontSeeInTitle.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +1 -1
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragAndDrop.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/executeAsyncScript.mustache +0 -2
- package/docs/webapi/executeScript.mustache +0 -2
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/focus.mustache +1 -0
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.mustache +1 -1
- package/docs/webapi/grabCookie.mustache +1 -1
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +1 -1
- package/docs/webapi/moveCursorTo.mustache +1 -1
- package/docs/webapi/openNewTab.mustache +1 -1
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/pressKeyDown.mustache +1 -1
- package/docs/webapi/pressKeyUp.mustache +1 -1
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
- package/docs/webapi/refreshPage.mustache +1 -1
- package/docs/webapi/resizeWindow.mustache +1 -1
- package/docs/webapi/rightClick.mustache +1 -1
- package/docs/webapi/saveElementScreenshot.mustache +1 -1
- package/docs/webapi/saveScreenshot.mustache +1 -1
- package/docs/webapi/say.mustache +1 -1
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/docs/webapi/scrollPageToBottom.mustache +1 -1
- package/docs/webapi/scrollPageToTop.mustache +1 -1
- package/docs/webapi/scrollTo.mustache +1 -1
- package/docs/webapi/see.mustache +1 -1
- package/docs/webapi/seeAttributesOnElements.mustache +1 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/seeCookie.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInCurrentUrl.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/webapi/seeInPopup.mustache +1 -1
- package/docs/webapi/seeInSource.mustache +1 -1
- package/docs/webapi/seeInTitle.mustache +1 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -1
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/seeTextEquals.mustache +1 -1
- package/docs/webapi/seeTitleEquals.mustache +1 -1
- package/docs/webapi/selectOption.mustache +1 -1
- package/docs/webapi/setCookie.mustache +1 -1
- package/docs/webapi/setGeoLocation.mustache +1 -1
- package/docs/webapi/switchTo.mustache +1 -1
- package/docs/webapi/switchToNextTab.mustache +1 -1
- package/docs/webapi/switchToPreviousTab.mustache +1 -1
- package/docs/webapi/type.mustache +1 -1
- package/docs/webapi/uncheckOption.mustache +1 -1
- package/docs/webapi/wait.mustache +1 -1
- package/docs/webapi/waitForClickable.mustache +1 -1
- package/docs/webapi/waitForDetached.mustache +1 -1
- package/docs/webapi/waitForElement.mustache +1 -1
- package/docs/webapi/waitForEnabled.mustache +1 -1
- package/docs/webapi/waitForFunction.mustache +1 -1
- package/docs/webapi/waitForInvisible.mustache +1 -1
- package/docs/webapi/waitForText.mustache +1 -1
- package/docs/webapi/waitForValue.mustache +1 -1
- package/docs/webapi/waitForVisible.mustache +1 -1
- package/docs/webapi/waitInUrl.mustache +1 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/waitToHide.mustache +1 -1
- package/docs/webapi/waitUrlEquals.mustache +1 -1
- package/lib/ai.js +12 -3
- package/lib/cli.js +3 -1
- package/lib/codecept.js +3 -0
- package/lib/command/dryRun.js +2 -1
- package/lib/command/info.js +24 -0
- package/lib/command/run-workers.js +3 -2
- package/lib/command/run.js +3 -2
- package/lib/data/context.js +14 -6
- package/lib/helper/ApiDataFactory.js +2 -1
- package/lib/helper/Appium.js +7 -5
- package/lib/helper/Expect.js +422 -0
- package/lib/helper/FileSystem.js +1 -1
- package/lib/helper/Playwright.js +134 -64
- package/lib/helper/Puppeteer.js +6 -6
- package/lib/helper/WebDriver.js +4 -4
- package/lib/helper/scripts/highlightElement.js +1 -1
- package/lib/html.js +3 -3
- package/lib/interfaces/gherkin.js +21 -2
- package/lib/output.js +1 -1
- package/lib/pause.js +6 -5
- package/lib/plugin/autoLogin.js +35 -8
- package/lib/plugin/heal.js +40 -7
- package/lib/plugin/retryTo.js +0 -2
- package/lib/plugin/tryTo.js +0 -3
- package/lib/recorder.js +12 -5
- package/lib/session.js +1 -1
- package/package.json +24 -17
- package/translations/de-DE.js +5 -0
- package/translations/fr-FR.js +14 -1
- package/translations/it-IT.js +1 -0
- package/translations/ja-JP.js +5 -0
- package/translations/pl-PL.js +5 -0
- package/translations/pt-BR.js +1 -0
- package/translations/ru-RU.js +1 -0
- package/translations/zh-CN.js +5 -0
- package/translations/zh-TW.js +5 -0
- package/typings/promiseBasedTypes.d.ts +905 -863
- package/typings/types.d.ts +909 -850
package/docs/mobile.md
CHANGED
|
@@ -24,13 +24,13 @@ I.seeElement({
|
|
|
24
24
|
});
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
This test is easy to read and write. Also it will work both on iOS and Android devices.
|
|
27
|
+
This test is easy to read and write. Also, it will work both on iOS and Android devices.
|
|
28
28
|
Doesn't it sound cool?
|
|
29
29
|
|
|
30
30
|
## Setting Up
|
|
31
31
|
|
|
32
32
|
Ensure that you have [CodeceptJS installed](https://codecept.io/installation/).
|
|
33
|
-
You will also need to install [Appium](https://appium.io/).
|
|
33
|
+
You will also need to install [Appium](https://appium.io/docs/en/2.1/).
|
|
34
34
|
We suggest to use [appium-doctor](https://www.npmjs.com/package/appium-doctor) to check if your system is ready for mobile testing.
|
|
35
35
|
|
|
36
36
|
```sh
|
|
@@ -45,13 +45,12 @@ To install Appium use npm:
|
|
|
45
45
|
npm i -g appium
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Appium 2x (still beta) reenvisions Appium as a platform where “drivers” and “plugins” can be easily created and shared independently.
|
|
48
|
+
Appium 2x reenvisions Appium as a platform where “drivers” and “plugins” can be easily created and shared independently.
|
|
49
|
+
|
|
50
|
+
** Note: ** Appium v1 is no longer maintained, so it's advised to migrate to Appium v2.
|
|
51
|
+
|
|
53
52
|
Install an Appium driver and its dependencies
|
|
54
|
-
To install the Appium driver and its dependencies, we'll be using the uiautomator2 (Android), XCUITest (iOS) drivers.
|
|
53
|
+
To install the Appium driver and its dependencies, we'll be using the `uiautomator2` (Android), `XCUITest` (iOS) drivers.
|
|
55
54
|
|
|
56
55
|
```
|
|
57
56
|
appium driver install xcuitest
|
|
@@ -79,11 +78,6 @@ It should be packed into apk (for Android) or .ipa (for iOS) or zip.
|
|
|
79
78
|
Next, is to launch the emulator or connect a physical device.
|
|
80
79
|
Once they are prepared, launch Appium:
|
|
81
80
|
|
|
82
|
-
```sh
|
|
83
|
-
appium
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
To use Appium 2.x:
|
|
87
81
|
```sh
|
|
88
82
|
tth~$npx appium --base-path=/wd/hub
|
|
89
83
|
[Appium] Welcome to Appium v2.0.0-beta.57 (REV 3e675c32ae71dc0b00749d5d29213e2ea5b53c5b)
|
|
@@ -102,7 +96,9 @@ tth~$npx appium --base-path=/wd/hub
|
|
|
102
96
|
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
|
|
103
97
|
```
|
|
104
98
|
|
|
105
|
-
|
|
99
|
+
** Note: ** Appium v2 doesn't use the same base path as Appium v1, hence if you want to use the same base path you should pass `--base-path=/wd/hub` when launching the Appium server.
|
|
100
|
+
|
|
101
|
+
To run mobile test you need either a device emulator (available with Android SDK or iOS) or real device connected for mobile testing. Alternatively, you may execute Appium with device emulator inside Docker container.
|
|
106
102
|
|
|
107
103
|
CodeceptJS should be installed with webdriverio support:
|
|
108
104
|
|
|
@@ -135,7 +131,7 @@ You will also be asked for the platform and the application package.
|
|
|
135
131
|
```
|
|
136
132
|
|
|
137
133
|
Check the newly created `codecept.conf.js` configuration file.
|
|
138
|
-
You may want to set some additional Appium settings via [desiredCapabilities](https://appium.io/docs/en/
|
|
134
|
+
You may want to set some additional Appium settings via [desiredCapabilities](https://appium.io/docs/en/2.1/guides/caps/)
|
|
139
135
|
|
|
140
136
|
```js
|
|
141
137
|
helpers: {
|
|
@@ -147,7 +143,7 @@ helpers: {
|
|
|
147
143
|
}
|
|
148
144
|
```
|
|
149
145
|
|
|
150
|
-
Once you configured Appium, create the first test by running
|
|
146
|
+
Once you configured Appium, create the first test by running:
|
|
151
147
|
|
|
152
148
|
```sh
|
|
153
149
|
npx codeceptjs gt
|
|
@@ -219,7 +215,7 @@ To start writing a test it is important to understand how to locate elements for
|
|
|
219
215
|
In both Android and iPhone elements are defined in XML format and can be searched by XPath locators.
|
|
220
216
|
|
|
221
217
|
```js
|
|
222
|
-
I.seeElement('//android.widget.ScrollView/android.widget.LinearLayout')
|
|
218
|
+
I.seeElement('//android.widget.ScrollView/android.widget.LinearLayout')
|
|
223
219
|
```
|
|
224
220
|
|
|
225
221
|
> Despite showing XPath in this guide we **do not recommend using XPath for testing iOS native apps. XPath runs very slow on iOS. Consider using ID or Accessibility ID locators instead.
|
|
@@ -243,7 +239,7 @@ I.seeElement('~startUserRegistrationButton');
|
|
|
243
239
|
```
|
|
244
240
|
|
|
245
241
|
Elements can also have ids, which can be located with `#` prefix.
|
|
246
|
-
On Android it
|
|
242
|
+
On Android, it is important to keep full package name in id locator:
|
|
247
243
|
|
|
248
244
|
```js
|
|
249
245
|
I.seeElement('#io.selendroid.testapp:id/inputUsername');
|
|
@@ -258,9 +254,9 @@ I.click('Click me!');
|
|
|
258
254
|
|
|
259
255
|
Native iOS/Android locators can be used with `android=` and `ios=` prefixes. [Learn more](https://webdriver.io/guide/usage/selectors.html#Mobile-Selectors).
|
|
260
256
|
|
|
261
|
-
But how to get all those locators? We recommend to use [Appium Inspector](https://github.com/appium/appium-
|
|
257
|
+
But how to get all those locators? We recommend to use [Appium Inspector](https://github.com/appium/appium-inspector).
|
|
262
258
|
|
|
263
|
-
For Android you can use **UI Automator Viewer** bundled with Android SDK:
|
|
259
|
+
For Android, you can use **UI Automator Viewer** bundled with Android SDK:
|
|
264
260
|
|
|
265
261
|

|
|
266
262
|
|
|
@@ -284,7 +280,7 @@ Inside WebView all browser features are enabled: CSS locators, JavaScript, etc.
|
|
|
284
280
|
To set a specific context use `{ web: 'webview.context' }` instead:
|
|
285
281
|
|
|
286
282
|
```js
|
|
287
|
-
within({webview: 'MyWEBVIEW_com.my.app'}, () => );
|
|
283
|
+
within({webview: 'MyWEBVIEW_com.my.app'}, () => {});
|
|
288
284
|
```
|
|
289
285
|
|
|
290
286
|
Alternatively use `switchToWeb` or `switchToNative` methods to switch between contexts.
|
package/docs/plugins.md
CHANGED
|
@@ -89,7 +89,7 @@ Scenario('log me in', ( {I, login} ) => {
|
|
|
89
89
|
#### How It Works
|
|
90
90
|
|
|
91
91
|
1. `restore` method is executed. It should open a page and set credentials.
|
|
92
|
-
2. `check` method is executed. It should reload a page (so cookies are applied) and check that this page belongs to logged
|
|
92
|
+
2. `check` method is executed. It should reload a page (so cookies are applied) and check that this page belongs to logged-in user. When you pass the second args `session`, you could perform the validation using passed session.
|
|
93
93
|
3. If `restore` and `check` were not successful, `login` is executed
|
|
94
94
|
4. `login` should fill in login form
|
|
95
95
|
5. After successful login, `fetch` is executed to save cookies into memory or file.
|
|
@@ -240,6 +240,40 @@ Scenario('login', async ( {I, login} ) => {
|
|
|
240
240
|
})
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
+
#### Tips: Using session to validate user
|
|
244
|
+
|
|
245
|
+
Instead of asserting on page elements for the current user in `check`, you can use the `session` you saved in `fetch`
|
|
246
|
+
|
|
247
|
+
```js
|
|
248
|
+
autoLogin: {
|
|
249
|
+
enabled: true,
|
|
250
|
+
saveToFile: true,
|
|
251
|
+
inject: 'login',
|
|
252
|
+
users: {
|
|
253
|
+
admin: {
|
|
254
|
+
login: async (I) => { // If you use async function in the autoLogin plugin
|
|
255
|
+
const phrase = await I.grabTextFrom('#phrase')
|
|
256
|
+
I.fillField('username', 'admin'),
|
|
257
|
+
I.fillField('password', 'password')
|
|
258
|
+
I.fillField('phrase', phrase)
|
|
259
|
+
},
|
|
260
|
+
check: (I, session) => {
|
|
261
|
+
// Throwing an error in `check` will make CodeceptJS perform the login step for the user
|
|
262
|
+
if (session.profile.email !== the.email.you.expect@some-mail.com) {
|
|
263
|
+
throw new Error ('Wrong user signed in');
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
```js
|
|
272
|
+
Scenario('login', async ( {I, login} ) => {
|
|
273
|
+
await login('admin') // you should use `await`
|
|
274
|
+
})
|
|
275
|
+
```
|
|
276
|
+
|
|
243
277
|
### Parameters
|
|
244
278
|
|
|
245
279
|
- `config`
|
|
@@ -8,4 +8,4 @@ I.appendField('password', secret('123456'));
|
|
|
8
8
|
```
|
|
9
9
|
@param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
10
10
|
@param {string} value text value to append.
|
|
11
|
-
|
|
11
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -9,4 +9,4 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
9
9
|
|
|
10
10
|
@param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
11
11
|
@param {string} pathToFile local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
12
|
-
|
|
12
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -15,3 +15,4 @@ I.dontSee('#add-to-cart-btn');
|
|
|
15
15
|
|
|
16
16
|
@param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
17
17
|
@param {any} [options] Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-blur) for available options object as 2nd argument.
|
|
18
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -10,4 +10,4 @@ I.checkOption('agree', '//form');
|
|
|
10
10
|
```
|
|
11
11
|
@param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
12
12
|
@param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
13
|
-
|
|
13
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -6,4 +6,4 @@ I.clearField('user[email]');
|
|
|
6
6
|
I.clearField('#email');
|
|
7
7
|
```
|
|
8
8
|
@param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
|
|
9
|
-
|
|
9
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder.
|
|
@@ -22,4 +22,4 @@ I.click({css: 'nav a.login'});
|
|
|
22
22
|
|
|
23
23
|
@param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
24
24
|
@param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
25
|
-
|
|
25
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -5,4 +5,4 @@ I.clickLink('Logout', '#nav');
|
|
|
5
5
|
```
|
|
6
6
|
@param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator
|
|
7
7
|
@param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator
|
|
8
|
-
|
|
8
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -8,4 +8,4 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
8
8
|
|
|
9
9
|
@param {string} text which is not present.
|
|
10
10
|
@param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
11
|
-
|
|
11
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -7,4 +7,4 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
@param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
10
|
-
|
|
10
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -7,4 +7,4 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
@param {string} url value to check.
|
|
10
|
-
|
|
10
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -5,4 +5,4 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
@param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
8
|
-
|
|
8
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -5,4 +5,4 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
@param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
8
|
-
|
|
8
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -8,4 +8,4 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
8
8
|
|
|
9
9
|
@param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
10
10
|
@param {CodeceptJS.StringOrSecret} value value to check.
|
|
11
|
-
|
|
11
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -10,4 +10,4 @@ I.doubleClick('.btn.edit');
|
|
|
10
10
|
|
|
11
11
|
@param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
12
12
|
@param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
13
|
-
|
|
13
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -9,4 +9,4 @@ I.downloadFile('td[class="text-right file-link"] a', 'thisIsCustomName');
|
|
|
9
9
|
|
|
10
10
|
@param {CodeceptJS.LocatorOrString} locator clickable link or button located by CSS|XPath locator.
|
|
11
11
|
@param {string} file custom file name.
|
|
12
|
-
|
|
12
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -6,4 +6,4 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
6
6
|
|
|
7
7
|
@param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
|
|
8
8
|
@param {LocatorOrString} destElement located by CSS|XPath|strict locator.
|
|
9
|
-
|
|
9
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -8,4 +8,4 @@ I.dragSlider('#slider', -70);
|
|
|
8
8
|
|
|
9
9
|
@param {CodeceptJS.LocatorOrString} locator located by label|name|CSS|XPath|strict locator.
|
|
10
10
|
@param {number} offsetX position to drag.
|
|
11
|
-
|
|
11
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -22,5 +22,3 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
22
22
|
@param {string|function} fn function to be executed in browser context.
|
|
23
23
|
@param {...any} args to be passed to function.
|
|
24
24
|
@returns {Promise<any>} script return value
|
|
25
|
-
|
|
26
|
-
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
@@ -24,5 +24,3 @@ let date = await I.executeScript(function(el) {
|
|
|
24
24
|
@param {string|function} fn function to be executed in browser context.
|
|
25
25
|
@param {...any} args to be passed to function.
|
|
26
26
|
@returns {Promise<any>} script return value
|
|
27
|
-
|
|
28
|
-
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
@@ -13,4 +13,4 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
13
13
|
```
|
|
14
14
|
@param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
15
15
|
@param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
16
|
-
|
|
16
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -10,3 +10,4 @@ I.see('#add-to-cart-bnt');
|
|
|
10
10
|
|
|
11
11
|
@param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
12
12
|
@param {any} [options] Playwright only: [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
|
|
13
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -25,4 +25,4 @@ I.forceClick({css: 'nav a.login'});
|
|
|
25
25
|
|
|
26
26
|
@param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
27
27
|
@param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
28
|
-
|
|
28
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -15,4 +15,4 @@ I.forceRightClick('Menu');
|
|
|
15
15
|
|
|
16
16
|
@param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
17
17
|
@param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
18
|
-
|
|
18
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -9,4 +9,4 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
9
9
|
@param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
10
10
|
@param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
11
11
|
@param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
12
|
-
|
|
12
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -3,4 +3,4 @@ First parameter can be set to `maximize`.
|
|
|
3
3
|
|
|
4
4
|
@param {number} width width in pixels or `maximize`.
|
|
5
5
|
@param {number} height height in pixels.
|
|
6
|
-
|
|
6
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -11,4 +11,4 @@ I.rightClick('Click me', '.context');
|
|
|
11
11
|
|
|
12
12
|
@param {CodeceptJS.LocatorOrString} locator clickable element located by CSS|XPath|strict locator.
|
|
13
13
|
@param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
14
|
-
|
|
14
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -7,4 +7,4 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
7
7
|
|
|
8
8
|
@param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
9
9
|
@param {string} fileName file name to save.
|
|
10
|
-
|
|
10
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -9,4 +9,4 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
9
9
|
|
|
10
10
|
@param {string} fileName file name to save.
|
|
11
11
|
@param {boolean} [fullPage=false] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
12
|
-
|
|
12
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
package/docs/webapi/say.mustache
CHANGED
|
@@ -7,4 +7,4 @@ I.say('This is by default'); //cyan is used
|
|
|
7
7
|
```
|
|
8
8
|
@param {string} text expected on console log.
|
|
9
9
|
@param {string} [color='cyan'] color you want to use.
|
|
10
|
-
|
|
10
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -8,4 +8,4 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
8
8
|
|
|
9
9
|
@param {LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
10
10
|
@param {ScrollIntoViewOptions} scrollIntoViewOptions see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
11
|
-
|
|
11
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -9,4 +9,4 @@ I.scrollTo('#submit', 5, 5);
|
|
|
9
9
|
@param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
10
10
|
@param {number} [offsetX=0] (optional, `0` by default) X-axis offset.
|
|
11
11
|
@param {number} [offsetY=0] (optional, `0` by default) Y-axis offset.
|
|
12
|
-
|
|
12
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
package/docs/webapi/see.mustache
CHANGED
|
@@ -8,4 +8,4 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
8
8
|
```
|
|
9
9
|
@param {string} text expected on page.
|
|
10
10
|
@param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
11
|
-
|
|
11
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -6,4 +6,4 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
6
6
|
|
|
7
7
|
@param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
8
8
|
@param {object} attributes attributes and their values to check.
|
|
9
|
-
|
|
9
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -7,4 +7,4 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
@param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
10
|
-
|
|
10
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -6,4 +6,4 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
6
6
|
|
|
7
7
|
@param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
8
8
|
@param {object} cssProperties object with CSS properties and their values to check.
|
|
9
|
-
|
|
9
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -5,4 +5,4 @@ Element is located by CSS or XPath.
|
|
|
5
5
|
I.seeElement('#modal');
|
|
6
6
|
```
|
|
7
7
|
@param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
8
|
-
|
|
8
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -5,4 +5,4 @@ Element is located by CSS or XPath.
|
|
|
5
5
|
I.seeElementInDOM('#modal');
|
|
6
6
|
```
|
|
7
7
|
@param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
8
|
-
|
|
8
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|
|
@@ -9,4 +9,4 @@ I.seeInField('#searchform input','Search');
|
|
|
9
9
|
```
|
|
10
10
|
@param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
11
11
|
@param {CodeceptJS.StringOrSecret} value value to check.
|
|
12
|
-
|
|
12
|
+
@returns {Promise<void>} automatically synchronized promise through #recorder
|