codeceptjs 3.3.1 → 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 +7 -0
- package/README.md +4 -25
- package/docs/build/Appium.js +18 -28
- package/docs/build/Nightmare.js +53 -53
- package/docs/build/Playwright.js +74 -99
- package/docs/build/Protractor.js +66 -66
- package/docs/build/Puppeteer.js +74 -74
- package/docs/build/REST.js +2 -2
- package/docs/build/TestCafe.js +53 -53
- package/docs/build/WebDriver.js +79 -81
- package/docs/changelog.md +7 -0
- package/docs/helpers/Appium.md +212 -268
- package/docs/helpers/Nightmare.md +92 -141
- package/docs/helpers/Playwright.md +266 -383
- package/docs/helpers/Puppeteer.md +171 -231
- package/docs/helpers/TestCafe.md +125 -174
- package/docs/helpers/WebDriver.md +184 -247
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- 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/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/helper/Appium.js +0 -10
- package/lib/helper/Playwright.js +3 -28
- package/lib/helper/REST.js +2 -2
- package/lib/helper/WebDriver.js +0 -2
- package/package.json +1 -1
- package/typings/types.d.ts +988 -517
|
@@ -233,9 +233,6 @@ Add the 'dialog' event listener to a page
|
|
|
233
233
|
|
|
234
234
|
- `page`
|
|
235
235
|
|
|
236
|
-
Returns **[Promise][10]<any>** The popup listener handles the dialog with the predefined action when it appears on the page.
|
|
237
|
-
It also saves a reference to the object which is used in seeInPopup.
|
|
238
|
-
|
|
239
236
|
### _contextLocator
|
|
240
237
|
|
|
241
238
|
Grab Locator if called within Context
|
|
@@ -248,8 +245,6 @@ Grab Locator if called within Context
|
|
|
248
245
|
|
|
249
246
|
Gets page URL including hash.
|
|
250
247
|
|
|
251
|
-
Returns **[Promise][10]<any>**
|
|
252
|
-
|
|
253
248
|
### _locate
|
|
254
249
|
|
|
255
250
|
Get elements by different locator types, including strict locator
|
|
@@ -263,8 +258,6 @@ const elements = await this.helpers['Playwright']._locate({name: 'password'});
|
|
|
263
258
|
|
|
264
259
|
- `locator`
|
|
265
260
|
|
|
266
|
-
Returns **[Promise][10]<any>**
|
|
267
|
-
|
|
268
261
|
### _locateCheckable
|
|
269
262
|
|
|
270
263
|
Find a checkbox by providing human readable text:
|
|
@@ -279,8 +272,6 @@ this.helpers['Playwright']._locateCheckable('I agree with terms and conditions')
|
|
|
279
272
|
- `locator`
|
|
280
273
|
- `providedContext`
|
|
281
274
|
|
|
282
|
-
Returns **[Promise][10]<any>**
|
|
283
|
-
|
|
284
275
|
### _locateClickable
|
|
285
276
|
|
|
286
277
|
Find a clickable element by providing human readable text:
|
|
@@ -293,8 +284,6 @@ this.helpers['Playwright']._locateClickable('Next page').then // ...
|
|
|
293
284
|
|
|
294
285
|
- `locator`
|
|
295
286
|
|
|
296
|
-
Returns **[Promise][10]<any>**
|
|
297
|
-
|
|
298
287
|
### _locateFields
|
|
299
288
|
|
|
300
289
|
Find field elements by providing human readable text:
|
|
@@ -307,25 +296,19 @@ this.helpers['Playwright']._locateFields('Your email').then // ...
|
|
|
307
296
|
|
|
308
297
|
- `locator`
|
|
309
298
|
|
|
310
|
-
Returns **[Promise][10]<any>**
|
|
311
|
-
|
|
312
299
|
### _setPage
|
|
313
300
|
|
|
314
301
|
Set current page
|
|
315
302
|
|
|
316
303
|
#### Parameters
|
|
317
304
|
|
|
318
|
-
- `page` **[object][
|
|
319
|
-
|
|
320
|
-
Returns **[Promise][10]<any>**
|
|
305
|
+
- `page` **[object][10]** page to set
|
|
321
306
|
|
|
322
307
|
### acceptPopup
|
|
323
308
|
|
|
324
309
|
Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
|
|
325
310
|
Don't confuse popups with modal windows, as created by [various
|
|
326
|
-
libraries][
|
|
327
|
-
|
|
328
|
-
Returns **[Promise][10]<any>**
|
|
311
|
+
libraries][11].
|
|
329
312
|
|
|
330
313
|
### amAcceptingPopups
|
|
331
314
|
|
|
@@ -338,8 +321,6 @@ I.click('#triggerPopup');
|
|
|
338
321
|
I.acceptPopup();
|
|
339
322
|
```
|
|
340
323
|
|
|
341
|
-
Returns **[Promise][10]<any>**
|
|
342
|
-
|
|
343
324
|
### amCancellingPopups
|
|
344
325
|
|
|
345
326
|
Set the automatic popup response to Cancel/Dismiss.
|
|
@@ -351,8 +332,6 @@ I.click('#triggerPopup');
|
|
|
351
332
|
I.cancelPopup();
|
|
352
333
|
```
|
|
353
334
|
|
|
354
|
-
Returns **[Promise][10]<any>**
|
|
355
|
-
|
|
356
335
|
### amOnPage
|
|
357
336
|
|
|
358
337
|
Opens a web page in a browser. Requires relative or absolute url.
|
|
@@ -366,9 +345,9 @@ I.amOnPage('/login'); // opens a login page
|
|
|
366
345
|
|
|
367
346
|
#### Parameters
|
|
368
347
|
|
|
369
|
-
- `url` **[string][
|
|
348
|
+
- `url` **[string][12]** url path or global url.
|
|
370
349
|
|
|
371
|
-
Returns **
|
|
350
|
+
Returns **void** automatically synchronized promise with recorder #!
|
|
372
351
|
|
|
373
352
|
### appendField
|
|
374
353
|
|
|
@@ -381,10 +360,9 @@ I.appendField('#myTextField', 'appended');
|
|
|
381
360
|
|
|
382
361
|
#### Parameters
|
|
383
362
|
|
|
384
|
-
- `field` **([string][
|
|
385
|
-
- `value` **[string][
|
|
386
|
-
|
|
387
|
-
Returns **[Promise][10]<any>**
|
|
363
|
+
- `field` **([string][12] | [object][10])** located by label|name|CSS|XPath|strict locator
|
|
364
|
+
- `value` **[string][12]** text value to append.
|
|
365
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
388
366
|
|
|
389
367
|
### attachFile
|
|
390
368
|
|
|
@@ -399,17 +377,14 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
399
377
|
|
|
400
378
|
#### Parameters
|
|
401
379
|
|
|
402
|
-
- `locator` **([string][
|
|
403
|
-
- `pathToFile` **[string][
|
|
404
|
-
|
|
405
|
-
Returns **[Promise][10]<any>**
|
|
380
|
+
- `locator` **([string][12] | [object][10])** field located by label|name|CSS|XPath|strict locator.
|
|
381
|
+
- `pathToFile` **[string][12]** local file path relative to codecept.json config file.
|
|
382
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
406
383
|
|
|
407
384
|
### cancelPopup
|
|
408
385
|
|
|
409
386
|
Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt.
|
|
410
387
|
|
|
411
|
-
Returns **[Promise][10]<any>**
|
|
412
|
-
|
|
413
388
|
### checkOption
|
|
414
389
|
|
|
415
390
|
Selects a checkbox or radio button.
|
|
@@ -425,15 +400,14 @@ I.checkOption('agree', '//form');
|
|
|
425
400
|
|
|
426
401
|
#### Parameters
|
|
427
402
|
|
|
428
|
-
- `field` **([string][
|
|
429
|
-
- `context` **([string][
|
|
403
|
+
- `field` **([string][12] | [object][10])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
404
|
+
- `context` **([string][12]? | [object][10])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
405
|
+
[!] returns a _promise_ which is synchronized internally by recorder[Additional options][13] for check available as 3rd argument.Examples:```js
|
|
406
|
+
// click on element at position
|
|
407
|
+
I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
408
|
+
```> ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
430
409
|
- `options`
|
|
431
410
|
|
|
432
|
-
Returns **[Promise][10]<any>** [Additional options][14] for check available as 3rd argument.Examples:```js
|
|
433
|
-
// click on element at position
|
|
434
|
-
I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
435
|
-
```> ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
436
|
-
|
|
437
411
|
### clearCookie
|
|
438
412
|
|
|
439
413
|
Clears a cookie by name,
|
|
@@ -446,9 +420,8 @@ I.clearCookie('test');
|
|
|
446
420
|
|
|
447
421
|
#### Parameters
|
|
448
422
|
|
|
449
|
-
- `cookie` **[string][
|
|
450
|
-
|
|
451
|
-
Returns **[Promise][10]<any>**
|
|
423
|
+
- `cookie` **[string][12]?** (optional, `null` by default) cookie name
|
|
424
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
452
425
|
|
|
453
426
|
### clearField
|
|
454
427
|
|
|
@@ -463,9 +436,8 @@ I.clearField('#email');
|
|
|
463
436
|
#### Parameters
|
|
464
437
|
|
|
465
438
|
- `field`
|
|
466
|
-
- `editable` **([string][
|
|
467
|
-
|
|
468
|
-
Returns **[Promise][10]<any>**
|
|
439
|
+
- `editable` **([string][12] | [object][10])** field located by label|name|CSS|XPath|strict locator.
|
|
440
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
469
441
|
|
|
470
442
|
### click
|
|
471
443
|
|
|
@@ -493,9 +465,10 @@ I.click({css: 'nav a.login'});
|
|
|
493
465
|
|
|
494
466
|
#### Parameters
|
|
495
467
|
|
|
496
|
-
- `locator` **([string][
|
|
497
|
-
- `context` **([string][
|
|
498
|
-
|
|
468
|
+
- `locator` **([string][12] | [object][10])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
469
|
+
- `context` **([string][12]? | [object][10] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
470
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
471
|
+
- `opts` **any?** [Additional options][14] for click available as 3rd argument.Examples:```js
|
|
499
472
|
// click on element at position
|
|
500
473
|
I.click('canvas', '.model', { position: { x: 20, y: 40 } })
|
|
501
474
|
|
|
@@ -503,8 +476,6 @@ I.click({css: 'nav a.login'});
|
|
|
503
476
|
I.click('.edit', null, { modifiers: ['Ctrl'] } )
|
|
504
477
|
```
|
|
505
478
|
|
|
506
|
-
Returns **[Promise][10]<any>**
|
|
507
|
-
|
|
508
479
|
### clickLink
|
|
509
480
|
|
|
510
481
|
Clicks link and waits for navigation (deprecated)
|
|
@@ -514,8 +485,6 @@ Clicks link and waits for navigation (deprecated)
|
|
|
514
485
|
- `locator`
|
|
515
486
|
- `context`
|
|
516
487
|
|
|
517
|
-
Returns **[Promise][10]<any>**
|
|
518
|
-
|
|
519
488
|
### closeCurrentTab
|
|
520
489
|
|
|
521
490
|
Close current tab and switches to previous.
|
|
@@ -524,8 +493,6 @@ Close current tab and switches to previous.
|
|
|
524
493
|
I.closeCurrentTab();
|
|
525
494
|
```
|
|
526
495
|
|
|
527
|
-
Returns **[Promise][10]<any>**
|
|
528
|
-
|
|
529
496
|
### closeOtherTabs
|
|
530
497
|
|
|
531
498
|
Close all tabs except for the current one.
|
|
@@ -534,8 +501,6 @@ Close all tabs except for the current one.
|
|
|
534
501
|
I.closeOtherTabs();
|
|
535
502
|
```
|
|
536
503
|
|
|
537
|
-
Returns **[Promise][10]<any>**
|
|
538
|
-
|
|
539
504
|
### dontSee
|
|
540
505
|
|
|
541
506
|
Opposite to `see`. Checks that a text is not present on a page.
|
|
@@ -548,10 +513,9 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
548
513
|
|
|
549
514
|
#### Parameters
|
|
550
515
|
|
|
551
|
-
- `text` **[string][
|
|
552
|
-
- `context` **([string][
|
|
553
|
-
|
|
554
|
-
Returns **[Promise][10]<any>**
|
|
516
|
+
- `text` **[string][12]** which is not present.
|
|
517
|
+
- `context` **([string][12] | [object][10])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
518
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
555
519
|
|
|
556
520
|
### dontSeeCheckboxIsChecked
|
|
557
521
|
|
|
@@ -565,9 +529,8 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
565
529
|
|
|
566
530
|
#### Parameters
|
|
567
531
|
|
|
568
|
-
- `field` **([string][
|
|
569
|
-
|
|
570
|
-
Returns **[Promise][10]<any>**
|
|
532
|
+
- `field` **([string][12] | [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
533
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
571
534
|
|
|
572
535
|
### dontSeeCookie
|
|
573
536
|
|
|
@@ -579,9 +542,8 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
579
542
|
|
|
580
543
|
#### Parameters
|
|
581
544
|
|
|
582
|
-
- `name` **[string][
|
|
583
|
-
|
|
584
|
-
Returns **[Promise][10]<any>**
|
|
545
|
+
- `name` **[string][12]** cookie name.
|
|
546
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
585
547
|
|
|
586
548
|
### dontSeeCurrentUrlEquals
|
|
587
549
|
|
|
@@ -595,9 +557,8 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
595
557
|
|
|
596
558
|
#### Parameters
|
|
597
559
|
|
|
598
|
-
- `url` **[string][
|
|
599
|
-
|
|
600
|
-
Returns **[Promise][10]<any>**
|
|
560
|
+
- `url` **[string][12]** value to check.
|
|
561
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
601
562
|
|
|
602
563
|
### dontSeeElement
|
|
603
564
|
|
|
@@ -609,9 +570,8 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
609
570
|
|
|
610
571
|
#### Parameters
|
|
611
572
|
|
|
612
|
-
- `locator` **([string][
|
|
613
|
-
|
|
614
|
-
Returns **[Promise][10]<any>**
|
|
573
|
+
- `locator` **([string][12] | [object][10])** located by CSS|XPath|Strict locator.
|
|
574
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
615
575
|
|
|
616
576
|
### dontSeeElementInDOM
|
|
617
577
|
|
|
@@ -623,9 +583,8 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
623
583
|
|
|
624
584
|
#### Parameters
|
|
625
585
|
|
|
626
|
-
- `locator` **([string][
|
|
627
|
-
|
|
628
|
-
Returns **[Promise][10]<any>**
|
|
586
|
+
- `locator` **([string][12] | [object][10])** located by CSS|XPath|Strict locator.
|
|
587
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
629
588
|
|
|
630
589
|
### dontSeeInCurrentUrl
|
|
631
590
|
|
|
@@ -633,9 +592,8 @@ Checks that current url does not contain a provided fragment.
|
|
|
633
592
|
|
|
634
593
|
#### Parameters
|
|
635
594
|
|
|
636
|
-
- `url` **[string][
|
|
637
|
-
|
|
638
|
-
Returns **[Promise][10]<any>**
|
|
595
|
+
- `url` **[string][12]** value to check.
|
|
596
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
639
597
|
|
|
640
598
|
### dontSeeInField
|
|
641
599
|
|
|
@@ -649,10 +607,9 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
649
607
|
|
|
650
608
|
#### Parameters
|
|
651
609
|
|
|
652
|
-
- `field` **([string][
|
|
653
|
-
- `value` **[string][
|
|
654
|
-
|
|
655
|
-
Returns **[Promise][10]<any>**
|
|
610
|
+
- `field` **([string][12] | [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
611
|
+
- `value` **[string][12]** value to check.
|
|
612
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
656
613
|
|
|
657
614
|
### dontSeeInSource
|
|
658
615
|
|
|
@@ -665,9 +622,8 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
665
622
|
#### Parameters
|
|
666
623
|
|
|
667
624
|
- `text`
|
|
668
|
-
- `value` **[string][
|
|
669
|
-
|
|
670
|
-
Returns **[Promise][10]<any>**
|
|
625
|
+
- `value` **[string][12]** to check.
|
|
626
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
671
627
|
|
|
672
628
|
### dontSeeInTitle
|
|
673
629
|
|
|
@@ -679,9 +635,8 @@ I.dontSeeInTitle('Error');
|
|
|
679
635
|
|
|
680
636
|
#### Parameters
|
|
681
637
|
|
|
682
|
-
- `text` **[string][
|
|
683
|
-
|
|
684
|
-
Returns **[Promise][10]<any>**
|
|
638
|
+
- `text` **[string][12]** value to check.
|
|
639
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
685
640
|
|
|
686
641
|
### doubleClick
|
|
687
642
|
|
|
@@ -697,10 +652,9 @@ I.doubleClick('.btn.edit');
|
|
|
697
652
|
|
|
698
653
|
#### Parameters
|
|
699
654
|
|
|
700
|
-
- `locator` **([string][
|
|
701
|
-
- `context` **([string][
|
|
702
|
-
|
|
703
|
-
Returns **[Promise][10]<any>**
|
|
655
|
+
- `locator` **([string][12] | [object][10])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
656
|
+
- `context` **([string][12]? | [object][10])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
657
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
704
658
|
|
|
705
659
|
### dragAndDrop
|
|
706
660
|
|
|
@@ -712,15 +666,14 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
712
666
|
|
|
713
667
|
#### Parameters
|
|
714
668
|
|
|
715
|
-
- `srcElement` **([string][
|
|
716
|
-
- `destElement` **([string][
|
|
717
|
-
|
|
669
|
+
- `srcElement` **([string][12] | [object][10])** located by CSS|XPath|strict locator.
|
|
670
|
+
- `destElement` **([string][12] | [object][10])** located by CSS|XPath|strict locator.
|
|
671
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
672
|
+
- `options` **any?** [Additional options][15] can be passed as 3rd argument.```js
|
|
718
673
|
// specify coordinates for source position
|
|
719
674
|
I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
|
|
720
675
|
```> By default option `force: true` is set
|
|
721
676
|
|
|
722
|
-
Returns **[Promise][10]<any>**
|
|
723
|
-
|
|
724
677
|
### dragSlider
|
|
725
678
|
|
|
726
679
|
Drag the scrubber of a slider to a given position
|
|
@@ -733,10 +686,9 @@ I.dragSlider('#slider', -70);
|
|
|
733
686
|
|
|
734
687
|
#### Parameters
|
|
735
688
|
|
|
736
|
-
- `locator` **([string][
|
|
737
|
-
- `offsetX` **[number][
|
|
738
|
-
|
|
739
|
-
Returns **[Promise][10]<any>**
|
|
689
|
+
- `locator` **([string][12] | [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
690
|
+
- `offsetX` **[number][16]** position to drag.
|
|
691
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
740
692
|
|
|
741
693
|
### executeScript
|
|
742
694
|
|
|
@@ -763,11 +715,9 @@ If a function returns a Promise it will wait for its resolution.
|
|
|
763
715
|
|
|
764
716
|
#### Parameters
|
|
765
717
|
|
|
766
|
-
- `fn` **([string][
|
|
718
|
+
- `fn` **([string][12] | [function][17])** function to be executed in browser context.
|
|
767
719
|
- `arg` **any?** optional argument to pass to the function
|
|
768
720
|
|
|
769
|
-
Returns **[Promise][10]<any>**
|
|
770
|
-
|
|
771
721
|
### fillField
|
|
772
722
|
|
|
773
723
|
Fills a text field or textarea, after clearing its value, with the given string.
|
|
@@ -786,10 +736,9 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
786
736
|
|
|
787
737
|
#### Parameters
|
|
788
738
|
|
|
789
|
-
- `field` **([string][
|
|
790
|
-
- `value` **([string][
|
|
791
|
-
|
|
792
|
-
Returns **[Promise][10]<any>**
|
|
739
|
+
- `field` **([string][12] | [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
740
|
+
- `value` **([string][12] | [object][10])** text value to fill.
|
|
741
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
793
742
|
|
|
794
743
|
### forceClick
|
|
795
744
|
|
|
@@ -820,10 +769,9 @@ I.forceClick({css: 'nav a.login'});
|
|
|
820
769
|
|
|
821
770
|
#### Parameters
|
|
822
771
|
|
|
823
|
-
- `locator` **([string][
|
|
824
|
-
- `context` **([string][
|
|
825
|
-
|
|
826
|
-
Returns **[Promise][10]<any>**
|
|
772
|
+
- `locator` **([string][12] | [object][10])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
773
|
+
- `context` **([string][12]? | [object][10])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
774
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
827
775
|
|
|
828
776
|
### grabAttributeFrom
|
|
829
777
|
|
|
@@ -837,10 +785,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
837
785
|
|
|
838
786
|
#### Parameters
|
|
839
787
|
|
|
840
|
-
- `locator` **([string][
|
|
841
|
-
- `attr` **[string][
|
|
788
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
789
|
+
- `attr` **[string][12]** attribute name.
|
|
842
790
|
|
|
843
|
-
Returns **[Promise][
|
|
791
|
+
Returns **[Promise][18]<[string][12]>** attribute value
|
|
844
792
|
|
|
845
793
|
### grabAttributeFromAll
|
|
846
794
|
|
|
@@ -853,10 +801,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
853
801
|
|
|
854
802
|
#### Parameters
|
|
855
803
|
|
|
856
|
-
- `locator` **([string][
|
|
857
|
-
- `attr` **[string][
|
|
804
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
805
|
+
- `attr` **[string][12]** attribute name.
|
|
858
806
|
|
|
859
|
-
Returns **[Promise][
|
|
807
|
+
Returns **[Promise][18]<[Array][19]<[string][12]>>** attribute value
|
|
860
808
|
|
|
861
809
|
### grabBrowserLogs
|
|
862
810
|
|
|
@@ -867,7 +815,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
867
815
|
console.log(JSON.stringify(logs))
|
|
868
816
|
```
|
|
869
817
|
|
|
870
|
-
Returns **[Promise][
|
|
818
|
+
Returns **[Promise][18]<[Array][19]<any>>**
|
|
871
819
|
|
|
872
820
|
### grabCookie
|
|
873
821
|
|
|
@@ -882,9 +830,9 @@ assert(cookie.value, '123456');
|
|
|
882
830
|
|
|
883
831
|
#### Parameters
|
|
884
832
|
|
|
885
|
-
- `name` **[string][
|
|
833
|
+
- `name` **[string][12]?** cookie name.
|
|
886
834
|
|
|
887
|
-
Returns **([Promise][
|
|
835
|
+
Returns **([Promise][18]<[string][12]> | [Promise][18]<[Array][19]<[string][12]>>)** attribute valueReturns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
888
836
|
|
|
889
837
|
### grabCssPropertyFrom
|
|
890
838
|
|
|
@@ -898,10 +846,10 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
898
846
|
|
|
899
847
|
#### Parameters
|
|
900
848
|
|
|
901
|
-
- `locator` **([string][
|
|
902
|
-
- `cssProperty` **[string][
|
|
849
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
850
|
+
- `cssProperty` **[string][12]** CSS property name.
|
|
903
851
|
|
|
904
|
-
Returns **[Promise][
|
|
852
|
+
Returns **[Promise][18]<[string][12]>** CSS value
|
|
905
853
|
|
|
906
854
|
### grabCssPropertyFromAll
|
|
907
855
|
|
|
@@ -914,10 +862,10 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
914
862
|
|
|
915
863
|
#### Parameters
|
|
916
864
|
|
|
917
|
-
- `locator` **([string][
|
|
918
|
-
- `cssProperty` **[string][
|
|
865
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
866
|
+
- `cssProperty` **[string][12]** CSS property name.
|
|
919
867
|
|
|
920
|
-
Returns **[Promise][
|
|
868
|
+
Returns **[Promise][18]<[Array][19]<[string][12]>>** CSS value
|
|
921
869
|
|
|
922
870
|
### grabCurrentUrl
|
|
923
871
|
|
|
@@ -929,7 +877,7 @@ let url = await I.grabCurrentUrl();
|
|
|
929
877
|
console.log(`Current URL is [${url}]`);
|
|
930
878
|
```
|
|
931
879
|
|
|
932
|
-
Returns **[Promise][
|
|
880
|
+
Returns **[Promise][18]<[string][12]>** current URL
|
|
933
881
|
|
|
934
882
|
### grabDataFromPerformanceTiming
|
|
935
883
|
|
|
@@ -954,7 +902,7 @@ let data = await I.grabDataFromPerformanceTiming();
|
|
|
954
902
|
}
|
|
955
903
|
```
|
|
956
904
|
|
|
957
|
-
Returns **[Promise][
|
|
905
|
+
Returns **[Promise][18]<any>** automatically synchronized promise through #recorder
|
|
958
906
|
|
|
959
907
|
### grabElementBoundingRect
|
|
960
908
|
|
|
@@ -978,11 +926,11 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
978
926
|
|
|
979
927
|
#### Parameters
|
|
980
928
|
|
|
981
|
-
- `locator` **([string][
|
|
929
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
982
930
|
- `prop`
|
|
983
|
-
- `elementSize` **[string][
|
|
931
|
+
- `elementSize` **[string][12]?** x, y, width or height of the given element.
|
|
984
932
|
|
|
985
|
-
Returns **([Promise][
|
|
933
|
+
Returns **([Promise][18]<DOMRect> | [Promise][18]<[number][16]>)** Element bounding rectangle
|
|
986
934
|
|
|
987
935
|
### grabHTMLFrom
|
|
988
936
|
|
|
@@ -997,9 +945,9 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
997
945
|
#### Parameters
|
|
998
946
|
|
|
999
947
|
- `locator`
|
|
1000
|
-
- `element` **([string][
|
|
948
|
+
- `element` **([string][12] | [object][10])** located by CSS|XPath|strict locator.
|
|
1001
949
|
|
|
1002
|
-
Returns **[Promise][
|
|
950
|
+
Returns **[Promise][18]<[string][12]>** HTML code for an element
|
|
1003
951
|
|
|
1004
952
|
### grabHTMLFromAll
|
|
1005
953
|
|
|
@@ -1013,9 +961,9 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1013
961
|
#### Parameters
|
|
1014
962
|
|
|
1015
963
|
- `locator`
|
|
1016
|
-
- `element` **([string][
|
|
964
|
+
- `element` **([string][12] | [object][10])** located by CSS|XPath|strict locator.
|
|
1017
965
|
|
|
1018
|
-
Returns **[Promise][
|
|
966
|
+
Returns **[Promise][18]<[Array][19]<[string][12]>>** HTML code for an element
|
|
1019
967
|
|
|
1020
968
|
### grabNumberOfOpenTabs
|
|
1021
969
|
|
|
@@ -1026,7 +974,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1026
974
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1027
975
|
```
|
|
1028
976
|
|
|
1029
|
-
Returns **[Promise][
|
|
977
|
+
Returns **[Promise][18]<[number][16]>** number of open tabs
|
|
1030
978
|
|
|
1031
979
|
### grabNumberOfVisibleElements
|
|
1032
980
|
|
|
@@ -1039,9 +987,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1039
987
|
|
|
1040
988
|
#### Parameters
|
|
1041
989
|
|
|
1042
|
-
- `locator` **([string][
|
|
990
|
+
- `locator` **([string][12] | [object][10])** located by CSS|XPath|strict locator.
|
|
1043
991
|
|
|
1044
|
-
Returns **[Promise][
|
|
992
|
+
Returns **[Promise][18]<[number][16]>** number of visible elements
|
|
1045
993
|
|
|
1046
994
|
### grabPageScrollPosition
|
|
1047
995
|
|
|
@@ -1052,7 +1000,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1052
1000
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1053
1001
|
```
|
|
1054
1002
|
|
|
1055
|
-
Returns **[Promise][
|
|
1003
|
+
Returns **[Promise][18]<PageScrollPosition>** scroll position
|
|
1056
1004
|
|
|
1057
1005
|
### grabPopupText
|
|
1058
1006
|
|
|
@@ -1062,7 +1010,7 @@ Grab the text within the popup. If no popup is visible then it will return null
|
|
|
1062
1010
|
await I.grabPopupText();
|
|
1063
1011
|
```
|
|
1064
1012
|
|
|
1065
|
-
Returns **[Promise][
|
|
1013
|
+
Returns **[Promise][18]<([string][12] | null)>**
|
|
1066
1014
|
|
|
1067
1015
|
### grabSource
|
|
1068
1016
|
|
|
@@ -1073,7 +1021,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1073
1021
|
let pageSource = await I.grabSource();
|
|
1074
1022
|
```
|
|
1075
1023
|
|
|
1076
|
-
Returns **[Promise][
|
|
1024
|
+
Returns **[Promise][18]<[string][12]>** source code
|
|
1077
1025
|
|
|
1078
1026
|
### grabTextFrom
|
|
1079
1027
|
|
|
@@ -1088,9 +1036,9 @@ If multiple elements found returns first element.
|
|
|
1088
1036
|
|
|
1089
1037
|
#### Parameters
|
|
1090
1038
|
|
|
1091
|
-
- `locator` **([string][
|
|
1039
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1092
1040
|
|
|
1093
|
-
Returns **[Promise][
|
|
1041
|
+
Returns **[Promise][18]<[string][12]>** attribute value
|
|
1094
1042
|
|
|
1095
1043
|
### grabTextFromAll
|
|
1096
1044
|
|
|
@@ -1103,9 +1051,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1103
1051
|
|
|
1104
1052
|
#### Parameters
|
|
1105
1053
|
|
|
1106
|
-
- `locator` **([string][
|
|
1054
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1107
1055
|
|
|
1108
|
-
Returns **[Promise][
|
|
1056
|
+
Returns **[Promise][18]<[Array][19]<[string][12]>>** attribute value
|
|
1109
1057
|
|
|
1110
1058
|
### grabTitle
|
|
1111
1059
|
|
|
@@ -1116,7 +1064,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1116
1064
|
let title = await I.grabTitle();
|
|
1117
1065
|
```
|
|
1118
1066
|
|
|
1119
|
-
Returns **[Promise][
|
|
1067
|
+
Returns **[Promise][18]<[string][12]>** title
|
|
1120
1068
|
|
|
1121
1069
|
### grabValueFrom
|
|
1122
1070
|
|
|
@@ -1130,9 +1078,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1130
1078
|
|
|
1131
1079
|
#### Parameters
|
|
1132
1080
|
|
|
1133
|
-
- `locator` **([string][
|
|
1081
|
+
- `locator` **([string][12] | [object][10])** field located by label|name|CSS|XPath|strict locator.
|
|
1134
1082
|
|
|
1135
|
-
Returns **[Promise][
|
|
1083
|
+
Returns **[Promise][18]<[string][12]>** attribute value
|
|
1136
1084
|
|
|
1137
1085
|
### grabValueFromAll
|
|
1138
1086
|
|
|
@@ -1145,9 +1093,9 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1145
1093
|
|
|
1146
1094
|
#### Parameters
|
|
1147
1095
|
|
|
1148
|
-
- `locator` **([string][
|
|
1096
|
+
- `locator` **([string][12] | [object][10])** field located by label|name|CSS|XPath|strict locator.
|
|
1149
1097
|
|
|
1150
|
-
Returns **[Promise][
|
|
1098
|
+
Returns **[Promise][18]<[Array][19]<[string][12]>>** attribute value
|
|
1151
1099
|
|
|
1152
1100
|
### handleDownloads
|
|
1153
1101
|
|
|
@@ -1165,9 +1113,9 @@ I.waitForFile('downloads/avatar.jpg', 5);
|
|
|
1165
1113
|
|
|
1166
1114
|
#### Parameters
|
|
1167
1115
|
|
|
1168
|
-
- `fileName` **[string][
|
|
1116
|
+
- `fileName` **[string][12]?** set filename for downloaded file
|
|
1169
1117
|
|
|
1170
|
-
Returns **[Promise][
|
|
1118
|
+
Returns **[Promise][18]<void>**
|
|
1171
1119
|
|
|
1172
1120
|
### haveRequestHeaders
|
|
1173
1121
|
|
|
@@ -1181,9 +1129,7 @@ I.haveRequestHeaders({
|
|
|
1181
1129
|
|
|
1182
1130
|
#### Parameters
|
|
1183
1131
|
|
|
1184
|
-
- `customHeaders` **[object][
|
|
1185
|
-
|
|
1186
|
-
Returns **[Promise][10]<any>**
|
|
1132
|
+
- `customHeaders` **[object][10]** headers to set
|
|
1187
1133
|
|
|
1188
1134
|
### makeApiRequest
|
|
1189
1135
|
|
|
@@ -1200,11 +1146,11 @@ I.makeApiRequest('PATCH', )
|
|
|
1200
1146
|
|
|
1201
1147
|
#### Parameters
|
|
1202
1148
|
|
|
1203
|
-
- `method` **[string][
|
|
1204
|
-
- `url` **[string][
|
|
1205
|
-
- `options` **[object][
|
|
1149
|
+
- `method` **[string][12]** HTTP method
|
|
1150
|
+
- `url` **[string][12]** endpoint
|
|
1151
|
+
- `options` **[object][10]** request options depending on method used
|
|
1206
1152
|
|
|
1207
|
-
Returns **[Promise][
|
|
1153
|
+
Returns **[Promise][18]<[object][10]>** response
|
|
1208
1154
|
|
|
1209
1155
|
### mockRoute
|
|
1210
1156
|
|
|
@@ -1218,10 +1164,8 @@ This method allows intercepting and mocking requests & responses. [Learn more ab
|
|
|
1218
1164
|
|
|
1219
1165
|
#### Parameters
|
|
1220
1166
|
|
|
1221
|
-
- `url` **([string][
|
|
1222
|
-
- `handler` **[function][
|
|
1223
|
-
|
|
1224
|
-
Returns **[Promise][10]<any>**
|
|
1167
|
+
- `url` **([string][12] | [RegExp][24])?** URL, regex or pattern for to match URL
|
|
1168
|
+
- `handler` **[function][17]?** a function to process reques
|
|
1225
1169
|
|
|
1226
1170
|
### moveCursorTo
|
|
1227
1171
|
|
|
@@ -1235,11 +1179,10 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1235
1179
|
|
|
1236
1180
|
#### Parameters
|
|
1237
1181
|
|
|
1238
|
-
- `locator` **([string][
|
|
1239
|
-
- `offsetX` **[number][
|
|
1240
|
-
- `offsetY` **[number][
|
|
1241
|
-
|
|
1242
|
-
Returns **[Promise][10]<any>**
|
|
1182
|
+
- `locator` **([string][12] | [object][10])** located by CSS|XPath|strict locator.
|
|
1183
|
+
- `offsetX` **[number][16]** (optional, `0` by default) X-axis offset.
|
|
1184
|
+
- `offsetY` **[number][16]** (optional, `0` by default) Y-axis offset.
|
|
1185
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1243
1186
|
|
|
1244
1187
|
### openNewTab
|
|
1245
1188
|
|
|
@@ -1260,8 +1203,6 @@ I.openNewTab({ isMobile: true });
|
|
|
1260
1203
|
|
|
1261
1204
|
- `options`
|
|
1262
1205
|
|
|
1263
|
-
Returns **[Promise][10]<any>**
|
|
1264
|
-
|
|
1265
1206
|
### pressKey
|
|
1266
1207
|
|
|
1267
1208
|
Presses a key in the browser (on a focused element).
|
|
@@ -1325,9 +1266,8 @@ Some of the supported key names are:
|
|
|
1325
1266
|
|
|
1326
1267
|
#### Parameters
|
|
1327
1268
|
|
|
1328
|
-
- `key` **([string][
|
|
1329
|
-
|
|
1330
|
-
Returns **[Promise][10]<any>** _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313][27]).
|
|
1269
|
+
- `key` **([string][12] | [Array][19]<[string][12]>)** key or array of keys to press.
|
|
1270
|
+
[!] returns a _promise_ which is synchronized internally by recorder_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313][27]).
|
|
1331
1271
|
|
|
1332
1272
|
### pressKeyDown
|
|
1333
1273
|
|
|
@@ -1343,9 +1283,8 @@ I.pressKeyUp('Control');
|
|
|
1343
1283
|
|
|
1344
1284
|
#### Parameters
|
|
1345
1285
|
|
|
1346
|
-
- `key` **[string][
|
|
1347
|
-
|
|
1348
|
-
Returns **[Promise][10]<any>**
|
|
1286
|
+
- `key` **[string][12]** name of key to press down.
|
|
1287
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1349
1288
|
|
|
1350
1289
|
### pressKeyUp
|
|
1351
1290
|
|
|
@@ -1361,9 +1300,8 @@ I.pressKeyUp('Control');
|
|
|
1361
1300
|
|
|
1362
1301
|
#### Parameters
|
|
1363
1302
|
|
|
1364
|
-
- `key` **[string][
|
|
1365
|
-
|
|
1366
|
-
Returns **[Promise][10]<any>**
|
|
1303
|
+
- `key` **[string][12]** name of key to release.
|
|
1304
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1367
1305
|
|
|
1368
1306
|
### refreshPage
|
|
1369
1307
|
|
|
@@ -1373,7 +1311,7 @@ Reload the current page.
|
|
|
1373
1311
|
I.refreshPage();
|
|
1374
1312
|
```
|
|
1375
1313
|
|
|
1376
|
-
|
|
1314
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1377
1315
|
|
|
1378
1316
|
### resizeWindow
|
|
1379
1317
|
|
|
@@ -1382,16 +1320,15 @@ First parameter can be set to `maximize`.
|
|
|
1382
1320
|
|
|
1383
1321
|
#### Parameters
|
|
1384
1322
|
|
|
1385
|
-
- `width` **[number][
|
|
1386
|
-
- `height` **[number][
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
//
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
```
|
|
1323
|
+
- `width` **[number][16]** width in pixels or `maximize`.
|
|
1324
|
+
- `height` **[number][16]** height in pixels.
|
|
1325
|
+
[!] returns a _promise_ which is synchronized internally by recorderUnlike other drivers Playwright changes the size of a viewport, not the window!
|
|
1326
|
+
Playwright does not control the window of a browser so it can't adjust its real size.
|
|
1327
|
+
It also can't maximize a window.Update configuration to change real window size on start:```js
|
|
1328
|
+
// inside codecept.conf.js
|
|
1329
|
+
// @codeceptjs/configure package must be installed
|
|
1330
|
+
{ setWindowSize } = require('@codeceptjs/configure');
|
|
1331
|
+
```
|
|
1395
1332
|
|
|
1396
1333
|
### rightClick
|
|
1397
1334
|
|
|
@@ -1408,10 +1345,9 @@ I.rightClick('Click me', '.context');
|
|
|
1408
1345
|
|
|
1409
1346
|
#### Parameters
|
|
1410
1347
|
|
|
1411
|
-
- `locator` **([string][
|
|
1412
|
-
- `context` **([string][
|
|
1413
|
-
|
|
1414
|
-
Returns **[Promise][10]<any>**
|
|
1348
|
+
- `locator` **([string][12] | [object][10])** clickable element located by CSS|XPath|strict locator.
|
|
1349
|
+
- `context` **([string][12]? | [object][10])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1350
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1415
1351
|
|
|
1416
1352
|
### saveElementScreenshot
|
|
1417
1353
|
|
|
@@ -1424,10 +1360,9 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1424
1360
|
|
|
1425
1361
|
#### Parameters
|
|
1426
1362
|
|
|
1427
|
-
- `locator` **([string][
|
|
1428
|
-
- `fileName` **[string][
|
|
1429
|
-
|
|
1430
|
-
Returns **[Promise][10]<any>**
|
|
1363
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1364
|
+
- `fileName` **[string][12]** file name to save.
|
|
1365
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1431
1366
|
|
|
1432
1367
|
### saveScreenshot
|
|
1433
1368
|
|
|
@@ -1442,10 +1377,9 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1442
1377
|
|
|
1443
1378
|
#### Parameters
|
|
1444
1379
|
|
|
1445
|
-
- `fileName` **[string][
|
|
1446
|
-
- `fullPage` **[boolean][29]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1447
|
-
|
|
1448
|
-
Returns **[Promise][10]<any>**
|
|
1380
|
+
- `fileName` **[string][12]** file name to save.
|
|
1381
|
+
- `fullPage` **[boolean][29]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1382
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1449
1383
|
|
|
1450
1384
|
### scrollPageToBottom
|
|
1451
1385
|
|
|
@@ -1455,7 +1389,7 @@ Scroll page to the bottom.
|
|
|
1455
1389
|
I.scrollPageToBottom();
|
|
1456
1390
|
```
|
|
1457
1391
|
|
|
1458
|
-
|
|
1392
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1459
1393
|
|
|
1460
1394
|
### scrollPageToTop
|
|
1461
1395
|
|
|
@@ -1465,7 +1399,7 @@ Scroll page to the top.
|
|
|
1465
1399
|
I.scrollPageToTop();
|
|
1466
1400
|
```
|
|
1467
1401
|
|
|
1468
|
-
|
|
1402
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1469
1403
|
|
|
1470
1404
|
### scrollTo
|
|
1471
1405
|
|
|
@@ -1479,11 +1413,10 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1479
1413
|
|
|
1480
1414
|
#### Parameters
|
|
1481
1415
|
|
|
1482
|
-
- `locator` **([string][
|
|
1483
|
-
- `offsetX` **[number][
|
|
1484
|
-
- `offsetY` **[number][
|
|
1485
|
-
|
|
1486
|
-
Returns **[Promise][10]<any>**
|
|
1416
|
+
- `locator` **([string][12] | [object][10])** located by CSS|XPath|strict locator.
|
|
1417
|
+
- `offsetX` **[number][16]** (optional, `0` by default) X-axis offset.
|
|
1418
|
+
- `offsetY` **[number][16]** (optional, `0` by default) Y-axis offset.
|
|
1419
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1487
1420
|
|
|
1488
1421
|
### see
|
|
1489
1422
|
|
|
@@ -1498,10 +1431,9 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1498
1431
|
|
|
1499
1432
|
#### Parameters
|
|
1500
1433
|
|
|
1501
|
-
- `text` **[string][
|
|
1502
|
-
- `context` **([string][
|
|
1503
|
-
|
|
1504
|
-
Returns **[Promise][10]<any>**
|
|
1434
|
+
- `text` **[string][12]** expected on page.
|
|
1435
|
+
- `context` **([string][12]? | [object][10])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1436
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1505
1437
|
|
|
1506
1438
|
### seeAttributesOnElements
|
|
1507
1439
|
|
|
@@ -1513,10 +1445,9 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1513
1445
|
|
|
1514
1446
|
#### Parameters
|
|
1515
1447
|
|
|
1516
|
-
- `locator` **([string][
|
|
1517
|
-
- `attributes` **[object][
|
|
1518
|
-
|
|
1519
|
-
Returns **[Promise][10]<any>**
|
|
1448
|
+
- `locator` **([string][12] | [object][10])** located by CSS|XPath|strict locator.
|
|
1449
|
+
- `attributes` **[object][10]** attributes and their values to check.
|
|
1450
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1520
1451
|
|
|
1521
1452
|
### seeCheckboxIsChecked
|
|
1522
1453
|
|
|
@@ -1530,9 +1461,8 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1530
1461
|
|
|
1531
1462
|
#### Parameters
|
|
1532
1463
|
|
|
1533
|
-
- `field` **([string][
|
|
1534
|
-
|
|
1535
|
-
Returns **[Promise][10]<any>**
|
|
1464
|
+
- `field` **([string][12] | [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
1465
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1536
1466
|
|
|
1537
1467
|
### seeCookie
|
|
1538
1468
|
|
|
@@ -1544,9 +1474,8 @@ I.seeCookie('Auth');
|
|
|
1544
1474
|
|
|
1545
1475
|
#### Parameters
|
|
1546
1476
|
|
|
1547
|
-
- `name` **[string][
|
|
1548
|
-
|
|
1549
|
-
Returns **[Promise][10]<any>**
|
|
1477
|
+
- `name` **[string][12]** cookie name.
|
|
1478
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1550
1479
|
|
|
1551
1480
|
### seeCssPropertiesOnElements
|
|
1552
1481
|
|
|
@@ -1558,10 +1487,9 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1558
1487
|
|
|
1559
1488
|
#### Parameters
|
|
1560
1489
|
|
|
1561
|
-
- `locator` **([string][
|
|
1562
|
-
- `cssProperties` **[object][
|
|
1563
|
-
|
|
1564
|
-
Returns **[Promise][10]<any>**
|
|
1490
|
+
- `locator` **([string][12] | [object][10])** located by CSS|XPath|strict locator.
|
|
1491
|
+
- `cssProperties` **[object][10]** object with CSS properties and their values to check.
|
|
1492
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1565
1493
|
|
|
1566
1494
|
### seeCurrentUrlEquals
|
|
1567
1495
|
|
|
@@ -1576,9 +1504,8 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1576
1504
|
|
|
1577
1505
|
#### Parameters
|
|
1578
1506
|
|
|
1579
|
-
- `url` **[string][
|
|
1580
|
-
|
|
1581
|
-
Returns **[Promise][10]<any>**
|
|
1507
|
+
- `url` **[string][12]** value to check.
|
|
1508
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1582
1509
|
|
|
1583
1510
|
### seeElement
|
|
1584
1511
|
|
|
@@ -1591,9 +1518,8 @@ I.seeElement('#modal');
|
|
|
1591
1518
|
|
|
1592
1519
|
#### Parameters
|
|
1593
1520
|
|
|
1594
|
-
- `locator` **([string][
|
|
1595
|
-
|
|
1596
|
-
Returns **[Promise][10]<any>**
|
|
1521
|
+
- `locator` **([string][12] | [object][10])** located by CSS|XPath|strict locator.
|
|
1522
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1597
1523
|
|
|
1598
1524
|
### seeElementInDOM
|
|
1599
1525
|
|
|
@@ -1606,9 +1532,8 @@ I.seeElementInDOM('#modal');
|
|
|
1606
1532
|
|
|
1607
1533
|
#### Parameters
|
|
1608
1534
|
|
|
1609
|
-
- `locator` **([string][
|
|
1610
|
-
|
|
1611
|
-
Returns **[Promise][10]<any>**
|
|
1535
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1536
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1612
1537
|
|
|
1613
1538
|
### seeInCurrentUrl
|
|
1614
1539
|
|
|
@@ -1620,9 +1545,8 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1620
1545
|
|
|
1621
1546
|
#### Parameters
|
|
1622
1547
|
|
|
1623
|
-
- `url` **[string][
|
|
1624
|
-
|
|
1625
|
-
Returns **[Promise][10]<any>**
|
|
1548
|
+
- `url` **[string][12]** a fragment to check
|
|
1549
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1626
1550
|
|
|
1627
1551
|
### seeInField
|
|
1628
1552
|
|
|
@@ -1638,10 +1562,9 @@ I.seeInField('#searchform input','Search');
|
|
|
1638
1562
|
|
|
1639
1563
|
#### Parameters
|
|
1640
1564
|
|
|
1641
|
-
- `field` **([string][
|
|
1642
|
-
- `value` **[string][
|
|
1643
|
-
|
|
1644
|
-
Returns **[Promise][10]<any>**
|
|
1565
|
+
- `field` **([string][12] | [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
1566
|
+
- `value` **[string][12]** value to check.
|
|
1567
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1645
1568
|
|
|
1646
1569
|
### seeInPopup
|
|
1647
1570
|
|
|
@@ -1654,9 +1577,8 @@ I.seeInPopup('Popup text');
|
|
|
1654
1577
|
|
|
1655
1578
|
#### Parameters
|
|
1656
1579
|
|
|
1657
|
-
- `text` **[string][
|
|
1658
|
-
|
|
1659
|
-
Returns **[Promise][10]<any>**
|
|
1580
|
+
- `text` **[string][12]** value to check.
|
|
1581
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1660
1582
|
|
|
1661
1583
|
### seeInSource
|
|
1662
1584
|
|
|
@@ -1668,9 +1590,8 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1668
1590
|
|
|
1669
1591
|
#### Parameters
|
|
1670
1592
|
|
|
1671
|
-
- `text` **[string][
|
|
1672
|
-
|
|
1673
|
-
Returns **[Promise][10]<any>**
|
|
1593
|
+
- `text` **[string][12]** value to check.
|
|
1594
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1674
1595
|
|
|
1675
1596
|
### seeInTitle
|
|
1676
1597
|
|
|
@@ -1682,9 +1603,8 @@ I.seeInTitle('Home Page');
|
|
|
1682
1603
|
|
|
1683
1604
|
#### Parameters
|
|
1684
1605
|
|
|
1685
|
-
- `text` **[string][
|
|
1686
|
-
|
|
1687
|
-
Returns **[Promise][10]<any>**
|
|
1606
|
+
- `text` **[string][12]** text value to check.
|
|
1607
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1688
1608
|
|
|
1689
1609
|
### seeNumberOfElements
|
|
1690
1610
|
|
|
@@ -1697,10 +1617,9 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1697
1617
|
|
|
1698
1618
|
#### Parameters
|
|
1699
1619
|
|
|
1700
|
-
- `locator` **([string][
|
|
1701
|
-
- `num` **[number][
|
|
1702
|
-
|
|
1703
|
-
Returns **[Promise][10]<any>**
|
|
1620
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1621
|
+
- `num` **[number][16]** number of elements.
|
|
1622
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1704
1623
|
|
|
1705
1624
|
### seeNumberOfVisibleElements
|
|
1706
1625
|
|
|
@@ -1713,10 +1632,9 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1713
1632
|
|
|
1714
1633
|
#### Parameters
|
|
1715
1634
|
|
|
1716
|
-
- `locator` **([string][
|
|
1717
|
-
- `num` **[number][
|
|
1718
|
-
|
|
1719
|
-
Returns **[Promise][10]<any>**
|
|
1635
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1636
|
+
- `num` **[number][16]** number of elements.
|
|
1637
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1720
1638
|
|
|
1721
1639
|
### seeTextEquals
|
|
1722
1640
|
|
|
@@ -1728,10 +1646,9 @@ I.seeTextEquals('text', 'h1');
|
|
|
1728
1646
|
|
|
1729
1647
|
#### Parameters
|
|
1730
1648
|
|
|
1731
|
-
- `text` **[string][
|
|
1732
|
-
- `context` **([string][
|
|
1733
|
-
|
|
1734
|
-
Returns **[Promise][10]<any>**
|
|
1649
|
+
- `text` **[string][12]** element value to check.
|
|
1650
|
+
- `context` **([string][12] | [object][10])?** element located by CSS|XPath|strict locator.
|
|
1651
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1735
1652
|
|
|
1736
1653
|
### seeTitleEquals
|
|
1737
1654
|
|
|
@@ -1743,9 +1660,8 @@ I.seeTitleEquals('Test title.');
|
|
|
1743
1660
|
|
|
1744
1661
|
#### Parameters
|
|
1745
1662
|
|
|
1746
|
-
- `text` **[string][
|
|
1747
|
-
|
|
1748
|
-
Returns **[Promise][10]<any>**
|
|
1663
|
+
- `text` **[string][12]** value to check.
|
|
1664
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1749
1665
|
|
|
1750
1666
|
### selectOption
|
|
1751
1667
|
|
|
@@ -1770,10 +1686,9 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1770
1686
|
|
|
1771
1687
|
#### Parameters
|
|
1772
1688
|
|
|
1773
|
-
- `select` **([string][
|
|
1774
|
-
- `option` **([string][
|
|
1775
|
-
|
|
1776
|
-
Returns **[Promise][10]<any>**
|
|
1689
|
+
- `select` **([string][12] | [object][10])** field located by label|name|CSS|XPath|strict locator.
|
|
1690
|
+
- `option` **([string][12] | [Array][19]<any>)** visible text or value of option.
|
|
1691
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1777
1692
|
|
|
1778
1693
|
### setCookie
|
|
1779
1694
|
|
|
@@ -1794,8 +1709,7 @@ I.setCookie([
|
|
|
1794
1709
|
#### Parameters
|
|
1795
1710
|
|
|
1796
1711
|
- `cookie` **(Cookie | [Array][19]<Cookie>)** a cookie object or array of cookie objects.
|
|
1797
|
-
|
|
1798
|
-
Returns **[Promise][10]<any>**
|
|
1712
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1799
1713
|
|
|
1800
1714
|
### stopMockingRoute
|
|
1801
1715
|
|
|
@@ -1810,10 +1724,8 @@ If no handler is passed, all mock requests for the rote are disabled.
|
|
|
1810
1724
|
|
|
1811
1725
|
#### Parameters
|
|
1812
1726
|
|
|
1813
|
-
- `url` **([string][
|
|
1814
|
-
- `handler` **[function][
|
|
1815
|
-
|
|
1816
|
-
Returns **[Promise][10]<any>**
|
|
1727
|
+
- `url` **([string][12] | [RegExp][24])?** URL, regex or pattern for to match URL
|
|
1728
|
+
- `handler` **[function][17]?** a function to process reques
|
|
1817
1729
|
|
|
1818
1730
|
### switchTo
|
|
1819
1731
|
|
|
@@ -1826,9 +1738,8 @@ I.switchTo(); // switch back to main page
|
|
|
1826
1738
|
|
|
1827
1739
|
#### Parameters
|
|
1828
1740
|
|
|
1829
|
-
- `locator` **([string][
|
|
1830
|
-
|
|
1831
|
-
Returns **[Promise][10]<any>**
|
|
1741
|
+
- `locator` **([string][12]? | [object][10])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1742
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1832
1743
|
|
|
1833
1744
|
### switchToNextTab
|
|
1834
1745
|
|
|
@@ -1841,9 +1752,7 @@ I.switchToNextTab(2);
|
|
|
1841
1752
|
|
|
1842
1753
|
#### Parameters
|
|
1843
1754
|
|
|
1844
|
-
- `num` **[number][
|
|
1845
|
-
|
|
1846
|
-
Returns **[Promise][10]<any>**
|
|
1755
|
+
- `num` **[number][16]**
|
|
1847
1756
|
|
|
1848
1757
|
### switchToPreviousTab
|
|
1849
1758
|
|
|
@@ -1856,9 +1765,7 @@ I.switchToPreviousTab(2);
|
|
|
1856
1765
|
|
|
1857
1766
|
#### Parameters
|
|
1858
1767
|
|
|
1859
|
-
- `num` **[number][
|
|
1860
|
-
|
|
1861
|
-
Returns **[Promise][10]<any>**
|
|
1768
|
+
- `num` **[number][16]**
|
|
1862
1769
|
|
|
1863
1770
|
### type
|
|
1864
1771
|
|
|
@@ -1880,10 +1787,9 @@ I.type(['T', 'E', 'X', 'T']);
|
|
|
1880
1787
|
#### Parameters
|
|
1881
1788
|
|
|
1882
1789
|
- `keys`
|
|
1883
|
-
- `delay` **[number][
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
Returns **[Promise][10]<any>**
|
|
1790
|
+
- `delay` **[number][16]?** (optional) delay in ms between key presses
|
|
1791
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1792
|
+
- `key` **([string][12] | [Array][19]<[string][12]>)** or array of keys to type.
|
|
1887
1793
|
|
|
1888
1794
|
### uncheckOption
|
|
1889
1795
|
|
|
@@ -1900,15 +1806,14 @@ I.uncheckOption('agree', '//form');
|
|
|
1900
1806
|
|
|
1901
1807
|
#### Parameters
|
|
1902
1808
|
|
|
1903
|
-
- `field` **([string][
|
|
1904
|
-
- `context` **([string][
|
|
1809
|
+
- `field` **([string][12] | [object][10])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1810
|
+
- `context` **([string][12]? | [object][10])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1811
|
+
[!] returns a _promise_ which is synchronized internally by recorder[Additional options][30] for uncheck available as 3rd argument.Examples:```js
|
|
1812
|
+
// click on element at position
|
|
1813
|
+
I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
1814
|
+
```> ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
1905
1815
|
- `options`
|
|
1906
1816
|
|
|
1907
|
-
Returns **[Promise][10]<any>** [Additional options][30] for uncheck available as 3rd argument.Examples:```js
|
|
1908
|
-
// click on element at position
|
|
1909
|
-
I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
1910
|
-
```> ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
1911
|
-
|
|
1912
1817
|
### usePlaywrightTo
|
|
1913
1818
|
|
|
1914
1819
|
Use Playwright API inside a test.
|
|
@@ -1926,10 +1831,8 @@ I.usePlaywrightTo('emulate offline mode', async ({ browserContext }) => {
|
|
|
1926
1831
|
|
|
1927
1832
|
#### Parameters
|
|
1928
1833
|
|
|
1929
|
-
- `description` **[string][
|
|
1930
|
-
- `fn` **[function][
|
|
1931
|
-
|
|
1932
|
-
Returns **[Promise][10]<any>**
|
|
1834
|
+
- `description` **[string][12]** used to show in logs.
|
|
1835
|
+
- `fn` **[function][17]** async function that executed with Playwright helper as argumen
|
|
1933
1836
|
|
|
1934
1837
|
### wait
|
|
1935
1838
|
|
|
@@ -1941,9 +1844,8 @@ I.wait(2); // wait 2 secs
|
|
|
1941
1844
|
|
|
1942
1845
|
#### Parameters
|
|
1943
1846
|
|
|
1944
|
-
- `sec` **[number][
|
|
1945
|
-
|
|
1946
|
-
Returns **[Promise][10]<any>**
|
|
1847
|
+
- `sec` **[number][16]** number of second to wait.
|
|
1848
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1947
1849
|
|
|
1948
1850
|
### waitForClickable
|
|
1949
1851
|
|
|
@@ -1957,11 +1859,10 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
1957
1859
|
|
|
1958
1860
|
#### Parameters
|
|
1959
1861
|
|
|
1960
|
-
- `locator` **([string][
|
|
1862
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1961
1863
|
- `waitTimeout`
|
|
1962
|
-
- `sec` **[number][
|
|
1963
|
-
|
|
1964
|
-
Returns **[Promise][10]<any>**
|
|
1864
|
+
- `sec` **[number][16]?** (optional, `1` by default) time in seconds to wait
|
|
1865
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1965
1866
|
|
|
1966
1867
|
### waitForDetached
|
|
1967
1868
|
|
|
@@ -1974,10 +1875,9 @@ I.waitForDetached('#popup');
|
|
|
1974
1875
|
|
|
1975
1876
|
#### Parameters
|
|
1976
1877
|
|
|
1977
|
-
- `locator` **([string][
|
|
1978
|
-
- `sec` **[number][
|
|
1979
|
-
|
|
1980
|
-
Returns **[Promise][10]<any>**
|
|
1878
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1879
|
+
- `sec` **[number][16]** (optional, `1` by default) time in seconds to wait
|
|
1880
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1981
1881
|
|
|
1982
1882
|
### waitForElement
|
|
1983
1883
|
|
|
@@ -1991,10 +1891,9 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1991
1891
|
|
|
1992
1892
|
#### Parameters
|
|
1993
1893
|
|
|
1994
|
-
- `locator` **([string][
|
|
1995
|
-
- `sec` **[number][
|
|
1996
|
-
|
|
1997
|
-
Returns **[Promise][10]<any>**
|
|
1894
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1895
|
+
- `sec` **[number][16]?** (optional, `1` by default) time in seconds to wait
|
|
1896
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1998
1897
|
|
|
1999
1898
|
### waitForEnabled
|
|
2000
1899
|
|
|
@@ -2003,10 +1902,9 @@ Element can be located by CSS or XPath.
|
|
|
2003
1902
|
|
|
2004
1903
|
#### Parameters
|
|
2005
1904
|
|
|
2006
|
-
- `locator` **([string][
|
|
2007
|
-
- `sec` **[number][
|
|
2008
|
-
|
|
2009
|
-
Returns **[Promise][10]<any>**
|
|
1905
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1906
|
+
- `sec` **[number][16]** (optional) time in seconds to wait, 1 by default.
|
|
1907
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2010
1908
|
|
|
2011
1909
|
### waitForFunction
|
|
2012
1910
|
|
|
@@ -2025,11 +1923,10 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
2025
1923
|
|
|
2026
1924
|
#### Parameters
|
|
2027
1925
|
|
|
2028
|
-
- `fn` **([string][
|
|
2029
|
-
- `argsOrSec` **([Array][19]<any> | [number][
|
|
2030
|
-
- `sec` **[number][
|
|
2031
|
-
|
|
2032
|
-
Returns **[Promise][10]<any>**
|
|
1926
|
+
- `fn` **([string][12] | [function][17])** to be executed in browser context.
|
|
1927
|
+
- `argsOrSec` **([Array][19]<any> | [number][16])?** (optional, `1` by default) arguments for function or seconds.
|
|
1928
|
+
- `sec` **[number][16]?** (optional, `1` by default) time in seconds to wait
|
|
1929
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2033
1930
|
|
|
2034
1931
|
### waitForInvisible
|
|
2035
1932
|
|
|
@@ -2042,10 +1939,9 @@ I.waitForInvisible('#popup');
|
|
|
2042
1939
|
|
|
2043
1940
|
#### Parameters
|
|
2044
1941
|
|
|
2045
|
-
- `locator` **([string][
|
|
2046
|
-
- `sec` **[number][
|
|
2047
|
-
|
|
2048
|
-
Returns **[Promise][10]<any>**
|
|
1942
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
1943
|
+
- `sec` **[number][16]** (optional, `1` by default) time in seconds to wait
|
|
1944
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2049
1945
|
|
|
2050
1946
|
### waitForNavigation
|
|
2051
1947
|
|
|
@@ -2057,8 +1953,6 @@ See [Playwright's reference][34]
|
|
|
2057
1953
|
|
|
2058
1954
|
- `opts` **any**
|
|
2059
1955
|
|
|
2060
|
-
Returns **[Promise][10]<any>**
|
|
2061
|
-
|
|
2062
1956
|
### waitForRequest
|
|
2063
1957
|
|
|
2064
1958
|
Waits for a network request.
|
|
@@ -2070,10 +1964,8 @@ I.waitForRequest(request => request.url() === 'http://example.com' && request.me
|
|
|
2070
1964
|
|
|
2071
1965
|
#### Parameters
|
|
2072
1966
|
|
|
2073
|
-
- `urlOrPredicate` **([string][
|
|
2074
|
-
- `sec` **[number][
|
|
2075
|
-
|
|
2076
|
-
Returns **[Promise][10]<any>**
|
|
1967
|
+
- `urlOrPredicate` **([string][12] | [function][17])**
|
|
1968
|
+
- `sec` **[number][16]?** seconds to wait
|
|
2077
1969
|
|
|
2078
1970
|
### waitForResponse
|
|
2079
1971
|
|
|
@@ -2086,10 +1978,8 @@ I.waitForResponse(response => response.url() === 'https://example.com' && respon
|
|
|
2086
1978
|
|
|
2087
1979
|
#### Parameters
|
|
2088
1980
|
|
|
2089
|
-
- `urlOrPredicate` **([string][
|
|
2090
|
-
- `sec` **[number][
|
|
2091
|
-
|
|
2092
|
-
Returns **[Promise][10]<any>**
|
|
1981
|
+
- `urlOrPredicate` **([string][12] | [function][17])**
|
|
1982
|
+
- `sec` **[number][16]?** number of seconds to wait
|
|
2093
1983
|
|
|
2094
1984
|
### waitForText
|
|
2095
1985
|
|
|
@@ -2104,11 +1994,10 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2104
1994
|
|
|
2105
1995
|
#### Parameters
|
|
2106
1996
|
|
|
2107
|
-
- `text` **[string][
|
|
2108
|
-
- `sec` **[number][
|
|
2109
|
-
- `context` **([string][
|
|
2110
|
-
|
|
2111
|
-
Returns **[Promise][10]<any>**
|
|
1997
|
+
- `text` **[string][12]** to wait for.
|
|
1998
|
+
- `sec` **[number][16]** (optional, `1` by default) time in seconds to wait
|
|
1999
|
+
- `context` **([string][12] | [object][10])?** (optional) element located by CSS|XPath|strict locator.
|
|
2000
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2112
2001
|
|
|
2113
2002
|
### waitForValue
|
|
2114
2003
|
|
|
@@ -2120,11 +2009,10 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2120
2009
|
|
|
2121
2010
|
#### Parameters
|
|
2122
2011
|
|
|
2123
|
-
- `field` **([string][
|
|
2124
|
-
- `value` **[string][
|
|
2125
|
-
- `sec` **[number][
|
|
2126
|
-
|
|
2127
|
-
Returns **[Promise][10]<any>**
|
|
2012
|
+
- `field` **([string][12] | [object][10])** input field.
|
|
2013
|
+
- `value` **[string][12]** expected value.
|
|
2014
|
+
- `sec` **[number][16]** (optional, `1` by default) time in seconds to wait
|
|
2015
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2128
2016
|
|
|
2129
2017
|
### waitForVisible
|
|
2130
2018
|
|
|
@@ -2137,10 +2025,9 @@ I.waitForVisible('#popup');
|
|
|
2137
2025
|
|
|
2138
2026
|
#### Parameters
|
|
2139
2027
|
|
|
2140
|
-
- `locator` **([string][
|
|
2141
|
-
- `sec` **[number][
|
|
2142
|
-
|
|
2143
|
-
Returns **[Promise][10]<any>** This method accepts [React selectors][35].
|
|
2028
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
2029
|
+
- `sec` **[number][16]** (optional, `1` by default) time in seconds to wait
|
|
2030
|
+
[!] returns a _promise_ which is synchronized internally by recorderThis method accepts [React selectors][35].
|
|
2144
2031
|
|
|
2145
2032
|
### waitInUrl
|
|
2146
2033
|
|
|
@@ -2152,10 +2039,9 @@ I.waitInUrl('/info', 2);
|
|
|
2152
2039
|
|
|
2153
2040
|
#### Parameters
|
|
2154
2041
|
|
|
2155
|
-
- `urlPart` **[string][
|
|
2156
|
-
- `sec` **[number][
|
|
2157
|
-
|
|
2158
|
-
Returns **[Promise][10]<any>**
|
|
2042
|
+
- `urlPart` **[string][12]** value to check.
|
|
2043
|
+
- `sec` **[number][16]** (optional, `1` by default) time in seconds to wait
|
|
2044
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2159
2045
|
|
|
2160
2046
|
### waitNumberOfVisibleElements
|
|
2161
2047
|
|
|
@@ -2167,11 +2053,10 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2167
2053
|
|
|
2168
2054
|
#### Parameters
|
|
2169
2055
|
|
|
2170
|
-
- `locator` **([string][
|
|
2171
|
-
- `num` **[number][
|
|
2172
|
-
- `sec` **[number][
|
|
2173
|
-
|
|
2174
|
-
Returns **[Promise][10]<any>**
|
|
2056
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
2057
|
+
- `num` **[number][16]** number of elements.
|
|
2058
|
+
- `sec` **[number][16]** (optional, `1` by default) time in seconds to wait
|
|
2059
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2175
2060
|
|
|
2176
2061
|
### waitToHide
|
|
2177
2062
|
|
|
@@ -2184,10 +2069,9 @@ I.waitToHide('#popup');
|
|
|
2184
2069
|
|
|
2185
2070
|
#### Parameters
|
|
2186
2071
|
|
|
2187
|
-
- `locator` **([string][
|
|
2188
|
-
- `sec` **[number][
|
|
2189
|
-
|
|
2190
|
-
Returns **[Promise][10]<any>**
|
|
2072
|
+
- `locator` **([string][12] | [object][10])** element located by CSS|XPath|strict locator.
|
|
2073
|
+
- `sec` **[number][16]** (optional, `1` by default) time in seconds to wait
|
|
2074
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2191
2075
|
|
|
2192
2076
|
### waitUrlEquals
|
|
2193
2077
|
|
|
@@ -2200,10 +2084,9 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2200
2084
|
|
|
2201
2085
|
#### Parameters
|
|
2202
2086
|
|
|
2203
|
-
- `urlPart` **[string][
|
|
2204
|
-
- `sec` **[number][
|
|
2205
|
-
|
|
2206
|
-
Returns **[Promise][10]<any>**
|
|
2087
|
+
- `urlPart` **[string][12]** value to check.
|
|
2088
|
+
- `sec` **[number][16]** (optional, `1` by default) time in seconds to wait
|
|
2089
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2207
2090
|
|
|
2208
2091
|
[1]: https://github.com/microsoft/playwright
|
|
2209
2092
|
|
|
@@ -2223,23 +2106,23 @@ Returns **[Promise][10]<any>**
|
|
|
2223
2106
|
|
|
2224
2107
|
[9]: https://github.com/microsoft/playwright/blob/v0.11.0/docs/api.md#working-with-chrome-extensions
|
|
2225
2108
|
|
|
2226
|
-
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
2109
|
+
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
2227
2110
|
|
|
2228
|
-
[11]:
|
|
2111
|
+
[11]: http://jster.net/category/windows-modals-popups
|
|
2229
2112
|
|
|
2230
|
-
[12]:
|
|
2113
|
+
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
2231
2114
|
|
|
2232
|
-
[13]: https://
|
|
2115
|
+
[13]: https://playwright.dev/docs/api/class-elementhandle#element-handle-check
|
|
2233
2116
|
|
|
2234
|
-
[14]: https://playwright.dev/docs/api/class-
|
|
2117
|
+
[14]: https://playwright.dev/docs/api/class-page#page-click
|
|
2235
2118
|
|
|
2236
|
-
[15]: https://playwright.dev/docs/api/class-page#page-
|
|
2119
|
+
[15]: https://playwright.dev/docs/api/class-page#page-drag-and-drop
|
|
2237
2120
|
|
|
2238
|
-
[16]: https://
|
|
2121
|
+
[16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
2239
2122
|
|
|
2240
|
-
[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
2123
|
+
[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2241
2124
|
|
|
2242
|
-
[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
2125
|
+
[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2243
2126
|
|
|
2244
2127
|
[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
2245
2128
|
|