codeceptjs 3.3.5-beta.6 → 3.3.6
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 +69 -2
- package/bin/codecept.js +40 -3
- package/docs/basics.md +24 -1
- package/docs/build/Appium.js +41 -22
- package/docs/build/FileSystem.js +1 -1
- package/docs/build/Nightmare.js +106 -57
- package/docs/build/Playwright.js +187 -111
- package/docs/build/Protractor.js +132 -70
- package/docs/build/Puppeteer.js +143 -76
- package/docs/build/REST.js +2 -2
- package/docs/build/TestCafe.js +107 -57
- package/docs/build/WebDriver.js +162 -89
- package/docs/changelog.md +107 -2
- package/docs/commands.md +5 -3
- package/docs/community-helpers.md +7 -4
- package/docs/configuration.md +5 -5
- package/docs/examples.md +39 -48
- package/docs/helpers/Appium.md +25 -23
- package/docs/helpers/FileSystem.md +1 -1
- package/docs/helpers/Nightmare.md +57 -57
- package/docs/helpers/Playwright.md +76 -75
- package/docs/helpers/Puppeteer.md +76 -85
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/TestCafe.md +57 -57
- package/docs/helpers/WebDriver.md +84 -97
- package/docs/quickstart.md +1 -1
- package/docs/reports.md +1 -1
- package/docs/secrets.md +1 -1
- package/docs/typescript.md +9 -69
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +3 -3
- 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 +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.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 +2 -2
- package/docs/webapi/saveScreenshot.mustache +2 -2
- 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/command/configMigrate.js +1 -1
- package/lib/command/dryRun.js +2 -1
- package/lib/command/generate.js +35 -18
- package/lib/command/run-rerun.js +38 -0
- package/lib/command/utils.js +13 -3
- package/lib/config.js +2 -2
- package/lib/data/context.js +7 -0
- package/lib/helper/Appium.js +6 -4
- package/lib/helper/FileSystem.js +1 -1
- package/lib/helper/Nightmare.js +1 -1
- package/lib/helper/Playwright.js +48 -38
- package/lib/helper/Protractor.js +1 -1
- package/lib/helper/REST.js +2 -2
- package/lib/helper/TestCafe.js +1 -1
- package/lib/helper/WebDriver.js +7 -7
- package/lib/plugin/wdio.js +11 -2
- package/lib/utils.js +3 -0
- package/package.json +2 -2
- package/typings/index.d.ts +46 -46
- package/typings/types.d.ts +497 -443
- package/docs/wiki/.git/FETCH_HEAD +0 -1
- package/docs/wiki/.git/HEAD +0 -1
- package/docs/wiki/.git/ORIG_HEAD +0 -1
- package/docs/wiki/.git/config +0 -11
- package/docs/wiki/.git/description +0 -1
- package/docs/wiki/.git/hooks/applypatch-msg.sample +0 -15
- package/docs/wiki/.git/hooks/commit-msg.sample +0 -24
- package/docs/wiki/.git/hooks/fsmonitor-watchman.sample +0 -173
- package/docs/wiki/.git/hooks/post-update.sample +0 -8
- package/docs/wiki/.git/hooks/pre-applypatch.sample +0 -14
- package/docs/wiki/.git/hooks/pre-commit.sample +0 -49
- package/docs/wiki/.git/hooks/pre-merge-commit.sample +0 -13
- package/docs/wiki/.git/hooks/pre-push.sample +0 -53
- package/docs/wiki/.git/hooks/pre-rebase.sample +0 -169
- package/docs/wiki/.git/hooks/pre-receive.sample +0 -24
- package/docs/wiki/.git/hooks/prepare-commit-msg.sample +0 -42
- package/docs/wiki/.git/hooks/push-to-checkout.sample +0 -78
- package/docs/wiki/.git/hooks/update.sample +0 -128
- package/docs/wiki/.git/index +0 -0
- package/docs/wiki/.git/info/exclude +0 -6
- package/docs/wiki/.git/logs/HEAD +0 -1
- package/docs/wiki/.git/logs/refs/heads/master +0 -1
- package/docs/wiki/.git/logs/refs/remotes/origin/HEAD +0 -1
- package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.idx +0 -0
- package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.pack +0 -0
- package/docs/wiki/.git/packed-refs +0 -2
- package/docs/wiki/.git/refs/heads/master +0 -1
- package/docs/wiki/.git/refs/remotes/origin/HEAD +0 -1
|
@@ -20,7 +20,7 @@ Requires `nightmare` package to be installed.
|
|
|
20
20
|
|
|
21
21
|
## Configuration
|
|
22
22
|
|
|
23
|
-
This helper should be configured in codecept.
|
|
23
|
+
This helper should be configured in codecept.conf.ts or codecept.conf.js
|
|
24
24
|
|
|
25
25
|
- `url` - base url of website to be tested
|
|
26
26
|
- `restart` - restart browser between tests.
|
|
@@ -97,12 +97,12 @@ I.appendField('#myTextField', 'appended');
|
|
|
97
97
|
|
|
98
98
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator
|
|
99
99
|
- `value` **[string][3]** text value to append.
|
|
100
|
-
|
|
100
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
101
101
|
|
|
102
102
|
### attachFile
|
|
103
103
|
|
|
104
104
|
Attaches a file to element located by label, name, CSS or XPath
|
|
105
|
-
Path to file is relative current codecept directory (where codecept.
|
|
105
|
+
Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
|
|
106
106
|
File will be uploaded to remote system (if tests are running remotely).
|
|
107
107
|
|
|
108
108
|
```js
|
|
@@ -113,8 +113,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
113
113
|
#### Parameters
|
|
114
114
|
|
|
115
115
|
- `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
116
|
-
- `pathToFile` **[string][3]** local file path relative to codecept.
|
|
117
|
-
|
|
116
|
+
- `pathToFile` **[string][3]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
117
|
+
⚠️ returns a _promise_ which is synchronized internally by recorderDoesn't work if the Chromium DevTools panel is open (as Chromium allows only one attachment to the debugger at a time. [See more][5])
|
|
118
118
|
|
|
119
119
|
### checkOption
|
|
120
120
|
|
|
@@ -133,7 +133,7 @@ I.checkOption('agree', '//form');
|
|
|
133
133
|
|
|
134
134
|
- `field` **([string][3] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
135
135
|
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
136
|
-
|
|
136
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
137
137
|
|
|
138
138
|
### clearCookie
|
|
139
139
|
|
|
@@ -148,7 +148,7 @@ I.clearCookie('test');
|
|
|
148
148
|
#### Parameters
|
|
149
149
|
|
|
150
150
|
- `cookie` **[string][3]?** (optional, `null` by default) cookie name
|
|
151
|
-
|
|
151
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
152
152
|
|
|
153
153
|
### clearField
|
|
154
154
|
|
|
@@ -164,7 +164,7 @@ I.clearField('#email');
|
|
|
164
164
|
|
|
165
165
|
- `field`
|
|
166
166
|
- `editable` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
167
|
-
|
|
167
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder.
|
|
168
168
|
|
|
169
169
|
### click
|
|
170
170
|
|
|
@@ -194,7 +194,7 @@ I.click({css: 'nav a.login'});
|
|
|
194
194
|
|
|
195
195
|
- `locator` **([string][3] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
196
196
|
- `context` **([string][3]? | [object][4] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
197
|
-
|
|
197
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
198
198
|
|
|
199
199
|
### dontSee
|
|
200
200
|
|
|
@@ -210,7 +210,7 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
210
210
|
|
|
211
211
|
- `text` **[string][3]** which is not present.
|
|
212
212
|
- `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
213
|
-
|
|
213
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
214
214
|
|
|
215
215
|
### dontSeeCheckboxIsChecked
|
|
216
216
|
|
|
@@ -225,7 +225,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
225
225
|
#### Parameters
|
|
226
226
|
|
|
227
227
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
228
|
-
|
|
228
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
229
229
|
|
|
230
230
|
### dontSeeCookie
|
|
231
231
|
|
|
@@ -238,7 +238,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
238
238
|
#### Parameters
|
|
239
239
|
|
|
240
240
|
- `name` **[string][3]** cookie name.
|
|
241
|
-
|
|
241
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
242
242
|
|
|
243
243
|
### dontSeeCurrentUrlEquals
|
|
244
244
|
|
|
@@ -253,7 +253,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
253
253
|
#### Parameters
|
|
254
254
|
|
|
255
255
|
- `url` **[string][3]** value to check.
|
|
256
|
-
|
|
256
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
257
257
|
|
|
258
258
|
### dontSeeElement
|
|
259
259
|
|
|
@@ -266,7 +266,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
266
266
|
#### Parameters
|
|
267
267
|
|
|
268
268
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator.
|
|
269
|
-
|
|
269
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
270
270
|
|
|
271
271
|
### dontSeeElementInDOM
|
|
272
272
|
|
|
@@ -279,7 +279,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
279
279
|
#### Parameters
|
|
280
280
|
|
|
281
281
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator.
|
|
282
|
-
|
|
282
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
283
283
|
|
|
284
284
|
### dontSeeInCurrentUrl
|
|
285
285
|
|
|
@@ -288,7 +288,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
288
288
|
#### Parameters
|
|
289
289
|
|
|
290
290
|
- `url` **[string][3]** value to check.
|
|
291
|
-
|
|
291
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
292
292
|
|
|
293
293
|
### dontSeeInField
|
|
294
294
|
|
|
@@ -304,7 +304,7 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
304
304
|
|
|
305
305
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
306
306
|
- `value` **[string][3]** value to check.
|
|
307
|
-
|
|
307
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
308
308
|
|
|
309
309
|
### dontSeeInSource
|
|
310
310
|
|
|
@@ -318,7 +318,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
318
318
|
|
|
319
319
|
- `text`
|
|
320
320
|
- `value` **[string][3]** to check.
|
|
321
|
-
|
|
321
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
322
322
|
|
|
323
323
|
### dontSeeInTitle
|
|
324
324
|
|
|
@@ -331,7 +331,7 @@ I.dontSeeInTitle('Error');
|
|
|
331
331
|
#### Parameters
|
|
332
332
|
|
|
333
333
|
- `text` **[string][3]** value to check.
|
|
334
|
-
|
|
334
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
335
335
|
|
|
336
336
|
### doubleClick
|
|
337
337
|
|
|
@@ -349,7 +349,7 @@ I.doubleClick('.btn.edit');
|
|
|
349
349
|
|
|
350
350
|
- `locator` **([string][3] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
351
351
|
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
352
|
-
|
|
352
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
353
353
|
|
|
354
354
|
### executeAsyncScript
|
|
355
355
|
|
|
@@ -377,7 +377,7 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
377
377
|
#### Parameters
|
|
378
378
|
|
|
379
379
|
- `args` **...any** to be passed to function.
|
|
380
|
-
|
|
380
|
+
⚠️ returns a _promise_ which is synchronized internally by recorderWrapper for asynchronous [evaluate][7].
|
|
381
381
|
Unlike NightmareJS implementation calling `done` will return its first argument.
|
|
382
382
|
- `fn` **([string][3] | [function][8])** function to be executed in browser context.
|
|
383
383
|
|
|
@@ -410,7 +410,7 @@ let date = await I.executeScript(function(el) {
|
|
|
410
410
|
#### Parameters
|
|
411
411
|
|
|
412
412
|
- `args` **...any** to be passed to function.
|
|
413
|
-
|
|
413
|
+
⚠️ returns a _promise_ which is synchronized internally by recorderWrapper for synchronous [evaluate][7]
|
|
414
414
|
- `fn` **([string][3] | [function][8])** function to be executed in browser context.
|
|
415
415
|
|
|
416
416
|
### fillField
|
|
@@ -433,7 +433,7 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
433
433
|
|
|
434
434
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
435
435
|
- `value` **([string][3] | [object][4])** text value to fill.
|
|
436
|
-
|
|
436
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
437
437
|
|
|
438
438
|
### grabAttributeFrom
|
|
439
439
|
|
|
@@ -713,7 +713,7 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
713
713
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
|
|
714
714
|
- `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
715
715
|
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
716
|
-
|
|
716
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
717
717
|
|
|
718
718
|
### pressKey
|
|
719
719
|
|
|
@@ -736,7 +736,7 @@ Reload the current page.
|
|
|
736
736
|
I.refreshPage();
|
|
737
737
|
```
|
|
738
738
|
|
|
739
|
-
|
|
739
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
740
740
|
|
|
741
741
|
### resizeWindow
|
|
742
742
|
|
|
@@ -747,7 +747,7 @@ First parameter can be set to `maximize`.
|
|
|
747
747
|
|
|
748
748
|
- `width` **[number][11]** width in pixels or `maximize`.
|
|
749
749
|
- `height` **[number][11]** height in pixels.
|
|
750
|
-
|
|
750
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
751
751
|
|
|
752
752
|
### rightClick
|
|
753
753
|
|
|
@@ -766,11 +766,11 @@ I.rightClick('Click me', '.context');
|
|
|
766
766
|
|
|
767
767
|
- `locator` **([string][3] | [object][4])** clickable element located by CSS|XPath|strict locator.
|
|
768
768
|
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
769
|
-
|
|
769
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
770
770
|
|
|
771
771
|
### saveElementScreenshot
|
|
772
772
|
|
|
773
|
-
Saves screenshot of the specified locator to ouput folder (set in codecept.
|
|
773
|
+
Saves screenshot of the specified locator to ouput folder (set in codecept.conf.ts or codecept.conf.js).
|
|
774
774
|
Filename is relative to output folder.
|
|
775
775
|
|
|
776
776
|
```js
|
|
@@ -781,11 +781,11 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
781
781
|
|
|
782
782
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
783
783
|
- `fileName` **[string][3]** file name to save.
|
|
784
|
-
|
|
784
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
785
785
|
|
|
786
786
|
### saveScreenshot
|
|
787
787
|
|
|
788
|
-
Saves a screenshot to ouput folder (set in codecept.
|
|
788
|
+
Saves a screenshot to ouput folder (set in codecept.conf.ts or codecept.conf.js).
|
|
789
789
|
Filename is relative to output folder.
|
|
790
790
|
Optionally resize the window to the full available page `scrollHeight` and `scrollWidth` to capture the entire page by passing `true` in as the second argument.
|
|
791
791
|
|
|
@@ -798,7 +798,7 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
798
798
|
|
|
799
799
|
- `fileName` **[string][3]** file name to save.
|
|
800
800
|
- `fullPage` **[boolean][13]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
801
|
-
|
|
801
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
802
802
|
|
|
803
803
|
### scrollPageToBottom
|
|
804
804
|
|
|
@@ -808,7 +808,7 @@ Scroll page to the bottom.
|
|
|
808
808
|
I.scrollPageToBottom();
|
|
809
809
|
```
|
|
810
810
|
|
|
811
|
-
|
|
811
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
812
812
|
|
|
813
813
|
### scrollPageToTop
|
|
814
814
|
|
|
@@ -818,7 +818,7 @@ Scroll page to the top.
|
|
|
818
818
|
I.scrollPageToTop();
|
|
819
819
|
```
|
|
820
820
|
|
|
821
|
-
|
|
821
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
822
822
|
|
|
823
823
|
### scrollTo
|
|
824
824
|
|
|
@@ -835,7 +835,7 @@ I.scrollTo('#submit', 5, 5);
|
|
|
835
835
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
|
|
836
836
|
- `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
837
837
|
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
838
|
-
|
|
838
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
839
839
|
|
|
840
840
|
### see
|
|
841
841
|
|
|
@@ -852,7 +852,7 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
852
852
|
|
|
853
853
|
- `text` **[string][3]** expected on page.
|
|
854
854
|
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
855
|
-
|
|
855
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
856
856
|
|
|
857
857
|
### seeCheckboxIsChecked
|
|
858
858
|
|
|
@@ -867,7 +867,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
867
867
|
#### Parameters
|
|
868
868
|
|
|
869
869
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
870
|
-
|
|
870
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
871
871
|
|
|
872
872
|
### seeCookie
|
|
873
873
|
|
|
@@ -880,7 +880,7 @@ I.seeCookie('Auth');
|
|
|
880
880
|
#### Parameters
|
|
881
881
|
|
|
882
882
|
- `name` **[string][3]** cookie name.
|
|
883
|
-
|
|
883
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
884
884
|
|
|
885
885
|
### seeCurrentUrlEquals
|
|
886
886
|
|
|
@@ -896,7 +896,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
896
896
|
#### Parameters
|
|
897
897
|
|
|
898
898
|
- `url` **[string][3]** value to check.
|
|
899
|
-
|
|
899
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
900
900
|
|
|
901
901
|
### seeElement
|
|
902
902
|
|
|
@@ -910,7 +910,7 @@ I.seeElement('#modal');
|
|
|
910
910
|
#### Parameters
|
|
911
911
|
|
|
912
912
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
|
|
913
|
-
|
|
913
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
914
914
|
|
|
915
915
|
### seeElementInDOM
|
|
916
916
|
|
|
@@ -924,7 +924,7 @@ I.seeElementInDOM('#modal');
|
|
|
924
924
|
#### Parameters
|
|
925
925
|
|
|
926
926
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
927
|
-
|
|
927
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
928
928
|
|
|
929
929
|
### seeInCurrentUrl
|
|
930
930
|
|
|
@@ -937,7 +937,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
937
937
|
#### Parameters
|
|
938
938
|
|
|
939
939
|
- `url` **[string][3]** a fragment to check
|
|
940
|
-
|
|
940
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
941
941
|
|
|
942
942
|
### seeInField
|
|
943
943
|
|
|
@@ -955,7 +955,7 @@ I.seeInField('#searchform input','Search');
|
|
|
955
955
|
|
|
956
956
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
957
957
|
- `value` **[string][3]** value to check.
|
|
958
|
-
|
|
958
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
959
959
|
|
|
960
960
|
### seeInSource
|
|
961
961
|
|
|
@@ -968,7 +968,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
968
968
|
#### Parameters
|
|
969
969
|
|
|
970
970
|
- `text` **[string][3]** value to check.
|
|
971
|
-
|
|
971
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
972
972
|
|
|
973
973
|
### seeInTitle
|
|
974
974
|
|
|
@@ -981,7 +981,7 @@ I.seeInTitle('Home Page');
|
|
|
981
981
|
#### Parameters
|
|
982
982
|
|
|
983
983
|
- `text` **[string][3]** text value to check.
|
|
984
|
-
|
|
984
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
985
985
|
|
|
986
986
|
### seeNumberOfElements
|
|
987
987
|
|
|
@@ -996,7 +996,7 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
996
996
|
|
|
997
997
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
998
998
|
- `num` **[number][11]** number of elements.
|
|
999
|
-
|
|
999
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1000
1000
|
|
|
1001
1001
|
### seeNumberOfVisibleElements
|
|
1002
1002
|
|
|
@@ -1011,7 +1011,7 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1011
1011
|
|
|
1012
1012
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1013
1013
|
- `num` **[number][11]** number of elements.
|
|
1014
|
-
|
|
1014
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1015
1015
|
|
|
1016
1016
|
### selectOption
|
|
1017
1017
|
|
|
@@ -1038,7 +1038,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1038
1038
|
|
|
1039
1039
|
- `select` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
1040
1040
|
- `option` **([string][3] | [Array][10]<any>)** visible text or value of option.
|
|
1041
|
-
|
|
1041
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1042
1042
|
|
|
1043
1043
|
### setCookie
|
|
1044
1044
|
|
|
@@ -1059,7 +1059,7 @@ I.setCookie([
|
|
|
1059
1059
|
#### Parameters
|
|
1060
1060
|
|
|
1061
1061
|
- `cookie` **(Cookie | [Array][10]<Cookie>)** a cookie object or array of cookie objects.
|
|
1062
|
-
|
|
1062
|
+
⚠️ returns a _promise_ which is synchronized internally by recorderWrapper for `.cookies.set(cookie)`.
|
|
1063
1063
|
[See more][14]
|
|
1064
1064
|
|
|
1065
1065
|
### triggerMouseEvent
|
|
@@ -1094,7 +1094,7 @@ I.uncheckOption('agree', '//form');
|
|
|
1094
1094
|
|
|
1095
1095
|
- `field` **([string][3] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1096
1096
|
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1097
|
-
|
|
1097
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1098
1098
|
|
|
1099
1099
|
### wait
|
|
1100
1100
|
|
|
@@ -1107,7 +1107,7 @@ I.wait(2); // wait 2 secs
|
|
|
1107
1107
|
#### Parameters
|
|
1108
1108
|
|
|
1109
1109
|
- `sec` **[number][11]** number of second to wait.
|
|
1110
|
-
|
|
1110
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1111
1111
|
|
|
1112
1112
|
### waitForDetached
|
|
1113
1113
|
|
|
@@ -1122,7 +1122,7 @@ I.waitForDetached('#popup');
|
|
|
1122
1122
|
|
|
1123
1123
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1124
1124
|
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1125
|
-
|
|
1125
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1126
1126
|
|
|
1127
1127
|
### waitForElement
|
|
1128
1128
|
|
|
@@ -1138,7 +1138,7 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1138
1138
|
|
|
1139
1139
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1140
1140
|
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1141
|
-
|
|
1141
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1142
1142
|
|
|
1143
1143
|
### waitForFunction
|
|
1144
1144
|
|
|
@@ -1160,7 +1160,7 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1160
1160
|
- `fn` **([string][3] | [function][8])** to be executed in browser context.
|
|
1161
1161
|
- `argsOrSec` **([Array][10]<any> | [number][11])?** (optional, `1` by default) arguments for function or seconds.
|
|
1162
1162
|
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1163
|
-
|
|
1163
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1164
1164
|
|
|
1165
1165
|
### waitForInvisible
|
|
1166
1166
|
|
|
@@ -1175,7 +1175,7 @@ I.waitForInvisible('#popup');
|
|
|
1175
1175
|
|
|
1176
1176
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1177
1177
|
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1178
|
-
|
|
1178
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1179
1179
|
|
|
1180
1180
|
### waitForText
|
|
1181
1181
|
|
|
@@ -1193,7 +1193,7 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1193
1193
|
- `text` **[string][3]** to wait for.
|
|
1194
1194
|
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1195
1195
|
- `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator.
|
|
1196
|
-
|
|
1196
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1197
1197
|
|
|
1198
1198
|
### waitForVisible
|
|
1199
1199
|
|
|
@@ -1208,7 +1208,7 @@ I.waitForVisible('#popup');
|
|
|
1208
1208
|
|
|
1209
1209
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1210
1210
|
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1211
|
-
|
|
1211
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1212
1212
|
|
|
1213
1213
|
### waitToHide
|
|
1214
1214
|
|
|
@@ -1223,7 +1223,7 @@ I.waitToHide('#popup');
|
|
|
1223
1223
|
|
|
1224
1224
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1225
1225
|
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1226
|
-
|
|
1226
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1227
1227
|
|
|
1228
1228
|
[1]: https://github.com/segmentio/nightmare
|
|
1229
1229
|
|