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
|
@@ -279,7 +279,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
279
279
|
|
|
280
280
|
- `url` **[string][8]** url path or global url.
|
|
281
281
|
|
|
282
|
-
Returns **
|
|
282
|
+
Returns **void** automatically synchronized promise with recorder #!
|
|
283
283
|
|
|
284
284
|
### appendField
|
|
285
285
|
|
|
@@ -294,8 +294,7 @@ I.appendField('#myTextField', 'appended');
|
|
|
294
294
|
|
|
295
295
|
- `field` **([string][8] | [object][6])** located by label|name|CSS|XPath|strict locator
|
|
296
296
|
- `value` **[string][8]** text value to append.
|
|
297
|
-
|
|
298
|
-
Returns **[Promise][9]<any>**
|
|
297
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
299
298
|
|
|
300
299
|
|
|
301
300
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -316,8 +315,7 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
316
315
|
|
|
317
316
|
- `locator` **([string][8] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
318
317
|
- `pathToFile` **[string][8]** local file path relative to codecept.json config file.
|
|
319
|
-
|
|
320
|
-
Returns **[Promise][9]<any>** > ⚠ There is an [issue with file upload in Puppeteer 2.1.0 & 2.1.1][10], downgrade to 2.0.0 if you face it.
|
|
318
|
+
[!] returns a _promise_ which is synchronized internally by recorder> ⚠ There is an [issue with file upload in Puppeteer 2.1.0 & 2.1.1][9], downgrade to 2.0.0 if you face it.
|
|
321
319
|
|
|
322
320
|
### cancelPopup
|
|
323
321
|
|
|
@@ -339,9 +337,8 @@ I.checkOption('agree', '//form');
|
|
|
339
337
|
#### Parameters
|
|
340
338
|
|
|
341
339
|
- `field` **([string][8] | [object][6])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
342
|
-
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
343
|
-
|
|
344
|
-
Returns **[Promise][9]<any>**
|
|
340
|
+
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
341
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
345
342
|
|
|
346
343
|
### clearCookie
|
|
347
344
|
|
|
@@ -356,9 +353,8 @@ I.clearCookie('test');
|
|
|
356
353
|
#### Parameters
|
|
357
354
|
|
|
358
355
|
- `name`
|
|
359
|
-
- `cookie` **[string][8]?** (optional, `null` by default) cookie name
|
|
360
|
-
|
|
361
|
-
Returns **[Promise][9]<any>**
|
|
356
|
+
- `cookie` **[string][8]?** (optional, `null` by default) cookie name
|
|
357
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
362
358
|
|
|
363
359
|
### clearField
|
|
364
360
|
|
|
@@ -374,8 +370,7 @@ I.clearField('#email');
|
|
|
374
370
|
|
|
375
371
|
- `field`
|
|
376
372
|
- `editable` **([string][8] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
377
|
-
|
|
378
|
-
Returns **[Promise][9]<any>**
|
|
373
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
379
374
|
|
|
380
375
|
### click
|
|
381
376
|
|
|
@@ -404,13 +399,12 @@ I.click({css: 'nav a.login'});
|
|
|
404
399
|
#### Parameters
|
|
405
400
|
|
|
406
401
|
- `locator` **([string][8] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
407
|
-
- `context` **([string][8]? | [object][6] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
408
|
-
|
|
409
|
-
Returns **[Promise][9]<any>**
|
|
402
|
+
- `context` **([string][8]? | [object][6] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
403
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
410
404
|
|
|
411
405
|
|
|
412
406
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
413
|
-
|
|
407
|
+
|
|
414
408
|
|
|
415
409
|
### clickLink
|
|
416
410
|
|
|
@@ -423,13 +417,12 @@ I.clickLink('Logout', '#nav');
|
|
|
423
417
|
#### Parameters
|
|
424
418
|
|
|
425
419
|
- `locator` **([string][8] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator
|
|
426
|
-
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator
|
|
427
|
-
|
|
428
|
-
Returns **[Promise][9]<any>**
|
|
420
|
+
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator
|
|
421
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
429
422
|
|
|
430
423
|
|
|
431
424
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
432
|
-
|
|
425
|
+
|
|
433
426
|
|
|
434
427
|
### closeCurrentTab
|
|
435
428
|
|
|
@@ -460,13 +453,12 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
460
453
|
#### Parameters
|
|
461
454
|
|
|
462
455
|
- `text` **[string][8]** which is not present.
|
|
463
|
-
- `context` **([string][8] | [object][6])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
464
|
-
|
|
465
|
-
Returns **[Promise][9]<any>**
|
|
456
|
+
- `context` **([string][8] | [object][6])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
457
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
466
458
|
|
|
467
459
|
|
|
468
460
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
469
|
-
|
|
461
|
+
|
|
470
462
|
|
|
471
463
|
### dontSeeCheckboxIsChecked
|
|
472
464
|
|
|
@@ -481,8 +473,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
481
473
|
#### Parameters
|
|
482
474
|
|
|
483
475
|
- `field` **([string][8] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
484
|
-
|
|
485
|
-
Returns **[Promise][9]<any>**
|
|
476
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
486
477
|
|
|
487
478
|
### dontSeeCookie
|
|
488
479
|
|
|
@@ -495,8 +486,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
495
486
|
#### Parameters
|
|
496
487
|
|
|
497
488
|
- `name` **[string][8]** cookie name.
|
|
498
|
-
|
|
499
|
-
Returns **[Promise][9]<any>**
|
|
489
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
500
490
|
|
|
501
491
|
### dontSeeCurrentUrlEquals
|
|
502
492
|
|
|
@@ -511,8 +501,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
511
501
|
#### Parameters
|
|
512
502
|
|
|
513
503
|
- `url` **[string][8]** value to check.
|
|
514
|
-
|
|
515
|
-
Returns **[Promise][9]<any>**
|
|
504
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
516
505
|
|
|
517
506
|
### dontSeeElement
|
|
518
507
|
|
|
@@ -525,8 +514,8 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
525
514
|
#### Parameters
|
|
526
515
|
|
|
527
516
|
- `locator` **([string][8] | [object][6])** located by CSS|XPath|Strict locator.
|
|
528
|
-
|
|
529
|
-
|
|
517
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
518
|
+
|
|
530
519
|
|
|
531
520
|
|
|
532
521
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -543,8 +532,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
543
532
|
#### Parameters
|
|
544
533
|
|
|
545
534
|
- `locator` **([string][8] | [object][6])** located by CSS|XPath|Strict locator.
|
|
546
|
-
|
|
547
|
-
Returns **[Promise][9]<any>**
|
|
535
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
548
536
|
|
|
549
537
|
### dontSeeInCurrentUrl
|
|
550
538
|
|
|
@@ -553,8 +541,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
553
541
|
#### Parameters
|
|
554
542
|
|
|
555
543
|
- `url` **[string][8]** value to check.
|
|
556
|
-
|
|
557
|
-
Returns **[Promise][9]<any>**
|
|
544
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
558
545
|
|
|
559
546
|
### dontSeeInField
|
|
560
547
|
|
|
@@ -570,8 +557,7 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
570
557
|
|
|
571
558
|
- `field` **([string][8] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
572
559
|
- `value` **[string][8]** value to check.
|
|
573
|
-
|
|
574
|
-
Returns **[Promise][9]<any>**
|
|
560
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
575
561
|
|
|
576
562
|
### dontSeeInSource
|
|
577
563
|
|
|
@@ -585,8 +571,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
585
571
|
|
|
586
572
|
- `text`
|
|
587
573
|
- `value` **[string][8]** to check.
|
|
588
|
-
|
|
589
|
-
Returns **[Promise][9]<any>**
|
|
574
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
590
575
|
|
|
591
576
|
### dontSeeInTitle
|
|
592
577
|
|
|
@@ -599,8 +584,7 @@ I.dontSeeInTitle('Error');
|
|
|
599
584
|
#### Parameters
|
|
600
585
|
|
|
601
586
|
- `text` **[string][8]** value to check.
|
|
602
|
-
|
|
603
|
-
Returns **[Promise][9]<any>**
|
|
587
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
604
588
|
|
|
605
589
|
### doubleClick
|
|
606
590
|
|
|
@@ -617,13 +601,12 @@ I.doubleClick('.btn.edit');
|
|
|
617
601
|
#### Parameters
|
|
618
602
|
|
|
619
603
|
- `locator` **([string][8] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
620
|
-
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
621
|
-
|
|
622
|
-
Returns **[Promise][9]<any>**
|
|
604
|
+
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
605
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
623
606
|
|
|
624
607
|
|
|
625
608
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
626
|
-
|
|
609
|
+
|
|
627
610
|
|
|
628
611
|
### downloadFile
|
|
629
612
|
|
|
@@ -648,8 +631,7 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
648
631
|
|
|
649
632
|
- `srcElement` **([string][8] | [object][6])** located by CSS|XPath|strict locator.
|
|
650
633
|
- `destElement` **([string][8] | [object][6])** located by CSS|XPath|strict locator.
|
|
651
|
-
|
|
652
|
-
Returns **[Promise][9]<any>**
|
|
634
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
653
635
|
|
|
654
636
|
### dragSlider
|
|
655
637
|
|
|
@@ -664,20 +646,20 @@ I.dragSlider('#slider', -70);
|
|
|
664
646
|
#### Parameters
|
|
665
647
|
|
|
666
648
|
- `locator` **([string][8] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
667
|
-
- `offsetX` **[number][
|
|
668
|
-
|
|
669
|
-
|
|
649
|
+
- `offsetX` **[number][10]** position to drag.
|
|
650
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
651
|
+
|
|
670
652
|
|
|
671
653
|
|
|
672
654
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
673
|
-
|
|
655
|
+
|
|
674
656
|
|
|
675
657
|
### executeAsyncScript
|
|
676
658
|
|
|
677
659
|
Executes async script on page.
|
|
678
660
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
679
661
|
|
|
680
|
-
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][
|
|
662
|
+
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][11].
|
|
681
663
|
|
|
682
664
|
```js
|
|
683
665
|
I.executeAsyncScript(function(done) {
|
|
@@ -698,9 +680,8 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
698
680
|
#### Parameters
|
|
699
681
|
|
|
700
682
|
- `args` **...any** to be passed to function.
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
Returns **[Promise][9]<any>** Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
683
|
+
[!] returns a _promise_ which is synchronized internally by recorderAsynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
|
|
684
|
+
- `fn` **([string][8] | [function][12])** function to be executed in browser context.
|
|
704
685
|
|
|
705
686
|
### executeScript
|
|
706
687
|
|
|
@@ -731,9 +712,8 @@ let date = await I.executeScript(function(el) {
|
|
|
731
712
|
#### Parameters
|
|
732
713
|
|
|
733
714
|
- `args` **...any** to be passed to function.
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
Returns **[Promise][9]<any>** If a function returns a Promise It will wait for it resolution.
|
|
715
|
+
[!] returns a _promise_ which is synchronized internally by recorderIf a function returns a Promise It will wait for it resolution.
|
|
716
|
+
- `fn` **([string][8] | [function][12])** function to be executed in browser context.
|
|
737
717
|
|
|
738
718
|
### fillField
|
|
739
719
|
|
|
@@ -755,8 +735,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
755
735
|
|
|
756
736
|
- `field` **([string][8] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
757
737
|
- `value` **([string][8] | [object][6])** text value to fill.
|
|
758
|
-
|
|
759
|
-
|
|
738
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
739
|
+
|
|
760
740
|
|
|
761
741
|
|
|
762
742
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -792,13 +772,12 @@ I.forceClick({css: 'nav a.login'});
|
|
|
792
772
|
#### Parameters
|
|
793
773
|
|
|
794
774
|
- `locator` **([string][8] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
795
|
-
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
796
|
-
|
|
797
|
-
Returns **[Promise][9]<any>**
|
|
775
|
+
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
776
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
798
777
|
|
|
799
778
|
|
|
800
779
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
801
|
-
|
|
780
|
+
|
|
802
781
|
|
|
803
782
|
### grabAttributeFrom
|
|
804
783
|
|
|
@@ -815,7 +794,7 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
815
794
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
816
795
|
- `attr` **[string][8]** attribute name.
|
|
817
796
|
|
|
818
|
-
Returns **[Promise][
|
|
797
|
+
Returns **[Promise][13]<[string][8]>** attribute value
|
|
819
798
|
|
|
820
799
|
|
|
821
800
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -835,7 +814,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
835
814
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
836
815
|
- `attr` **[string][8]** attribute name.
|
|
837
816
|
|
|
838
|
-
Returns **[Promise][
|
|
817
|
+
Returns **[Promise][13]<[Array][14]<[string][8]>>** attribute value
|
|
839
818
|
|
|
840
819
|
|
|
841
820
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -850,7 +829,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
850
829
|
console.log(JSON.stringify(logs))
|
|
851
830
|
```
|
|
852
831
|
|
|
853
|
-
Returns **[Promise][
|
|
832
|
+
Returns **[Promise][13]<[Array][14]<any>>**
|
|
854
833
|
|
|
855
834
|
### grabCookie
|
|
856
835
|
|
|
@@ -867,7 +846,7 @@ assert(cookie.value, '123456');
|
|
|
867
846
|
|
|
868
847
|
- `name` **[string][8]?** cookie name.
|
|
869
848
|
|
|
870
|
-
Returns **([Promise][
|
|
849
|
+
Returns **([Promise][13]<[string][8]> | [Promise][13]<[Array][14]<[string][8]>>)** attribute valueReturns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
871
850
|
|
|
872
851
|
### grabCssPropertyFrom
|
|
873
852
|
|
|
@@ -884,7 +863,7 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
884
863
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
885
864
|
- `cssProperty` **[string][8]** CSS property name.
|
|
886
865
|
|
|
887
|
-
Returns **[Promise][
|
|
866
|
+
Returns **[Promise][13]<[string][8]>** CSS value
|
|
888
867
|
|
|
889
868
|
|
|
890
869
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -904,7 +883,7 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
904
883
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
905
884
|
- `cssProperty` **[string][8]** CSS property name.
|
|
906
885
|
|
|
907
|
-
Returns **[Promise][
|
|
886
|
+
Returns **[Promise][13]<[Array][14]<[string][8]>>** CSS value
|
|
908
887
|
|
|
909
888
|
|
|
910
889
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -920,7 +899,7 @@ let url = await I.grabCurrentUrl();
|
|
|
920
899
|
console.log(`Current URL is [${url}]`);
|
|
921
900
|
```
|
|
922
901
|
|
|
923
|
-
Returns **[Promise][
|
|
902
|
+
Returns **[Promise][13]<[string][8]>** current URL
|
|
924
903
|
|
|
925
904
|
### grabDataFromPerformanceTiming
|
|
926
905
|
|
|
@@ -945,7 +924,7 @@ let data = await I.grabDataFromPerformanceTiming();
|
|
|
945
924
|
}
|
|
946
925
|
```
|
|
947
926
|
|
|
948
|
-
Returns **[Promise][
|
|
927
|
+
Returns **[Promise][13]<any>** automatically synchronized promise through #recorder
|
|
949
928
|
|
|
950
929
|
### grabElementBoundingRect
|
|
951
930
|
|
|
@@ -973,7 +952,7 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
973
952
|
- `prop`
|
|
974
953
|
- `elementSize` **[string][8]?** x, y, width or height of the given element.
|
|
975
954
|
|
|
976
|
-
Returns **([Promise][
|
|
955
|
+
Returns **([Promise][13]<DOMRect> | [Promise][13]<[number][10]>)** Element bounding rectangle
|
|
977
956
|
|
|
978
957
|
### grabHTMLFrom
|
|
979
958
|
|
|
@@ -990,7 +969,7 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
990
969
|
- `locator`
|
|
991
970
|
- `element` **([string][8] | [object][6])** located by CSS|XPath|strict locator.
|
|
992
971
|
|
|
993
|
-
Returns **[Promise][
|
|
972
|
+
Returns **[Promise][13]<[string][8]>** HTML code for an element
|
|
994
973
|
|
|
995
974
|
### grabHTMLFromAll
|
|
996
975
|
|
|
@@ -1006,7 +985,7 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1006
985
|
- `locator`
|
|
1007
986
|
- `element` **([string][8] | [object][6])** located by CSS|XPath|strict locator.
|
|
1008
987
|
|
|
1009
|
-
Returns **[Promise][
|
|
988
|
+
Returns **[Promise][13]<[Array][14]<[string][8]>>** HTML code for an element
|
|
1010
989
|
|
|
1011
990
|
### grabNumberOfOpenTabs
|
|
1012
991
|
|
|
@@ -1017,7 +996,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1017
996
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1018
997
|
```
|
|
1019
998
|
|
|
1020
|
-
Returns **[Promise][
|
|
999
|
+
Returns **[Promise][13]<[number][10]>** number of open tabs
|
|
1021
1000
|
|
|
1022
1001
|
### grabNumberOfVisibleElements
|
|
1023
1002
|
|
|
@@ -1032,7 +1011,7 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1032
1011
|
|
|
1033
1012
|
- `locator` **([string][8] | [object][6])** located by CSS|XPath|strict locator.
|
|
1034
1013
|
|
|
1035
|
-
Returns **[Promise][
|
|
1014
|
+
Returns **[Promise][13]<[number][10]>** number of visible elements
|
|
1036
1015
|
|
|
1037
1016
|
|
|
1038
1017
|
|
|
@@ -1048,7 +1027,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1048
1027
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1049
1028
|
```
|
|
1050
1029
|
|
|
1051
|
-
Returns **[Promise][
|
|
1030
|
+
Returns **[Promise][13]<PageScrollPosition>** scroll position
|
|
1052
1031
|
|
|
1053
1032
|
### grabPopupText
|
|
1054
1033
|
|
|
@@ -1058,7 +1037,7 @@ Grab the text within the popup. If no popup is visible then it will return null
|
|
|
1058
1037
|
await I.grabPopupText();
|
|
1059
1038
|
```
|
|
1060
1039
|
|
|
1061
|
-
Returns **[Promise][
|
|
1040
|
+
Returns **[Promise][13]<([string][8] | null)>**
|
|
1062
1041
|
|
|
1063
1042
|
### grabSource
|
|
1064
1043
|
|
|
@@ -1069,7 +1048,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1069
1048
|
let pageSource = await I.grabSource();
|
|
1070
1049
|
```
|
|
1071
1050
|
|
|
1072
|
-
Returns **[Promise][
|
|
1051
|
+
Returns **[Promise][13]<[string][8]>** source code
|
|
1073
1052
|
|
|
1074
1053
|
### grabTextFrom
|
|
1075
1054
|
|
|
@@ -1086,7 +1065,7 @@ If multiple elements found returns first element.
|
|
|
1086
1065
|
|
|
1087
1066
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1088
1067
|
|
|
1089
|
-
Returns **[Promise][
|
|
1068
|
+
Returns **[Promise][13]<[string][8]>** attribute value
|
|
1090
1069
|
|
|
1091
1070
|
|
|
1092
1071
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1105,7 +1084,7 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1105
1084
|
|
|
1106
1085
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1107
1086
|
|
|
1108
|
-
Returns **[Promise][
|
|
1087
|
+
Returns **[Promise][13]<[Array][14]<[string][8]>>** attribute value
|
|
1109
1088
|
|
|
1110
1089
|
|
|
1111
1090
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1120,7 +1099,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1120
1099
|
let title = await I.grabTitle();
|
|
1121
1100
|
```
|
|
1122
1101
|
|
|
1123
|
-
Returns **[Promise][
|
|
1102
|
+
Returns **[Promise][13]<[string][8]>** title
|
|
1124
1103
|
|
|
1125
1104
|
### grabValueFrom
|
|
1126
1105
|
|
|
@@ -1136,7 +1115,7 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1136
1115
|
|
|
1137
1116
|
- `locator` **([string][8] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
1138
1117
|
|
|
1139
|
-
Returns **[Promise][
|
|
1118
|
+
Returns **[Promise][13]<[string][8]>** attribute value
|
|
1140
1119
|
|
|
1141
1120
|
### grabValueFromAll
|
|
1142
1121
|
|
|
@@ -1151,7 +1130,7 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1151
1130
|
|
|
1152
1131
|
- `locator` **([string][8] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
1153
1132
|
|
|
1154
|
-
Returns **[Promise][
|
|
1133
|
+
Returns **[Promise][13]<[Array][14]<[string][8]>>** attribute value
|
|
1155
1134
|
|
|
1156
1135
|
### handleDownloads
|
|
1157
1136
|
|
|
@@ -1199,14 +1178,14 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1199
1178
|
#### Parameters
|
|
1200
1179
|
|
|
1201
1180
|
- `locator` **([string][8] | [object][6])** located by CSS|XPath|strict locator.
|
|
1202
|
-
- `offsetX` **[number][
|
|
1203
|
-
- `offsetY` **[number][
|
|
1204
|
-
|
|
1205
|
-
|
|
1181
|
+
- `offsetX` **[number][10]** (optional, `0` by default) X-axis offset.
|
|
1182
|
+
- `offsetY` **[number][10]** (optional, `0` by default) Y-axis offset.
|
|
1183
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1184
|
+
|
|
1206
1185
|
|
|
1207
1186
|
|
|
1208
1187
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1209
|
-
|
|
1188
|
+
|
|
1210
1189
|
|
|
1211
1190
|
### openNewTab
|
|
1212
1191
|
|
|
@@ -1280,8 +1259,7 @@ Some of the supported key names are:
|
|
|
1280
1259
|
#### Parameters
|
|
1281
1260
|
|
|
1282
1261
|
- `key` **([string][8] | [Array][14]<[string][8]>)** key or array of keys to press.
|
|
1283
|
-
|
|
1284
|
-
Returns **[Promise][9]<any>** _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313][17]).
|
|
1262
|
+
[!] returns a _promise_ which is synchronized internally by recorder_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313][17]).
|
|
1285
1263
|
|
|
1286
1264
|
### pressKeyDown
|
|
1287
1265
|
|
|
@@ -1298,8 +1276,7 @@ I.pressKeyUp('Control');
|
|
|
1298
1276
|
#### Parameters
|
|
1299
1277
|
|
|
1300
1278
|
- `key` **[string][8]** name of key to press down.
|
|
1301
|
-
|
|
1302
|
-
Returns **[Promise][9]<any>**
|
|
1279
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1303
1280
|
|
|
1304
1281
|
### pressKeyUp
|
|
1305
1282
|
|
|
@@ -1316,8 +1293,7 @@ I.pressKeyUp('Control');
|
|
|
1316
1293
|
#### Parameters
|
|
1317
1294
|
|
|
1318
1295
|
- `key` **[string][8]** name of key to release.
|
|
1319
|
-
|
|
1320
|
-
Returns **[Promise][9]<any>**
|
|
1296
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1321
1297
|
|
|
1322
1298
|
### refreshPage
|
|
1323
1299
|
|
|
@@ -1327,7 +1303,7 @@ Reload the current page.
|
|
|
1327
1303
|
I.refreshPage();
|
|
1328
1304
|
```
|
|
1329
1305
|
|
|
1330
|
-
|
|
1306
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1331
1307
|
|
|
1332
1308
|
### resizeWindow
|
|
1333
1309
|
|
|
@@ -1336,12 +1312,11 @@ First parameter can be set to `maximize`.
|
|
|
1336
1312
|
|
|
1337
1313
|
#### Parameters
|
|
1338
1314
|
|
|
1339
|
-
- `width` **[number][
|
|
1340
|
-
- `height` **[number][
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
It also can't maximize a window.
|
|
1315
|
+
- `width` **[number][10]** width in pixels or `maximize`.
|
|
1316
|
+
- `height` **[number][10]** height in pixels.
|
|
1317
|
+
[!] returns a _promise_ which is synchronized internally by recorderUnlike other drivers Puppeteer changes the size of a viewport, not the window!
|
|
1318
|
+
Puppeteer does not control the window of a browser so it can't adjust its real size.
|
|
1319
|
+
It also can't maximize a window.
|
|
1345
1320
|
|
|
1346
1321
|
### rightClick
|
|
1347
1322
|
|
|
@@ -1359,13 +1334,12 @@ I.rightClick('Click me', '.context');
|
|
|
1359
1334
|
#### Parameters
|
|
1360
1335
|
|
|
1361
1336
|
- `locator` **([string][8] | [object][6])** clickable element located by CSS|XPath|strict locator.
|
|
1362
|
-
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1363
|
-
|
|
1364
|
-
Returns **[Promise][9]<any>**
|
|
1337
|
+
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1338
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1365
1339
|
|
|
1366
1340
|
|
|
1367
1341
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1368
|
-
|
|
1342
|
+
|
|
1369
1343
|
|
|
1370
1344
|
### saveElementScreenshot
|
|
1371
1345
|
|
|
@@ -1380,8 +1354,7 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1380
1354
|
|
|
1381
1355
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1382
1356
|
- `fileName` **[string][8]** file name to save.
|
|
1383
|
-
|
|
1384
|
-
Returns **[Promise][9]<any>**
|
|
1357
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1385
1358
|
|
|
1386
1359
|
### saveScreenshot
|
|
1387
1360
|
|
|
@@ -1397,9 +1370,8 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1397
1370
|
#### Parameters
|
|
1398
1371
|
|
|
1399
1372
|
- `fileName` **[string][8]** file name to save.
|
|
1400
|
-
- `fullPage` **[boolean][19]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1401
|
-
|
|
1402
|
-
Returns **[Promise][9]<any>**
|
|
1373
|
+
- `fullPage` **[boolean][19]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1374
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1403
1375
|
|
|
1404
1376
|
### scrollPageToBottom
|
|
1405
1377
|
|
|
@@ -1409,7 +1381,7 @@ Scroll page to the bottom.
|
|
|
1409
1381
|
I.scrollPageToBottom();
|
|
1410
1382
|
```
|
|
1411
1383
|
|
|
1412
|
-
|
|
1384
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1413
1385
|
|
|
1414
1386
|
### scrollPageToTop
|
|
1415
1387
|
|
|
@@ -1419,7 +1391,7 @@ Scroll page to the top.
|
|
|
1419
1391
|
I.scrollPageToTop();
|
|
1420
1392
|
```
|
|
1421
1393
|
|
|
1422
|
-
|
|
1394
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1423
1395
|
|
|
1424
1396
|
### scrollTo
|
|
1425
1397
|
|
|
@@ -1434,10 +1406,9 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1434
1406
|
#### Parameters
|
|
1435
1407
|
|
|
1436
1408
|
- `locator` **([string][8] | [object][6])** located by CSS|XPath|strict locator.
|
|
1437
|
-
- `offsetX` **[number][
|
|
1438
|
-
- `offsetY` **[number][
|
|
1439
|
-
|
|
1440
|
-
Returns **[Promise][9]<any>**
|
|
1409
|
+
- `offsetX` **[number][10]** (optional, `0` by default) X-axis offset.
|
|
1410
|
+
- `offsetY` **[number][10]** (optional, `0` by default) Y-axis offset.
|
|
1411
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1441
1412
|
|
|
1442
1413
|
### see
|
|
1443
1414
|
|
|
@@ -1453,13 +1424,12 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1453
1424
|
#### Parameters
|
|
1454
1425
|
|
|
1455
1426
|
- `text` **[string][8]** expected on page.
|
|
1456
|
-
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1457
|
-
|
|
1458
|
-
Returns **[Promise][9]<any>**
|
|
1427
|
+
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1428
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1459
1429
|
|
|
1460
1430
|
|
|
1461
1431
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
1462
|
-
|
|
1432
|
+
|
|
1463
1433
|
|
|
1464
1434
|
### seeAttributesOnElements
|
|
1465
1435
|
|
|
@@ -1473,8 +1443,8 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1473
1443
|
|
|
1474
1444
|
- `locator` **([string][8] | [object][6])** located by CSS|XPath|strict locator.
|
|
1475
1445
|
- `attributes` **[object][6]** attributes and their values to check.
|
|
1476
|
-
|
|
1477
|
-
|
|
1446
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1447
|
+
|
|
1478
1448
|
|
|
1479
1449
|
|
|
1480
1450
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1493,8 +1463,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1493
1463
|
#### Parameters
|
|
1494
1464
|
|
|
1495
1465
|
- `field` **([string][8] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
1496
|
-
|
|
1497
|
-
Returns **[Promise][9]<any>**
|
|
1466
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1498
1467
|
|
|
1499
1468
|
### seeCookie
|
|
1500
1469
|
|
|
@@ -1507,8 +1476,7 @@ I.seeCookie('Auth');
|
|
|
1507
1476
|
#### Parameters
|
|
1508
1477
|
|
|
1509
1478
|
- `name` **[string][8]** cookie name.
|
|
1510
|
-
|
|
1511
|
-
Returns **[Promise][9]<any>**
|
|
1479
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1512
1480
|
|
|
1513
1481
|
### seeCssPropertiesOnElements
|
|
1514
1482
|
|
|
@@ -1522,8 +1490,8 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1522
1490
|
|
|
1523
1491
|
- `locator` **([string][8] | [object][6])** located by CSS|XPath|strict locator.
|
|
1524
1492
|
- `cssProperties` **[object][6]** object with CSS properties and their values to check.
|
|
1525
|
-
|
|
1526
|
-
|
|
1493
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1494
|
+
|
|
1527
1495
|
|
|
1528
1496
|
|
|
1529
1497
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1543,8 +1511,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1543
1511
|
#### Parameters
|
|
1544
1512
|
|
|
1545
1513
|
- `url` **[string][8]** value to check.
|
|
1546
|
-
|
|
1547
|
-
Returns **[Promise][9]<any>**
|
|
1514
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1548
1515
|
|
|
1549
1516
|
### seeElement
|
|
1550
1517
|
|
|
@@ -1558,8 +1525,8 @@ I.seeElement('#modal');
|
|
|
1558
1525
|
#### Parameters
|
|
1559
1526
|
|
|
1560
1527
|
- `locator` **([string][8] | [object][6])** located by CSS|XPath|strict locator.
|
|
1561
|
-
|
|
1562
|
-
|
|
1528
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1529
|
+
|
|
1563
1530
|
|
|
1564
1531
|
|
|
1565
1532
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1577,8 +1544,7 @@ I.seeElementInDOM('#modal');
|
|
|
1577
1544
|
#### Parameters
|
|
1578
1545
|
|
|
1579
1546
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1580
|
-
|
|
1581
|
-
Returns **[Promise][9]<any>**
|
|
1547
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1582
1548
|
|
|
1583
1549
|
### seeInCurrentUrl
|
|
1584
1550
|
|
|
@@ -1591,8 +1557,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1591
1557
|
#### Parameters
|
|
1592
1558
|
|
|
1593
1559
|
- `url` **[string][8]** a fragment to check
|
|
1594
|
-
|
|
1595
|
-
Returns **[Promise][9]<any>**
|
|
1560
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1596
1561
|
|
|
1597
1562
|
### seeInField
|
|
1598
1563
|
|
|
@@ -1610,8 +1575,7 @@ I.seeInField('#searchform input','Search');
|
|
|
1610
1575
|
|
|
1611
1576
|
- `field` **([string][8] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
1612
1577
|
- `value` **[string][8]** value to check.
|
|
1613
|
-
|
|
1614
|
-
Returns **[Promise][9]<any>**
|
|
1578
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1615
1579
|
|
|
1616
1580
|
### seeInPopup
|
|
1617
1581
|
|
|
@@ -1625,8 +1589,7 @@ I.seeInPopup('Popup text');
|
|
|
1625
1589
|
#### Parameters
|
|
1626
1590
|
|
|
1627
1591
|
- `text` **[string][8]** value to check.
|
|
1628
|
-
|
|
1629
|
-
Returns **[Promise][9]<any>**
|
|
1592
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1630
1593
|
|
|
1631
1594
|
### seeInSource
|
|
1632
1595
|
|
|
@@ -1639,8 +1602,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1639
1602
|
#### Parameters
|
|
1640
1603
|
|
|
1641
1604
|
- `text` **[string][8]** value to check.
|
|
1642
|
-
|
|
1643
|
-
Returns **[Promise][9]<any>**
|
|
1605
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1644
1606
|
|
|
1645
1607
|
### seeInTitle
|
|
1646
1608
|
|
|
@@ -1653,8 +1615,7 @@ I.seeInTitle('Home Page');
|
|
|
1653
1615
|
#### Parameters
|
|
1654
1616
|
|
|
1655
1617
|
- `text` **[string][8]** text value to check.
|
|
1656
|
-
|
|
1657
|
-
Returns **[Promise][9]<any>**
|
|
1618
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1658
1619
|
|
|
1659
1620
|
### seeNumberOfElements
|
|
1660
1621
|
|
|
@@ -1668,9 +1629,8 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1668
1629
|
#### Parameters
|
|
1669
1630
|
|
|
1670
1631
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1671
|
-
- `num` **[number][
|
|
1672
|
-
|
|
1673
|
-
Returns **[Promise][9]<any>**
|
|
1632
|
+
- `num` **[number][10]** number of elements.
|
|
1633
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1674
1634
|
|
|
1675
1635
|
|
|
1676
1636
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1688,9 +1648,8 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1688
1648
|
#### Parameters
|
|
1689
1649
|
|
|
1690
1650
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1691
|
-
- `num` **[number][
|
|
1692
|
-
|
|
1693
|
-
Returns **[Promise][9]<any>**
|
|
1651
|
+
- `num` **[number][10]** number of elements.
|
|
1652
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1694
1653
|
|
|
1695
1654
|
|
|
1696
1655
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1707,9 +1666,8 @@ I.seeTextEquals('text', 'h1');
|
|
|
1707
1666
|
#### Parameters
|
|
1708
1667
|
|
|
1709
1668
|
- `text` **[string][8]** element value to check.
|
|
1710
|
-
- `context` **([string][8] | [object][6])?** element located by CSS|XPath|strict locator.
|
|
1711
|
-
|
|
1712
|
-
Returns **[Promise][9]<any>**
|
|
1669
|
+
- `context` **([string][8] | [object][6])?** element located by CSS|XPath|strict locator.
|
|
1670
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1713
1671
|
|
|
1714
1672
|
### seeTitleEquals
|
|
1715
1673
|
|
|
@@ -1722,8 +1680,7 @@ I.seeTitleEquals('Test title.');
|
|
|
1722
1680
|
#### Parameters
|
|
1723
1681
|
|
|
1724
1682
|
- `text` **[string][8]** value to check.
|
|
1725
|
-
|
|
1726
|
-
Returns **[Promise][9]<any>**
|
|
1683
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1727
1684
|
|
|
1728
1685
|
### selectOption
|
|
1729
1686
|
|
|
@@ -1750,8 +1707,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1750
1707
|
|
|
1751
1708
|
- `select` **([string][8] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
1752
1709
|
- `option` **([string][8] | [Array][14]<any>)** visible text or value of option.
|
|
1753
|
-
|
|
1754
|
-
Returns **[Promise][9]<any>**
|
|
1710
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1755
1711
|
|
|
1756
1712
|
### setCookie
|
|
1757
1713
|
|
|
@@ -1772,8 +1728,7 @@ I.setCookie([
|
|
|
1772
1728
|
#### Parameters
|
|
1773
1729
|
|
|
1774
1730
|
- `cookie` **(Cookie | [Array][14]<Cookie>)** a cookie object or array of cookie objects.
|
|
1775
|
-
|
|
1776
|
-
Returns **[Promise][9]<any>**
|
|
1731
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1777
1732
|
|
|
1778
1733
|
### switchTo
|
|
1779
1734
|
|
|
@@ -1786,9 +1741,8 @@ I.switchTo(); // switch back to main page
|
|
|
1786
1741
|
|
|
1787
1742
|
#### Parameters
|
|
1788
1743
|
|
|
1789
|
-
- `locator` **([string][8]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1790
|
-
|
|
1791
|
-
Returns **[Promise][9]<any>**
|
|
1744
|
+
- `locator` **([string][8]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1745
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1792
1746
|
|
|
1793
1747
|
### switchToNextTab
|
|
1794
1748
|
|
|
@@ -1801,7 +1755,7 @@ I.switchToNextTab(2);
|
|
|
1801
1755
|
|
|
1802
1756
|
#### Parameters
|
|
1803
1757
|
|
|
1804
|
-
- `num` **[number][
|
|
1758
|
+
- `num` **[number][10]**
|
|
1805
1759
|
|
|
1806
1760
|
### switchToPreviousTab
|
|
1807
1761
|
|
|
@@ -1814,7 +1768,7 @@ I.switchToPreviousTab(2);
|
|
|
1814
1768
|
|
|
1815
1769
|
#### Parameters
|
|
1816
1770
|
|
|
1817
|
-
- `num` **[number][
|
|
1771
|
+
- `num` **[number][10]**
|
|
1818
1772
|
|
|
1819
1773
|
### type
|
|
1820
1774
|
|
|
@@ -1836,11 +1790,10 @@ I.type(['T', 'E', 'X', 'T']);
|
|
|
1836
1790
|
#### Parameters
|
|
1837
1791
|
|
|
1838
1792
|
- `keys`
|
|
1839
|
-
- `delay` **[number][
|
|
1793
|
+
- `delay` **[number][10]?** (optional) delay in ms between key presses
|
|
1794
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1840
1795
|
- `key` **([string][8] | [Array][14]<[string][8]>)** or array of keys to type.
|
|
1841
1796
|
|
|
1842
|
-
Returns **[Promise][9]<any>**
|
|
1843
|
-
|
|
1844
1797
|
### uncheckOption
|
|
1845
1798
|
|
|
1846
1799
|
Unselects a checkbox or radio button.
|
|
@@ -1857,9 +1810,8 @@ I.uncheckOption('agree', '//form');
|
|
|
1857
1810
|
#### Parameters
|
|
1858
1811
|
|
|
1859
1812
|
- `field` **([string][8] | [object][6])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1860
|
-
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1861
|
-
|
|
1862
|
-
Returns **[Promise][9]<any>**
|
|
1813
|
+
- `context` **([string][8]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1814
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1863
1815
|
|
|
1864
1816
|
### usePuppeteerTo
|
|
1865
1817
|
|
|
@@ -1879,7 +1831,7 @@ I.usePuppeteerTo('emulate offline mode', async ({ page }) {
|
|
|
1879
1831
|
#### Parameters
|
|
1880
1832
|
|
|
1881
1833
|
- `description` **[string][8]** used to show in logs.
|
|
1882
|
-
- `fn` **[function][
|
|
1834
|
+
- `fn` **[function][12]** async function that is executed with Puppeteer as argument
|
|
1883
1835
|
|
|
1884
1836
|
### wait
|
|
1885
1837
|
|
|
@@ -1891,9 +1843,8 @@ I.wait(2); // wait 2 secs
|
|
|
1891
1843
|
|
|
1892
1844
|
#### Parameters
|
|
1893
1845
|
|
|
1894
|
-
- `sec` **[number][
|
|
1895
|
-
|
|
1896
|
-
Returns **[Promise][9]<any>**
|
|
1846
|
+
- `sec` **[number][10]** number of second to wait.
|
|
1847
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1897
1848
|
|
|
1898
1849
|
### waitForClickable
|
|
1899
1850
|
|
|
@@ -1909,9 +1860,8 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
1909
1860
|
|
|
1910
1861
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1911
1862
|
- `waitTimeout`
|
|
1912
|
-
- `sec` **[number][
|
|
1913
|
-
|
|
1914
|
-
Returns **[Promise][9]<any>**
|
|
1863
|
+
- `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait
|
|
1864
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1915
1865
|
|
|
1916
1866
|
### waitForDetached
|
|
1917
1867
|
|
|
@@ -1925,9 +1875,8 @@ I.waitForDetached('#popup');
|
|
|
1925
1875
|
#### Parameters
|
|
1926
1876
|
|
|
1927
1877
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1928
|
-
- `sec` **[number][
|
|
1929
|
-
|
|
1930
|
-
Returns **[Promise][9]<any>**
|
|
1878
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
1879
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1931
1880
|
|
|
1932
1881
|
### waitForElement
|
|
1933
1882
|
|
|
@@ -1942,9 +1891,9 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1942
1891
|
#### Parameters
|
|
1943
1892
|
|
|
1944
1893
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1945
|
-
- `sec` **[number][
|
|
1946
|
-
|
|
1947
|
-
|
|
1894
|
+
- `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait
|
|
1895
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1896
|
+
|
|
1948
1897
|
|
|
1949
1898
|
|
|
1950
1899
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1958,9 +1907,8 @@ Element can be located by CSS or XPath.
|
|
|
1958
1907
|
#### Parameters
|
|
1959
1908
|
|
|
1960
1909
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1961
|
-
- `sec` **[number][
|
|
1962
|
-
|
|
1963
|
-
Returns **[Promise][9]<any>**
|
|
1910
|
+
- `sec` **[number][10]** (optional) time in seconds to wait, 1 by default.
|
|
1911
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1964
1912
|
|
|
1965
1913
|
### waitForFunction
|
|
1966
1914
|
|
|
@@ -1979,11 +1927,10 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1979
1927
|
|
|
1980
1928
|
#### Parameters
|
|
1981
1929
|
|
|
1982
|
-
- `fn` **([string][8] | [function][
|
|
1983
|
-
- `argsOrSec` **([Array][14]<any> | [number][
|
|
1984
|
-
- `sec` **[number][
|
|
1985
|
-
|
|
1986
|
-
Returns **[Promise][9]<any>**
|
|
1930
|
+
- `fn` **([string][8] | [function][12])** to be executed in browser context.
|
|
1931
|
+
- `argsOrSec` **([Array][14]<any> | [number][10])?** (optional, `1` by default) arguments for function or seconds.
|
|
1932
|
+
- `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait
|
|
1933
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1987
1934
|
|
|
1988
1935
|
### waitForInvisible
|
|
1989
1936
|
|
|
@@ -1997,9 +1944,8 @@ I.waitForInvisible('#popup');
|
|
|
1997
1944
|
#### Parameters
|
|
1998
1945
|
|
|
1999
1946
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2000
|
-
- `sec` **[number][
|
|
2001
|
-
|
|
2002
|
-
Returns **[Promise][9]<any>**
|
|
1947
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
1948
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2003
1949
|
|
|
2004
1950
|
### waitForNavigation
|
|
2005
1951
|
|
|
@@ -2022,8 +1968,8 @@ I.waitForRequest(request => request.url() === 'http://example.com' && request.me
|
|
|
2022
1968
|
|
|
2023
1969
|
#### Parameters
|
|
2024
1970
|
|
|
2025
|
-
- `urlOrPredicate` **([string][8] | [function][
|
|
2026
|
-
- `sec` **[number][
|
|
1971
|
+
- `urlOrPredicate` **([string][8] | [function][12])**
|
|
1972
|
+
- `sec` **[number][10]?** seconds to wait
|
|
2027
1973
|
|
|
2028
1974
|
### waitForResponse
|
|
2029
1975
|
|
|
@@ -2036,8 +1982,8 @@ I.waitForResponse(response => response.url() === 'http://example.com' && respons
|
|
|
2036
1982
|
|
|
2037
1983
|
#### Parameters
|
|
2038
1984
|
|
|
2039
|
-
- `urlOrPredicate` **([string][8] | [function][
|
|
2040
|
-
- `sec` **[number][
|
|
1985
|
+
- `urlOrPredicate` **([string][8] | [function][12])**
|
|
1986
|
+
- `sec` **[number][10]?** number of seconds to wait
|
|
2041
1987
|
|
|
2042
1988
|
### waitForText
|
|
2043
1989
|
|
|
@@ -2053,10 +1999,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2053
1999
|
#### Parameters
|
|
2054
2000
|
|
|
2055
2001
|
- `text` **[string][8]** to wait for.
|
|
2056
|
-
- `sec` **[number][
|
|
2057
|
-
- `context` **([string][8] | [object][6])?** (optional) element located by CSS|XPath|strict locator.
|
|
2058
|
-
|
|
2059
|
-
Returns **[Promise][9]<any>**
|
|
2002
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
2003
|
+
- `context` **([string][8] | [object][6])?** (optional) element located by CSS|XPath|strict locator.
|
|
2004
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2060
2005
|
|
|
2061
2006
|
### waitForValue
|
|
2062
2007
|
|
|
@@ -2070,9 +2015,8 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2070
2015
|
|
|
2071
2016
|
- `field` **([string][8] | [object][6])** input field.
|
|
2072
2017
|
- `value` **[string][8]** expected value.
|
|
2073
|
-
- `sec` **[number][
|
|
2074
|
-
|
|
2075
|
-
Returns **[Promise][9]<any>**
|
|
2018
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
2019
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2076
2020
|
|
|
2077
2021
|
### waitForVisible
|
|
2078
2022
|
|
|
@@ -2086,9 +2030,8 @@ I.waitForVisible('#popup');
|
|
|
2086
2030
|
#### Parameters
|
|
2087
2031
|
|
|
2088
2032
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2089
|
-
- `sec` **[number][
|
|
2090
|
-
|
|
2091
|
-
Returns **[Promise][9]<any>** This method accepts [React selectors][22].
|
|
2033
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
2034
|
+
[!] returns a _promise_ which is synchronized internally by recorderThis method accepts [React selectors][22].
|
|
2092
2035
|
|
|
2093
2036
|
### waitInUrl
|
|
2094
2037
|
|
|
@@ -2101,9 +2044,8 @@ I.waitInUrl('/info', 2);
|
|
|
2101
2044
|
#### Parameters
|
|
2102
2045
|
|
|
2103
2046
|
- `urlPart` **[string][8]** value to check.
|
|
2104
|
-
- `sec` **[number][
|
|
2105
|
-
|
|
2106
|
-
Returns **[Promise][9]<any>**
|
|
2047
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
2048
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2107
2049
|
|
|
2108
2050
|
### waitNumberOfVisibleElements
|
|
2109
2051
|
|
|
@@ -2116,14 +2058,14 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2116
2058
|
#### Parameters
|
|
2117
2059
|
|
|
2118
2060
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2119
|
-
- `num` **[number][
|
|
2120
|
-
- `sec` **[number][
|
|
2121
|
-
|
|
2122
|
-
|
|
2061
|
+
- `num` **[number][10]** number of elements.
|
|
2062
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
2063
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2064
|
+
|
|
2123
2065
|
|
|
2124
2066
|
|
|
2125
2067
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
2126
|
-
|
|
2068
|
+
|
|
2127
2069
|
|
|
2128
2070
|
### waitToHide
|
|
2129
2071
|
|
|
@@ -2137,9 +2079,8 @@ I.waitToHide('#popup');
|
|
|
2137
2079
|
#### Parameters
|
|
2138
2080
|
|
|
2139
2081
|
- `locator` **([string][8] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2140
|
-
- `sec` **[number][
|
|
2141
|
-
|
|
2142
|
-
Returns **[Promise][9]<any>**
|
|
2082
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
2083
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2143
2084
|
|
|
2144
2085
|
### waitUrlEquals
|
|
2145
2086
|
|
|
@@ -2153,9 +2094,8 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2153
2094
|
#### Parameters
|
|
2154
2095
|
|
|
2155
2096
|
- `urlPart` **[string][8]** value to check.
|
|
2156
|
-
- `sec` **[number][
|
|
2157
|
-
|
|
2158
|
-
Returns **[Promise][9]<any>**
|
|
2097
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
2098
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2159
2099
|
|
|
2160
2100
|
[1]: https://github.com/GoogleChrome/puppeteer
|
|
2161
2101
|
|
|
@@ -2173,15 +2113,15 @@ Returns **[Promise][9]<any>**
|
|
|
2173
2113
|
|
|
2174
2114
|
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
2175
2115
|
|
|
2176
|
-
[9]: https://
|
|
2116
|
+
[9]: https://github.com/puppeteer/puppeteer/issues/5420
|
|
2177
2117
|
|
|
2178
|
-
[10]: https://
|
|
2118
|
+
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
2179
2119
|
|
|
2180
|
-
[11]: https://
|
|
2120
|
+
[11]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
2181
2121
|
|
|
2182
|
-
[12]: https://
|
|
2122
|
+
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2183
2123
|
|
|
2184
|
-
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
2124
|
+
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2185
2125
|
|
|
2186
2126
|
[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
2187
2127
|
|