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/helpers/TestCafe.md
CHANGED
|
@@ -107,7 +107,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
107
107
|
|
|
108
108
|
- `url` **[string][4]** url path or global url.
|
|
109
109
|
|
|
110
|
-
Returns **void
|
|
110
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
111
111
|
|
|
112
112
|
### appendField
|
|
113
113
|
|
|
@@ -122,9 +122,10 @@ I.appendField('password', secret('123456'));
|
|
|
122
122
|
|
|
123
123
|
#### Parameters
|
|
124
124
|
|
|
125
|
-
- `field` **([string][4] | [object][
|
|
125
|
+
- `field` **([string][4] | [object][6])** located by label|name|CSS|XPath|strict locator
|
|
126
126
|
- `value` **[string][4]** text value to append.
|
|
127
|
-
|
|
127
|
+
|
|
128
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
128
129
|
|
|
129
130
|
### attachFile
|
|
130
131
|
|
|
@@ -141,13 +142,14 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
141
142
|
|
|
142
143
|
- `field`
|
|
143
144
|
- `pathToFile` **[string][4]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
- `locator` **([string][4] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
146
|
+
|
|
147
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
146
148
|
|
|
147
149
|
### blur
|
|
148
150
|
|
|
149
151
|
Remove focus from a text input, button, etc.
|
|
150
|
-
Calls [blur][
|
|
152
|
+
Calls [blur][7] on the element.
|
|
151
153
|
|
|
152
154
|
Examples:
|
|
153
155
|
|
|
@@ -164,8 +166,10 @@ I.dontSee('#add-to-cart-btn');
|
|
|
164
166
|
|
|
165
167
|
#### Parameters
|
|
166
168
|
|
|
167
|
-
- `locator` **([string][4] | [object][
|
|
168
|
-
- `options` **any?** Playwright only: [Additional options][
|
|
169
|
+
- `locator` **([string][4] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
170
|
+
- `options` **any?** Playwright only: [Additional options][8] for available options object as 2nd argument.
|
|
171
|
+
|
|
172
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
169
173
|
|
|
170
174
|
### checkOption
|
|
171
175
|
|
|
@@ -182,9 +186,10 @@ I.checkOption('agree', '//form');
|
|
|
182
186
|
|
|
183
187
|
#### Parameters
|
|
184
188
|
|
|
185
|
-
- `field` **([string][4] | [object][
|
|
186
|
-
- `context` **([string][4]? | [object][
|
|
187
|
-
|
|
189
|
+
- `field` **([string][4] | [object][6])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
190
|
+
- `context` **([string][4]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
191
|
+
|
|
192
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
188
193
|
|
|
189
194
|
### clearCookie
|
|
190
195
|
|
|
@@ -199,8 +204,9 @@ I.clearCookie('test');
|
|
|
199
204
|
#### Parameters
|
|
200
205
|
|
|
201
206
|
- `cookieName`
|
|
202
|
-
- `cookie` **[string][4]?** (optional, `null` by default) cookie name
|
|
203
|
-
|
|
207
|
+
- `cookie` **[string][4]?** (optional, `null` by default) cookie name
|
|
208
|
+
|
|
209
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
204
210
|
|
|
205
211
|
### clearField
|
|
206
212
|
|
|
@@ -215,8 +221,9 @@ I.clearField('#email');
|
|
|
215
221
|
#### Parameters
|
|
216
222
|
|
|
217
223
|
- `field`
|
|
218
|
-
- `editable` **([string][4] | [object][
|
|
219
|
-
|
|
224
|
+
- `editable` **([string][4] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
225
|
+
|
|
226
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder.
|
|
220
227
|
|
|
221
228
|
### click
|
|
222
229
|
|
|
@@ -244,9 +251,10 @@ I.click({css: 'nav a.login'});
|
|
|
244
251
|
|
|
245
252
|
#### Parameters
|
|
246
253
|
|
|
247
|
-
- `locator` **([string][4] | [object][
|
|
248
|
-
- `context` **([string][4]? | [object][
|
|
249
|
-
|
|
254
|
+
- `locator` **([string][4] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
255
|
+
- `context` **([string][4]? | [object][6] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
256
|
+
|
|
257
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
250
258
|
|
|
251
259
|
### dontSee
|
|
252
260
|
|
|
@@ -261,8 +269,9 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
261
269
|
#### Parameters
|
|
262
270
|
|
|
263
271
|
- `text` **[string][4]** which is not present.
|
|
264
|
-
- `context` **([string][4] | [object][
|
|
265
|
-
|
|
272
|
+
- `context` **([string][4] | [object][6])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
273
|
+
|
|
274
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
266
275
|
|
|
267
276
|
### dontSeeCheckboxIsChecked
|
|
268
277
|
|
|
@@ -276,8 +285,9 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
276
285
|
|
|
277
286
|
#### Parameters
|
|
278
287
|
|
|
279
|
-
- `field` **([string][4] | [object][
|
|
280
|
-
|
|
288
|
+
- `field` **([string][4] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
289
|
+
|
|
290
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
281
291
|
|
|
282
292
|
### dontSeeCookie
|
|
283
293
|
|
|
@@ -290,7 +300,8 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
290
300
|
#### Parameters
|
|
291
301
|
|
|
292
302
|
- `name` **[string][4]** cookie name.
|
|
293
|
-
|
|
303
|
+
|
|
304
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
294
305
|
|
|
295
306
|
### dontSeeCurrentUrlEquals
|
|
296
307
|
|
|
@@ -305,7 +316,8 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
305
316
|
#### Parameters
|
|
306
317
|
|
|
307
318
|
- `url` **[string][4]** value to check.
|
|
308
|
-
|
|
319
|
+
|
|
320
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
309
321
|
|
|
310
322
|
### dontSeeElement
|
|
311
323
|
|
|
@@ -317,8 +329,9 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
317
329
|
|
|
318
330
|
#### Parameters
|
|
319
331
|
|
|
320
|
-
- `locator` **([string][4] | [object][
|
|
321
|
-
|
|
332
|
+
- `locator` **([string][4] | [object][6])** located by CSS|XPath|Strict locator.
|
|
333
|
+
|
|
334
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
322
335
|
|
|
323
336
|
### dontSeeElementInDOM
|
|
324
337
|
|
|
@@ -330,8 +343,9 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
330
343
|
|
|
331
344
|
#### Parameters
|
|
332
345
|
|
|
333
|
-
- `locator` **([string][4] | [object][
|
|
334
|
-
|
|
346
|
+
- `locator` **([string][4] | [object][6])** located by CSS|XPath|Strict locator.
|
|
347
|
+
|
|
348
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
335
349
|
|
|
336
350
|
### dontSeeInCurrentUrl
|
|
337
351
|
|
|
@@ -340,7 +354,8 @@ Checks that current url does not contain a provided fragment.
|
|
|
340
354
|
#### Parameters
|
|
341
355
|
|
|
342
356
|
- `url` **[string][4]** value to check.
|
|
343
|
-
|
|
357
|
+
|
|
358
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
344
359
|
|
|
345
360
|
### dontSeeInField
|
|
346
361
|
|
|
@@ -354,9 +369,10 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
354
369
|
|
|
355
370
|
#### Parameters
|
|
356
371
|
|
|
357
|
-
- `field` **([string][4] | [object][
|
|
358
|
-
- `value` **([string][4] | [object][
|
|
359
|
-
|
|
372
|
+
- `field` **([string][4] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
373
|
+
- `value` **([string][4] | [object][6])** value to check.
|
|
374
|
+
|
|
375
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
360
376
|
|
|
361
377
|
### dontSeeInSource
|
|
362
378
|
|
|
@@ -370,7 +386,8 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
370
386
|
|
|
371
387
|
- `text`
|
|
372
388
|
- `value` **[string][4]** to check.
|
|
373
|
-
|
|
389
|
+
|
|
390
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
374
391
|
|
|
375
392
|
### doubleClick
|
|
376
393
|
|
|
@@ -386,9 +403,10 @@ I.doubleClick('.btn.edit');
|
|
|
386
403
|
|
|
387
404
|
#### Parameters
|
|
388
405
|
|
|
389
|
-
- `locator` **([string][4] | [object][
|
|
390
|
-
- `context` **([string][4]? | [object][
|
|
391
|
-
|
|
406
|
+
- `locator` **([string][4] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
407
|
+
- `context` **([string][4]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
408
|
+
|
|
409
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
392
410
|
|
|
393
411
|
### executeScript
|
|
394
412
|
|
|
@@ -418,10 +436,10 @@ let date = await I.executeScript(function(el) {
|
|
|
418
436
|
|
|
419
437
|
#### Parameters
|
|
420
438
|
|
|
421
|
-
- `fn` **([string][4] | [function][
|
|
439
|
+
- `fn` **([string][4] | [function][9])** function to be executed in browser context.
|
|
422
440
|
- `args` **...any** to be passed to function.
|
|
423
441
|
|
|
424
|
-
Returns **[Promise][
|
|
442
|
+
Returns **[Promise][5]<any>** script return valueIf a function returns a Promise It will wait for its resolution.
|
|
425
443
|
|
|
426
444
|
### fillField
|
|
427
445
|
|
|
@@ -441,13 +459,14 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
441
459
|
|
|
442
460
|
#### Parameters
|
|
443
461
|
|
|
444
|
-
- `field` **([string][4] | [object][
|
|
445
|
-
- `value` **([string][4] | [object][
|
|
446
|
-
|
|
462
|
+
- `field` **([string][4] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
463
|
+
- `value` **([string][4] | [object][6])** text value to fill.
|
|
464
|
+
|
|
465
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
447
466
|
|
|
448
467
|
### focus
|
|
449
468
|
|
|
450
|
-
Calls [focus][
|
|
469
|
+
Calls [focus][7] on the matching element.
|
|
451
470
|
|
|
452
471
|
Examples:
|
|
453
472
|
|
|
@@ -459,9 +478,11 @@ I.see('#add-to-cart-bnt');
|
|
|
459
478
|
|
|
460
479
|
#### Parameters
|
|
461
480
|
|
|
462
|
-
- `locator` **([string][4] | [object][
|
|
481
|
+
- `locator` **([string][4] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
463
482
|
- `options` **any?** Playwright only: [Additional options][10] for available options object as 2nd argument.
|
|
464
483
|
|
|
484
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
485
|
+
|
|
465
486
|
### grabAttributeFrom
|
|
466
487
|
|
|
467
488
|
Retrieves an attribute from an element located by CSS or XPath and returns it to test.
|
|
@@ -474,10 +495,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
474
495
|
|
|
475
496
|
#### Parameters
|
|
476
497
|
|
|
477
|
-
- `locator` **([string][4] | [object][
|
|
498
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
478
499
|
- `attr` **[string][4]** attribute name.
|
|
479
500
|
|
|
480
|
-
Returns **[Promise][
|
|
501
|
+
Returns **[Promise][5]<[string][4]>** attribute value
|
|
481
502
|
|
|
482
503
|
### grabAttributeFromAll
|
|
483
504
|
|
|
@@ -491,10 +512,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
491
512
|
|
|
492
513
|
#### Parameters
|
|
493
514
|
|
|
494
|
-
- `locator` **([string][4] | [object][
|
|
515
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
495
516
|
- `attr` **[string][4]** attribute name.
|
|
496
517
|
|
|
497
|
-
Returns **[Promise][
|
|
518
|
+
Returns **[Promise][5]<[string][4]>** attribute value
|
|
498
519
|
|
|
499
520
|
### grabBrowserLogs
|
|
500
521
|
|
|
@@ -520,7 +541,7 @@ assert(cookie.value, '123456');
|
|
|
520
541
|
|
|
521
542
|
- `name` **[string][4]?** cookie name.
|
|
522
543
|
|
|
523
|
-
Returns **
|
|
544
|
+
Returns **any** attribute valueReturns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
524
545
|
|
|
525
546
|
### grabCurrentUrl
|
|
526
547
|
|
|
@@ -532,7 +553,7 @@ let url = await I.grabCurrentUrl();
|
|
|
532
553
|
console.log(`Current URL is [${url}]`);
|
|
533
554
|
```
|
|
534
555
|
|
|
535
|
-
Returns **[Promise][
|
|
556
|
+
Returns **[Promise][5]<[string][4]>** current URL
|
|
536
557
|
|
|
537
558
|
### grabNumberOfVisibleElements
|
|
538
559
|
|
|
@@ -545,9 +566,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
545
566
|
|
|
546
567
|
#### Parameters
|
|
547
568
|
|
|
548
|
-
- `locator` **([string][4] | [object][
|
|
569
|
+
- `locator` **([string][4] | [object][6])** located by CSS|XPath|strict locator.
|
|
549
570
|
|
|
550
|
-
Returns **[Promise][
|
|
571
|
+
Returns **[Promise][5]<[number][11]>** number of visible elements
|
|
551
572
|
|
|
552
573
|
### grabPageScrollPosition
|
|
553
574
|
|
|
@@ -558,7 +579,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
558
579
|
let { x, y } = await I.grabPageScrollPosition();
|
|
559
580
|
```
|
|
560
581
|
|
|
561
|
-
Returns **[Promise][
|
|
582
|
+
Returns **[Promise][5]<PageScrollPosition>** scroll position
|
|
562
583
|
|
|
563
584
|
### grabSource
|
|
564
585
|
|
|
@@ -569,7 +590,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
569
590
|
let pageSource = await I.grabSource();
|
|
570
591
|
```
|
|
571
592
|
|
|
572
|
-
Returns **[Promise][
|
|
593
|
+
Returns **[Promise][5]<[string][4]>** source code
|
|
573
594
|
|
|
574
595
|
### grabTextFrom
|
|
575
596
|
|
|
@@ -584,9 +605,9 @@ If multiple elements found returns first element.
|
|
|
584
605
|
|
|
585
606
|
#### Parameters
|
|
586
607
|
|
|
587
|
-
- `locator` **([string][4] | [object][
|
|
608
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
588
609
|
|
|
589
|
-
Returns **[Promise][
|
|
610
|
+
Returns **[Promise][5]<[string][4]>** attribute value
|
|
590
611
|
|
|
591
612
|
### grabTextFromAll
|
|
592
613
|
|
|
@@ -599,9 +620,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
599
620
|
|
|
600
621
|
#### Parameters
|
|
601
622
|
|
|
602
|
-
- `locator` **([string][4] | [object][
|
|
623
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
603
624
|
|
|
604
|
-
Returns **[Promise][
|
|
625
|
+
Returns **[Promise][5]<[Array][12]<[string][4]>>** attribute value
|
|
605
626
|
|
|
606
627
|
### grabValueFrom
|
|
607
628
|
|
|
@@ -615,9 +636,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
615
636
|
|
|
616
637
|
#### Parameters
|
|
617
638
|
|
|
618
|
-
- `locator` **([string][4] | [object][
|
|
639
|
+
- `locator` **([string][4] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
619
640
|
|
|
620
|
-
Returns **[Promise][
|
|
641
|
+
Returns **[Promise][5]<[string][4]>** attribute value
|
|
621
642
|
|
|
622
643
|
### grabValueFromAll
|
|
623
644
|
|
|
@@ -630,9 +651,9 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
630
651
|
|
|
631
652
|
#### Parameters
|
|
632
653
|
|
|
633
|
-
- `locator` **([string][4] | [object][
|
|
654
|
+
- `locator` **([string][4] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
634
655
|
|
|
635
|
-
Returns **[Promise][
|
|
656
|
+
Returns **[Promise][5]<[Array][12]<[string][4]>>** attribute value
|
|
636
657
|
|
|
637
658
|
### moveCursorTo
|
|
638
659
|
|
|
@@ -646,10 +667,11 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
646
667
|
|
|
647
668
|
#### Parameters
|
|
648
669
|
|
|
649
|
-
- `locator` **([string][4] | [object][
|
|
650
|
-
- `offsetX` **[number][
|
|
651
|
-
- `offsetY` **[number][
|
|
652
|
-
|
|
670
|
+
- `locator` **([string][4] | [object][6])** located by CSS|XPath|strict locator.
|
|
671
|
+
- `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
672
|
+
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
673
|
+
|
|
674
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
653
675
|
|
|
654
676
|
### pressKey
|
|
655
677
|
|
|
@@ -665,8 +687,9 @@ I.pressKey(['Control','a']);
|
|
|
665
687
|
|
|
666
688
|
#### Parameters
|
|
667
689
|
|
|
668
|
-
- `key` **([string][4] | [Array][
|
|
669
|
-
|
|
690
|
+
- `key` **([string][4] | [Array][12]<[string][4]>)** key or array of keys to press.
|
|
691
|
+
|
|
692
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
670
693
|
|
|
671
694
|
|
|
672
695
|
[Valid key names](https://w3c.github.io/webdriver/#keyboard-actions) are:
|
|
@@ -709,7 +732,7 @@ Reload the current page.
|
|
|
709
732
|
I.refreshPage();
|
|
710
733
|
```
|
|
711
734
|
|
|
712
|
-
|
|
735
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
713
736
|
|
|
714
737
|
### resizeWindow
|
|
715
738
|
|
|
@@ -718,9 +741,10 @@ First parameter can be set to `maximize`.
|
|
|
718
741
|
|
|
719
742
|
#### Parameters
|
|
720
743
|
|
|
721
|
-
- `width` **[number][
|
|
722
|
-
- `height` **[number][
|
|
723
|
-
|
|
744
|
+
- `width` **[number][11]** width in pixels or `maximize`.
|
|
745
|
+
- `height` **[number][11]** height in pixels.
|
|
746
|
+
|
|
747
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
724
748
|
|
|
725
749
|
### rightClick
|
|
726
750
|
|
|
@@ -737,9 +761,10 @@ I.rightClick('Click me', '.context');
|
|
|
737
761
|
|
|
738
762
|
#### Parameters
|
|
739
763
|
|
|
740
|
-
- `locator` **([string][4] | [object][
|
|
741
|
-
- `context` **([string][4]? | [object][
|
|
742
|
-
|
|
764
|
+
- `locator` **([string][4] | [object][6])** clickable element located by CSS|XPath|strict locator.
|
|
765
|
+
- `context` **([string][4]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
766
|
+
|
|
767
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
743
768
|
|
|
744
769
|
### saveElementScreenshot
|
|
745
770
|
|
|
@@ -752,9 +777,10 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
752
777
|
|
|
753
778
|
#### Parameters
|
|
754
779
|
|
|
755
|
-
- `locator` **([string][4] | [object][
|
|
780
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
756
781
|
- `fileName` **[string][4]** file name to save.
|
|
757
|
-
|
|
782
|
+
|
|
783
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
758
784
|
|
|
759
785
|
### saveScreenshot
|
|
760
786
|
|
|
@@ -770,8 +796,9 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
770
796
|
#### Parameters
|
|
771
797
|
|
|
772
798
|
- `fileName` **[string][4]** file name to save.
|
|
773
|
-
- `fullPage` **[boolean][14]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
774
|
-
|
|
799
|
+
- `fullPage` **[boolean][14]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
800
|
+
|
|
801
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
775
802
|
|
|
776
803
|
### scrollPageToBottom
|
|
777
804
|
|
|
@@ -781,7 +808,7 @@ Scroll page to the bottom.
|
|
|
781
808
|
I.scrollPageToBottom();
|
|
782
809
|
```
|
|
783
810
|
|
|
784
|
-
|
|
811
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
785
812
|
|
|
786
813
|
### scrollPageToTop
|
|
787
814
|
|
|
@@ -791,7 +818,7 @@ Scroll page to the top.
|
|
|
791
818
|
I.scrollPageToTop();
|
|
792
819
|
```
|
|
793
820
|
|
|
794
|
-
|
|
821
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
795
822
|
|
|
796
823
|
### scrollTo
|
|
797
824
|
|
|
@@ -805,10 +832,11 @@ I.scrollTo('#submit', 5, 5);
|
|
|
805
832
|
|
|
806
833
|
#### Parameters
|
|
807
834
|
|
|
808
|
-
- `locator` **([string][4] | [object][
|
|
809
|
-
- `offsetX` **[number][
|
|
810
|
-
- `offsetY` **[number][
|
|
811
|
-
|
|
835
|
+
- `locator` **([string][4] | [object][6])** located by CSS|XPath|strict locator.
|
|
836
|
+
- `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
837
|
+
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
838
|
+
|
|
839
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
812
840
|
|
|
813
841
|
### see
|
|
814
842
|
|
|
@@ -824,8 +852,9 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
824
852
|
#### Parameters
|
|
825
853
|
|
|
826
854
|
- `text` **[string][4]** expected on page.
|
|
827
|
-
- `context` **([string][4]? | [object][
|
|
828
|
-
|
|
855
|
+
- `context` **([string][4]? | [object][6])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
856
|
+
|
|
857
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
829
858
|
|
|
830
859
|
### seeCheckboxIsChecked
|
|
831
860
|
|
|
@@ -839,8 +868,9 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
839
868
|
|
|
840
869
|
#### Parameters
|
|
841
870
|
|
|
842
|
-
- `field` **([string][4] | [object][
|
|
843
|
-
|
|
871
|
+
- `field` **([string][4] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
872
|
+
|
|
873
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
844
874
|
|
|
845
875
|
### seeCookie
|
|
846
876
|
|
|
@@ -853,7 +883,8 @@ I.seeCookie('Auth');
|
|
|
853
883
|
#### Parameters
|
|
854
884
|
|
|
855
885
|
- `name` **[string][4]** cookie name.
|
|
856
|
-
|
|
886
|
+
|
|
887
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
857
888
|
|
|
858
889
|
### seeCurrentUrlEquals
|
|
859
890
|
|
|
@@ -869,7 +900,8 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
869
900
|
#### Parameters
|
|
870
901
|
|
|
871
902
|
- `url` **[string][4]** value to check.
|
|
872
|
-
|
|
903
|
+
|
|
904
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
873
905
|
|
|
874
906
|
### seeElement
|
|
875
907
|
|
|
@@ -882,8 +914,9 @@ I.seeElement('#modal');
|
|
|
882
914
|
|
|
883
915
|
#### Parameters
|
|
884
916
|
|
|
885
|
-
- `locator` **([string][4] | [object][
|
|
886
|
-
|
|
917
|
+
- `locator` **([string][4] | [object][6])** located by CSS|XPath|strict locator.
|
|
918
|
+
|
|
919
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
887
920
|
|
|
888
921
|
### seeElementInDOM
|
|
889
922
|
|
|
@@ -896,8 +929,9 @@ I.seeElementInDOM('#modal');
|
|
|
896
929
|
|
|
897
930
|
#### Parameters
|
|
898
931
|
|
|
899
|
-
- `locator` **([string][4] | [object][
|
|
900
|
-
|
|
932
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
933
|
+
|
|
934
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
901
935
|
|
|
902
936
|
### seeInCurrentUrl
|
|
903
937
|
|
|
@@ -910,7 +944,8 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
910
944
|
#### Parameters
|
|
911
945
|
|
|
912
946
|
- `url` **[string][4]** a fragment to check
|
|
913
|
-
|
|
947
|
+
|
|
948
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
914
949
|
|
|
915
950
|
### seeInField
|
|
916
951
|
|
|
@@ -926,9 +961,10 @@ I.seeInField('#searchform input','Search');
|
|
|
926
961
|
|
|
927
962
|
#### Parameters
|
|
928
963
|
|
|
929
|
-
- `field` **([string][4] | [object][
|
|
930
|
-
- `value` **([string][4] | [object][
|
|
931
|
-
|
|
964
|
+
- `field` **([string][4] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
965
|
+
- `value` **([string][4] | [object][6])** value to check.
|
|
966
|
+
|
|
967
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
932
968
|
|
|
933
969
|
### seeInSource
|
|
934
970
|
|
|
@@ -941,7 +977,8 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
941
977
|
#### Parameters
|
|
942
978
|
|
|
943
979
|
- `text` **[string][4]** value to check.
|
|
944
|
-
|
|
980
|
+
|
|
981
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
945
982
|
|
|
946
983
|
### seeNumberOfVisibleElements
|
|
947
984
|
|
|
@@ -954,9 +991,10 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
954
991
|
|
|
955
992
|
#### Parameters
|
|
956
993
|
|
|
957
|
-
- `locator` **([string][4] | [object][
|
|
958
|
-
- `num` **[number][
|
|
959
|
-
|
|
994
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
995
|
+
- `num` **[number][11]** number of elements.
|
|
996
|
+
|
|
997
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
960
998
|
|
|
961
999
|
### seeTextEquals
|
|
962
1000
|
|
|
@@ -994,9 +1032,10 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
994
1032
|
|
|
995
1033
|
#### Parameters
|
|
996
1034
|
|
|
997
|
-
- `select` **([string][4] | [object][
|
|
998
|
-
- `option` **([string][4] | [Array][
|
|
999
|
-
|
|
1035
|
+
- `select` **([string][4] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
1036
|
+
- `option` **([string][4] | [Array][12]<any>)** visible text or value of option.
|
|
1037
|
+
|
|
1038
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1000
1039
|
|
|
1001
1040
|
### setCookie
|
|
1002
1041
|
|
|
@@ -1016,8 +1055,9 @@ I.setCookie([
|
|
|
1016
1055
|
|
|
1017
1056
|
#### Parameters
|
|
1018
1057
|
|
|
1019
|
-
- `cookie` **(Cookie | [Array][
|
|
1020
|
-
|
|
1058
|
+
- `cookie` **(Cookie | [Array][12]<Cookie>)** a cookie object or array of cookie objects.
|
|
1059
|
+
|
|
1060
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1021
1061
|
|
|
1022
1062
|
### switchTo
|
|
1023
1063
|
|
|
@@ -1030,8 +1070,9 @@ I.switchTo(); // switch back to main page
|
|
|
1030
1070
|
|
|
1031
1071
|
#### Parameters
|
|
1032
1072
|
|
|
1033
|
-
- `locator` **([string][4]? | [object][
|
|
1034
|
-
|
|
1073
|
+
- `locator` **([string][4]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1074
|
+
|
|
1075
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1035
1076
|
|
|
1036
1077
|
### uncheckOption
|
|
1037
1078
|
|
|
@@ -1048,9 +1089,10 @@ I.uncheckOption('agree', '//form');
|
|
|
1048
1089
|
|
|
1049
1090
|
#### Parameters
|
|
1050
1091
|
|
|
1051
|
-
- `field` **([string][4] | [object][
|
|
1052
|
-
- `context` **([string][4]? | [object][
|
|
1053
|
-
|
|
1092
|
+
- `field` **([string][4] | [object][6])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1093
|
+
- `context` **([string][4]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1094
|
+
|
|
1095
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1054
1096
|
|
|
1055
1097
|
### useTestCafeTo
|
|
1056
1098
|
|
|
@@ -1070,7 +1112,7 @@ I.useTestCafeTo('handle browser dialog', async ({ t }) {
|
|
|
1070
1112
|
#### Parameters
|
|
1071
1113
|
|
|
1072
1114
|
- `description` **[string][4]** used to show in logs.
|
|
1073
|
-
- `fn` **[function][
|
|
1115
|
+
- `fn` **[function][9]** async functuion that executed with TestCafe helper as argument
|
|
1074
1116
|
|
|
1075
1117
|
### wait
|
|
1076
1118
|
|
|
@@ -1082,8 +1124,9 @@ I.wait(2); // wait 2 secs
|
|
|
1082
1124
|
|
|
1083
1125
|
#### Parameters
|
|
1084
1126
|
|
|
1085
|
-
- `sec` **[number][
|
|
1086
|
-
|
|
1127
|
+
- `sec` **[number][11]** number of second to wait.
|
|
1128
|
+
|
|
1129
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1087
1130
|
|
|
1088
1131
|
### waitForElement
|
|
1089
1132
|
|
|
@@ -1097,9 +1140,10 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1097
1140
|
|
|
1098
1141
|
#### Parameters
|
|
1099
1142
|
|
|
1100
|
-
- `locator` **([string][4] | [object][
|
|
1101
|
-
- `sec` **[number][
|
|
1102
|
-
|
|
1143
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1144
|
+
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1145
|
+
|
|
1146
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1103
1147
|
|
|
1104
1148
|
### waitForFunction
|
|
1105
1149
|
|
|
@@ -1118,10 +1162,11 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1118
1162
|
|
|
1119
1163
|
#### Parameters
|
|
1120
1164
|
|
|
1121
|
-
- `fn` **([string][4] | [function][
|
|
1122
|
-
- `argsOrSec` **([Array][
|
|
1123
|
-
- `sec` **[number][
|
|
1124
|
-
|
|
1165
|
+
- `fn` **([string][4] | [function][9])** to be executed in browser context.
|
|
1166
|
+
- `argsOrSec` **([Array][12]<any> | [number][11])?** (optional, `1` by default) arguments for function or seconds.
|
|
1167
|
+
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1168
|
+
|
|
1169
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1125
1170
|
|
|
1126
1171
|
### waitForInvisible
|
|
1127
1172
|
|
|
@@ -1134,9 +1179,10 @@ I.waitForInvisible('#popup');
|
|
|
1134
1179
|
|
|
1135
1180
|
#### Parameters
|
|
1136
1181
|
|
|
1137
|
-
- `locator` **([string][4] | [object][
|
|
1138
|
-
- `sec` **[number][
|
|
1139
|
-
|
|
1182
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1183
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1184
|
+
|
|
1185
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1140
1186
|
|
|
1141
1187
|
### waitForText
|
|
1142
1188
|
|
|
@@ -1152,9 +1198,10 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1152
1198
|
#### Parameters
|
|
1153
1199
|
|
|
1154
1200
|
- `text` **[string][4]** to wait for.
|
|
1155
|
-
- `sec` **[number][
|
|
1156
|
-
- `context` **([string][4] | [object][
|
|
1157
|
-
|
|
1201
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1202
|
+
- `context` **([string][4] | [object][6])?** (optional) element located by CSS|XPath|strict locator.
|
|
1203
|
+
|
|
1204
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1158
1205
|
|
|
1159
1206
|
### waitForVisible
|
|
1160
1207
|
|
|
@@ -1167,9 +1214,10 @@ I.waitForVisible('#popup');
|
|
|
1167
1214
|
|
|
1168
1215
|
#### Parameters
|
|
1169
1216
|
|
|
1170
|
-
- `locator` **([string][4] | [object][
|
|
1171
|
-
- `sec` **[number][
|
|
1172
|
-
|
|
1217
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1218
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1219
|
+
|
|
1220
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1173
1221
|
|
|
1174
1222
|
### waitInUrl
|
|
1175
1223
|
|
|
@@ -1182,8 +1230,9 @@ I.waitInUrl('/info', 2);
|
|
|
1182
1230
|
#### Parameters
|
|
1183
1231
|
|
|
1184
1232
|
- `urlPart` **[string][4]** value to check.
|
|
1185
|
-
- `sec` **[number][
|
|
1186
|
-
|
|
1233
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1234
|
+
|
|
1235
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1187
1236
|
|
|
1188
1237
|
### waitNumberOfVisibleElements
|
|
1189
1238
|
|
|
@@ -1195,10 +1244,11 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
1195
1244
|
|
|
1196
1245
|
#### Parameters
|
|
1197
1246
|
|
|
1198
|
-
- `locator` **([string][4] | [object][
|
|
1199
|
-
- `num` **[number][
|
|
1200
|
-
- `sec` **[number][
|
|
1201
|
-
|
|
1247
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1248
|
+
- `num` **[number][11]** number of elements.
|
|
1249
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1250
|
+
|
|
1251
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1202
1252
|
|
|
1203
1253
|
### waitToHide
|
|
1204
1254
|
|
|
@@ -1211,9 +1261,10 @@ I.waitToHide('#popup');
|
|
|
1211
1261
|
|
|
1212
1262
|
#### Parameters
|
|
1213
1263
|
|
|
1214
|
-
- `locator` **([string][4] | [object][
|
|
1215
|
-
- `sec` **[number][
|
|
1216
|
-
|
|
1264
|
+
- `locator` **([string][4] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1265
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1266
|
+
|
|
1267
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1217
1268
|
|
|
1218
1269
|
### waitUrlEquals
|
|
1219
1270
|
|
|
@@ -1227,8 +1278,9 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
1227
1278
|
#### Parameters
|
|
1228
1279
|
|
|
1229
1280
|
- `urlPart` **[string][4]** value to check.
|
|
1230
|
-
- `sec` **[number][
|
|
1231
|
-
|
|
1281
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1282
|
+
|
|
1283
|
+
Returns **[Promise][5]<void>** automatically synchronized promise through #recorder
|
|
1232
1284
|
|
|
1233
1285
|
## getPageUrl
|
|
1234
1286
|
|
|
@@ -1246,21 +1298,21 @@ Client Functions
|
|
|
1246
1298
|
|
|
1247
1299
|
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1248
1300
|
|
|
1249
|
-
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
1301
|
+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1250
1302
|
|
|
1251
|
-
[6]: https://developer.mozilla.org/
|
|
1303
|
+
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1252
1304
|
|
|
1253
|
-
[7]: https://
|
|
1305
|
+
[7]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
|
|
1254
1306
|
|
|
1255
|
-
[8]: https://
|
|
1307
|
+
[8]: https://playwright.dev/docs/api/class-locator#locator-blur
|
|
1256
1308
|
|
|
1257
|
-
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
1309
|
+
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1258
1310
|
|
|
1259
1311
|
[10]: https://playwright.dev/docs/api/class-locator#locator-focus
|
|
1260
1312
|
|
|
1261
|
-
[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
1313
|
+
[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1262
1314
|
|
|
1263
|
-
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
1315
|
+
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1264
1316
|
|
|
1265
1317
|
[13]: https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value
|
|
1266
1318
|
|