codeceptjs 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -1
- package/README.md +15 -22
- package/bin/codecept.js +3 -1
- package/docs/advanced.md +1 -1
- package/docs/angular.md +6 -9
- package/docs/basics.md +388 -86
- package/docs/bdd.md +4 -3
- package/docs/build/Nightmare.js +3 -0
- package/docs/build/Polly.js +26 -12
- package/docs/build/Puppeteer.js +14 -13
- package/docs/build/TestCafe.js +101 -2
- package/docs/build/WebDriver.js +53 -52
- package/docs/changelog.md +86 -57
- package/docs/detox.md +235 -0
- package/docs/helpers/Detox.md +579 -0
- package/docs/helpers/Polly.md +13 -3
- package/docs/helpers/Puppeteer.md +155 -156
- package/docs/helpers/TestCafe.md +53 -0
- package/docs/helpers/WebDriver.md +209 -204
- package/docs/locators.md +2 -0
- package/docs/mobile.md +5 -1
- package/docs/puppeteer.md +59 -13
- package/docs/quickstart.md +47 -12
- package/docs/testcafe.md +157 -0
- package/docs/webdriver.md +453 -0
- package/lib/command/definitions.js +152 -7
- package/lib/command/gherkin/snippets.js +19 -8
- package/lib/command/init.js +30 -22
- package/lib/command/utils.js +1 -1
- package/lib/container.js +36 -10
- package/lib/data/dataScenarioConfig.js +18 -0
- package/lib/helper/Nightmare.js +3 -0
- package/lib/helper/Polly.js +26 -12
- package/lib/helper/Puppeteer.js +14 -13
- package/lib/helper/TestCafe.js +72 -2
- package/lib/helper/WebDriver.js +53 -52
- package/lib/helper/testcafe/testcafe-utils.js +3 -2
- package/lib/interfaces/scenarioConfig.js +2 -2
- package/lib/listener/config.js +2 -2
- package/lib/plugin/allure.js +3 -0
- package/lib/step.js +5 -2
- package/lib/ui.js +1 -1
- package/lib/utils.js +13 -21
- package/package.json +14 -12
|
@@ -42,15 +42,15 @@ This helper should be configured in codecept.json or codecept.conf.js
|
|
|
42
42
|
|
|
43
43
|
Example:
|
|
44
44
|
|
|
45
|
-
```
|
|
45
|
+
```js
|
|
46
46
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
helpers: {
|
|
48
|
+
WebDriver : {
|
|
49
|
+
smartWait: 5000,
|
|
50
|
+
browser: "chrome",
|
|
51
|
+
restart: false,
|
|
52
|
+
windowSize: "maximize",
|
|
53
|
+
timeouts: {
|
|
54
54
|
"script": 60000,
|
|
55
55
|
"page load": 10000
|
|
56
56
|
}
|
|
@@ -64,15 +64,15 @@ website][6].
|
|
|
64
64
|
|
|
65
65
|
### Headless Chrome
|
|
66
66
|
|
|
67
|
-
```
|
|
67
|
+
```js
|
|
68
68
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
helpers: {
|
|
70
|
+
WebDriver : {
|
|
71
|
+
url: "http://localhost",
|
|
72
|
+
browser: "chrome",
|
|
73
|
+
desiredCapabilities: {
|
|
74
|
+
chromeOptions: {
|
|
75
|
+
args: [ "--headless", "--disable-gpu", "--window-size=800,600" ]
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -84,14 +84,14 @@ website][6].
|
|
|
84
84
|
|
|
85
85
|
Additional configuration params can be used from [IE options][7]
|
|
86
86
|
|
|
87
|
-
```
|
|
87
|
+
```js
|
|
88
88
|
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
helpers: {
|
|
90
|
+
WebDriver : {
|
|
91
|
+
url: "http://localhost",
|
|
92
|
+
browser: "internet explorer",
|
|
93
|
+
desiredCapabilities: {
|
|
94
|
+
ieOptions: {
|
|
95
95
|
"ie.browserCommandLineSwitches": "-private",
|
|
96
96
|
"ie.usePerProcessProxy": true,
|
|
97
97
|
"ie.ensureCleanSession": true,
|
|
@@ -104,15 +104,18 @@ Additional configuration params can be used from [IE options][7]
|
|
|
104
104
|
|
|
105
105
|
### Selenoid Options
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
[Selenoid][8] is a modern way to run Selenium inside Docker containers.
|
|
108
|
+
Selenoid is easy to set up and provides more features than original Selenium Server. Use `selenoidOptions` to set Selenoid capabilities
|
|
109
|
+
|
|
110
|
+
```js
|
|
108
111
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
helpers: {
|
|
113
|
+
WebDriver : {
|
|
114
|
+
url: "http://localhost",
|
|
115
|
+
browser: "chrome",
|
|
116
|
+
desiredCapabilities: {
|
|
117
|
+
selenoidOptions: {
|
|
118
|
+
enableVNC: true,
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
}
|
|
@@ -120,17 +123,17 @@ Additional configuration params can be used from [IE options][7]
|
|
|
120
123
|
}
|
|
121
124
|
```
|
|
122
125
|
|
|
123
|
-
### Connect
|
|
126
|
+
### Connect Through proxy
|
|
124
127
|
|
|
125
128
|
CodeceptJS also provides flexible options when you want to execute tests to Selenium servers through proxy. You will
|
|
126
129
|
need to update the `helpers.WebDriver.capabilities.proxy` key.
|
|
127
130
|
|
|
128
131
|
```js
|
|
129
132
|
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
helpers: {
|
|
134
|
+
WebDriver: {
|
|
135
|
+
capabilities: {
|
|
136
|
+
proxy: {
|
|
134
137
|
"proxyType": "manual|pac",
|
|
135
138
|
"proxyAutoconfigUrl": "URL TO PAC FILE",
|
|
136
139
|
"httpProxy": "PROXY SERVER",
|
|
@@ -151,10 +154,10 @@ For example,
|
|
|
151
154
|
|
|
152
155
|
```js
|
|
153
156
|
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
helpers: {
|
|
158
|
+
WebDriver: {
|
|
159
|
+
capabilities: {
|
|
160
|
+
proxy: {
|
|
158
161
|
"proxyType": "manual",
|
|
159
162
|
"httpProxy": "http://corporate.proxy:8080",
|
|
160
163
|
"socksUsername": "codeceptjs",
|
|
@@ -173,7 +176,7 @@ information.
|
|
|
173
176
|
### Cloud Providers
|
|
174
177
|
|
|
175
178
|
WebDriver makes it possible to execute tests against services like `Sauce Labs` `BrowserStack` `TestingBot`
|
|
176
|
-
Check out their documentation on [available parameters][
|
|
179
|
+
Check out their documentation on [available parameters][9]
|
|
177
180
|
|
|
178
181
|
Connecting to `BrowserStack` and `Sauce Labs` is simple. All you need to do
|
|
179
182
|
is set the `user` and `key` parameters. WebDriver automatically know which
|
|
@@ -181,12 +184,12 @@ service provider to connect to.
|
|
|
181
184
|
|
|
182
185
|
```js
|
|
183
186
|
{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
helpers:{
|
|
188
|
+
WebDriver: {
|
|
189
|
+
url: "YOUR_DESIRED_HOST",
|
|
190
|
+
user: "YOUR_BROWSERSTACK_USER",
|
|
191
|
+
key: "YOUR_BROWSERSTACK_KEY",
|
|
192
|
+
capabilities: {
|
|
190
193
|
"browserName": "chrome",
|
|
191
194
|
|
|
192
195
|
// only set this if you're using BrowserStackLocal to test a local domain
|
|
@@ -222,9 +225,9 @@ plugins: {
|
|
|
222
225
|
}
|
|
223
226
|
```
|
|
224
227
|
|
|
225
|
-
See [complete reference on webdriver.io][
|
|
228
|
+
See [complete reference on webdriver.io][10].
|
|
226
229
|
|
|
227
|
-
> Alternatively, use [codeceptjs-saucehelper][
|
|
230
|
+
> Alternatively, use [codeceptjs-saucehelper][11] for better reporting.
|
|
228
231
|
|
|
229
232
|
#### BrowserStack
|
|
230
233
|
|
|
@@ -248,13 +251,13 @@ plugins: {
|
|
|
248
251
|
}
|
|
249
252
|
```
|
|
250
253
|
|
|
251
|
-
See [complete reference on webdriver.io][
|
|
254
|
+
See [complete reference on webdriver.io][12].
|
|
252
255
|
|
|
253
|
-
> Alternatively, use [codeceptjs-bshelper][
|
|
256
|
+
> Alternatively, use [codeceptjs-bshelper][13] for better reporting.
|
|
254
257
|
|
|
255
258
|
#### TestingBot
|
|
256
259
|
|
|
257
|
-
> Recommended: use official [TestingBot Helper][
|
|
260
|
+
> Recommended: use official [TestingBot Helper][14].
|
|
258
261
|
|
|
259
262
|
Alternatively, TestingBot can be configured via wdio service, which should be installed additionally:
|
|
260
263
|
|
|
@@ -276,25 +279,25 @@ plugins: {
|
|
|
276
279
|
}
|
|
277
280
|
```
|
|
278
281
|
|
|
279
|
-
See [complete reference on webdriver.io][
|
|
282
|
+
See [complete reference on webdriver.io][15].
|
|
280
283
|
|
|
281
284
|
#### Applitools
|
|
282
285
|
|
|
283
286
|
Visual testing via Applitools service
|
|
284
287
|
|
|
285
|
-
> Use [CodeceptJS Applitools Helper][
|
|
288
|
+
> Use [CodeceptJS Applitools Helper][16] with Applitools wdio service.
|
|
286
289
|
|
|
287
290
|
### Multiremote Capabilities
|
|
288
291
|
|
|
289
292
|
This is a work in progress but you can control two browsers at a time right out of the box.
|
|
290
293
|
Individual control is something that is planned for a later version.
|
|
291
294
|
|
|
292
|
-
Here is the [webdriverio docs][
|
|
295
|
+
Here is the [webdriverio docs][17] on the subject
|
|
293
296
|
|
|
294
297
|
```js
|
|
295
298
|
{
|
|
296
|
-
|
|
297
|
-
|
|
299
|
+
helpers: {
|
|
300
|
+
WebDriver: {
|
|
298
301
|
"multiremote": {
|
|
299
302
|
"MyChrome": {
|
|
300
303
|
"desiredCapabilities": {
|
|
@@ -381,7 +384,7 @@ this.helpers['WebDriver']._locateFields('Your email').then // ...
|
|
|
381
384
|
|
|
382
385
|
Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
|
|
383
386
|
Don't confuse popups with modal windows, as created by [various
|
|
384
|
-
libraries][
|
|
387
|
+
libraries][18].
|
|
385
388
|
|
|
386
389
|
### amOnPage
|
|
387
390
|
|
|
@@ -396,7 +399,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
396
399
|
|
|
397
400
|
#### Parameters
|
|
398
401
|
|
|
399
|
-
- `url` [string][
|
|
402
|
+
- `url` [string][19] url path or global url.
|
|
400
403
|
|
|
401
404
|
|
|
402
405
|
|
|
@@ -411,8 +414,8 @@ I.appendField('#myTextField', 'appended');
|
|
|
411
414
|
|
|
412
415
|
#### Parameters
|
|
413
416
|
|
|
414
|
-
- `field` ([string][
|
|
415
|
-
- `value` [string][
|
|
417
|
+
- `field` ([string][19] \| [object][20]) located by label|name|CSS|XPath|strict locator
|
|
418
|
+
- `value` [string][19] text value to append.
|
|
416
419
|
|
|
417
420
|
|
|
418
421
|
|
|
@@ -434,8 +437,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
434
437
|
|
|
435
438
|
#### Parameters
|
|
436
439
|
|
|
437
|
-
- `locator` ([string][
|
|
438
|
-
- `pathToFile` [string][
|
|
440
|
+
- `locator` ([string][19] \| [object][20]) field located by label|name|CSS|XPath|strict locator.
|
|
441
|
+
- `pathToFile` [string][19] local file path relative to codecept.json config file.
|
|
439
442
|
|
|
440
443
|
|
|
441
444
|
Appium: not tested
|
|
@@ -459,8 +462,8 @@ I.checkOption('agree', '//form');
|
|
|
459
462
|
|
|
460
463
|
#### Parameters
|
|
461
464
|
|
|
462
|
-
- `field` ([string][
|
|
463
|
-
- `context` [string][
|
|
465
|
+
- `field` ([string][19] \| [object][20]) checkbox located by label | name | CSS | XPath | strict locator.
|
|
466
|
+
- `context` [string][19] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
464
467
|
|
|
465
468
|
|
|
466
469
|
Appium: not tested
|
|
@@ -477,7 +480,7 @@ I.clearCookie('test');
|
|
|
477
480
|
|
|
478
481
|
#### Parameters
|
|
479
482
|
|
|
480
|
-
- `cookie` [string][
|
|
483
|
+
- `cookie` [string][19] (optional, `null` by default) cookie name
|
|
481
484
|
|
|
482
485
|
|
|
483
486
|
|
|
@@ -494,7 +497,7 @@ I.clearField('#email');
|
|
|
494
497
|
#### Parameters
|
|
495
498
|
|
|
496
499
|
- `field`
|
|
497
|
-
- `editable` ([string][
|
|
500
|
+
- `editable` ([string][19] \| [object][20]) field located by label|name|CSS|XPath|strict locator.
|
|
498
501
|
|
|
499
502
|
|
|
500
503
|
|
|
@@ -524,8 +527,8 @@ I.click({css: 'nav a.login'});
|
|
|
524
527
|
|
|
525
528
|
#### Parameters
|
|
526
529
|
|
|
527
|
-
- `locator` ([string][
|
|
528
|
-
- `context` ([string][
|
|
530
|
+
- `locator` ([string][19] \| [object][20]) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
531
|
+
- `context` ([string][19] \| [object][20]) (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
529
532
|
|
|
530
533
|
|
|
531
534
|
|
|
@@ -551,7 +554,7 @@ I.closeOtherTabs();
|
|
|
551
554
|
|
|
552
555
|
### defineTimeout
|
|
553
556
|
|
|
554
|
-
Set [WebDriver timeouts][
|
|
557
|
+
Set [WebDriver timeouts][21] in realtime.
|
|
555
558
|
|
|
556
559
|
Timeouts are expected to be passed as object:
|
|
557
560
|
|
|
@@ -576,8 +579,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
576
579
|
|
|
577
580
|
#### Parameters
|
|
578
581
|
|
|
579
|
-
- `text` [string][
|
|
580
|
-
- `context` ([string][
|
|
582
|
+
- `text` [string][19] which is not present.
|
|
583
|
+
- `context` ([string][19] \| [object][20]) (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
581
584
|
|
|
582
585
|
|
|
583
586
|
|
|
@@ -596,7 +599,7 @@ I.dontSeeeCheckboxIsChedcked('agree'); // located by name
|
|
|
596
599
|
|
|
597
600
|
#### Parameters
|
|
598
601
|
|
|
599
|
-
- `field` ([string][
|
|
602
|
+
- `field` ([string][19] \| [object][20]) located by label|name|CSS|XPath|strict locator.
|
|
600
603
|
|
|
601
604
|
|
|
602
605
|
Appium: not tested
|
|
@@ -611,7 +614,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
611
614
|
|
|
612
615
|
#### Parameters
|
|
613
616
|
|
|
614
|
-
- `name` [string][
|
|
617
|
+
- `name` [string][19] cookie name.
|
|
615
618
|
|
|
616
619
|
|
|
617
620
|
|
|
@@ -627,7 +630,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
627
630
|
|
|
628
631
|
#### Parameters
|
|
629
632
|
|
|
630
|
-
- `url` [string][
|
|
633
|
+
- `url` [string][19] value to check.
|
|
631
634
|
|
|
632
635
|
|
|
633
636
|
|
|
@@ -641,7 +644,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
641
644
|
|
|
642
645
|
#### Parameters
|
|
643
646
|
|
|
644
|
-
- `locator` ([string][
|
|
647
|
+
- `locator` ([string][19] \| [object][20]) located by CSS|XPath|Strict locator.
|
|
645
648
|
|
|
646
649
|
|
|
647
650
|
|
|
@@ -660,7 +663,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
660
663
|
|
|
661
664
|
#### Parameters
|
|
662
665
|
|
|
663
|
-
- `locator` ([string][
|
|
666
|
+
- `locator` ([string][19] \| [object][20]) located by CSS|XPath|Strict locator.
|
|
664
667
|
|
|
665
668
|
|
|
666
669
|
|
|
@@ -670,7 +673,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
670
673
|
|
|
671
674
|
#### Parameters
|
|
672
675
|
|
|
673
|
-
- `url` [string][
|
|
676
|
+
- `url` [string][19] value to check.
|
|
674
677
|
|
|
675
678
|
|
|
676
679
|
|
|
@@ -686,8 +689,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
686
689
|
|
|
687
690
|
#### Parameters
|
|
688
691
|
|
|
689
|
-
- `field` ([string][
|
|
690
|
-
- `value` [string][
|
|
692
|
+
- `field` ([string][19] \| [object][20]) located by label|name|CSS|XPath|strict locator.
|
|
693
|
+
- `value` [string][19] value to check.
|
|
691
694
|
|
|
692
695
|
|
|
693
696
|
|
|
@@ -702,7 +705,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
702
705
|
#### Parameters
|
|
703
706
|
|
|
704
707
|
- `text`
|
|
705
|
-
- `value` [string][
|
|
708
|
+
- `value` [string][19] to check.
|
|
706
709
|
|
|
707
710
|
|
|
708
711
|
|
|
@@ -716,7 +719,7 @@ I.dontSeeInTitle('Error');
|
|
|
716
719
|
|
|
717
720
|
#### Parameters
|
|
718
721
|
|
|
719
|
-
- `text` [string][
|
|
722
|
+
- `text` [string][19] value to check.
|
|
720
723
|
|
|
721
724
|
|
|
722
725
|
|
|
@@ -734,8 +737,8 @@ I.doubleClick('.btn.edit');
|
|
|
734
737
|
|
|
735
738
|
#### Parameters
|
|
736
739
|
|
|
737
|
-
- `locator` ([string][
|
|
738
|
-
- `context` ([string][
|
|
740
|
+
- `locator` ([string][19] \| [object][20]) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
741
|
+
- `context` ([string][19] \| [object][20]) (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
739
742
|
|
|
740
743
|
|
|
741
744
|
|
|
@@ -753,8 +756,8 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
753
756
|
|
|
754
757
|
#### Parameters
|
|
755
758
|
|
|
756
|
-
- `srcElement` ([string][
|
|
757
|
-
- `destElement` ([string][
|
|
759
|
+
- `srcElement` ([string][19] \| [object][20]) located by CSS|XPath|strict locator.
|
|
760
|
+
- `destElement` ([string][19] \| [object][20]) located by CSS|XPath|strict locator.
|
|
758
761
|
|
|
759
762
|
|
|
760
763
|
Appium: not tested
|
|
@@ -771,8 +774,8 @@ I.dragSlider('#slider', -70);
|
|
|
771
774
|
|
|
772
775
|
#### Parameters
|
|
773
776
|
|
|
774
|
-
- `locator` ([string][
|
|
775
|
-
- `offsetX` [number][
|
|
777
|
+
- `locator` ([string][19] \| [object][20]) located by label|name|CSS|XPath|strict locator.
|
|
778
|
+
- `offsetX` [number][22] position to drag.
|
|
776
779
|
|
|
777
780
|
|
|
778
781
|
|
|
@@ -781,7 +784,7 @@ I.dragSlider('#slider', -70);
|
|
|
781
784
|
Executes async script on page.
|
|
782
785
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
783
786
|
|
|
784
|
-
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][
|
|
787
|
+
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][23].
|
|
785
788
|
|
|
786
789
|
```js
|
|
787
790
|
I.executeAsyncScript(function(done) {
|
|
@@ -801,7 +804,7 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
801
804
|
|
|
802
805
|
#### Parameters
|
|
803
806
|
|
|
804
|
-
- `fn` ([string][
|
|
807
|
+
- `fn` ([string][19] \| [function][24]) function to be executed in browser context.
|
|
805
808
|
|
|
806
809
|
### executeScript
|
|
807
810
|
|
|
@@ -831,7 +834,7 @@ let date = await I.executeScript(function(el) {
|
|
|
831
834
|
|
|
832
835
|
#### Parameters
|
|
833
836
|
|
|
834
|
-
- `fn` ([string][
|
|
837
|
+
- `fn` ([string][19] \| [function][24]) function to be executed in browser context.
|
|
835
838
|
|
|
836
839
|
### fillField
|
|
837
840
|
|
|
@@ -851,8 +854,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
851
854
|
|
|
852
855
|
#### Parameters
|
|
853
856
|
|
|
854
|
-
- `field` ([string][
|
|
855
|
-
- `value` [string][
|
|
857
|
+
- `field` ([string][19] \| [object][20]) located by label|name|CSS|XPath|strict locator.
|
|
858
|
+
- `value` [string][19] text value to fill.
|
|
856
859
|
|
|
857
860
|
|
|
858
861
|
|
|
@@ -882,10 +885,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
882
885
|
|
|
883
886
|
#### Parameters
|
|
884
887
|
|
|
885
|
-
- `locator` ([string][
|
|
886
|
-
- `attr` [string][
|
|
888
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
889
|
+
- `attr` [string][19] attribute name.
|
|
887
890
|
|
|
888
|
-
Returns [Promise][
|
|
891
|
+
Returns [Promise][25]<[string][19]> attribute value
|
|
889
892
|
|
|
890
893
|
|
|
891
894
|
Appium: can be used for apps only with several values ("contentDescription", "text", "className", "resourceId")
|
|
@@ -915,7 +918,7 @@ assert(cookie.value, '123456');
|
|
|
915
918
|
|
|
916
919
|
- `name` cookie name.
|
|
917
920
|
|
|
918
|
-
Returns [Promise][
|
|
921
|
+
Returns [Promise][25]<[string][19]> attribute value
|
|
919
922
|
|
|
920
923
|
|
|
921
924
|
|
|
@@ -930,10 +933,10 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
930
933
|
|
|
931
934
|
#### Parameters
|
|
932
935
|
|
|
933
|
-
- `locator` ([string][
|
|
934
|
-
- `cssProperty` [string][
|
|
936
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
937
|
+
- `cssProperty` [string][19] CSS property name.
|
|
935
938
|
|
|
936
|
-
Returns [Promise][
|
|
939
|
+
Returns [Promise][25]<[string][19]> CSS value
|
|
937
940
|
|
|
938
941
|
|
|
939
942
|
|
|
@@ -947,7 +950,7 @@ let url = await I.grabCurrentUrl();
|
|
|
947
950
|
console.log(`Current URL is [${url}]`);
|
|
948
951
|
```
|
|
949
952
|
|
|
950
|
-
Returns [Promise][
|
|
953
|
+
Returns [Promise][25]<[string][19]> current URL
|
|
951
954
|
|
|
952
955
|
|
|
953
956
|
|
|
@@ -974,7 +977,7 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
974
977
|
|
|
975
978
|
- `locator` element located by CSS|XPath|strict locator.
|
|
976
979
|
|
|
977
|
-
Returns [Promise][
|
|
980
|
+
Returns [Promise][25]<[string][19]> HTML code for an element
|
|
978
981
|
|
|
979
982
|
|
|
980
983
|
|
|
@@ -986,7 +989,7 @@ Grab number of open tabs.
|
|
|
986
989
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
987
990
|
```
|
|
988
991
|
|
|
989
|
-
Returns [Promise][
|
|
992
|
+
Returns [Promise][25]<[number][22]> number of open tabs
|
|
990
993
|
|
|
991
994
|
|
|
992
995
|
|
|
@@ -1000,9 +1003,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1000
1003
|
|
|
1001
1004
|
#### Parameters
|
|
1002
1005
|
|
|
1003
|
-
- `locator` ([string][
|
|
1006
|
+
- `locator` ([string][19] \| [object][20]) located by CSS|XPath|strict locator.
|
|
1004
1007
|
|
|
1005
|
-
Returns [Promise][
|
|
1008
|
+
Returns [Promise][25]<[number][22]> number of visible elements
|
|
1006
1009
|
|
|
1007
1010
|
|
|
1008
1011
|
|
|
@@ -1015,7 +1018,7 @@ Resumes test execution, so should be used inside an async function with `await`
|
|
|
1015
1018
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1016
1019
|
```
|
|
1017
1020
|
|
|
1018
|
-
Returns [Promise][
|
|
1021
|
+
Returns [Promise][25]<[object][20]> scroll position
|
|
1019
1022
|
|
|
1020
1023
|
|
|
1021
1024
|
|
|
@@ -1036,7 +1039,7 @@ Resumes test execution, so should be used inside an async function.
|
|
|
1036
1039
|
let pageSource = await I.grabSource();
|
|
1037
1040
|
```
|
|
1038
1041
|
|
|
1039
|
-
Returns [Promise][
|
|
1042
|
+
Returns [Promise][25]<[string][19]> source code
|
|
1040
1043
|
|
|
1041
1044
|
|
|
1042
1045
|
|
|
@@ -1055,7 +1058,7 @@ If multiple elements found returns an array of texts.
|
|
|
1055
1058
|
|
|
1056
1059
|
- `locator` element located by CSS|XPath|strict locator.
|
|
1057
1060
|
|
|
1058
|
-
Returns [Promise][
|
|
1061
|
+
Returns [Promise][25]<[string][19]> attribute value
|
|
1059
1062
|
|
|
1060
1063
|
|
|
1061
1064
|
|
|
@@ -1068,7 +1071,7 @@ Resumes test execution, so should be used inside async with `await` operator.
|
|
|
1068
1071
|
let title = await I.grabTitle();
|
|
1069
1072
|
```
|
|
1070
1073
|
|
|
1071
|
-
Returns [Promise][
|
|
1074
|
+
Returns [Promise][25]<[string][19]> title
|
|
1072
1075
|
|
|
1073
1076
|
|
|
1074
1077
|
|
|
@@ -1083,9 +1086,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1083
1086
|
|
|
1084
1087
|
#### Parameters
|
|
1085
1088
|
|
|
1086
|
-
- `locator` ([string][
|
|
1089
|
+
- `locator` ([string][19] \| [object][20]) field located by label|name|CSS|XPath|strict locator.
|
|
1087
1090
|
|
|
1088
|
-
Returns [Promise][
|
|
1091
|
+
Returns [Promise][25]<[string][19]> attribute value
|
|
1089
1092
|
|
|
1090
1093
|
|
|
1091
1094
|
|
|
@@ -1101,9 +1104,9 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1101
1104
|
|
|
1102
1105
|
#### Parameters
|
|
1103
1106
|
|
|
1104
|
-
- `locator` ([string][
|
|
1105
|
-
- `offsetX` [number][
|
|
1106
|
-
- `offsetY` [number][
|
|
1107
|
+
- `locator` ([string][19] \| [object][20]) located by CSS|XPath|strict locator.
|
|
1108
|
+
- `offsetX` [number][22] (optional, `0` by default) X-axis offset.
|
|
1109
|
+
- `offsetY` [number][22] (optional, `0` by default) Y-axis offset.
|
|
1107
1110
|
|
|
1108
1111
|
|
|
1109
1112
|
|
|
@@ -1118,7 +1121,7 @@ I.openNewTab();
|
|
|
1118
1121
|
### pressKey
|
|
1119
1122
|
|
|
1120
1123
|
Presses a key on a focused element.
|
|
1121
|
-
Special keys like 'Enter', 'Control', [etc][
|
|
1124
|
+
Special keys like 'Enter', 'Control', [etc][26]
|
|
1122
1125
|
will be replaced with corresponding unicode.
|
|
1123
1126
|
If modifier key is used (Control, Command, Alt, Shift) in array, it will be released afterwards.
|
|
1124
1127
|
|
|
@@ -1129,7 +1132,7 @@ I.pressKey(['Control','a']);
|
|
|
1129
1132
|
|
|
1130
1133
|
#### Parameters
|
|
1131
1134
|
|
|
1132
|
-
- `key` ([string][
|
|
1135
|
+
- `key` ([string][19] \| [array][27]) key or array of keys to press.
|
|
1133
1136
|
|
|
1134
1137
|
|
|
1135
1138
|
|
|
@@ -1189,8 +1192,8 @@ First parameter can be set to `maximize`.
|
|
|
1189
1192
|
|
|
1190
1193
|
#### Parameters
|
|
1191
1194
|
|
|
1192
|
-
- `width` [number][
|
|
1193
|
-
- `height` [number][
|
|
1195
|
+
- `width` [number][22] width in pixels or `maximize`.
|
|
1196
|
+
- `height` [number][22] height in pixels.
|
|
1194
1197
|
|
|
1195
1198
|
|
|
1196
1199
|
Appium: not tested in web, in apps doesn't work
|
|
@@ -1210,8 +1213,8 @@ I.rightClick('Click me', '.context');
|
|
|
1210
1213
|
|
|
1211
1214
|
#### Parameters
|
|
1212
1215
|
|
|
1213
|
-
- `locator` ([string][
|
|
1214
|
-
- `context` ([string][
|
|
1216
|
+
- `locator` ([string][19] \| [object][20]) clickable element located by CSS|XPath|strict locator.
|
|
1217
|
+
- `context` ([string][19] \| [object][20]) (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1215
1218
|
|
|
1216
1219
|
|
|
1217
1220
|
|
|
@@ -1258,8 +1261,8 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1258
1261
|
|
|
1259
1262
|
#### Parameters
|
|
1260
1263
|
|
|
1261
|
-
- `fileName` [string][
|
|
1262
|
-
- `fullPage` [boolean][
|
|
1264
|
+
- `fileName` [string][19] file name to save.
|
|
1265
|
+
- `fullPage` [boolean][28] (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1263
1266
|
|
|
1264
1267
|
|
|
1265
1268
|
|
|
@@ -1297,9 +1300,9 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1297
1300
|
|
|
1298
1301
|
#### Parameters
|
|
1299
1302
|
|
|
1300
|
-
- `locator` ([string][
|
|
1301
|
-
- `offsetX` [number][
|
|
1302
|
-
- `offsetY` [number][
|
|
1303
|
+
- `locator` ([string][19] \| [object][20]) located by CSS|XPath|strict locator.
|
|
1304
|
+
- `offsetX` [number][22] (optional, `0` by default) X-axis offset.
|
|
1305
|
+
- `offsetY` [number][22] (optional, `0` by default) Y-axis offset.
|
|
1303
1306
|
|
|
1304
1307
|
|
|
1305
1308
|
|
|
@@ -1316,8 +1319,8 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1316
1319
|
|
|
1317
1320
|
#### Parameters
|
|
1318
1321
|
|
|
1319
|
-
- `text` [string][
|
|
1320
|
-
- `context` ([string][
|
|
1322
|
+
- `text` [string][19] expected on page.
|
|
1323
|
+
- `context` ([string][19] \| [object][20]) (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1321
1324
|
|
|
1322
1325
|
|
|
1323
1326
|
|
|
@@ -1335,8 +1338,8 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1335
1338
|
|
|
1336
1339
|
#### Parameters
|
|
1337
1340
|
|
|
1338
|
-
- `locator` ([string][
|
|
1339
|
-
- `attributes` [object][
|
|
1341
|
+
- `locator` ([string][19] \| [object][20]) located by CSS|XPath|strict locator.
|
|
1342
|
+
- `attributes` [object][20] attributes and their values to check.
|
|
1340
1343
|
|
|
1341
1344
|
|
|
1342
1345
|
|
|
@@ -1352,7 +1355,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1352
1355
|
|
|
1353
1356
|
#### Parameters
|
|
1354
1357
|
|
|
1355
|
-
- `field` ([string][
|
|
1358
|
+
- `field` ([string][19] \| [object][20]) located by label|name|CSS|XPath|strict locator.
|
|
1356
1359
|
|
|
1357
1360
|
|
|
1358
1361
|
Appium: not tested
|
|
@@ -1367,7 +1370,7 @@ I.seeCookie('Auth');
|
|
|
1367
1370
|
|
|
1368
1371
|
#### Parameters
|
|
1369
1372
|
|
|
1370
|
-
- `name` [string][
|
|
1373
|
+
- `name` [string][19] cookie name.
|
|
1371
1374
|
|
|
1372
1375
|
|
|
1373
1376
|
|
|
@@ -1381,8 +1384,8 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1381
1384
|
|
|
1382
1385
|
#### Parameters
|
|
1383
1386
|
|
|
1384
|
-
- `locator` ([string][
|
|
1385
|
-
- `cssProperties` [object][
|
|
1387
|
+
- `locator` ([string][19] \| [object][20]) located by CSS|XPath|strict locator.
|
|
1388
|
+
- `cssProperties` [object][20] object with CSS properties and their values to check.
|
|
1386
1389
|
|
|
1387
1390
|
|
|
1388
1391
|
|
|
@@ -1399,7 +1402,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1399
1402
|
|
|
1400
1403
|
#### Parameters
|
|
1401
1404
|
|
|
1402
|
-
- `url` [string][
|
|
1405
|
+
- `url` [string][19] value to check.
|
|
1403
1406
|
|
|
1404
1407
|
|
|
1405
1408
|
|
|
@@ -1414,7 +1417,7 @@ I.seeElement('#modal');
|
|
|
1414
1417
|
|
|
1415
1418
|
#### Parameters
|
|
1416
1419
|
|
|
1417
|
-
- `locator` ([string][
|
|
1420
|
+
- `locator` ([string][19] \| [object][20]) located by CSS|XPath|strict locator.
|
|
1418
1421
|
|
|
1419
1422
|
|
|
1420
1423
|
|
|
@@ -1434,7 +1437,7 @@ I.seeElementInDOM('#modal');
|
|
|
1434
1437
|
|
|
1435
1438
|
#### Parameters
|
|
1436
1439
|
|
|
1437
|
-
- `locator` ([string][
|
|
1440
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
1438
1441
|
|
|
1439
1442
|
|
|
1440
1443
|
|
|
@@ -1448,7 +1451,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1448
1451
|
|
|
1449
1452
|
#### Parameters
|
|
1450
1453
|
|
|
1451
|
-
- `url` [string][
|
|
1454
|
+
- `url` [string][19] a fragment to check
|
|
1452
1455
|
|
|
1453
1456
|
|
|
1454
1457
|
|
|
@@ -1466,8 +1469,8 @@ I.seeInField('#searchform input','Search');
|
|
|
1466
1469
|
|
|
1467
1470
|
#### Parameters
|
|
1468
1471
|
|
|
1469
|
-
- `field` ([string][
|
|
1470
|
-
- `value` [string][
|
|
1472
|
+
- `field` ([string][19] \| [object][20]) located by label|name|CSS|XPath|strict locator.
|
|
1473
|
+
- `value` [string][19] value to check.
|
|
1471
1474
|
|
|
1472
1475
|
|
|
1473
1476
|
|
|
@@ -1490,7 +1493,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1490
1493
|
|
|
1491
1494
|
#### Parameters
|
|
1492
1495
|
|
|
1493
|
-
- `text` [string][
|
|
1496
|
+
- `text` [string][19] value to check.
|
|
1494
1497
|
|
|
1495
1498
|
|
|
1496
1499
|
|
|
@@ -1504,7 +1507,7 @@ I.seeInTitle('Home Page');
|
|
|
1504
1507
|
|
|
1505
1508
|
#### Parameters
|
|
1506
1509
|
|
|
1507
|
-
- `text` [string][
|
|
1510
|
+
- `text` [string][19] text value to check.
|
|
1508
1511
|
|
|
1509
1512
|
|
|
1510
1513
|
|
|
@@ -1519,8 +1522,8 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1519
1522
|
|
|
1520
1523
|
#### Parameters
|
|
1521
1524
|
|
|
1522
|
-
- `locator` ([string][
|
|
1523
|
-
- `num` [number][
|
|
1525
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
1526
|
+
- `num` [number][22] number of elements.
|
|
1524
1527
|
|
|
1525
1528
|
|
|
1526
1529
|
|
|
@@ -1540,8 +1543,8 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1540
1543
|
|
|
1541
1544
|
#### Parameters
|
|
1542
1545
|
|
|
1543
|
-
- `locator` ([string][
|
|
1544
|
-
- `num` [number][
|
|
1546
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
1547
|
+
- `num` [number][22] number of elements.
|
|
1545
1548
|
|
|
1546
1549
|
|
|
1547
1550
|
|
|
@@ -1598,8 +1601,8 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1598
1601
|
|
|
1599
1602
|
#### Parameters
|
|
1600
1603
|
|
|
1601
|
-
- `select` ([string][
|
|
1602
|
-
- `option` ([string][
|
|
1604
|
+
- `select` ([string][19] \| [object][20]) field located by label|name|CSS|XPath|strict locator.
|
|
1605
|
+
- `option` ([string][19] \| [array][27]) visible text or value of option.
|
|
1603
1606
|
|
|
1604
1607
|
|
|
1605
1608
|
|
|
@@ -1613,10 +1616,10 @@ I.setCookie({name: 'auth', value: true});
|
|
|
1613
1616
|
|
|
1614
1617
|
#### Parameters
|
|
1615
1618
|
|
|
1616
|
-
- `cookie` [object][
|
|
1619
|
+
- `cookie` [object][20] a cookie object.
|
|
1617
1620
|
|
|
1618
1621
|
Uses Selenium's JSON [cookie
|
|
1619
|
-
format][
|
|
1622
|
+
format][29].
|
|
1620
1623
|
|
|
1621
1624
|
### switchTo
|
|
1622
1625
|
|
|
@@ -1629,7 +1632,7 @@ I.switchTo(); // switch back to main page
|
|
|
1629
1632
|
|
|
1630
1633
|
#### Parameters
|
|
1631
1634
|
|
|
1632
|
-
- `locator` ([string][
|
|
1635
|
+
- `locator` ([string][19] \| [object][20]) (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1633
1636
|
|
|
1634
1637
|
|
|
1635
1638
|
|
|
@@ -1694,8 +1697,8 @@ I.uncheckOption('agree', '//form');
|
|
|
1694
1697
|
|
|
1695
1698
|
#### Parameters
|
|
1696
1699
|
|
|
1697
|
-
- `field` ([string][
|
|
1698
|
-
- `context` [string][
|
|
1700
|
+
- `field` ([string][19] \| [object][20]) checkbox located by label | name | CSS | XPath | strict locator.
|
|
1701
|
+
- `context` [string][19] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1699
1702
|
|
|
1700
1703
|
|
|
1701
1704
|
Appium: not tested
|
|
@@ -1710,7 +1713,7 @@ I.wait(2); // wait 2 secs
|
|
|
1710
1713
|
|
|
1711
1714
|
#### Parameters
|
|
1712
1715
|
|
|
1713
|
-
- `sec` [number][
|
|
1716
|
+
- `sec` [number][22] number of second to wait.
|
|
1714
1717
|
|
|
1715
1718
|
|
|
1716
1719
|
|
|
@@ -1725,8 +1728,8 @@ I.waitForDetached('#popup');
|
|
|
1725
1728
|
|
|
1726
1729
|
#### Parameters
|
|
1727
1730
|
|
|
1728
|
-
- `locator` ([string][
|
|
1729
|
-
- `sec` [number][
|
|
1731
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
1732
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1730
1733
|
|
|
1731
1734
|
|
|
1732
1735
|
|
|
@@ -1742,8 +1745,8 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1742
1745
|
|
|
1743
1746
|
#### Parameters
|
|
1744
1747
|
|
|
1745
|
-
- `locator` ([string][
|
|
1746
|
-
- `sec` [number][
|
|
1748
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
1749
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1747
1750
|
|
|
1748
1751
|
|
|
1749
1752
|
|
|
@@ -1754,7 +1757,7 @@ Element can be located by CSS or XPath.
|
|
|
1754
1757
|
|
|
1755
1758
|
#### Parameters
|
|
1756
1759
|
|
|
1757
|
-
- `locator` ([string][
|
|
1760
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
1758
1761
|
- `sec` (optional) time in seconds to wait, 1 by default.
|
|
1759
1762
|
|
|
1760
1763
|
|
|
@@ -1776,9 +1779,9 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1776
1779
|
|
|
1777
1780
|
#### Parameters
|
|
1778
1781
|
|
|
1779
|
-
- `fn` ([string][
|
|
1780
|
-
- `argsOrSec` ([array][
|
|
1781
|
-
- `sec` [number][
|
|
1782
|
+
- `fn` ([string][19] \| [function][24]) to be executed in browser context.
|
|
1783
|
+
- `argsOrSec` ([array][27] \| [number][22]) (optional, `1` by default) arguments for function or seconds.
|
|
1784
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1782
1785
|
|
|
1783
1786
|
|
|
1784
1787
|
|
|
@@ -1793,8 +1796,8 @@ I.waitForInvisible('#popup');
|
|
|
1793
1796
|
|
|
1794
1797
|
#### Parameters
|
|
1795
1798
|
|
|
1796
|
-
- `locator` ([string][
|
|
1797
|
-
- `sec` [number][
|
|
1799
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
1800
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1798
1801
|
|
|
1799
1802
|
|
|
1800
1803
|
|
|
@@ -1811,9 +1814,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1811
1814
|
|
|
1812
1815
|
#### Parameters
|
|
1813
1816
|
|
|
1814
|
-
- `text` [string][
|
|
1815
|
-
- `sec` [number][
|
|
1816
|
-
- `context` ([string][
|
|
1817
|
+
- `text` [string][19] to wait for.
|
|
1818
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1819
|
+
- `context` ([string][19] \| [object][20]) (optional) element located by CSS|XPath|strict locator.
|
|
1817
1820
|
|
|
1818
1821
|
|
|
1819
1822
|
|
|
@@ -1827,9 +1830,9 @@ I.waitForValue('//input', "GoodValue");
|
|
|
1827
1830
|
|
|
1828
1831
|
#### Parameters
|
|
1829
1832
|
|
|
1830
|
-
- `field` ([string][
|
|
1831
|
-
- `value` [string][
|
|
1832
|
-
- `sec` [number][
|
|
1833
|
+
- `field` ([string][19] \| [object][20]) input field.
|
|
1834
|
+
- `value` [string][19] expected value.
|
|
1835
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1833
1836
|
|
|
1834
1837
|
|
|
1835
1838
|
|
|
@@ -1844,8 +1847,8 @@ I.waitForVisible('#popup');
|
|
|
1844
1847
|
|
|
1845
1848
|
#### Parameters
|
|
1846
1849
|
|
|
1847
|
-
- `locator` ([string][
|
|
1848
|
-
- `sec` [number][
|
|
1850
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
1851
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1849
1852
|
|
|
1850
1853
|
|
|
1851
1854
|
|
|
@@ -1859,8 +1862,8 @@ I.waitInUrl('/info', 2);
|
|
|
1859
1862
|
|
|
1860
1863
|
#### Parameters
|
|
1861
1864
|
|
|
1862
|
-
- `urlPart` [string][
|
|
1863
|
-
- `sec` [number][
|
|
1865
|
+
- `urlPart` [string][19] value to check.
|
|
1866
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1864
1867
|
|
|
1865
1868
|
|
|
1866
1869
|
|
|
@@ -1874,9 +1877,9 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
1874
1877
|
|
|
1875
1878
|
#### Parameters
|
|
1876
1879
|
|
|
1877
|
-
- `locator` ([string][
|
|
1878
|
-
- `num` [number][
|
|
1879
|
-
- `sec` [number][
|
|
1880
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
1881
|
+
- `num` [number][22] number of elements.
|
|
1882
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1880
1883
|
|
|
1881
1884
|
|
|
1882
1885
|
|
|
@@ -1891,8 +1894,8 @@ I.waitToHide('#popup');
|
|
|
1891
1894
|
|
|
1892
1895
|
#### Parameters
|
|
1893
1896
|
|
|
1894
|
-
- `locator` ([string][
|
|
1895
|
-
- `sec` [number][
|
|
1897
|
+
- `locator` ([string][19] \| [object][20]) element located by CSS|XPath|strict locator.
|
|
1898
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1896
1899
|
|
|
1897
1900
|
|
|
1898
1901
|
|
|
@@ -1907,9 +1910,9 @@ I.waitUntil(() => window.requests == 0, 5);
|
|
|
1907
1910
|
|
|
1908
1911
|
#### Parameters
|
|
1909
1912
|
|
|
1910
|
-
- `fn` ([function][
|
|
1911
|
-
- `sec` [number][
|
|
1912
|
-
- `timeoutMsg` [string][
|
|
1913
|
+
- `fn` ([function][24] \| [string][19]) function which is executed in browser context.
|
|
1914
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1915
|
+
- `timeoutMsg` [string][19] message to show in case of timeout fail.
|
|
1913
1916
|
|
|
1914
1917
|
|
|
1915
1918
|
- `interval`
|
|
@@ -1925,8 +1928,8 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
1925
1928
|
|
|
1926
1929
|
#### Parameters
|
|
1927
1930
|
|
|
1928
|
-
- `urlPart` [string][
|
|
1929
|
-
- `sec` [number][
|
|
1931
|
+
- `urlPart` [string][19] value to check.
|
|
1932
|
+
- `sec` [number][22] (optional, `1` by default) time in seconds to wait
|
|
1930
1933
|
|
|
1931
1934
|
|
|
1932
1935
|
|
|
@@ -1944,44 +1947,46 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
1944
1947
|
|
|
1945
1948
|
[7]: https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/IE/Options.html
|
|
1946
1949
|
|
|
1947
|
-
[8]:
|
|
1950
|
+
[8]: https://aerokube.com/selenoid/latest/
|
|
1951
|
+
|
|
1952
|
+
[9]: http://webdriver.io/guide/usage/cloudservices.html
|
|
1948
1953
|
|
|
1949
|
-
[
|
|
1954
|
+
[10]: https://webdriver.io/docs/sauce-service.html
|
|
1950
1955
|
|
|
1951
|
-
[
|
|
1956
|
+
[11]: https://github.com/puneet0191/codeceptjs-saucehelper/
|
|
1952
1957
|
|
|
1953
|
-
[
|
|
1958
|
+
[12]: https://webdriver.io/docs/browserstack-service.html
|
|
1954
1959
|
|
|
1955
|
-
[
|
|
1960
|
+
[13]: https://github.com/PeterNgTr/codeceptjs-bshelper
|
|
1956
1961
|
|
|
1957
|
-
[
|
|
1962
|
+
[14]: https://github.com/testingbot/codeceptjs-tbhelper
|
|
1958
1963
|
|
|
1959
|
-
[
|
|
1964
|
+
[15]: https://webdriver.io/docs/testingbot-service.html
|
|
1960
1965
|
|
|
1961
|
-
[
|
|
1966
|
+
[16]: https://github.com/PeterNgTr/codeceptjs-applitoolshelper
|
|
1962
1967
|
|
|
1963
|
-
[
|
|
1968
|
+
[17]: http://webdriver.io/guide/usage/multiremote.html
|
|
1964
1969
|
|
|
1965
|
-
[
|
|
1970
|
+
[18]: http://jster.net/category/windows-modals-popups
|
|
1966
1971
|
|
|
1967
|
-
[
|
|
1972
|
+
[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1968
1973
|
|
|
1969
|
-
[
|
|
1974
|
+
[20]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1970
1975
|
|
|
1971
|
-
[
|
|
1976
|
+
[21]: https://webdriver.io/docs/timeouts.html
|
|
1972
1977
|
|
|
1973
|
-
[
|
|
1978
|
+
[22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1974
1979
|
|
|
1975
|
-
[
|
|
1980
|
+
[23]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
1976
1981
|
|
|
1977
|
-
[
|
|
1982
|
+
[24]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1978
1983
|
|
|
1979
|
-
[
|
|
1984
|
+
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1980
1985
|
|
|
1981
|
-
[
|
|
1986
|
+
[26]: https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value
|
|
1982
1987
|
|
|
1983
|
-
[
|
|
1988
|
+
[27]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1984
1989
|
|
|
1985
|
-
[
|
|
1990
|
+
[28]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
1986
1991
|
|
|
1987
|
-
[
|
|
1992
|
+
[29]: https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object
|