codeceptjs 2.4.3 → 2.6.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 +117 -0
- package/README.md +32 -7
- package/bin/codecept.js +3 -0
- package/docs/basics.md +11 -5
- package/docs/bdd.md +4 -4
- package/docs/build/MockRequest.js +3 -0
- package/docs/build/Nightmare.js +10 -2
- package/docs/build/Playwright.js +3187 -0
- package/docs/build/Protractor.js +16 -2
- package/docs/build/Puppeteer.js +126 -19
- package/docs/build/REST.js +3 -1
- package/docs/build/TestCafe.js +11 -3
- package/docs/build/WebDriver.js +361 -28
- package/docs/changelog.md +116 -0
- package/docs/configuration.md +2 -2
- package/docs/custom-helpers.md +55 -10
- package/docs/helpers/Appium.md +81 -1
- package/docs/helpers/MockRequest.md +281 -38
- package/docs/helpers/Nightmare.md +10 -2
- package/docs/helpers/Playwright.md +1770 -0
- package/docs/helpers/Protractor.md +15 -3
- package/docs/helpers/Puppeteer-firefox.md +32 -1
- package/docs/helpers/Puppeteer.md +126 -76
- package/docs/helpers/TestCafe.md +10 -2
- package/docs/helpers/WebDriver.md +208 -118
- package/docs/locators.md +2 -0
- package/docs/playwright.md +306 -0
- package/docs/plugins.md +103 -0
- package/docs/reports.md +12 -0
- package/docs/shadow.md +68 -0
- package/docs/visual.md +0 -73
- package/docs/webapi/forceClick.mustache +27 -0
- package/docs/webapi/seeInPopup.mustache +7 -0
- package/docs/webapi/setCookie.mustache +10 -2
- package/docs/webapi/type.mustache +12 -0
- package/docs/webdriver.md +7 -3
- package/lib/codecept.js +1 -1
- package/lib/command/definitions.js +2 -2
- package/lib/command/generate.js +4 -4
- package/lib/command/gherkin/snippets.js +4 -4
- package/lib/command/init.js +1 -1
- package/lib/command/interactive.js +3 -0
- package/lib/command/run-multiple.js +2 -2
- package/lib/command/run-rerun.js +2 -0
- package/lib/command/run-workers.js +22 -8
- package/lib/command/run.js +2 -0
- package/lib/command/workers/runTests.js +1 -0
- package/lib/container.js +1 -1
- package/lib/event.js +2 -0
- package/lib/helper/MockRequest.js +3 -0
- package/lib/helper/Playwright.js +2422 -0
- package/lib/helper/Protractor.js +1 -2
- package/lib/helper/Puppeteer.js +84 -19
- package/lib/helper/REST.js +3 -1
- package/lib/helper/TestCafe.js +1 -1
- package/lib/helper/WebDriver.js +313 -26
- package/lib/helper/extras/PlaywrightPropEngine.js +53 -0
- package/lib/helper/scripts/isElementClickable.js +54 -14
- package/lib/interfaces/gherkin.js +1 -1
- package/lib/listener/helpers.js +3 -0
- package/lib/locator.js +5 -0
- package/lib/mochaFactory.js +12 -10
- package/lib/plugin/allure.js +8 -1
- package/lib/plugin/autoDelay.js +1 -8
- package/lib/plugin/commentStep.js +133 -0
- package/lib/plugin/screenshotOnFail.js +3 -10
- package/lib/plugin/selenoid.js +2 -2
- package/lib/plugin/standardActingHelpers.js +13 -0
- package/lib/plugin/stepByStepReport.js +1 -8
- package/lib/plugin/wdio.js +10 -1
- package/lib/reporter/cli.js +30 -1
- package/lib/session.js +7 -4
- package/package.json +13 -10
- package/typings/Mocha.d.ts +567 -16
- package/typings/index.d.ts +9 -5
- package/typings/types.d.ts +1634 -74
|
@@ -352,6 +352,14 @@ const browser = WebDriver.browser
|
|
|
352
352
|
|
|
353
353
|
- `config`
|
|
354
354
|
|
|
355
|
+
### _isShadowLocator
|
|
356
|
+
|
|
357
|
+
Check if locator is type of "Shadow"
|
|
358
|
+
|
|
359
|
+
#### Parameters
|
|
360
|
+
|
|
361
|
+
- `locator` **[object][18]**
|
|
362
|
+
|
|
355
363
|
### _locate
|
|
356
364
|
|
|
357
365
|
Get elements by different locator types, including strict locator.
|
|
@@ -363,7 +371,7 @@ this.helpers['WebDriver']._locate({name: 'password'}).then //...
|
|
|
363
371
|
|
|
364
372
|
#### Parameters
|
|
365
373
|
|
|
366
|
-
- `locator` **([string][
|
|
374
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
367
375
|
- `smartWait`
|
|
368
376
|
|
|
369
377
|
### _locateCheckable
|
|
@@ -376,19 +384,21 @@ this.helpers['WebDriver']._locateCheckable('I agree with terms and conditions').
|
|
|
376
384
|
|
|
377
385
|
#### Parameters
|
|
378
386
|
|
|
379
|
-
- `locator` **([string][
|
|
387
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
380
388
|
|
|
381
389
|
### _locateClickable
|
|
382
390
|
|
|
383
391
|
Find a clickable element by providing human readable text:
|
|
384
392
|
|
|
385
393
|
```js
|
|
386
|
-
this.helpers
|
|
394
|
+
const els = await this.helpers.WebDriver._locateClickable('Next page');
|
|
395
|
+
const els = await this.helpers.WebDriver._locateClickable('Next page', '.pages');
|
|
387
396
|
```
|
|
388
397
|
|
|
389
398
|
#### Parameters
|
|
390
399
|
|
|
391
|
-
- `locator` **([string][
|
|
400
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
401
|
+
- `context`
|
|
392
402
|
|
|
393
403
|
### _locateFields
|
|
394
404
|
|
|
@@ -400,7 +410,23 @@ this.helpers['WebDriver']._locateFields('Your email').then // ...
|
|
|
400
410
|
|
|
401
411
|
#### Parameters
|
|
402
412
|
|
|
403
|
-
- `locator` **([string][
|
|
413
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
414
|
+
|
|
415
|
+
### _locateShadow
|
|
416
|
+
|
|
417
|
+
Locate Element within the Shadow Dom
|
|
418
|
+
|
|
419
|
+
#### Parameters
|
|
420
|
+
|
|
421
|
+
- `locator` **[object][18]**
|
|
422
|
+
|
|
423
|
+
### _smartWait
|
|
424
|
+
|
|
425
|
+
Smart Wait to locate an element
|
|
426
|
+
|
|
427
|
+
#### Parameters
|
|
428
|
+
|
|
429
|
+
- `locator` **[object][18]**
|
|
404
430
|
|
|
405
431
|
### acceptPopup
|
|
406
432
|
|
|
@@ -421,7 +447,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
421
447
|
|
|
422
448
|
#### Parameters
|
|
423
449
|
|
|
424
|
-
- `url` **[string][
|
|
450
|
+
- `url` **[string][19]** url path or global url.
|
|
425
451
|
|
|
426
452
|
### appendField
|
|
427
453
|
|
|
@@ -434,8 +460,8 @@ I.appendField('#myTextField', 'appended');
|
|
|
434
460
|
|
|
435
461
|
#### Parameters
|
|
436
462
|
|
|
437
|
-
- `field` **([string][
|
|
438
|
-
- `value` **[string][
|
|
463
|
+
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator
|
|
464
|
+
- `value` **[string][19]** text value to append.
|
|
439
465
|
|
|
440
466
|
|
|
441
467
|
|
|
@@ -455,8 +481,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
455
481
|
|
|
456
482
|
#### Parameters
|
|
457
483
|
|
|
458
|
-
- `locator` **([string][
|
|
459
|
-
- `pathToFile` **[string][
|
|
484
|
+
- `locator` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
485
|
+
- `pathToFile` **[string][19]** local file path relative to codecept.json config file.
|
|
460
486
|
Appium: not tested
|
|
461
487
|
|
|
462
488
|
### cancelPopup
|
|
@@ -478,8 +504,8 @@ I.checkOption('agree', '//form');
|
|
|
478
504
|
|
|
479
505
|
#### Parameters
|
|
480
506
|
|
|
481
|
-
- `field` **([string][
|
|
482
|
-
- `context` **([string][
|
|
507
|
+
- `field` **([string][19] | [object][18])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
508
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
483
509
|
Appium: not tested
|
|
484
510
|
|
|
485
511
|
### clearCookie
|
|
@@ -494,7 +520,7 @@ I.clearCookie('test');
|
|
|
494
520
|
|
|
495
521
|
#### Parameters
|
|
496
522
|
|
|
497
|
-
- `cookie` **[string][
|
|
523
|
+
- `cookie` **[string][19]?** (optional, `null` by default) cookie name
|
|
498
524
|
|
|
499
525
|
### clearField
|
|
500
526
|
|
|
@@ -509,7 +535,7 @@ I.clearField('#email');
|
|
|
509
535
|
#### Parameters
|
|
510
536
|
|
|
511
537
|
- `field`
|
|
512
|
-
- `editable` **([string][
|
|
538
|
+
- `editable` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
513
539
|
|
|
514
540
|
### click
|
|
515
541
|
|
|
@@ -537,8 +563,8 @@ I.click({css: 'nav a.login'});
|
|
|
537
563
|
|
|
538
564
|
#### Parameters
|
|
539
565
|
|
|
540
|
-
- `locator` **([string][
|
|
541
|
-
- `context` **([string][
|
|
566
|
+
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
567
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
542
568
|
|
|
543
569
|
|
|
544
570
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -587,8 +613,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
587
613
|
|
|
588
614
|
#### Parameters
|
|
589
615
|
|
|
590
|
-
- `text` **[string][
|
|
591
|
-
- `context` **([string][
|
|
616
|
+
- `text` **[string][19]** which is not present.
|
|
617
|
+
- `context` **([string][19] | [object][18])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
592
618
|
|
|
593
619
|
|
|
594
620
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -606,7 +632,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
606
632
|
|
|
607
633
|
#### Parameters
|
|
608
634
|
|
|
609
|
-
- `field` **([string][
|
|
635
|
+
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.Appium: not tested
|
|
610
636
|
|
|
611
637
|
### dontSeeCookie
|
|
612
638
|
|
|
@@ -618,7 +644,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
618
644
|
|
|
619
645
|
#### Parameters
|
|
620
646
|
|
|
621
|
-
- `name` **[string][
|
|
647
|
+
- `name` **[string][19]** cookie name.
|
|
622
648
|
|
|
623
649
|
### dontSeeCurrentUrlEquals
|
|
624
650
|
|
|
@@ -632,7 +658,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
632
658
|
|
|
633
659
|
#### Parameters
|
|
634
660
|
|
|
635
|
-
- `url` **[string][
|
|
661
|
+
- `url` **[string][19]** value to check.
|
|
636
662
|
|
|
637
663
|
### dontSeeElement
|
|
638
664
|
|
|
@@ -644,7 +670,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
644
670
|
|
|
645
671
|
#### Parameters
|
|
646
672
|
|
|
647
|
-
- `locator` **([string][
|
|
673
|
+
- `locator` **([string][19] | [object][18])** located by CSS|XPath|Strict locator.
|
|
648
674
|
|
|
649
675
|
|
|
650
676
|
|
|
@@ -661,7 +687,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
661
687
|
|
|
662
688
|
#### Parameters
|
|
663
689
|
|
|
664
|
-
- `locator` **([string][
|
|
690
|
+
- `locator` **([string][19] | [object][18])** located by CSS|XPath|Strict locator.
|
|
665
691
|
|
|
666
692
|
### dontSeeInCurrentUrl
|
|
667
693
|
|
|
@@ -669,7 +695,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
669
695
|
|
|
670
696
|
#### Parameters
|
|
671
697
|
|
|
672
|
-
- `url` **[string][
|
|
698
|
+
- `url` **[string][19]** value to check.
|
|
673
699
|
|
|
674
700
|
### dontSeeInField
|
|
675
701
|
|
|
@@ -683,8 +709,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
683
709
|
|
|
684
710
|
#### Parameters
|
|
685
711
|
|
|
686
|
-
- `field` **([string][
|
|
687
|
-
- `value` **[string][
|
|
712
|
+
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
713
|
+
- `value` **[string][19]** value to check.
|
|
688
714
|
|
|
689
715
|
### dontSeeInSource
|
|
690
716
|
|
|
@@ -697,7 +723,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
697
723
|
#### Parameters
|
|
698
724
|
|
|
699
725
|
- `text`
|
|
700
|
-
- `value` **[string][
|
|
726
|
+
- `value` **[string][19]** to check.
|
|
701
727
|
|
|
702
728
|
### dontSeeInTitle
|
|
703
729
|
|
|
@@ -709,7 +735,7 @@ I.dontSeeInTitle('Error');
|
|
|
709
735
|
|
|
710
736
|
#### Parameters
|
|
711
737
|
|
|
712
|
-
- `text` **[string][
|
|
738
|
+
- `text` **[string][19]** value to check.
|
|
713
739
|
|
|
714
740
|
### doubleClick
|
|
715
741
|
|
|
@@ -725,8 +751,8 @@ I.doubleClick('.btn.edit');
|
|
|
725
751
|
|
|
726
752
|
#### Parameters
|
|
727
753
|
|
|
728
|
-
- `locator` **([string][
|
|
729
|
-
- `context` **([string][
|
|
754
|
+
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
755
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
730
756
|
|
|
731
757
|
|
|
732
758
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -742,8 +768,8 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
742
768
|
|
|
743
769
|
#### Parameters
|
|
744
770
|
|
|
745
|
-
- `srcElement` **([string][
|
|
746
|
-
- `destElement` **([string][
|
|
771
|
+
- `srcElement` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
772
|
+
- `destElement` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
747
773
|
Appium: not tested
|
|
748
774
|
|
|
749
775
|
### dragSlider
|
|
@@ -758,7 +784,7 @@ I.dragSlider('#slider', -70);
|
|
|
758
784
|
|
|
759
785
|
#### Parameters
|
|
760
786
|
|
|
761
|
-
- `locator` **([string][
|
|
787
|
+
- `locator` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
762
788
|
- `offsetX` **[number][22]** position to drag.
|
|
763
789
|
|
|
764
790
|
### executeAsyncScript
|
|
@@ -786,7 +812,7 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
786
812
|
|
|
787
813
|
#### Parameters
|
|
788
814
|
|
|
789
|
-
- `fn` **([string][
|
|
815
|
+
- `fn` **([string][19] | [function][24])** function to be executed in browser context.
|
|
790
816
|
- `args` **...any** to be passed to function.
|
|
791
817
|
|
|
792
818
|
Returns **[Promise][25]<any>**
|
|
@@ -819,7 +845,7 @@ let date = await I.executeScript(function(el) {
|
|
|
819
845
|
|
|
820
846
|
#### Parameters
|
|
821
847
|
|
|
822
|
-
- `fn` **([string][
|
|
848
|
+
- `fn` **([string][19] | [function][24])** function to be executed in browser context.
|
|
823
849
|
- `args` **...any** to be passed to function.
|
|
824
850
|
|
|
825
851
|
Returns **[Promise][25]<any>** Wraps [execute][26] command.
|
|
@@ -842,13 +868,49 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
842
868
|
|
|
843
869
|
#### Parameters
|
|
844
870
|
|
|
845
|
-
- `field` **([string][
|
|
846
|
-
- `value` **[string][
|
|
871
|
+
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
872
|
+
- `value` **[string][19]** text value to fill.
|
|
847
873
|
|
|
848
874
|
|
|
849
875
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
850
876
|
|
|
851
877
|
|
|
878
|
+
### forceClick
|
|
879
|
+
|
|
880
|
+
Perform an emulated click on a link or a button, given by a locator.
|
|
881
|
+
Unlike normal click instead of sending native event, emulates a click with JavaScript.
|
|
882
|
+
This works on hidden, animated or inactive elements as well.
|
|
883
|
+
|
|
884
|
+
If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
|
|
885
|
+
For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
|
|
886
|
+
For images, the "alt" attribute and inner text of any parent links are searched.
|
|
887
|
+
|
|
888
|
+
The second parameter is a context (CSS or XPath locator) to narrow the search.
|
|
889
|
+
|
|
890
|
+
```js
|
|
891
|
+
// simple link
|
|
892
|
+
I.forceClick('Logout');
|
|
893
|
+
// button of form
|
|
894
|
+
I.forceClick('Submit');
|
|
895
|
+
// CSS button
|
|
896
|
+
I.forceClick('#form input[type=submit]');
|
|
897
|
+
// XPath
|
|
898
|
+
I.forceClick('//form/*[@type=submit]');
|
|
899
|
+
// link in context
|
|
900
|
+
I.forceClick('Logout', '#nav');
|
|
901
|
+
// using strict locator
|
|
902
|
+
I.forceClick({css: 'nav a.login'});
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
#### Parameters
|
|
906
|
+
|
|
907
|
+
- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
908
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
This action supports [React locators](https://codecept.io/react#locators)
|
|
912
|
+
|
|
913
|
+
|
|
852
914
|
### grabAllWindowHandles
|
|
853
915
|
|
|
854
916
|
Get all Window Handles.
|
|
@@ -870,10 +932,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
870
932
|
|
|
871
933
|
#### Parameters
|
|
872
934
|
|
|
873
|
-
- `locator` **([string][
|
|
874
|
-
- `attr` **[string][
|
|
935
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
936
|
+
- `attr` **[string][19]** attribute name.
|
|
875
937
|
|
|
876
|
-
Returns **[Promise][25]<[string][
|
|
938
|
+
Returns **[Promise][25]<[string][19]>** attribute value
|
|
877
939
|
Appium: can be used for apps only with several values ("contentDescription", "text", "className", "resourceId")
|
|
878
940
|
|
|
879
941
|
### grabBrowserLogs
|
|
@@ -885,7 +947,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
885
947
|
console.log(JSON.stringify(logs))
|
|
886
948
|
```
|
|
887
949
|
|
|
888
|
-
Returns **[Promise][25]<([string][
|
|
950
|
+
Returns **[Promise][25]<([string][19] | [undefined][27])>**
|
|
889
951
|
|
|
890
952
|
### grabCookie
|
|
891
953
|
|
|
@@ -900,9 +962,9 @@ assert(cookie.value, '123456');
|
|
|
900
962
|
|
|
901
963
|
#### Parameters
|
|
902
964
|
|
|
903
|
-
- `name` **[string][
|
|
965
|
+
- `name` **[string][19]?** cookie name.
|
|
904
966
|
|
|
905
|
-
Returns **[Promise][25]<[string][
|
|
967
|
+
Returns **[Promise][25]<[string][19]>** attribute value
|
|
906
968
|
|
|
907
969
|
### grabCssPropertyFrom
|
|
908
970
|
|
|
@@ -915,10 +977,10 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
915
977
|
|
|
916
978
|
#### Parameters
|
|
917
979
|
|
|
918
|
-
- `locator` **([string][
|
|
919
|
-
- `cssProperty` **[string][
|
|
980
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
981
|
+
- `cssProperty` **[string][19]** CSS property name.
|
|
920
982
|
|
|
921
|
-
Returns **[Promise][25]<[string][
|
|
983
|
+
Returns **[Promise][25]<[string][19]>** CSS value
|
|
922
984
|
|
|
923
985
|
### grabCurrentUrl
|
|
924
986
|
|
|
@@ -930,7 +992,7 @@ let url = await I.grabCurrentUrl();
|
|
|
930
992
|
console.log(`Current URL is [${url}]`);
|
|
931
993
|
```
|
|
932
994
|
|
|
933
|
-
Returns **[Promise][25]<[string][
|
|
995
|
+
Returns **[Promise][25]<[string][19]>** current URL
|
|
934
996
|
|
|
935
997
|
### grabCurrentWindowHandle
|
|
936
998
|
|
|
@@ -963,11 +1025,11 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
963
1025
|
|
|
964
1026
|
#### Parameters
|
|
965
1027
|
|
|
966
|
-
- `locator` **([string][
|
|
1028
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
967
1029
|
- `prop`
|
|
968
|
-
- `elementSize` **[string][
|
|
1030
|
+
- `elementSize` **[string][19]** x, y, width or height of the given element.
|
|
969
1031
|
|
|
970
|
-
Returns **[object][
|
|
1032
|
+
Returns **[object][18]** Element bounding rectangle
|
|
971
1033
|
|
|
972
1034
|
### grabGeoLocation
|
|
973
1035
|
|
|
@@ -990,9 +1052,9 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
990
1052
|
#### Parameters
|
|
991
1053
|
|
|
992
1054
|
- `locator`
|
|
993
|
-
- `element` **([string][
|
|
1055
|
+
- `element` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
994
1056
|
|
|
995
|
-
Returns **[Promise][25]<[string][
|
|
1057
|
+
Returns **[Promise][25]<[string][19]>** HTML code for an element
|
|
996
1058
|
|
|
997
1059
|
### grabNumberOfOpenTabs
|
|
998
1060
|
|
|
@@ -1014,7 +1076,7 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1014
1076
|
|
|
1015
1077
|
#### Parameters
|
|
1016
1078
|
|
|
1017
|
-
- `locator` **([string][
|
|
1079
|
+
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1018
1080
|
|
|
1019
1081
|
Returns **[Promise][25]<[number][22]>** number of visible elements
|
|
1020
1082
|
|
|
@@ -1027,7 +1089,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1027
1089
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1028
1090
|
```
|
|
1029
1091
|
|
|
1030
|
-
Returns **[Promise][25]<[Object][
|
|
1092
|
+
Returns **[Promise][25]<[Object][18]<[string][19], any>>** scroll position
|
|
1031
1093
|
|
|
1032
1094
|
### grabPopupText
|
|
1033
1095
|
|
|
@@ -1046,7 +1108,7 @@ Resumes test execution, so should be used inside an async function.
|
|
|
1046
1108
|
let pageSource = await I.grabSource();
|
|
1047
1109
|
```
|
|
1048
1110
|
|
|
1049
|
-
Returns **[Promise][25]<[string][
|
|
1111
|
+
Returns **[Promise][25]<[string][19]>** source code
|
|
1050
1112
|
|
|
1051
1113
|
### grabTextFrom
|
|
1052
1114
|
|
|
@@ -1061,9 +1123,9 @@ If multiple elements found returns an array of texts.
|
|
|
1061
1123
|
|
|
1062
1124
|
#### Parameters
|
|
1063
1125
|
|
|
1064
|
-
- `locator` **([string][
|
|
1126
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1065
1127
|
|
|
1066
|
-
Returns **[Promise][25]<([string][
|
|
1128
|
+
Returns **[Promise][25]<([string][19] | [Array][28]<[string][19]>)>** attribute value
|
|
1067
1129
|
|
|
1068
1130
|
### grabTitle
|
|
1069
1131
|
|
|
@@ -1074,7 +1136,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1074
1136
|
let title = await I.grabTitle();
|
|
1075
1137
|
```
|
|
1076
1138
|
|
|
1077
|
-
Returns **[Promise][25]<[string][
|
|
1139
|
+
Returns **[Promise][25]<[string][19]>** title
|
|
1078
1140
|
|
|
1079
1141
|
### grabValueFrom
|
|
1080
1142
|
|
|
@@ -1087,9 +1149,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1087
1149
|
|
|
1088
1150
|
#### Parameters
|
|
1089
1151
|
|
|
1090
|
-
- `locator` **([string][
|
|
1152
|
+
- `locator` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1091
1153
|
|
|
1092
|
-
Returns **[Promise][25]<[string][
|
|
1154
|
+
Returns **[Promise][25]<[string][19]>** attribute value
|
|
1093
1155
|
|
|
1094
1156
|
### moveCursorTo
|
|
1095
1157
|
|
|
@@ -1103,7 +1165,9 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1103
1165
|
|
|
1104
1166
|
#### Parameters
|
|
1105
1167
|
|
|
1106
|
-
- `locator` **([string][
|
|
1168
|
+
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1169
|
+
- `xOffset`
|
|
1170
|
+
- `yOffset`
|
|
1107
1171
|
- `offsetX` **[number][22]** (optional, `0` by default) X-axis offset.
|
|
1108
1172
|
- `offsetY` **[number][22]** (optional, `0` by default) Y-axis offset.
|
|
1109
1173
|
|
|
@@ -1183,7 +1247,7 @@ Some of the supported key names are:
|
|
|
1183
1247
|
|
|
1184
1248
|
#### Parameters
|
|
1185
1249
|
|
|
1186
|
-
- `key` **([string][
|
|
1250
|
+
- `key` **([string][19] | [Array][28]<[string][19]>)** key or array of keys to press._Note:_ In case a text field or textarea is focused be aware that some browsers do not respect active modifier when combining modifier keys with other keys.
|
|
1187
1251
|
|
|
1188
1252
|
### pressKeyDown
|
|
1189
1253
|
|
|
@@ -1199,7 +1263,7 @@ I.pressKeyUp('Control');
|
|
|
1199
1263
|
|
|
1200
1264
|
#### Parameters
|
|
1201
1265
|
|
|
1202
|
-
- `key` **[string][
|
|
1266
|
+
- `key` **[string][19]** name of key to press down.
|
|
1203
1267
|
|
|
1204
1268
|
### pressKeyUp
|
|
1205
1269
|
|
|
@@ -1215,7 +1279,7 @@ I.pressKeyUp('Control');
|
|
|
1215
1279
|
|
|
1216
1280
|
#### Parameters
|
|
1217
1281
|
|
|
1218
|
-
- `key` **[string][
|
|
1282
|
+
- `key` **[string][19]** name of key to release.
|
|
1219
1283
|
|
|
1220
1284
|
### refreshPage
|
|
1221
1285
|
|
|
@@ -1251,8 +1315,8 @@ I.rightClick('Click me', '.context');
|
|
|
1251
1315
|
|
|
1252
1316
|
#### Parameters
|
|
1253
1317
|
|
|
1254
|
-
- `locator` **([string][
|
|
1255
|
-
- `context` **([string][
|
|
1318
|
+
- `locator` **([string][19] | [object][18])** clickable element located by CSS|XPath|strict locator.
|
|
1319
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1256
1320
|
|
|
1257
1321
|
|
|
1258
1322
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1297,7 +1361,7 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1297
1361
|
|
|
1298
1362
|
#### Parameters
|
|
1299
1363
|
|
|
1300
|
-
- `fileName` **[string][
|
|
1364
|
+
- `fileName` **[string][19]** file name to save.
|
|
1301
1365
|
- `fullPage` **[boolean][31]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1302
1366
|
|
|
1303
1367
|
### scrollIntoView
|
|
@@ -1312,9 +1376,9 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1312
1376
|
|
|
1313
1377
|
#### Parameters
|
|
1314
1378
|
|
|
1315
|
-
- `locator` **([string][
|
|
1379
|
+
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1316
1380
|
- `scrollIntoViewOptions`
|
|
1317
|
-
- `alignToTop` **([boolean][31] | [object][
|
|
1381
|
+
- `alignToTop` **([boolean][31] | [object][18])** (optional) or scrollIntoViewOptions (optional), see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][32].
|
|
1318
1382
|
|
|
1319
1383
|
### scrollPageToBottom
|
|
1320
1384
|
|
|
@@ -1344,7 +1408,7 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1344
1408
|
|
|
1345
1409
|
#### Parameters
|
|
1346
1410
|
|
|
1347
|
-
- `locator` **([string][
|
|
1411
|
+
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1348
1412
|
- `offsetX` **[number][22]** (optional, `0` by default) X-axis offset.
|
|
1349
1413
|
- `offsetY` **[number][22]** (optional, `0` by default) Y-axis offset.
|
|
1350
1414
|
|
|
@@ -1361,8 +1425,8 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1361
1425
|
|
|
1362
1426
|
#### Parameters
|
|
1363
1427
|
|
|
1364
|
-
- `text` **[string][
|
|
1365
|
-
- `context` **([string][
|
|
1428
|
+
- `text` **[string][19]** expected on page.
|
|
1429
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1366
1430
|
|
|
1367
1431
|
|
|
1368
1432
|
This action supports [React locators](https://codecept.io/react#locators)
|
|
@@ -1378,8 +1442,8 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1378
1442
|
|
|
1379
1443
|
#### Parameters
|
|
1380
1444
|
|
|
1381
|
-
- `locator` **([string][
|
|
1382
|
-
- `attributes` **[object][
|
|
1445
|
+
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1446
|
+
- `attributes` **[object][18]** attributes and their values to check.
|
|
1383
1447
|
|
|
1384
1448
|
### seeCheckboxIsChecked
|
|
1385
1449
|
|
|
@@ -1393,7 +1457,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1393
1457
|
|
|
1394
1458
|
#### Parameters
|
|
1395
1459
|
|
|
1396
|
-
- `field` **([string][
|
|
1460
|
+
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.Appium: not tested
|
|
1397
1461
|
|
|
1398
1462
|
### seeCookie
|
|
1399
1463
|
|
|
@@ -1405,7 +1469,7 @@ I.seeCookie('Auth');
|
|
|
1405
1469
|
|
|
1406
1470
|
#### Parameters
|
|
1407
1471
|
|
|
1408
|
-
- `name` **[string][
|
|
1472
|
+
- `name` **[string][19]** cookie name.
|
|
1409
1473
|
|
|
1410
1474
|
### seeCssPropertiesOnElements
|
|
1411
1475
|
|
|
@@ -1417,8 +1481,8 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1417
1481
|
|
|
1418
1482
|
#### Parameters
|
|
1419
1483
|
|
|
1420
|
-
- `locator` **([string][
|
|
1421
|
-
- `cssProperties` **[object][
|
|
1484
|
+
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1485
|
+
- `cssProperties` **[object][18]** object with CSS properties and their values to check.
|
|
1422
1486
|
|
|
1423
1487
|
### seeCurrentUrlEquals
|
|
1424
1488
|
|
|
@@ -1433,7 +1497,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1433
1497
|
|
|
1434
1498
|
#### Parameters
|
|
1435
1499
|
|
|
1436
|
-
- `url` **[string][
|
|
1500
|
+
- `url` **[string][19]** value to check.
|
|
1437
1501
|
|
|
1438
1502
|
### seeElement
|
|
1439
1503
|
|
|
@@ -1446,7 +1510,7 @@ I.seeElement('#modal');
|
|
|
1446
1510
|
|
|
1447
1511
|
#### Parameters
|
|
1448
1512
|
|
|
1449
|
-
- `locator` **([string][
|
|
1513
|
+
- `locator` **([string][19] | [object][18])** located by CSS|XPath|strict locator.
|
|
1450
1514
|
|
|
1451
1515
|
|
|
1452
1516
|
|
|
@@ -1464,7 +1528,7 @@ I.seeElementInDOM('#modal');
|
|
|
1464
1528
|
|
|
1465
1529
|
#### Parameters
|
|
1466
1530
|
|
|
1467
|
-
- `locator` **([string][
|
|
1531
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1468
1532
|
|
|
1469
1533
|
### seeInCurrentUrl
|
|
1470
1534
|
|
|
@@ -1476,7 +1540,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1476
1540
|
|
|
1477
1541
|
#### Parameters
|
|
1478
1542
|
|
|
1479
|
-
- `url` **[string][
|
|
1543
|
+
- `url` **[string][19]** a fragment to check
|
|
1480
1544
|
|
|
1481
1545
|
### seeInField
|
|
1482
1546
|
|
|
@@ -1492,8 +1556,8 @@ I.seeInField('#searchform input','Search');
|
|
|
1492
1556
|
|
|
1493
1557
|
#### Parameters
|
|
1494
1558
|
|
|
1495
|
-
- `field` **([string][
|
|
1496
|
-
- `value` **[string][
|
|
1559
|
+
- `field` **([string][19] | [object][18])** located by label|name|CSS|XPath|strict locator.
|
|
1560
|
+
- `value` **[string][19]** value to check.
|
|
1497
1561
|
|
|
1498
1562
|
### seeInPopup
|
|
1499
1563
|
|
|
@@ -1502,7 +1566,7 @@ given string.
|
|
|
1502
1566
|
|
|
1503
1567
|
#### Parameters
|
|
1504
1568
|
|
|
1505
|
-
- `text` **[string][
|
|
1569
|
+
- `text` **[string][19]** value to check.
|
|
1506
1570
|
|
|
1507
1571
|
### seeInSource
|
|
1508
1572
|
|
|
@@ -1514,7 +1578,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1514
1578
|
|
|
1515
1579
|
#### Parameters
|
|
1516
1580
|
|
|
1517
|
-
- `text` **[string][
|
|
1581
|
+
- `text` **[string][19]** value to check.
|
|
1518
1582
|
|
|
1519
1583
|
### seeInTitle
|
|
1520
1584
|
|
|
@@ -1526,7 +1590,7 @@ I.seeInTitle('Home Page');
|
|
|
1526
1590
|
|
|
1527
1591
|
#### Parameters
|
|
1528
1592
|
|
|
1529
|
-
- `text` **[string][
|
|
1593
|
+
- `text` **[string][19]** text value to check.
|
|
1530
1594
|
|
|
1531
1595
|
### seeNumberOfElements
|
|
1532
1596
|
|
|
@@ -1539,7 +1603,7 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1539
1603
|
|
|
1540
1604
|
#### Parameters
|
|
1541
1605
|
|
|
1542
|
-
- `locator` **([string][
|
|
1606
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1543
1607
|
- `num` **[number][22]** number of elements.
|
|
1544
1608
|
|
|
1545
1609
|
|
|
@@ -1557,7 +1621,7 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1557
1621
|
|
|
1558
1622
|
#### Parameters
|
|
1559
1623
|
|
|
1560
|
-
- `locator` **([string][
|
|
1624
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1561
1625
|
- `num` **[number][22]** number of elements.
|
|
1562
1626
|
|
|
1563
1627
|
|
|
@@ -1574,8 +1638,8 @@ I.seeTextEquals('text', 'h1');
|
|
|
1574
1638
|
|
|
1575
1639
|
#### Parameters
|
|
1576
1640
|
|
|
1577
|
-
- `text` **[string][
|
|
1578
|
-
- `context` **([string][
|
|
1641
|
+
- `text` **[string][19]** element value to check.
|
|
1642
|
+
- `context` **([string][19] | [object][18]?)** element located by CSS|XPath|strict locator.
|
|
1579
1643
|
|
|
1580
1644
|
### seeTitleEquals
|
|
1581
1645
|
|
|
@@ -1587,7 +1651,7 @@ I.seeTitleEquals('Test title.');
|
|
|
1587
1651
|
|
|
1588
1652
|
#### Parameters
|
|
1589
1653
|
|
|
1590
|
-
- `text` **[string][
|
|
1654
|
+
- `text` **[string][19]** value to check.
|
|
1591
1655
|
|
|
1592
1656
|
### selectOption
|
|
1593
1657
|
|
|
@@ -1612,20 +1676,28 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1612
1676
|
|
|
1613
1677
|
#### Parameters
|
|
1614
1678
|
|
|
1615
|
-
- `select` **([string][
|
|
1616
|
-
- `option` **([string][
|
|
1679
|
+
- `select` **([string][19] | [object][18])** field located by label|name|CSS|XPath|strict locator.
|
|
1680
|
+
- `option` **([string][19] | [Array][28]<any>)** visible text or value of option.
|
|
1617
1681
|
|
|
1618
1682
|
### setCookie
|
|
1619
1683
|
|
|
1620
|
-
Sets
|
|
1684
|
+
Sets cookie(s).
|
|
1685
|
+
|
|
1686
|
+
Can be a single cookie object or an array of cookies:
|
|
1621
1687
|
|
|
1622
1688
|
```js
|
|
1623
1689
|
I.setCookie({name: 'auth', value: true});
|
|
1690
|
+
|
|
1691
|
+
// as array
|
|
1692
|
+
I.setCookie([
|
|
1693
|
+
{name: 'auth', value: true},
|
|
1694
|
+
{name: 'agree', value: true}
|
|
1695
|
+
]);
|
|
1624
1696
|
```
|
|
1625
1697
|
|
|
1626
1698
|
#### Parameters
|
|
1627
1699
|
|
|
1628
|
-
- `cookie` **[object][
|
|
1700
|
+
- `cookie` **([object][18] | [array][28])** a cookie object or array of cookie objects.Uses Selenium's JSON [cookie
|
|
1629
1701
|
format][33].
|
|
1630
1702
|
|
|
1631
1703
|
### setGeoLocation
|
|
@@ -1654,7 +1726,7 @@ I.switchTo(); // switch back to main page
|
|
|
1654
1726
|
|
|
1655
1727
|
#### Parameters
|
|
1656
1728
|
|
|
1657
|
-
- `locator` **([string][
|
|
1729
|
+
- `locator` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1658
1730
|
|
|
1659
1731
|
### switchToNextTab
|
|
1660
1732
|
|
|
@@ -1702,6 +1774,24 @@ await I.switchToWindow( window );
|
|
|
1702
1774
|
|
|
1703
1775
|
- `window`
|
|
1704
1776
|
|
|
1777
|
+
### type
|
|
1778
|
+
|
|
1779
|
+
Types out the given string or the array of keys provided.
|
|
1780
|
+
_Note:_ Should only be used when using [`fillField`][29] is not an option.
|
|
1781
|
+
|
|
1782
|
+
```js
|
|
1783
|
+
// When passing in a string
|
|
1784
|
+
I.type('Type this out.');
|
|
1785
|
+
// When passing in an array
|
|
1786
|
+
I.type(['T', 'E', 'X', 'T']);
|
|
1787
|
+
```
|
|
1788
|
+
|
|
1789
|
+
#### Parameters
|
|
1790
|
+
|
|
1791
|
+
- `keys`
|
|
1792
|
+
- `key` **([string][19] | [Array][28]<[string][19]>)** or array of keys to type.
|
|
1793
|
+
Type out given array of keys or a string of text
|
|
1794
|
+
|
|
1705
1795
|
### uncheckOption
|
|
1706
1796
|
|
|
1707
1797
|
Unselects a checkbox or radio button.
|
|
@@ -1717,8 +1807,8 @@ I.uncheckOption('agree', '//form');
|
|
|
1717
1807
|
|
|
1718
1808
|
#### Parameters
|
|
1719
1809
|
|
|
1720
|
-
- `field` **([string][
|
|
1721
|
-
- `context` **([string][
|
|
1810
|
+
- `field` **([string][19] | [object][18])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1811
|
+
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1722
1812
|
Appium: not tested
|
|
1723
1813
|
|
|
1724
1814
|
### wait
|
|
@@ -1745,7 +1835,7 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
1745
1835
|
|
|
1746
1836
|
#### Parameters
|
|
1747
1837
|
|
|
1748
|
-
- `locator` **([string][
|
|
1838
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1749
1839
|
- `waitTimeout`
|
|
1750
1840
|
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
1751
1841
|
|
|
@@ -1760,7 +1850,7 @@ I.waitForDetached('#popup');
|
|
|
1760
1850
|
|
|
1761
1851
|
#### Parameters
|
|
1762
1852
|
|
|
1763
|
-
- `locator` **([string][
|
|
1853
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1764
1854
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
1765
1855
|
|
|
1766
1856
|
### waitForElement
|
|
@@ -1775,7 +1865,7 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1775
1865
|
|
|
1776
1866
|
#### Parameters
|
|
1777
1867
|
|
|
1778
|
-
- `locator` **([string][
|
|
1868
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1779
1869
|
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
1780
1870
|
|
|
1781
1871
|
### waitForEnabled
|
|
@@ -1785,7 +1875,7 @@ Element can be located by CSS or XPath.
|
|
|
1785
1875
|
|
|
1786
1876
|
#### Parameters
|
|
1787
1877
|
|
|
1788
|
-
- `locator` **([string][
|
|
1878
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1789
1879
|
- `sec` **[number][22]** (optional) time in seconds to wait, 1 by default.
|
|
1790
1880
|
|
|
1791
1881
|
### waitForFunction
|
|
@@ -1805,7 +1895,7 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1805
1895
|
|
|
1806
1896
|
#### Parameters
|
|
1807
1897
|
|
|
1808
|
-
- `fn` **([string][
|
|
1898
|
+
- `fn` **([string][19] | [function][24])** to be executed in browser context.
|
|
1809
1899
|
- `argsOrSec` **([Array][28]<any> | [number][22])?** (optional, `1` by default) arguments for function or seconds.
|
|
1810
1900
|
- `sec` **[number][22]?** (optional, `1` by default) time in seconds to wait
|
|
1811
1901
|
|
|
@@ -1820,7 +1910,7 @@ I.waitForInvisible('#popup');
|
|
|
1820
1910
|
|
|
1821
1911
|
#### Parameters
|
|
1822
1912
|
|
|
1823
|
-
- `locator` **([string][
|
|
1913
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1824
1914
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
1825
1915
|
|
|
1826
1916
|
### waitForText
|
|
@@ -1836,9 +1926,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1836
1926
|
|
|
1837
1927
|
#### Parameters
|
|
1838
1928
|
|
|
1839
|
-
- `text` **[string][
|
|
1929
|
+
- `text` **[string][19]** to wait for.
|
|
1840
1930
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
1841
|
-
- `context` **([string][
|
|
1931
|
+
- `context` **([string][19] | [object][18])?** (optional) element located by CSS|XPath|strict locator.
|
|
1842
1932
|
|
|
1843
1933
|
### waitForValue
|
|
1844
1934
|
|
|
@@ -1850,8 +1940,8 @@ I.waitForValue('//input', "GoodValue");
|
|
|
1850
1940
|
|
|
1851
1941
|
#### Parameters
|
|
1852
1942
|
|
|
1853
|
-
- `field` **([string][
|
|
1854
|
-
- `value` **[string][
|
|
1943
|
+
- `field` **([string][19] | [object][18])** input field.
|
|
1944
|
+
- `value` **[string][19]** expected value.
|
|
1855
1945
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
1856
1946
|
|
|
1857
1947
|
### waitForVisible
|
|
@@ -1865,7 +1955,7 @@ I.waitForVisible('#popup');
|
|
|
1865
1955
|
|
|
1866
1956
|
#### Parameters
|
|
1867
1957
|
|
|
1868
|
-
- `locator` **([string][
|
|
1958
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1869
1959
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
1870
1960
|
|
|
1871
1961
|
### waitInUrl
|
|
@@ -1878,7 +1968,7 @@ I.waitInUrl('/info', 2);
|
|
|
1878
1968
|
|
|
1879
1969
|
#### Parameters
|
|
1880
1970
|
|
|
1881
|
-
- `urlPart` **[string][
|
|
1971
|
+
- `urlPart` **[string][19]** value to check.
|
|
1882
1972
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
1883
1973
|
|
|
1884
1974
|
### waitNumberOfVisibleElements
|
|
@@ -1891,7 +1981,7 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
1891
1981
|
|
|
1892
1982
|
#### Parameters
|
|
1893
1983
|
|
|
1894
|
-
- `locator` **([string][
|
|
1984
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1895
1985
|
- `num` **[number][22]** number of elements.
|
|
1896
1986
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
1897
1987
|
|
|
@@ -1906,7 +1996,7 @@ I.waitToHide('#popup');
|
|
|
1906
1996
|
|
|
1907
1997
|
#### Parameters
|
|
1908
1998
|
|
|
1909
|
-
- `locator` **([string][
|
|
1999
|
+
- `locator` **([string][19] | [object][18])** element located by CSS|XPath|strict locator.
|
|
1910
2000
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
1911
2001
|
|
|
1912
2002
|
### waitUntil
|
|
@@ -1920,9 +2010,9 @@ I.waitUntil(() => window.requests == 0, 5);
|
|
|
1920
2010
|
|
|
1921
2011
|
#### Parameters
|
|
1922
2012
|
|
|
1923
|
-
- `fn` **([function][24] | [string][
|
|
2013
|
+
- `fn` **([function][24] | [string][19])** function which is executed in browser context.
|
|
1924
2014
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
1925
|
-
- `timeoutMsg` **[string][
|
|
2015
|
+
- `timeoutMsg` **[string][19]** message to show in case of timeout fail.
|
|
1926
2016
|
- `interval` **[number][22]?**
|
|
1927
2017
|
|
|
1928
2018
|
### waitUrlEquals
|
|
@@ -1936,7 +2026,7 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
1936
2026
|
|
|
1937
2027
|
#### Parameters
|
|
1938
2028
|
|
|
1939
|
-
- `urlPart` **[string][
|
|
2029
|
+
- `urlPart` **[string][19]** value to check.
|
|
1940
2030
|
- `sec` **[number][22]** (optional, `1` by default) time in seconds to wait
|
|
1941
2031
|
|
|
1942
2032
|
[1]: http://webdriver.io/
|
|
@@ -1973,9 +2063,9 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
1973
2063
|
|
|
1974
2064
|
[17]: http://webdriver.io/guide/usage/multiremote.html
|
|
1975
2065
|
|
|
1976
|
-
[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
2066
|
+
[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1977
2067
|
|
|
1978
|
-
[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
2068
|
+
[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1979
2069
|
|
|
1980
2070
|
[20]: http://jster.net/category/windows-modals-popups
|
|
1981
2071
|
|