codeceptjs 3.3.0-beta.5 → 3.3.2
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 +50 -1
- package/README.md +6 -1
- package/docs/api.md +45 -30
- package/docs/bdd.md +1 -0
- package/docs/best.md +1 -1
- package/docs/build/ApiDataFactory.js +4 -3
- package/docs/build/Appium.js +53 -48
- package/docs/build/GraphQL.js +4 -2
- package/docs/build/GraphQLDataFactory.js +3 -3
- package/docs/build/JSONResponse.js +1 -1
- package/docs/build/Nightmare.js +101 -72
- package/docs/build/Playwright.js +166 -113
- package/docs/build/Protractor.js +72 -34
- package/docs/build/Puppeteer.js +143 -100
- package/docs/build/REST.js +5 -2
- package/docs/build/TestCafe.js +97 -66
- package/docs/build/WebDriver.js +183 -135
- package/docs/changelog.md +99 -0
- package/docs/custom-helpers.md +1 -1
- package/docs/data.md +2 -2
- package/docs/email.md +5 -0
- package/docs/helpers/ApiDataFactory.md +7 -3
- package/docs/helpers/Appium.md +217 -175
- package/docs/helpers/GraphQL.md +6 -0
- package/docs/helpers/GraphQLDataFactory.md +3 -3
- package/docs/helpers/JSONResponse.md +1 -1
- package/docs/helpers/MockRequest.md +8 -6
- package/docs/helpers/Nightmare.md +98 -45
- package/docs/helpers/Playwright.md +151 -59
- package/docs/helpers/Puppeteer.md +103 -26
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/TestCafe.md +77 -22
- package/docs/helpers/WebDriver.md +150 -62
- package/docs/index.md +1 -1
- package/docs/locators.md +1 -1
- package/docs/videos.md +2 -2
- package/docs/webapi/amOnPage.mustache +2 -1
- package/docs/webapi/appendField.mustache +2 -1
- package/docs/webapi/attachFile.mustache +2 -1
- package/docs/webapi/checkOption.mustache +2 -1
- package/docs/webapi/clearCookie.mustache +2 -1
- package/docs/webapi/clearField.mustache +1 -0
- package/docs/webapi/click.mustache +2 -1
- package/docs/webapi/clickLink.mustache +2 -1
- package/docs/webapi/closeCurrentTab.mustache +6 -4
- package/docs/webapi/closeOtherTabs.mustache +6 -4
- package/docs/webapi/dontSee.mustache +1 -0
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -0
- package/docs/webapi/dontSeeCookie.mustache +2 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +2 -1
- package/docs/webapi/dontSeeElement.mustache +2 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +2 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +2 -1
- package/docs/webapi/dontSeeInField.mustache +2 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -0
- package/docs/webapi/dontSeeInTitle.mustache +2 -1
- package/docs/webapi/doubleClick.mustache +1 -0
- package/docs/webapi/downloadFile.mustache +2 -1
- package/docs/webapi/dragAndDrop.mustache +1 -0
- package/docs/webapi/dragSlider.mustache +2 -1
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -0
- package/docs/webapi/forceClick.mustache +1 -0
- package/docs/webapi/forceRightClick.mustache +1 -0
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +2 -1
- package/docs/webapi/moveCursorTo.mustache +1 -0
- package/docs/webapi/openNewTab.mustache +6 -4
- package/docs/webapi/pressKey.mustache +2 -1
- package/docs/webapi/pressKeyDown.mustache +1 -0
- package/docs/webapi/pressKeyUp.mustache +1 -0
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -0
- package/docs/webapi/refreshPage.mustache +1 -0
- package/docs/webapi/resizeWindow.mustache +2 -1
- package/docs/webapi/rightClick.mustache +1 -0
- package/docs/webapi/saveElementScreenshot.mustache +1 -0
- package/docs/webapi/saveScreenshot.mustache +2 -1
- package/docs/webapi/say.mustache +2 -1
- package/docs/webapi/scrollIntoView.mustache +1 -0
- package/docs/webapi/scrollPageToBottom.mustache +1 -0
- package/docs/webapi/scrollPageToTop.mustache +1 -0
- package/docs/webapi/scrollTo.mustache +2 -1
- package/docs/webapi/see.mustache +2 -1
- package/docs/webapi/seeAttributesOnElements.mustache +2 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -0
- package/docs/webapi/seeCookie.mustache +1 -0
- package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +2 -1
- package/docs/webapi/seeElement.mustache +2 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -0
- package/docs/webapi/seeInCurrentUrl.mustache +2 -1
- package/docs/webapi/seeInField.mustache +1 -0
- package/docs/webapi/seeInPopup.mustache +1 -0
- package/docs/webapi/seeInSource.mustache +2 -1
- package/docs/webapi/seeInTitle.mustache +2 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -0
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -0
- package/docs/webapi/seeTextEquals.mustache +2 -1
- package/docs/webapi/seeTitleEquals.mustache +6 -5
- package/docs/webapi/selectOption.mustache +1 -0
- package/docs/webapi/setCookie.mustache +1 -0
- package/docs/webapi/setGeoLocation.mustache +1 -0
- package/docs/webapi/switchTo.mustache +2 -1
- package/docs/webapi/switchToNextTab.mustache +8 -7
- package/docs/webapi/switchToPreviousTab.mustache +8 -7
- package/docs/webapi/type.mustache +1 -0
- package/docs/webapi/uncheckOption.mustache +2 -1
- package/docs/webapi/wait.mustache +2 -1
- package/docs/webapi/waitForClickable.mustache +2 -1
- package/docs/webapi/waitForDetached.mustache +2 -1
- package/docs/webapi/waitForElement.mustache +2 -1
- package/docs/webapi/waitForEnabled.mustache +2 -1
- package/docs/webapi/waitForFunction.mustache +1 -0
- package/docs/webapi/waitForInvisible.mustache +2 -1
- package/docs/webapi/waitForText.mustache +2 -1
- package/docs/webapi/waitForValue.mustache +1 -0
- package/docs/webapi/waitForVisible.mustache +1 -0
- package/docs/webapi/waitInUrl.mustache +2 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -1
- package/docs/webapi/waitToHide.mustache +2 -1
- package/docs/webapi/waitUrlEquals.mustache +2 -1
- package/lib/command/definitions.js +9 -0
- package/lib/command/run.js +2 -2
- package/lib/command/workers/runTests.js +40 -0
- package/lib/helper/ApiDataFactory.js +4 -3
- package/lib/helper/Appium.js +2 -7
- package/lib/helper/GraphQL.js +4 -2
- package/lib/helper/GraphQLDataFactory.js +3 -3
- package/lib/helper/JSONResponse.js +1 -1
- package/lib/helper/Playwright.js +28 -17
- package/lib/helper/REST.js +5 -2
- package/lib/helper/WebDriver.js +4 -0
- package/lib/interfaces/bdd.js +5 -0
- package/lib/listener/steps.js +1 -0
- package/lib/plugin/fakerTransform.js +1 -1
- package/lib/plugin/stepByStepReport.js +8 -6
- package/lib/workers.js +12 -0
- package/package.json +3 -3
- package/typings/types.d.ts +578 -109
package/docs/helpers/GraphQL.md
CHANGED
|
@@ -66,6 +66,8 @@ Prepares request for axios call
|
|
|
66
66
|
- `operation` **[object][2]**
|
|
67
67
|
- `headers` **[object][2]**
|
|
68
68
|
|
|
69
|
+
Returns **[object][2]** graphQLRequest
|
|
70
|
+
|
|
69
71
|
### sendMutation
|
|
70
72
|
|
|
71
73
|
Send query to GraphQL endpoint over http
|
|
@@ -95,6 +97,8 @@ I.sendMutation(`
|
|
|
95
97
|
- `options` **[object][2]** are additional query options
|
|
96
98
|
- `headers` **[object][2]**
|
|
97
99
|
|
|
100
|
+
Returns **any** Promise<any>
|
|
101
|
+
|
|
98
102
|
### sendQuery
|
|
99
103
|
|
|
100
104
|
Send query to GraphQL endpoint over http.
|
|
@@ -117,6 +121,8 @@ const user = response.data.data;
|
|
|
117
121
|
- `options` **[object][2]** are additional query options
|
|
118
122
|
- `headers` **[object][2]**
|
|
119
123
|
|
|
124
|
+
Returns **any** Promise<any>
|
|
125
|
+
|
|
120
126
|
[1]: https://github.com/axios/axios
|
|
121
127
|
|
|
122
128
|
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
@@ -43,7 +43,7 @@ To make this work you need
|
|
|
43
43
|
Install [Rosie][1] and [Faker][2] libraries.
|
|
44
44
|
|
|
45
45
|
```sh
|
|
46
|
-
npm i rosie faker --save-dev
|
|
46
|
+
npm i rosie @faker-js/faker --save-dev
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
Create a factory file for a resource.
|
|
@@ -53,8 +53,8 @@ See the example for Users factories:
|
|
|
53
53
|
```js
|
|
54
54
|
// tests/factories/users.js
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const Factory = require('rosie').Factory;
|
|
57
|
+
const faker = require('@faker-js/faker');
|
|
58
58
|
|
|
59
59
|
// Used with a constructor function passed to Factory, so that the final build
|
|
60
60
|
// object matches the necessary pattern to be sent as the variables object.
|
|
@@ -207,7 +207,7 @@ Executes a callback function passing in `response` object and chai assertions wi
|
|
|
207
207
|
Use it to perform custom checks of response data
|
|
208
208
|
|
|
209
209
|
```js
|
|
210
|
-
I.seeResponseValidByCallback({ data, status, expect } => {
|
|
210
|
+
I.seeResponseValidByCallback(({ data, status, expect }) => {
|
|
211
211
|
expect(status).to.eql(200);
|
|
212
212
|
expect(data).keys.to.include(['user', 'company']);
|
|
213
213
|
});
|
|
@@ -244,13 +244,15 @@ I.mockRequest('GET', ['/secrets', '/v2/secrets'], 403);
|
|
|
244
244
|
Use PollyJS [Server Routes API][12] to declare mocks via callback function:
|
|
245
245
|
|
|
246
246
|
```js
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
});
|
|
247
|
+
I.mockServer((server) => {
|
|
248
|
+
// basic usage
|
|
249
|
+
server.get('/api/v2/users').intercept((req, res) => {
|
|
250
|
+
res.sendStatus(200).json({ users });
|
|
251
|
+
});
|
|
251
252
|
|
|
252
|
-
// passthrough requests to "/api/v2"
|
|
253
|
-
server.get('/api/v1').passthrough();
|
|
253
|
+
// passthrough requests to "/api/v2"
|
|
254
|
+
server.get('/api/v1').passthrough();
|
|
255
|
+
});
|
|
254
256
|
```
|
|
255
257
|
|
|
256
258
|
In record replay mode you can define which routes should be recorded and where to store them:
|
|
@@ -82,6 +82,8 @@ I.amOnPage('/login'); // opens a login page
|
|
|
82
82
|
- `url` **[string][3]** url path or global url.
|
|
83
83
|
- `headers` **[object][4]?** list of request headers can be passed
|
|
84
84
|
|
|
85
|
+
Returns **void** automatically synchronized promise with recorder #!
|
|
86
|
+
|
|
85
87
|
### appendField
|
|
86
88
|
|
|
87
89
|
Appends text to a input field or textarea.
|
|
@@ -95,6 +97,7 @@ I.appendField('#myTextField', 'appended');
|
|
|
95
97
|
|
|
96
98
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator
|
|
97
99
|
- `value` **[string][3]** text value to append.
|
|
100
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
98
101
|
|
|
99
102
|
### attachFile
|
|
100
103
|
|
|
@@ -110,7 +113,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
110
113
|
#### Parameters
|
|
111
114
|
|
|
112
115
|
- `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
113
|
-
- `pathToFile` **[string][3]** local file path relative to codecept.json config file.
|
|
116
|
+
- `pathToFile` **[string][3]** local file path relative to codecept.json 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])
|
|
114
118
|
|
|
115
119
|
### checkOption
|
|
116
120
|
|
|
@@ -128,7 +132,8 @@ I.checkOption('agree', '//form');
|
|
|
128
132
|
#### Parameters
|
|
129
133
|
|
|
130
134
|
- `field` **([string][3] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
131
|
-
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
135
|
+
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
136
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
132
137
|
|
|
133
138
|
### clearCookie
|
|
134
139
|
|
|
@@ -142,7 +147,8 @@ I.clearCookie('test');
|
|
|
142
147
|
|
|
143
148
|
#### Parameters
|
|
144
149
|
|
|
145
|
-
- `cookie` **[string][3]?** (optional, `null` by default) cookie name
|
|
150
|
+
- `cookie` **[string][3]?** (optional, `null` by default) cookie name
|
|
151
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
146
152
|
|
|
147
153
|
### clearField
|
|
148
154
|
|
|
@@ -158,6 +164,7 @@ I.clearField('#email');
|
|
|
158
164
|
|
|
159
165
|
- `field`
|
|
160
166
|
- `editable` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
167
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
161
168
|
|
|
162
169
|
### click
|
|
163
170
|
|
|
@@ -186,7 +193,8 @@ I.click({css: 'nav a.login'});
|
|
|
186
193
|
#### Parameters
|
|
187
194
|
|
|
188
195
|
- `locator` **([string][3] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
189
|
-
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
196
|
+
- `context` **([string][3]? | [object][4] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
197
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
190
198
|
|
|
191
199
|
### dontSee
|
|
192
200
|
|
|
@@ -201,7 +209,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
201
209
|
#### Parameters
|
|
202
210
|
|
|
203
211
|
- `text` **[string][3]** which is not present.
|
|
204
|
-
- `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
212
|
+
- `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
213
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
205
214
|
|
|
206
215
|
### dontSeeCheckboxIsChecked
|
|
207
216
|
|
|
@@ -216,6 +225,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
216
225
|
#### Parameters
|
|
217
226
|
|
|
218
227
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
228
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
219
229
|
|
|
220
230
|
### dontSeeCookie
|
|
221
231
|
|
|
@@ -228,6 +238,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
228
238
|
#### Parameters
|
|
229
239
|
|
|
230
240
|
- `name` **[string][3]** cookie name.
|
|
241
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
231
242
|
|
|
232
243
|
### dontSeeCurrentUrlEquals
|
|
233
244
|
|
|
@@ -242,6 +253,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
242
253
|
#### Parameters
|
|
243
254
|
|
|
244
255
|
- `url` **[string][3]** value to check.
|
|
256
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
245
257
|
|
|
246
258
|
### dontSeeElement
|
|
247
259
|
|
|
@@ -254,6 +266,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
254
266
|
#### Parameters
|
|
255
267
|
|
|
256
268
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator.
|
|
269
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
257
270
|
|
|
258
271
|
### dontSeeElementInDOM
|
|
259
272
|
|
|
@@ -266,6 +279,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
266
279
|
#### Parameters
|
|
267
280
|
|
|
268
281
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator.
|
|
282
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
269
283
|
|
|
270
284
|
### dontSeeInCurrentUrl
|
|
271
285
|
|
|
@@ -274,6 +288,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
274
288
|
#### Parameters
|
|
275
289
|
|
|
276
290
|
- `url` **[string][3]** value to check.
|
|
291
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
277
292
|
|
|
278
293
|
### dontSeeInField
|
|
279
294
|
|
|
@@ -289,6 +304,7 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
289
304
|
|
|
290
305
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
291
306
|
- `value` **[string][3]** value to check.
|
|
307
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
292
308
|
|
|
293
309
|
### dontSeeInSource
|
|
294
310
|
|
|
@@ -302,6 +318,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
302
318
|
|
|
303
319
|
- `text`
|
|
304
320
|
- `value` **[string][3]** to check.
|
|
321
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
305
322
|
|
|
306
323
|
### dontSeeInTitle
|
|
307
324
|
|
|
@@ -314,6 +331,7 @@ I.dontSeeInTitle('Error');
|
|
|
314
331
|
#### Parameters
|
|
315
332
|
|
|
316
333
|
- `text` **[string][3]** value to check.
|
|
334
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
317
335
|
|
|
318
336
|
### doubleClick
|
|
319
337
|
|
|
@@ -330,7 +348,8 @@ I.doubleClick('.btn.edit');
|
|
|
330
348
|
#### Parameters
|
|
331
349
|
|
|
332
350
|
- `locator` **([string][3] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
333
|
-
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
351
|
+
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
352
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
334
353
|
|
|
335
354
|
### executeAsyncScript
|
|
336
355
|
|
|
@@ -358,10 +377,9 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
358
377
|
#### Parameters
|
|
359
378
|
|
|
360
379
|
- `args` **...any** to be passed to function.
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
Unlike NightmareJS implementation calling `done` will return its first argument.
|
|
380
|
+
[!] returns a _promise_ which is synchronized internally by recorderWrapper for asynchronous [evaluate][7].
|
|
381
|
+
Unlike NightmareJS implementation calling `done` will return its first argument.
|
|
382
|
+
- `fn` **([string][3] | [function][8])** function to be executed in browser context.
|
|
365
383
|
|
|
366
384
|
### executeScript
|
|
367
385
|
|
|
@@ -392,9 +410,8 @@ let date = await I.executeScript(function(el) {
|
|
|
392
410
|
#### Parameters
|
|
393
411
|
|
|
394
412
|
- `args` **...any** to be passed to function.
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
Returns **[Promise][8]<any>** Wrapper for synchronous [evaluate][9]
|
|
413
|
+
[!] returns a _promise_ which is synchronized internally by recorderWrapper for synchronous [evaluate][7]
|
|
414
|
+
- `fn` **([string][3] | [function][8])** function to be executed in browser context.
|
|
398
415
|
|
|
399
416
|
### fillField
|
|
400
417
|
|
|
@@ -416,6 +433,7 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
416
433
|
|
|
417
434
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
418
435
|
- `value` **([string][3] | [object][4])** text value to fill.
|
|
436
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
419
437
|
|
|
420
438
|
### grabAttributeFrom
|
|
421
439
|
|
|
@@ -432,7 +450,7 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
432
450
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
433
451
|
- `attr` **[string][3]** attribute name.
|
|
434
452
|
|
|
435
|
-
Returns **[Promise][
|
|
453
|
+
Returns **[Promise][9]<[string][3]>** attribute value
|
|
436
454
|
|
|
437
455
|
### grabAttributeFromAll
|
|
438
456
|
|
|
@@ -448,7 +466,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
448
466
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
449
467
|
- `attr` **[string][3]** attribute name.
|
|
450
468
|
|
|
451
|
-
Returns **[Promise][
|
|
469
|
+
Returns **[Promise][9]<[Array][10]<[string][3]>>** attribute value
|
|
452
470
|
|
|
453
471
|
### grabCookie
|
|
454
472
|
|
|
@@ -465,7 +483,7 @@ assert(cookie.value, '123456');
|
|
|
465
483
|
|
|
466
484
|
- `name` **[string][3]?** cookie name.
|
|
467
485
|
|
|
468
|
-
Returns **([Promise][
|
|
486
|
+
Returns **([Promise][9]<[string][3]> | [Promise][9]<[Array][10]<[string][3]>>)** attribute valueCookie in JSON format. If name not passed returns all cookies for this domain.Multiple cookies can be received by passing query object `I.grabCookie({ secure: true});`. If you'd like get all cookies for all urls, use: `.grabCookie({ url: null }).`
|
|
469
487
|
|
|
470
488
|
### grabCssPropertyFrom
|
|
471
489
|
|
|
@@ -482,7 +500,7 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
482
500
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
483
501
|
- `cssProperty` **[string][3]** CSS property name.
|
|
484
502
|
|
|
485
|
-
Returns **[Promise][
|
|
503
|
+
Returns **[Promise][9]<[string][3]>** CSS value
|
|
486
504
|
|
|
487
505
|
### grabCurrentUrl
|
|
488
506
|
|
|
@@ -494,7 +512,7 @@ let url = await I.grabCurrentUrl();
|
|
|
494
512
|
console.log(`Current URL is [${url}]`);
|
|
495
513
|
```
|
|
496
514
|
|
|
497
|
-
Returns **[Promise][
|
|
515
|
+
Returns **[Promise][9]<[string][3]>** current URL
|
|
498
516
|
|
|
499
517
|
### grabElementBoundingRect
|
|
500
518
|
|
|
@@ -522,7 +540,7 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
522
540
|
- `prop`
|
|
523
541
|
- `elementSize` **[string][3]?** x, y, width or height of the given element.
|
|
524
542
|
|
|
525
|
-
Returns **([Promise][
|
|
543
|
+
Returns **([Promise][9]<DOMRect> | [Promise][9]<[number][11]>)** Element bounding rectangle
|
|
526
544
|
|
|
527
545
|
### grabHAR
|
|
528
546
|
|
|
@@ -548,7 +566,7 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
548
566
|
- `locator`
|
|
549
567
|
- `element` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
|
|
550
568
|
|
|
551
|
-
Returns **[Promise][
|
|
569
|
+
Returns **[Promise][9]<[string][3]>** HTML code for an element
|
|
552
570
|
|
|
553
571
|
### grabHTMLFromAll
|
|
554
572
|
|
|
@@ -564,7 +582,7 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
564
582
|
- `locator`
|
|
565
583
|
- `element` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
|
|
566
584
|
|
|
567
|
-
Returns **[Promise][
|
|
585
|
+
Returns **[Promise][9]<[Array][10]<[string][3]>>** HTML code for an element
|
|
568
586
|
|
|
569
587
|
### grabNumberOfVisibleElements
|
|
570
588
|
|
|
@@ -579,7 +597,7 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
579
597
|
|
|
580
598
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
|
|
581
599
|
|
|
582
|
-
Returns **[Promise][
|
|
600
|
+
Returns **[Promise][9]<[number][11]>** number of visible elements
|
|
583
601
|
|
|
584
602
|
### grabPageScrollPosition
|
|
585
603
|
|
|
@@ -590,7 +608,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
590
608
|
let { x, y } = await I.grabPageScrollPosition();
|
|
591
609
|
```
|
|
592
610
|
|
|
593
|
-
Returns **[Promise][
|
|
611
|
+
Returns **[Promise][9]<PageScrollPosition>** scroll position
|
|
594
612
|
|
|
595
613
|
### grabTextFrom
|
|
596
614
|
|
|
@@ -607,7 +625,7 @@ If multiple elements found returns first element.
|
|
|
607
625
|
|
|
608
626
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
609
627
|
|
|
610
|
-
Returns **[Promise][
|
|
628
|
+
Returns **[Promise][9]<[string][3]>** attribute value
|
|
611
629
|
|
|
612
630
|
### grabTextFromAll
|
|
613
631
|
|
|
@@ -622,7 +640,7 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
622
640
|
|
|
623
641
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
624
642
|
|
|
625
|
-
Returns **[Promise][
|
|
643
|
+
Returns **[Promise][9]<[Array][10]<[string][3]>>** attribute value
|
|
626
644
|
|
|
627
645
|
### grabTitle
|
|
628
646
|
|
|
@@ -633,7 +651,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
633
651
|
let title = await I.grabTitle();
|
|
634
652
|
```
|
|
635
653
|
|
|
636
|
-
Returns **[Promise][
|
|
654
|
+
Returns **[Promise][9]<[string][3]>** title
|
|
637
655
|
|
|
638
656
|
### grabValueFrom
|
|
639
657
|
|
|
@@ -649,7 +667,7 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
649
667
|
|
|
650
668
|
- `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
651
669
|
|
|
652
|
-
Returns **[Promise][
|
|
670
|
+
Returns **[Promise][9]<[string][3]>** attribute value
|
|
653
671
|
|
|
654
672
|
### grabValueFromAll
|
|
655
673
|
|
|
@@ -664,7 +682,7 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
664
682
|
|
|
665
683
|
- `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
666
684
|
|
|
667
|
-
Returns **[Promise][
|
|
685
|
+
Returns **[Promise][9]<[Array][10]<[string][3]>>** attribute value
|
|
668
686
|
|
|
669
687
|
### haveHeader
|
|
670
688
|
|
|
@@ -694,7 +712,8 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
694
712
|
|
|
695
713
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
|
|
696
714
|
- `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
697
|
-
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
715
|
+
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
716
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
698
717
|
|
|
699
718
|
### pressKey
|
|
700
719
|
|
|
@@ -717,6 +736,8 @@ Reload the current page.
|
|
|
717
736
|
I.refreshPage();
|
|
718
737
|
```
|
|
719
738
|
|
|
739
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
740
|
+
|
|
720
741
|
### resizeWindow
|
|
721
742
|
|
|
722
743
|
Resize the current window to provided width and height.
|
|
@@ -726,6 +747,7 @@ First parameter can be set to `maximize`.
|
|
|
726
747
|
|
|
727
748
|
- `width` **[number][11]** width in pixels or `maximize`.
|
|
728
749
|
- `height` **[number][11]** height in pixels.
|
|
750
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
729
751
|
|
|
730
752
|
### rightClick
|
|
731
753
|
|
|
@@ -743,7 +765,8 @@ I.rightClick('Click me', '.context');
|
|
|
743
765
|
#### Parameters
|
|
744
766
|
|
|
745
767
|
- `locator` **([string][3] | [object][4])** clickable element located by CSS|XPath|strict locator.
|
|
746
|
-
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
768
|
+
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
769
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
747
770
|
|
|
748
771
|
### saveElementScreenshot
|
|
749
772
|
|
|
@@ -758,6 +781,7 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
758
781
|
|
|
759
782
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
760
783
|
- `fileName` **[string][3]** file name to save.
|
|
784
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
761
785
|
|
|
762
786
|
### saveScreenshot
|
|
763
787
|
|
|
@@ -773,7 +797,8 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
773
797
|
#### Parameters
|
|
774
798
|
|
|
775
799
|
- `fileName` **[string][3]** file name to save.
|
|
776
|
-
- `fullPage` **[boolean][13]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
800
|
+
- `fullPage` **[boolean][13]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
801
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
777
802
|
|
|
778
803
|
### scrollPageToBottom
|
|
779
804
|
|
|
@@ -783,6 +808,8 @@ Scroll page to the bottom.
|
|
|
783
808
|
I.scrollPageToBottom();
|
|
784
809
|
```
|
|
785
810
|
|
|
811
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
812
|
+
|
|
786
813
|
### scrollPageToTop
|
|
787
814
|
|
|
788
815
|
Scroll page to the top.
|
|
@@ -791,6 +818,8 @@ Scroll page to the top.
|
|
|
791
818
|
I.scrollPageToTop();
|
|
792
819
|
```
|
|
793
820
|
|
|
821
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
822
|
+
|
|
794
823
|
### scrollTo
|
|
795
824
|
|
|
796
825
|
Scrolls to element matched by locator.
|
|
@@ -805,7 +834,8 @@ I.scrollTo('#submit', 5, 5);
|
|
|
805
834
|
|
|
806
835
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
|
|
807
836
|
- `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
808
|
-
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
837
|
+
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
838
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
809
839
|
|
|
810
840
|
### see
|
|
811
841
|
|
|
@@ -821,7 +851,8 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
821
851
|
#### Parameters
|
|
822
852
|
|
|
823
853
|
- `text` **[string][3]** expected on page.
|
|
824
|
-
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
854
|
+
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
855
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
825
856
|
|
|
826
857
|
### seeCheckboxIsChecked
|
|
827
858
|
|
|
@@ -836,6 +867,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
836
867
|
#### Parameters
|
|
837
868
|
|
|
838
869
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
870
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
839
871
|
|
|
840
872
|
### seeCookie
|
|
841
873
|
|
|
@@ -848,6 +880,7 @@ I.seeCookie('Auth');
|
|
|
848
880
|
#### Parameters
|
|
849
881
|
|
|
850
882
|
- `name` **[string][3]** cookie name.
|
|
883
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
851
884
|
|
|
852
885
|
### seeCurrentUrlEquals
|
|
853
886
|
|
|
@@ -863,6 +896,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
863
896
|
#### Parameters
|
|
864
897
|
|
|
865
898
|
- `url` **[string][3]** value to check.
|
|
899
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
866
900
|
|
|
867
901
|
### seeElement
|
|
868
902
|
|
|
@@ -876,6 +910,7 @@ I.seeElement('#modal');
|
|
|
876
910
|
#### Parameters
|
|
877
911
|
|
|
878
912
|
- `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
|
|
913
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
879
914
|
|
|
880
915
|
### seeElementInDOM
|
|
881
916
|
|
|
@@ -889,6 +924,7 @@ I.seeElementInDOM('#modal');
|
|
|
889
924
|
#### Parameters
|
|
890
925
|
|
|
891
926
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
927
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
892
928
|
|
|
893
929
|
### seeInCurrentUrl
|
|
894
930
|
|
|
@@ -901,6 +937,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
901
937
|
#### Parameters
|
|
902
938
|
|
|
903
939
|
- `url` **[string][3]** a fragment to check
|
|
940
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
904
941
|
|
|
905
942
|
### seeInField
|
|
906
943
|
|
|
@@ -918,6 +955,7 @@ I.seeInField('#searchform input','Search');
|
|
|
918
955
|
|
|
919
956
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
920
957
|
- `value` **[string][3]** value to check.
|
|
958
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
921
959
|
|
|
922
960
|
### seeInSource
|
|
923
961
|
|
|
@@ -930,6 +968,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
930
968
|
#### Parameters
|
|
931
969
|
|
|
932
970
|
- `text` **[string][3]** value to check.
|
|
971
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
933
972
|
|
|
934
973
|
### seeInTitle
|
|
935
974
|
|
|
@@ -942,6 +981,7 @@ I.seeInTitle('Home Page');
|
|
|
942
981
|
#### Parameters
|
|
943
982
|
|
|
944
983
|
- `text` **[string][3]** text value to check.
|
|
984
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
945
985
|
|
|
946
986
|
### seeNumberOfElements
|
|
947
987
|
|
|
@@ -956,6 +996,7 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
956
996
|
|
|
957
997
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
958
998
|
- `num` **[number][11]** number of elements.
|
|
999
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
959
1000
|
|
|
960
1001
|
### seeNumberOfVisibleElements
|
|
961
1002
|
|
|
@@ -970,6 +1011,7 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
970
1011
|
|
|
971
1012
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
972
1013
|
- `num` **[number][11]** number of elements.
|
|
1014
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
973
1015
|
|
|
974
1016
|
### selectOption
|
|
975
1017
|
|
|
@@ -996,6 +1038,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
996
1038
|
|
|
997
1039
|
- `select` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
998
1040
|
- `option` **([string][3] | [Array][10]<any>)** visible text or value of option.
|
|
1041
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
999
1042
|
|
|
1000
1043
|
### setCookie
|
|
1001
1044
|
|
|
@@ -1015,7 +1058,8 @@ I.setCookie([
|
|
|
1015
1058
|
|
|
1016
1059
|
#### Parameters
|
|
1017
1060
|
|
|
1018
|
-
- `cookie` **(Cookie | [Array][10]<Cookie>)** a cookie object or array of cookie objects.
|
|
1061
|
+
- `cookie` **(Cookie | [Array][10]<Cookie>)** a cookie object or array of cookie objects.
|
|
1062
|
+
[!] returns a _promise_ which is synchronized internally by recorderWrapper for `.cookies.set(cookie)`.
|
|
1019
1063
|
[See more][14]
|
|
1020
1064
|
|
|
1021
1065
|
### triggerMouseEvent
|
|
@@ -1049,7 +1093,8 @@ I.uncheckOption('agree', '//form');
|
|
|
1049
1093
|
#### Parameters
|
|
1050
1094
|
|
|
1051
1095
|
- `field` **([string][3] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1052
|
-
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1096
|
+
- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1097
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1053
1098
|
|
|
1054
1099
|
### wait
|
|
1055
1100
|
|
|
@@ -1062,6 +1107,7 @@ I.wait(2); // wait 2 secs
|
|
|
1062
1107
|
#### Parameters
|
|
1063
1108
|
|
|
1064
1109
|
- `sec` **[number][11]** number of second to wait.
|
|
1110
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1065
1111
|
|
|
1066
1112
|
### waitForDetached
|
|
1067
1113
|
|
|
@@ -1075,7 +1121,8 @@ I.waitForDetached('#popup');
|
|
|
1075
1121
|
#### Parameters
|
|
1076
1122
|
|
|
1077
1123
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1078
|
-
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1124
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1125
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1079
1126
|
|
|
1080
1127
|
### waitForElement
|
|
1081
1128
|
|
|
@@ -1091,6 +1138,7 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1091
1138
|
|
|
1092
1139
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1093
1140
|
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1141
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1094
1142
|
|
|
1095
1143
|
### waitForFunction
|
|
1096
1144
|
|
|
@@ -1109,9 +1157,10 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1109
1157
|
|
|
1110
1158
|
#### Parameters
|
|
1111
1159
|
|
|
1112
|
-
- `fn` **([string][3] | [function][
|
|
1160
|
+
- `fn` **([string][3] | [function][8])** to be executed in browser context.
|
|
1113
1161
|
- `argsOrSec` **([Array][10]<any> | [number][11])?** (optional, `1` by default) arguments for function or seconds.
|
|
1114
|
-
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1162
|
+
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1163
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1115
1164
|
|
|
1116
1165
|
### waitForInvisible
|
|
1117
1166
|
|
|
@@ -1125,7 +1174,8 @@ I.waitForInvisible('#popup');
|
|
|
1125
1174
|
#### Parameters
|
|
1126
1175
|
|
|
1127
1176
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1128
|
-
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1177
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1178
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1129
1179
|
|
|
1130
1180
|
### waitForText
|
|
1131
1181
|
|
|
@@ -1142,7 +1192,8 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1142
1192
|
|
|
1143
1193
|
- `text` **[string][3]** to wait for.
|
|
1144
1194
|
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1145
|
-
- `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator.
|
|
1195
|
+
- `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator.
|
|
1196
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1146
1197
|
|
|
1147
1198
|
### waitForVisible
|
|
1148
1199
|
|
|
@@ -1156,7 +1207,8 @@ I.waitForVisible('#popup');
|
|
|
1156
1207
|
#### Parameters
|
|
1157
1208
|
|
|
1158
1209
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1159
|
-
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1210
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1211
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1160
1212
|
|
|
1161
1213
|
### waitToHide
|
|
1162
1214
|
|
|
@@ -1170,7 +1222,8 @@ I.waitToHide('#popup');
|
|
|
1170
1222
|
#### Parameters
|
|
1171
1223
|
|
|
1172
1224
|
- `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
|
|
1173
|
-
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1225
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1226
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1174
1227
|
|
|
1175
1228
|
[1]: https://github.com/segmentio/nightmare
|
|
1176
1229
|
|
|
@@ -1184,11 +1237,11 @@ I.waitToHide('#popup');
|
|
|
1184
1237
|
|
|
1185
1238
|
[6]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
1186
1239
|
|
|
1187
|
-
[7]: https://
|
|
1240
|
+
[7]: https://github.com/segmentio/nightmare#evaluatefn-arg1-arg2
|
|
1188
1241
|
|
|
1189
|
-
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
1242
|
+
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1190
1243
|
|
|
1191
|
-
[9]: https://
|
|
1244
|
+
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1192
1245
|
|
|
1193
1246
|
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1194
1247
|
|