codeceptjs 3.3.3 → 3.3.5-beta.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 +38 -0
- package/docs/api.md +4 -0
- package/docs/basics.md +2 -0
- package/docs/bdd.md +12 -0
- package/docs/build/JSONResponse.js +44 -3
- package/docs/build/Playwright.js +63 -40
- package/docs/build/Puppeteer.js +54 -43
- package/docs/build/REST.js +23 -9
- package/docs/build/WebDriver.js +39 -30
- package/docs/community-helpers.md +1 -0
- package/docs/configuration.md +21 -18
- package/docs/helpers/Appium.md +0 -723
- package/docs/helpers/JSONResponse.md +24 -0
- package/docs/helpers/Playwright.md +276 -264
- package/docs/helpers/Puppeteer.md +230 -222
- package/docs/helpers/REST.md +21 -6
- package/docs/helpers/WebDriver.md +265 -259
- package/docs/plugins.md +41 -1
- package/docs/reports.md +11 -0
- package/docs/secrets.md +30 -0
- package/docs/wiki/.git/FETCH_HEAD +1 -0
- package/docs/wiki/.git/HEAD +1 -0
- package/docs/wiki/.git/ORIG_HEAD +1 -0
- package/docs/wiki/.git/config +11 -0
- package/docs/wiki/.git/description +1 -0
- package/docs/wiki/.git/hooks/applypatch-msg.sample +15 -0
- package/docs/wiki/.git/hooks/commit-msg.sample +24 -0
- package/docs/wiki/.git/hooks/fsmonitor-watchman.sample +173 -0
- package/docs/wiki/.git/hooks/post-update.sample +8 -0
- package/docs/wiki/.git/hooks/pre-applypatch.sample +14 -0
- package/docs/wiki/.git/hooks/pre-commit.sample +49 -0
- package/docs/wiki/.git/hooks/pre-merge-commit.sample +13 -0
- package/docs/wiki/.git/hooks/pre-push.sample +53 -0
- package/docs/wiki/.git/hooks/pre-rebase.sample +169 -0
- package/docs/wiki/.git/hooks/pre-receive.sample +24 -0
- package/docs/wiki/.git/hooks/prepare-commit-msg.sample +42 -0
- package/docs/wiki/.git/hooks/push-to-checkout.sample +78 -0
- package/docs/wiki/.git/hooks/update.sample +128 -0
- package/docs/wiki/.git/index +0 -0
- package/docs/wiki/.git/info/exclude +6 -0
- package/docs/wiki/.git/logs/HEAD +1 -0
- package/docs/wiki/.git/logs/refs/heads/master +1 -0
- package/docs/wiki/.git/logs/refs/remotes/origin/HEAD +1 -0
- package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.idx +0 -0
- package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.pack +0 -0
- package/docs/wiki/.git/packed-refs +2 -0
- package/docs/wiki/.git/refs/heads/master +1 -0
- package/docs/wiki/.git/refs/remotes/origin/HEAD +1 -0
- package/docs/wiki/Community-Helpers-&-Plugins.md +7 -3
- package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +29 -0
- package/docs/wiki/Examples.md +39 -48
- package/docs/wiki/Release-Process.md +8 -8
- package/docs/wiki/Tests.md +62 -60
- package/docs/wiki/Upgrading-to-CodeceptJS-3.md +2 -2
- package/lib/command/generate.js +3 -0
- package/lib/command/init.js +88 -41
- package/lib/command/interactive.js +1 -1
- package/lib/config.js +9 -0
- package/lib/helper/JSONResponse.js +44 -3
- package/lib/helper/Playwright.js +63 -40
- package/lib/helper/Puppeteer.js +54 -43
- package/lib/helper/REST.js +23 -9
- package/lib/helper/WebDriver.js +39 -30
- package/lib/interfaces/gherkin.js +1 -1
- package/lib/plugin/customLocator.js +50 -3
- package/lib/plugin/retryFailedStep.js +1 -1
- package/lib/plugin/retryTo.js +1 -8
- package/lib/secret.js +31 -1
- package/lib/step.js +22 -10
- package/lib/utils.js +1 -6
- package/package.json +4 -4
- package/typings/index.d.ts +158 -0
- package/typings/types.d.ts +367 -96
|
@@ -16,31 +16,37 @@ manipulate browser using Selenium WebDriver or PhantomJS.
|
|
|
16
16
|
|
|
17
17
|
WebDriver requires Selenium Server and ChromeDriver/GeckoDriver to be installed. Those tools can be easily installed via NPM. Please check [Testing with WebDriver][2] for more details.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- `
|
|
30
|
-
- `
|
|
31
|
-
- `
|
|
32
|
-
- `
|
|
33
|
-
- `
|
|
34
|
-
- `
|
|
35
|
-
- `
|
|
36
|
-
- `
|
|
37
|
-
- `
|
|
38
|
-
- `
|
|
39
|
-
- `
|
|
40
|
-
|
|
41
|
-
- `
|
|
42
|
-
|
|
43
|
-
- `
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Configuration
|
|
22
|
+
|
|
23
|
+
This helper should be configured in codecept.conf.js
|
|
24
|
+
|
|
25
|
+
Type: [object][16]
|
|
26
|
+
|
|
27
|
+
### Properties
|
|
28
|
+
|
|
29
|
+
- `url` **[string][17]** base url of website to be tested.
|
|
30
|
+
- `browser` **[string][17]** browser in which to perform testing.
|
|
31
|
+
- `basicAuth` **[string][17]?** (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
32
|
+
- `host` **[string][17]?** WebDriver host to connect.
|
|
33
|
+
- `port` **[string][17]?** WebDriver port to connect.
|
|
34
|
+
- `protocol` **[string][17]?** protocol for WebDriver server.
|
|
35
|
+
- `path` **[string][17]?** path to WebDriver server,
|
|
36
|
+
- `restart` **[boolean][29]?** restart browser between tests.
|
|
37
|
+
- `smartWait` **[boolean][29]?** **enables [SmartWait][33]**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
|
|
38
|
+
- `disableScreenshots` **[boolean][29]?** don't save screenshots on failure.
|
|
39
|
+
- `fullPageScreenshots` **[boolean][29]?** (optional - make full page screenshots on failure.
|
|
40
|
+
- `uniqueScreenshotNames` **[boolean][29]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
41
|
+
- `keepBrowserState` **[boolean][29]?** keep browser state between tests when `restart` is set to false.
|
|
42
|
+
- `keepCookies` **[boolean][29]?** keep cookies between tests when `restart` set to false.
|
|
43
|
+
- `windowSize` **[string][17]?** default window size. Set to `maximize` or a dimension in the format `640x480`.
|
|
44
|
+
- `waitForTimeout` **[number][20]?** sets default wait time in _ms_ for all `wait*` functions.
|
|
45
|
+
- `desiredCapabilities` **[object][16]?** Selenium's [desired capabilities][6].
|
|
46
|
+
- `manualStart` **[boolean][29]?** do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
|
|
47
|
+
- `timeouts` **[object][16]?** [WebDriver timeouts][34] defined as hash.
|
|
48
|
+
|
|
49
|
+
|
|
44
50
|
|
|
45
51
|
Example:
|
|
46
52
|
|
|
@@ -82,7 +88,7 @@ Example with basic authentication
|
|
|
82
88
|
```
|
|
83
89
|
|
|
84
90
|
Additional configuration params can be used from [webdriverio
|
|
85
|
-
website][
|
|
91
|
+
website][3].
|
|
86
92
|
|
|
87
93
|
### Headless Chrome
|
|
88
94
|
|
|
@@ -104,7 +110,7 @@ website][6].
|
|
|
104
110
|
|
|
105
111
|
### Internet Explorer
|
|
106
112
|
|
|
107
|
-
Additional configuration params can be used from [IE options][
|
|
113
|
+
Additional configuration params can be used from [IE options][4]
|
|
108
114
|
|
|
109
115
|
```js
|
|
110
116
|
{
|
|
@@ -126,7 +132,7 @@ Additional configuration params can be used from [IE options][7]
|
|
|
126
132
|
|
|
127
133
|
### Selenoid Options
|
|
128
134
|
|
|
129
|
-
[Selenoid][
|
|
135
|
+
[Selenoid][5] is a modern way to run Selenium inside Docker containers.
|
|
130
136
|
Selenoid is easy to set up and provides more features than original Selenium Server. Use `selenoidOptions` to set Selenoid capabilities
|
|
131
137
|
|
|
132
138
|
```js
|
|
@@ -192,13 +198,13 @@ For example,
|
|
|
192
198
|
}
|
|
193
199
|
```
|
|
194
200
|
|
|
195
|
-
Please refer to [Selenium - Proxy Object][
|
|
201
|
+
Please refer to [Selenium - Proxy Object][6] for more
|
|
196
202
|
information.
|
|
197
203
|
|
|
198
204
|
### Cloud Providers
|
|
199
205
|
|
|
200
206
|
WebDriver makes it possible to execute tests against services like `Sauce Labs` `BrowserStack` `TestingBot`
|
|
201
|
-
Check out their documentation on [available parameters][
|
|
207
|
+
Check out their documentation on [available parameters][7]
|
|
202
208
|
|
|
203
209
|
Connecting to `BrowserStack` and `Sauce Labs` is simple. All you need to do
|
|
204
210
|
is set the `user` and `key` parameters. WebDriver automatically know which
|
|
@@ -247,9 +253,9 @@ plugins: {
|
|
|
247
253
|
}
|
|
248
254
|
```
|
|
249
255
|
|
|
250
|
-
See [complete reference on webdriver.io][
|
|
256
|
+
See [complete reference on webdriver.io][8].
|
|
251
257
|
|
|
252
|
-
> Alternatively, use [codeceptjs-saucehelper][
|
|
258
|
+
> Alternatively, use [codeceptjs-saucehelper][9] for better reporting.
|
|
253
259
|
|
|
254
260
|
#### BrowserStack
|
|
255
261
|
|
|
@@ -273,13 +279,13 @@ plugins: {
|
|
|
273
279
|
}
|
|
274
280
|
```
|
|
275
281
|
|
|
276
|
-
See [complete reference on webdriver.io][
|
|
282
|
+
See [complete reference on webdriver.io][10].
|
|
277
283
|
|
|
278
|
-
> Alternatively, use [codeceptjs-bshelper][
|
|
284
|
+
> Alternatively, use [codeceptjs-bshelper][11] for better reporting.
|
|
279
285
|
|
|
280
286
|
#### TestingBot
|
|
281
287
|
|
|
282
|
-
> **Recommended**: use official [TestingBot Helper][
|
|
288
|
+
> **Recommended**: use official [TestingBot Helper][12].
|
|
283
289
|
|
|
284
290
|
Alternatively, TestingBot can be configured via wdio service, which should be installed additionally:
|
|
285
291
|
|
|
@@ -301,20 +307,20 @@ plugins: {
|
|
|
301
307
|
}
|
|
302
308
|
```
|
|
303
309
|
|
|
304
|
-
See [complete reference on webdriver.io][
|
|
310
|
+
See [complete reference on webdriver.io][13].
|
|
305
311
|
|
|
306
312
|
#### Applitools
|
|
307
313
|
|
|
308
314
|
Visual testing via Applitools service
|
|
309
315
|
|
|
310
|
-
> Use [CodeceptJS Applitools Helper][
|
|
316
|
+
> Use [CodeceptJS Applitools Helper][14] with Applitools wdio service.
|
|
311
317
|
|
|
312
318
|
### Multiremote Capabilities
|
|
313
319
|
|
|
314
320
|
This is a work in progress but you can control two browsers at a time right out of the box.
|
|
315
321
|
Individual control is something that is planned for a later version.
|
|
316
322
|
|
|
317
|
-
Here is the [webdriverio docs][
|
|
323
|
+
Here is the [webdriverio docs][15] on the subject
|
|
318
324
|
|
|
319
325
|
```js
|
|
320
326
|
{
|
|
@@ -358,7 +364,7 @@ Check if locator is type of "Shadow"
|
|
|
358
364
|
|
|
359
365
|
#### Parameters
|
|
360
366
|
|
|
361
|
-
- `locator` **[object][
|
|
367
|
+
- `locator` **[object][16]**
|
|
362
368
|
|
|
363
369
|
### _locate
|
|
364
370
|
|
|
@@ -371,7 +377,7 @@ this.helpers['WebDriver']._locate({name: 'password'}).then //...
|
|
|
371
377
|
|
|
372
378
|
#### Parameters
|
|
373
379
|
|
|
374
|
-
- `locator` **([string][
|
|
380
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
375
381
|
- `smartWait`
|
|
376
382
|
|
|
377
383
|
### _locateCheckable
|
|
@@ -384,7 +390,7 @@ this.helpers['WebDriver']._locateCheckable('I agree with terms and conditions').
|
|
|
384
390
|
|
|
385
391
|
#### Parameters
|
|
386
392
|
|
|
387
|
-
- `locator` **([string][
|
|
393
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
388
394
|
|
|
389
395
|
### _locateClickable
|
|
390
396
|
|
|
@@ -397,7 +403,7 @@ const els = await this.helpers.WebDriver._locateClickable('Next page', '.pages')
|
|
|
397
403
|
|
|
398
404
|
#### Parameters
|
|
399
405
|
|
|
400
|
-
- `locator` **([string][
|
|
406
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
401
407
|
- `context`
|
|
402
408
|
|
|
403
409
|
### _locateFields
|
|
@@ -410,7 +416,7 @@ this.helpers['WebDriver']._locateFields('Your email').then // ...
|
|
|
410
416
|
|
|
411
417
|
#### Parameters
|
|
412
418
|
|
|
413
|
-
- `locator` **([string][
|
|
419
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
414
420
|
|
|
415
421
|
### _locateShadow
|
|
416
422
|
|
|
@@ -418,7 +424,7 @@ Locate Element within the Shadow Dom
|
|
|
418
424
|
|
|
419
425
|
#### Parameters
|
|
420
426
|
|
|
421
|
-
- `locator` **[object][
|
|
427
|
+
- `locator` **[object][16]**
|
|
422
428
|
|
|
423
429
|
### _smartWait
|
|
424
430
|
|
|
@@ -426,13 +432,13 @@ Smart Wait to locate an element
|
|
|
426
432
|
|
|
427
433
|
#### Parameters
|
|
428
434
|
|
|
429
|
-
- `locator` **[object][
|
|
435
|
+
- `locator` **[object][16]**
|
|
430
436
|
|
|
431
437
|
### acceptPopup
|
|
432
438
|
|
|
433
439
|
Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
|
|
434
440
|
Don't confuse popups with modal windows, as created by [various
|
|
435
|
-
libraries][
|
|
441
|
+
libraries][18].
|
|
436
442
|
|
|
437
443
|
### amOnPage
|
|
438
444
|
|
|
@@ -447,7 +453,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
447
453
|
|
|
448
454
|
#### Parameters
|
|
449
455
|
|
|
450
|
-
- `url` **[string][
|
|
456
|
+
- `url` **[string][17]** url path or global url.
|
|
451
457
|
|
|
452
458
|
Returns **void** automatically synchronized promise with recorder #!
|
|
453
459
|
|
|
@@ -462,8 +468,8 @@ I.appendField('#myTextField', 'appended');
|
|
|
462
468
|
|
|
463
469
|
#### Parameters
|
|
464
470
|
|
|
465
|
-
- `field` **([string][
|
|
466
|
-
- `value` **[string][
|
|
471
|
+
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator
|
|
472
|
+
- `value` **[string][17]** text value to append.
|
|
467
473
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
468
474
|
|
|
469
475
|
|
|
@@ -484,8 +490,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
484
490
|
|
|
485
491
|
#### Parameters
|
|
486
492
|
|
|
487
|
-
- `locator` **([string][
|
|
488
|
-
- `pathToFile` **[string][
|
|
493
|
+
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
494
|
+
- `pathToFile` **[string][17]** local file path relative to codecept.json config file.
|
|
489
495
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
490
496
|
Appium: not tested
|
|
491
497
|
|
|
@@ -508,8 +514,8 @@ I.checkOption('agree', '//form');
|
|
|
508
514
|
|
|
509
515
|
#### Parameters
|
|
510
516
|
|
|
511
|
-
- `field` **([string][
|
|
512
|
-
- `context` **([string][
|
|
517
|
+
- `field` **([string][17] | [object][16])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
518
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
513
519
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
514
520
|
Appium: not tested
|
|
515
521
|
|
|
@@ -525,7 +531,7 @@ I.clearCookie('test');
|
|
|
525
531
|
|
|
526
532
|
#### Parameters
|
|
527
533
|
|
|
528
|
-
- `cookie` **[string][
|
|
534
|
+
- `cookie` **[string][17]?** (optional, `null` by default) cookie name
|
|
529
535
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
530
536
|
|
|
531
537
|
### clearField
|
|
@@ -541,7 +547,7 @@ I.clearField('#email');
|
|
|
541
547
|
#### Parameters
|
|
542
548
|
|
|
543
549
|
- `field`
|
|
544
|
-
- `editable` **([string][
|
|
550
|
+
- `editable` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
545
551
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
546
552
|
|
|
547
553
|
### click
|
|
@@ -570,8 +576,8 @@ I.click({css: 'nav a.login'});
|
|
|
570
576
|
|
|
571
577
|
#### Parameters
|
|
572
578
|
|
|
573
|
-
- `locator` **([string][
|
|
574
|
-
- `context` **([string][
|
|
579
|
+
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
580
|
+
- `context` **([string][17]? | [object][16] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
575
581
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
576
582
|
|
|
577
583
|
|
|
@@ -600,7 +606,7 @@ I.closeOtherTabs();
|
|
|
600
606
|
|
|
601
607
|
### defineTimeout
|
|
602
608
|
|
|
603
|
-
Set [WebDriver timeouts][
|
|
609
|
+
Set [WebDriver timeouts][19] in realtime.
|
|
604
610
|
|
|
605
611
|
Timeouts are expected to be passed as object:
|
|
606
612
|
|
|
@@ -625,8 +631,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
625
631
|
|
|
626
632
|
#### Parameters
|
|
627
633
|
|
|
628
|
-
- `text` **[string][
|
|
629
|
-
- `context` **([string][
|
|
634
|
+
- `text` **[string][17]** which is not present.
|
|
635
|
+
- `context` **([string][17] | [object][16])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
630
636
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
631
637
|
|
|
632
638
|
|
|
@@ -645,7 +651,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
645
651
|
|
|
646
652
|
#### Parameters
|
|
647
653
|
|
|
648
|
-
- `field` **([string][
|
|
654
|
+
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
649
655
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
650
656
|
Appium: not tested
|
|
651
657
|
|
|
@@ -659,7 +665,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
659
665
|
|
|
660
666
|
#### Parameters
|
|
661
667
|
|
|
662
|
-
- `name` **[string][
|
|
668
|
+
- `name` **[string][17]** cookie name.
|
|
663
669
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
664
670
|
|
|
665
671
|
### dontSeeCurrentUrlEquals
|
|
@@ -674,7 +680,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
674
680
|
|
|
675
681
|
#### Parameters
|
|
676
682
|
|
|
677
|
-
- `url` **[string][
|
|
683
|
+
- `url` **[string][17]** value to check.
|
|
678
684
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
679
685
|
|
|
680
686
|
### dontSeeElement
|
|
@@ -687,7 +693,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
687
693
|
|
|
688
694
|
#### Parameters
|
|
689
695
|
|
|
690
|
-
- `locator` **([string][
|
|
696
|
+
- `locator` **([string][17] | [object][16])** located by CSS|XPath|Strict locator.
|
|
691
697
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
692
698
|
|
|
693
699
|
|
|
@@ -705,7 +711,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
705
711
|
|
|
706
712
|
#### Parameters
|
|
707
713
|
|
|
708
|
-
- `locator` **([string][
|
|
714
|
+
- `locator` **([string][17] | [object][16])** located by CSS|XPath|Strict locator.
|
|
709
715
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
710
716
|
|
|
711
717
|
### dontSeeInCurrentUrl
|
|
@@ -714,7 +720,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
714
720
|
|
|
715
721
|
#### Parameters
|
|
716
722
|
|
|
717
|
-
- `url` **[string][
|
|
723
|
+
- `url` **[string][17]** value to check.
|
|
718
724
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
719
725
|
|
|
720
726
|
### dontSeeInField
|
|
@@ -729,8 +735,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
729
735
|
|
|
730
736
|
#### Parameters
|
|
731
737
|
|
|
732
|
-
- `field` **([string][
|
|
733
|
-
- `value` **[string][
|
|
738
|
+
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
739
|
+
- `value` **[string][17]** value to check.
|
|
734
740
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
735
741
|
|
|
736
742
|
### dontSeeInSource
|
|
@@ -744,7 +750,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
744
750
|
#### Parameters
|
|
745
751
|
|
|
746
752
|
- `text`
|
|
747
|
-
- `value` **[string][
|
|
753
|
+
- `value` **[string][17]** to check.
|
|
748
754
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
749
755
|
|
|
750
756
|
### dontSeeInTitle
|
|
@@ -757,7 +763,7 @@ I.dontSeeInTitle('Error');
|
|
|
757
763
|
|
|
758
764
|
#### Parameters
|
|
759
765
|
|
|
760
|
-
- `text` **[string][
|
|
766
|
+
- `text` **[string][17]** value to check.
|
|
761
767
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
762
768
|
|
|
763
769
|
### doubleClick
|
|
@@ -774,8 +780,8 @@ I.doubleClick('.btn.edit');
|
|
|
774
780
|
|
|
775
781
|
#### Parameters
|
|
776
782
|
|
|
777
|
-
- `locator` **([string][
|
|
778
|
-
- `context` **([string][
|
|
783
|
+
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
784
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
779
785
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
780
786
|
|
|
781
787
|
|
|
@@ -792,8 +798,8 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
792
798
|
|
|
793
799
|
#### Parameters
|
|
794
800
|
|
|
795
|
-
- `srcElement` **([string][
|
|
796
|
-
- `destElement` **([string][
|
|
801
|
+
- `srcElement` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
802
|
+
- `destElement` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
797
803
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
798
804
|
Appium: not tested
|
|
799
805
|
|
|
@@ -809,8 +815,8 @@ I.dragSlider('#slider', -70);
|
|
|
809
815
|
|
|
810
816
|
#### Parameters
|
|
811
817
|
|
|
812
|
-
- `locator` **([string][
|
|
813
|
-
- `offsetX` **[number][
|
|
818
|
+
- `locator` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
819
|
+
- `offsetX` **[number][20]** position to drag.
|
|
814
820
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
815
821
|
|
|
816
822
|
### executeAsyncScript
|
|
@@ -818,7 +824,7 @@ I.dragSlider('#slider', -70);
|
|
|
818
824
|
Executes async script on page.
|
|
819
825
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
820
826
|
|
|
821
|
-
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][
|
|
827
|
+
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][21].
|
|
822
828
|
|
|
823
829
|
```js
|
|
824
830
|
I.executeAsyncScript(function(done) {
|
|
@@ -840,7 +846,7 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
840
846
|
|
|
841
847
|
- `args` **...any** to be passed to function.
|
|
842
848
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
843
|
-
- `fn` **([string][
|
|
849
|
+
- `fn` **([string][17] | [function][22])** function to be executed in browser context.
|
|
844
850
|
|
|
845
851
|
### executeScript
|
|
846
852
|
|
|
@@ -871,8 +877,8 @@ let date = await I.executeScript(function(el) {
|
|
|
871
877
|
#### Parameters
|
|
872
878
|
|
|
873
879
|
- `args` **...any** to be passed to function.
|
|
874
|
-
[!] returns a _promise_ which is synchronized internally by recorderWraps [execute][
|
|
875
|
-
- `fn` **([string][
|
|
880
|
+
[!] returns a _promise_ which is synchronized internally by recorderWraps [execute][23] command.
|
|
881
|
+
- `fn` **([string][17] | [function][22])** function to be executed in browser context.
|
|
876
882
|
|
|
877
883
|
### fillField
|
|
878
884
|
|
|
@@ -892,8 +898,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
892
898
|
|
|
893
899
|
#### Parameters
|
|
894
900
|
|
|
895
|
-
- `field` **([string][
|
|
896
|
-
- `value` **([string][
|
|
901
|
+
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
902
|
+
- `value` **([string][17] | [object][16])** text value to fill.
|
|
897
903
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
898
904
|
|
|
899
905
|
|
|
@@ -931,8 +937,8 @@ I.forceClick({css: 'nav a.login'});
|
|
|
931
937
|
|
|
932
938
|
#### Parameters
|
|
933
939
|
|
|
934
|
-
- `locator` **([string][
|
|
935
|
-
- `context` **([string][
|
|
940
|
+
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
941
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
936
942
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
937
943
|
|
|
938
944
|
|
|
@@ -958,8 +964,8 @@ I.forceRightClick('Menu');
|
|
|
958
964
|
|
|
959
965
|
#### Parameters
|
|
960
966
|
|
|
961
|
-
- `locator` **([string][
|
|
962
|
-
- `context` **([string][
|
|
967
|
+
- `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
968
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
963
969
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
964
970
|
|
|
965
971
|
|
|
@@ -975,7 +981,7 @@ Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
|
|
|
975
981
|
const windows = await I.grabAllWindowHandles();
|
|
976
982
|
```
|
|
977
983
|
|
|
978
|
-
Returns **[Promise][
|
|
984
|
+
Returns **[Promise][24]<[Array][25]<[string][17]>>**
|
|
979
985
|
|
|
980
986
|
### grabAttributeFrom
|
|
981
987
|
|
|
@@ -989,10 +995,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
989
995
|
|
|
990
996
|
#### Parameters
|
|
991
997
|
|
|
992
|
-
- `locator` **([string][
|
|
993
|
-
- `attr` **[string][
|
|
998
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
999
|
+
- `attr` **[string][17]** attribute name.
|
|
994
1000
|
|
|
995
|
-
Returns **[Promise][
|
|
1001
|
+
Returns **[Promise][24]<[string][17]>** attribute value
|
|
996
1002
|
|
|
997
1003
|
### grabAttributeFromAll
|
|
998
1004
|
|
|
@@ -1005,10 +1011,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
1005
1011
|
|
|
1006
1012
|
#### Parameters
|
|
1007
1013
|
|
|
1008
|
-
- `locator` **([string][
|
|
1009
|
-
- `attr` **[string][
|
|
1014
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1015
|
+
- `attr` **[string][17]** attribute name.
|
|
1010
1016
|
|
|
1011
|
-
Returns **[Promise][
|
|
1017
|
+
Returns **[Promise][24]<[Array][25]<[string][17]>>** attribute value
|
|
1012
1018
|
|
|
1013
1019
|
### grabBrowserLogs
|
|
1014
1020
|
|
|
@@ -1020,7 +1026,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
1020
1026
|
console.log(JSON.stringify(logs))
|
|
1021
1027
|
```
|
|
1022
1028
|
|
|
1023
|
-
Returns **([Promise][
|
|
1029
|
+
Returns **([Promise][24]<[Array][25]<[object][16]>> | [undefined][26])** all browser logs
|
|
1024
1030
|
|
|
1025
1031
|
### grabCookie
|
|
1026
1032
|
|
|
@@ -1035,9 +1041,9 @@ assert(cookie.value, '123456');
|
|
|
1035
1041
|
|
|
1036
1042
|
#### Parameters
|
|
1037
1043
|
|
|
1038
|
-
- `name` **[string][
|
|
1044
|
+
- `name` **[string][17]?** cookie name.
|
|
1039
1045
|
|
|
1040
|
-
Returns **([Promise][
|
|
1046
|
+
Returns **([Promise][24]<[string][17]> | [Promise][24]<[Array][25]<[string][17]>>)** attribute value
|
|
1041
1047
|
|
|
1042
1048
|
### grabCssPropertyFrom
|
|
1043
1049
|
|
|
@@ -1051,10 +1057,10 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
1051
1057
|
|
|
1052
1058
|
#### Parameters
|
|
1053
1059
|
|
|
1054
|
-
- `locator` **([string][
|
|
1055
|
-
- `cssProperty` **[string][
|
|
1060
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1061
|
+
- `cssProperty` **[string][17]** CSS property name.
|
|
1056
1062
|
|
|
1057
|
-
Returns **[Promise][
|
|
1063
|
+
Returns **[Promise][24]<[string][17]>** CSS value
|
|
1058
1064
|
|
|
1059
1065
|
### grabCssPropertyFromAll
|
|
1060
1066
|
|
|
@@ -1067,10 +1073,10 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
1067
1073
|
|
|
1068
1074
|
#### Parameters
|
|
1069
1075
|
|
|
1070
|
-
- `locator` **([string][
|
|
1071
|
-
- `cssProperty` **[string][
|
|
1076
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1077
|
+
- `cssProperty` **[string][17]** CSS property name.
|
|
1072
1078
|
|
|
1073
|
-
Returns **[Promise][
|
|
1079
|
+
Returns **[Promise][24]<[Array][25]<[string][17]>>** CSS value
|
|
1074
1080
|
|
|
1075
1081
|
### grabCurrentUrl
|
|
1076
1082
|
|
|
@@ -1082,7 +1088,7 @@ let url = await I.grabCurrentUrl();
|
|
|
1082
1088
|
console.log(`Current URL is [${url}]`);
|
|
1083
1089
|
```
|
|
1084
1090
|
|
|
1085
|
-
Returns **[Promise][
|
|
1091
|
+
Returns **[Promise][24]<[string][17]>** current URL
|
|
1086
1092
|
|
|
1087
1093
|
### grabCurrentWindowHandle
|
|
1088
1094
|
|
|
@@ -1093,7 +1099,7 @@ Useful for referencing it when calling `I.switchToWindow(handle)`
|
|
|
1093
1099
|
const window = await I.grabCurrentWindowHandle();
|
|
1094
1100
|
```
|
|
1095
1101
|
|
|
1096
|
-
Returns **[Promise][
|
|
1102
|
+
Returns **[Promise][24]<[string][17]>**
|
|
1097
1103
|
|
|
1098
1104
|
### grabElementBoundingRect
|
|
1099
1105
|
|
|
@@ -1117,11 +1123,11 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
1117
1123
|
|
|
1118
1124
|
#### Parameters
|
|
1119
1125
|
|
|
1120
|
-
- `locator` **([string][
|
|
1126
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1121
1127
|
- `prop`
|
|
1122
|
-
- `elementSize` **[string][
|
|
1128
|
+
- `elementSize` **[string][17]?** x, y, width or height of the given element.
|
|
1123
1129
|
|
|
1124
|
-
Returns **([Promise][
|
|
1130
|
+
Returns **([Promise][24]<DOMRect> | [Promise][24]<[number][20]>)** Element bounding rectangle
|
|
1125
1131
|
|
|
1126
1132
|
### grabGeoLocation
|
|
1127
1133
|
|
|
@@ -1132,7 +1138,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1132
1138
|
let geoLocation = await I.grabGeoLocation();
|
|
1133
1139
|
```
|
|
1134
1140
|
|
|
1135
|
-
Returns **[Promise][
|
|
1141
|
+
Returns **[Promise][24]<{latitude: [number][20], longitude: [number][20], altitude: [number][20]}>**
|
|
1136
1142
|
|
|
1137
1143
|
### grabHTMLFrom
|
|
1138
1144
|
|
|
@@ -1147,9 +1153,9 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1147
1153
|
#### Parameters
|
|
1148
1154
|
|
|
1149
1155
|
- `locator`
|
|
1150
|
-
- `element` **([string][
|
|
1156
|
+
- `element` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1151
1157
|
|
|
1152
|
-
Returns **[Promise][
|
|
1158
|
+
Returns **[Promise][24]<[string][17]>** HTML code for an element
|
|
1153
1159
|
|
|
1154
1160
|
### grabHTMLFromAll
|
|
1155
1161
|
|
|
@@ -1163,9 +1169,9 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1163
1169
|
#### Parameters
|
|
1164
1170
|
|
|
1165
1171
|
- `locator`
|
|
1166
|
-
- `element` **([string][
|
|
1172
|
+
- `element` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1167
1173
|
|
|
1168
|
-
Returns **[Promise][
|
|
1174
|
+
Returns **[Promise][24]<[Array][25]<[string][17]>>** HTML code for an element
|
|
1169
1175
|
|
|
1170
1176
|
### grabNumberOfOpenTabs
|
|
1171
1177
|
|
|
@@ -1176,7 +1182,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1176
1182
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1177
1183
|
```
|
|
1178
1184
|
|
|
1179
|
-
Returns **[Promise][
|
|
1185
|
+
Returns **[Promise][24]<[number][20]>** number of open tabs
|
|
1180
1186
|
|
|
1181
1187
|
### grabNumberOfVisibleElements
|
|
1182
1188
|
|
|
@@ -1189,9 +1195,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1189
1195
|
|
|
1190
1196
|
#### Parameters
|
|
1191
1197
|
|
|
1192
|
-
- `locator` **([string][
|
|
1198
|
+
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1193
1199
|
|
|
1194
|
-
Returns **[Promise][
|
|
1200
|
+
Returns **[Promise][24]<[number][20]>** number of visible elements
|
|
1195
1201
|
|
|
1196
1202
|
### grabPageScrollPosition
|
|
1197
1203
|
|
|
@@ -1202,7 +1208,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1202
1208
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1203
1209
|
```
|
|
1204
1210
|
|
|
1205
|
-
Returns **[Promise][
|
|
1211
|
+
Returns **[Promise][24]<PageScrollPosition>** scroll position
|
|
1206
1212
|
|
|
1207
1213
|
### grabPopupText
|
|
1208
1214
|
|
|
@@ -1212,7 +1218,7 @@ Grab the text within the popup. If no popup is visible then it will return null.
|
|
|
1212
1218
|
await I.grabPopupText();
|
|
1213
1219
|
```
|
|
1214
1220
|
|
|
1215
|
-
Returns **[Promise][
|
|
1221
|
+
Returns **[Promise][24]<[string][17]>**
|
|
1216
1222
|
|
|
1217
1223
|
### grabSource
|
|
1218
1224
|
|
|
@@ -1223,7 +1229,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1223
1229
|
let pageSource = await I.grabSource();
|
|
1224
1230
|
```
|
|
1225
1231
|
|
|
1226
|
-
Returns **[Promise][
|
|
1232
|
+
Returns **[Promise][24]<[string][17]>** source code
|
|
1227
1233
|
|
|
1228
1234
|
### grabTextFrom
|
|
1229
1235
|
|
|
@@ -1238,9 +1244,9 @@ If multiple elements found returns first element.
|
|
|
1238
1244
|
|
|
1239
1245
|
#### Parameters
|
|
1240
1246
|
|
|
1241
|
-
- `locator` **([string][
|
|
1247
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1242
1248
|
|
|
1243
|
-
Returns **[Promise][
|
|
1249
|
+
Returns **[Promise][24]<[string][17]>** attribute value
|
|
1244
1250
|
|
|
1245
1251
|
### grabTextFromAll
|
|
1246
1252
|
|
|
@@ -1253,9 +1259,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1253
1259
|
|
|
1254
1260
|
#### Parameters
|
|
1255
1261
|
|
|
1256
|
-
- `locator` **([string][
|
|
1262
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1257
1263
|
|
|
1258
|
-
Returns **[Promise][
|
|
1264
|
+
Returns **[Promise][24]<[Array][25]<[string][17]>>** attribute value
|
|
1259
1265
|
|
|
1260
1266
|
### grabTitle
|
|
1261
1267
|
|
|
@@ -1266,7 +1272,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1266
1272
|
let title = await I.grabTitle();
|
|
1267
1273
|
```
|
|
1268
1274
|
|
|
1269
|
-
Returns **[Promise][
|
|
1275
|
+
Returns **[Promise][24]<[string][17]>** title
|
|
1270
1276
|
|
|
1271
1277
|
### grabValueFrom
|
|
1272
1278
|
|
|
@@ -1280,9 +1286,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1280
1286
|
|
|
1281
1287
|
#### Parameters
|
|
1282
1288
|
|
|
1283
|
-
- `locator` **([string][
|
|
1289
|
+
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
1284
1290
|
|
|
1285
|
-
Returns **[Promise][
|
|
1291
|
+
Returns **[Promise][24]<[string][17]>** attribute value
|
|
1286
1292
|
|
|
1287
1293
|
### grabValueFromAll
|
|
1288
1294
|
|
|
@@ -1295,9 +1301,9 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1295
1301
|
|
|
1296
1302
|
#### Parameters
|
|
1297
1303
|
|
|
1298
|
-
- `locator` **([string][
|
|
1304
|
+
- `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
1299
1305
|
|
|
1300
|
-
Returns **[Promise][
|
|
1306
|
+
Returns **[Promise][24]<[Array][25]<[string][17]>>** attribute value
|
|
1301
1307
|
|
|
1302
1308
|
### moveCursorTo
|
|
1303
1309
|
|
|
@@ -1311,11 +1317,11 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1311
1317
|
|
|
1312
1318
|
#### Parameters
|
|
1313
1319
|
|
|
1314
|
-
- `locator` **([string][
|
|
1320
|
+
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1315
1321
|
- `xOffset`
|
|
1316
1322
|
- `yOffset`
|
|
1317
|
-
- `offsetX` **[number][
|
|
1318
|
-
- `offsetY` **[number][
|
|
1323
|
+
- `offsetX` **[number][20]** (optional, `0` by default) X-axis offset.
|
|
1324
|
+
- `offsetY` **[number][20]** (optional, `0` by default) Y-axis offset.
|
|
1319
1325
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1320
1326
|
|
|
1321
1327
|
### openNewTab
|
|
@@ -1337,7 +1343,7 @@ I.openNewTab();
|
|
|
1337
1343
|
|
|
1338
1344
|
Presses a key in the browser (on a focused element).
|
|
1339
1345
|
|
|
1340
|
-
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][
|
|
1346
|
+
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][27].
|
|
1341
1347
|
|
|
1342
1348
|
```js
|
|
1343
1349
|
I.pressKey('Backspace');
|
|
@@ -1396,14 +1402,14 @@ Some of the supported key names are:
|
|
|
1396
1402
|
|
|
1397
1403
|
#### Parameters
|
|
1398
1404
|
|
|
1399
|
-
- `key` **([string][
|
|
1405
|
+
- `key` **([string][17] | [Array][25]<[string][17]>)** key or array of keys to press.
|
|
1400
1406
|
[!] returns a _promise_ which is synchronized internally by recorder_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.
|
|
1401
1407
|
|
|
1402
1408
|
### pressKeyDown
|
|
1403
1409
|
|
|
1404
1410
|
Presses a key in the browser and leaves it in a down state.
|
|
1405
1411
|
|
|
1406
|
-
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][
|
|
1412
|
+
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][28]).
|
|
1407
1413
|
|
|
1408
1414
|
```js
|
|
1409
1415
|
I.pressKeyDown('Control');
|
|
@@ -1413,14 +1419,14 @@ I.pressKeyUp('Control');
|
|
|
1413
1419
|
|
|
1414
1420
|
#### Parameters
|
|
1415
1421
|
|
|
1416
|
-
- `key` **[string][
|
|
1422
|
+
- `key` **[string][17]** name of key to press down.
|
|
1417
1423
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1418
1424
|
|
|
1419
1425
|
### pressKeyUp
|
|
1420
1426
|
|
|
1421
1427
|
Releases a key in the browser which was previously set to a down state.
|
|
1422
1428
|
|
|
1423
|
-
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][
|
|
1429
|
+
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][28]).
|
|
1424
1430
|
|
|
1425
1431
|
```js
|
|
1426
1432
|
I.pressKeyDown('Control');
|
|
@@ -1430,7 +1436,7 @@ I.pressKeyUp('Control');
|
|
|
1430
1436
|
|
|
1431
1437
|
#### Parameters
|
|
1432
1438
|
|
|
1433
|
-
- `key` **[string][
|
|
1439
|
+
- `key` **[string][17]** name of key to release.
|
|
1434
1440
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1435
1441
|
|
|
1436
1442
|
### refreshPage
|
|
@@ -1450,8 +1456,8 @@ First parameter can be set to `maximize`.
|
|
|
1450
1456
|
|
|
1451
1457
|
#### Parameters
|
|
1452
1458
|
|
|
1453
|
-
- `width` **[number][
|
|
1454
|
-
- `height` **[number][
|
|
1459
|
+
- `width` **[number][20]** width in pixels or `maximize`.
|
|
1460
|
+
- `height` **[number][20]** height in pixels.
|
|
1455
1461
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1456
1462
|
Appium: not tested in web, in apps doesn't work
|
|
1457
1463
|
|
|
@@ -1470,8 +1476,8 @@ I.rightClick('Click me', '.context');
|
|
|
1470
1476
|
|
|
1471
1477
|
#### Parameters
|
|
1472
1478
|
|
|
1473
|
-
- `locator` **([string][
|
|
1474
|
-
- `context` **([string][
|
|
1479
|
+
- `locator` **([string][17] | [object][16])** clickable element located by CSS|XPath|strict locator.
|
|
1480
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1475
1481
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1476
1482
|
|
|
1477
1483
|
|
|
@@ -1515,8 +1521,8 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1515
1521
|
|
|
1516
1522
|
#### Parameters
|
|
1517
1523
|
|
|
1518
|
-
- `locator` **([string][
|
|
1519
|
-
- `fileName` **[string][
|
|
1524
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1525
|
+
- `fileName` **[string][17]** file name to save.
|
|
1520
1526
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1521
1527
|
|
|
1522
1528
|
### saveScreenshot
|
|
@@ -1532,8 +1538,8 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1532
1538
|
|
|
1533
1539
|
#### Parameters
|
|
1534
1540
|
|
|
1535
|
-
- `fileName` **[string][
|
|
1536
|
-
- `fullPage` **[boolean][
|
|
1541
|
+
- `fileName` **[string][17]** file name to save.
|
|
1542
|
+
- `fullPage` **[boolean][29]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1537
1543
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1538
1544
|
|
|
1539
1545
|
### scrollIntoView
|
|
@@ -1548,8 +1554,8 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1548
1554
|
|
|
1549
1555
|
#### Parameters
|
|
1550
1556
|
|
|
1551
|
-
- `locator` **([string][
|
|
1552
|
-
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][
|
|
1557
|
+
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1558
|
+
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][30].
|
|
1553
1559
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1554
1560
|
|
|
1555
1561
|
### scrollPageToBottom
|
|
@@ -1584,9 +1590,9 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1584
1590
|
|
|
1585
1591
|
#### Parameters
|
|
1586
1592
|
|
|
1587
|
-
- `locator` **([string][
|
|
1588
|
-
- `offsetX` **[number][
|
|
1589
|
-
- `offsetY` **[number][
|
|
1593
|
+
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1594
|
+
- `offsetX` **[number][20]** (optional, `0` by default) X-axis offset.
|
|
1595
|
+
- `offsetY` **[number][20]** (optional, `0` by default) Y-axis offset.
|
|
1590
1596
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1591
1597
|
|
|
1592
1598
|
### see
|
|
@@ -1602,8 +1608,8 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1602
1608
|
|
|
1603
1609
|
#### Parameters
|
|
1604
1610
|
|
|
1605
|
-
- `text` **[string][
|
|
1606
|
-
- `context` **([string][
|
|
1611
|
+
- `text` **[string][17]** expected on page.
|
|
1612
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1607
1613
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1608
1614
|
|
|
1609
1615
|
|
|
@@ -1620,8 +1626,8 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1620
1626
|
|
|
1621
1627
|
#### Parameters
|
|
1622
1628
|
|
|
1623
|
-
- `locator` **([string][
|
|
1624
|
-
- `attributes` **[object][
|
|
1629
|
+
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1630
|
+
- `attributes` **[object][16]** attributes and their values to check.
|
|
1625
1631
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1626
1632
|
|
|
1627
1633
|
### seeCheckboxIsChecked
|
|
@@ -1636,7 +1642,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1636
1642
|
|
|
1637
1643
|
#### Parameters
|
|
1638
1644
|
|
|
1639
|
-
- `field` **([string][
|
|
1645
|
+
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
1640
1646
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1641
1647
|
Appium: not tested
|
|
1642
1648
|
|
|
@@ -1650,7 +1656,7 @@ I.seeCookie('Auth');
|
|
|
1650
1656
|
|
|
1651
1657
|
#### Parameters
|
|
1652
1658
|
|
|
1653
|
-
- `name` **[string][
|
|
1659
|
+
- `name` **[string][17]** cookie name.
|
|
1654
1660
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1655
1661
|
|
|
1656
1662
|
### seeCssPropertiesOnElements
|
|
@@ -1663,8 +1669,8 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1663
1669
|
|
|
1664
1670
|
#### Parameters
|
|
1665
1671
|
|
|
1666
|
-
- `locator` **([string][
|
|
1667
|
-
- `cssProperties` **[object][
|
|
1672
|
+
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1673
|
+
- `cssProperties` **[object][16]** object with CSS properties and their values to check.
|
|
1668
1674
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1669
1675
|
|
|
1670
1676
|
### seeCurrentUrlEquals
|
|
@@ -1680,7 +1686,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1680
1686
|
|
|
1681
1687
|
#### Parameters
|
|
1682
1688
|
|
|
1683
|
-
- `url` **[string][
|
|
1689
|
+
- `url` **[string][17]** value to check.
|
|
1684
1690
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1685
1691
|
|
|
1686
1692
|
### seeElement
|
|
@@ -1694,7 +1700,7 @@ I.seeElement('#modal');
|
|
|
1694
1700
|
|
|
1695
1701
|
#### Parameters
|
|
1696
1702
|
|
|
1697
|
-
- `locator` **([string][
|
|
1703
|
+
- `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
|
|
1698
1704
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1699
1705
|
|
|
1700
1706
|
|
|
@@ -1713,7 +1719,7 @@ I.seeElementInDOM('#modal');
|
|
|
1713
1719
|
|
|
1714
1720
|
#### Parameters
|
|
1715
1721
|
|
|
1716
|
-
- `locator` **([string][
|
|
1722
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1717
1723
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1718
1724
|
|
|
1719
1725
|
### seeInCurrentUrl
|
|
@@ -1726,7 +1732,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1726
1732
|
|
|
1727
1733
|
#### Parameters
|
|
1728
1734
|
|
|
1729
|
-
- `url` **[string][
|
|
1735
|
+
- `url` **[string][17]** a fragment to check
|
|
1730
1736
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1731
1737
|
|
|
1732
1738
|
### seeInField
|
|
@@ -1743,8 +1749,8 @@ I.seeInField('#searchform input','Search');
|
|
|
1743
1749
|
|
|
1744
1750
|
#### Parameters
|
|
1745
1751
|
|
|
1746
|
-
- `field` **([string][
|
|
1747
|
-
- `value` **[string][
|
|
1752
|
+
- `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
|
|
1753
|
+
- `value` **[string][17]** value to check.
|
|
1748
1754
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1749
1755
|
|
|
1750
1756
|
### seeInPopup
|
|
@@ -1754,7 +1760,7 @@ given string.
|
|
|
1754
1760
|
|
|
1755
1761
|
#### Parameters
|
|
1756
1762
|
|
|
1757
|
-
- `text` **[string][
|
|
1763
|
+
- `text` **[string][17]** value to check.
|
|
1758
1764
|
|
|
1759
1765
|
### seeInSource
|
|
1760
1766
|
|
|
@@ -1766,7 +1772,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1766
1772
|
|
|
1767
1773
|
#### Parameters
|
|
1768
1774
|
|
|
1769
|
-
- `text` **[string][
|
|
1775
|
+
- `text` **[string][17]** value to check.
|
|
1770
1776
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1771
1777
|
|
|
1772
1778
|
### seeInTitle
|
|
@@ -1779,7 +1785,7 @@ I.seeInTitle('Home Page');
|
|
|
1779
1785
|
|
|
1780
1786
|
#### Parameters
|
|
1781
1787
|
|
|
1782
|
-
- `text` **[string][
|
|
1788
|
+
- `text` **[string][17]** text value to check.
|
|
1783
1789
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1784
1790
|
|
|
1785
1791
|
### seeNumberOfElements
|
|
@@ -1793,8 +1799,8 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1793
1799
|
|
|
1794
1800
|
#### Parameters
|
|
1795
1801
|
|
|
1796
|
-
- `locator` **([string][
|
|
1797
|
-
- `num` **[number][
|
|
1802
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1803
|
+
- `num` **[number][20]** number of elements.
|
|
1798
1804
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1799
1805
|
|
|
1800
1806
|
|
|
@@ -1813,8 +1819,8 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1813
1819
|
|
|
1814
1820
|
#### Parameters
|
|
1815
1821
|
|
|
1816
|
-
- `locator` **([string][
|
|
1817
|
-
- `num` **[number][
|
|
1822
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
1823
|
+
- `num` **[number][20]** number of elements.
|
|
1818
1824
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1819
1825
|
|
|
1820
1826
|
|
|
@@ -1832,8 +1838,8 @@ I.seeTextEquals('text', 'h1');
|
|
|
1832
1838
|
|
|
1833
1839
|
#### Parameters
|
|
1834
1840
|
|
|
1835
|
-
- `text` **[string][
|
|
1836
|
-
- `context` **([string][
|
|
1841
|
+
- `text` **[string][17]** element value to check.
|
|
1842
|
+
- `context` **([string][17] | [object][16])?** element located by CSS|XPath|strict locator.
|
|
1837
1843
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1838
1844
|
|
|
1839
1845
|
### seeTitleEquals
|
|
@@ -1846,7 +1852,7 @@ I.seeTitleEquals('Test title.');
|
|
|
1846
1852
|
|
|
1847
1853
|
#### Parameters
|
|
1848
1854
|
|
|
1849
|
-
- `text` **[string][
|
|
1855
|
+
- `text` **[string][17]** value to check.
|
|
1850
1856
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1851
1857
|
|
|
1852
1858
|
### selectOption
|
|
@@ -1872,8 +1878,8 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1872
1878
|
|
|
1873
1879
|
#### Parameters
|
|
1874
1880
|
|
|
1875
|
-
- `select` **([string][
|
|
1876
|
-
- `option` **([string][
|
|
1881
|
+
- `select` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
|
|
1882
|
+
- `option` **([string][17] | [Array][25]<any>)** visible text or value of option.
|
|
1877
1883
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1878
1884
|
|
|
1879
1885
|
### setCookie
|
|
@@ -1894,9 +1900,9 @@ I.setCookie([
|
|
|
1894
1900
|
|
|
1895
1901
|
#### Parameters
|
|
1896
1902
|
|
|
1897
|
-
- `cookie` **(Cookie | [Array][
|
|
1903
|
+
- `cookie` **(Cookie | [Array][25]<Cookie>)** a cookie object or array of cookie objects.
|
|
1898
1904
|
[!] returns a _promise_ which is synchronized internally by recorderUses Selenium's JSON [cookie
|
|
1899
|
-
format][
|
|
1905
|
+
format][31].
|
|
1900
1906
|
|
|
1901
1907
|
### setGeoLocation
|
|
1902
1908
|
|
|
@@ -1909,9 +1915,9 @@ I.setGeoLocation(121.21, 11.56, 10);
|
|
|
1909
1915
|
|
|
1910
1916
|
#### Parameters
|
|
1911
1917
|
|
|
1912
|
-
- `latitude` **[number][
|
|
1913
|
-
- `longitude` **[number][
|
|
1914
|
-
- `altitude` **[number][
|
|
1918
|
+
- `latitude` **[number][20]** to set.
|
|
1919
|
+
- `longitude` **[number][20]** to set
|
|
1920
|
+
- `altitude` **[number][20]?** (optional, null by default) to set
|
|
1915
1921
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1916
1922
|
|
|
1917
1923
|
### switchTo
|
|
@@ -1925,7 +1931,7 @@ I.switchTo(); // switch back to main page
|
|
|
1925
1931
|
|
|
1926
1932
|
#### Parameters
|
|
1927
1933
|
|
|
1928
|
-
- `locator` **([string][
|
|
1934
|
+
- `locator` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1929
1935
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1930
1936
|
|
|
1931
1937
|
### switchToNextTab
|
|
@@ -1939,8 +1945,8 @@ I.switchToNextTab(2);
|
|
|
1939
1945
|
|
|
1940
1946
|
#### Parameters
|
|
1941
1947
|
|
|
1942
|
-
- `num` **[number][
|
|
1943
|
-
- `sec` **([number][
|
|
1948
|
+
- `num` **[number][20]?** (optional) number of tabs to switch forward, default: 1.
|
|
1949
|
+
- `sec` **([number][20] | null)?** (optional) time in seconds to wait.
|
|
1944
1950
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1945
1951
|
|
|
1946
1952
|
### switchToPreviousTab
|
|
@@ -1954,8 +1960,8 @@ I.switchToPreviousTab(2);
|
|
|
1954
1960
|
|
|
1955
1961
|
#### Parameters
|
|
1956
1962
|
|
|
1957
|
-
- `num` **[number][
|
|
1958
|
-
- `sec` **[number][
|
|
1963
|
+
- `num` **[number][20]?** (optional) number of tabs to switch backward, default: 1.
|
|
1964
|
+
- `sec` **[number][20]??** (optional) time in seconds to wait.
|
|
1959
1965
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1960
1966
|
|
|
1961
1967
|
### switchToWindow
|
|
@@ -1974,13 +1980,13 @@ await I.switchToWindow( window );
|
|
|
1974
1980
|
|
|
1975
1981
|
#### Parameters
|
|
1976
1982
|
|
|
1977
|
-
- `window` **[string][
|
|
1983
|
+
- `window` **[string][17]** name of window handle.
|
|
1978
1984
|
|
|
1979
1985
|
### type
|
|
1980
1986
|
|
|
1981
1987
|
Types out the given text into an active field.
|
|
1982
1988
|
To slow down typing use a second parameter, to set interval between key presses.
|
|
1983
|
-
_Note:_ Should be used when [`fillField`][
|
|
1989
|
+
_Note:_ Should be used when [`fillField`][27] is not an option.
|
|
1984
1990
|
|
|
1985
1991
|
```js
|
|
1986
1992
|
// passing in a string
|
|
@@ -1996,9 +2002,9 @@ I.type(['T', 'E', 'X', 'T']);
|
|
|
1996
2002
|
#### Parameters
|
|
1997
2003
|
|
|
1998
2004
|
- `keys`
|
|
1999
|
-
- `delay` **[number][
|
|
2005
|
+
- `delay` **[number][20]?** (optional) delay in ms between key presses
|
|
2000
2006
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2001
|
-
- `key` **([string][
|
|
2007
|
+
- `key` **([string][17] | [Array][25]<[string][17]>)** or array of keys to type.
|
|
2002
2008
|
|
|
2003
2009
|
### uncheckOption
|
|
2004
2010
|
|
|
@@ -2015,19 +2021,19 @@ I.uncheckOption('agree', '//form');
|
|
|
2015
2021
|
|
|
2016
2022
|
#### Parameters
|
|
2017
2023
|
|
|
2018
|
-
- `field` **([string][
|
|
2019
|
-
- `context` **([string][
|
|
2024
|
+
- `field` **([string][17] | [object][16])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
2025
|
+
- `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2020
2026
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2021
2027
|
Appium: not tested
|
|
2022
2028
|
|
|
2023
2029
|
### useWebDriverTo
|
|
2024
2030
|
|
|
2025
|
-
Use [webdriverio][
|
|
2031
|
+
Use [webdriverio][32] API inside a test.
|
|
2026
2032
|
|
|
2027
2033
|
First argument is a description of an action.
|
|
2028
2034
|
Second argument is async function that gets this helper as parameter.
|
|
2029
2035
|
|
|
2030
|
-
{ [`browser`][
|
|
2036
|
+
{ [`browser`][32]) } object from WebDriver API is available.
|
|
2031
2037
|
|
|
2032
2038
|
```js
|
|
2033
2039
|
I.useWebDriverTo('open multiple windows', async ({ browser }) {
|
|
@@ -2038,8 +2044,8 @@ I.useWebDriverTo('open multiple windows', async ({ browser }) {
|
|
|
2038
2044
|
|
|
2039
2045
|
#### Parameters
|
|
2040
2046
|
|
|
2041
|
-
- `description` **[string][
|
|
2042
|
-
- `fn` **[function][
|
|
2047
|
+
- `description` **[string][17]** used to show in logs.
|
|
2048
|
+
- `fn` **[function][22]** async functuion that executed with WebDriver helper as argument
|
|
2043
2049
|
|
|
2044
2050
|
### wait
|
|
2045
2051
|
|
|
@@ -2051,7 +2057,7 @@ I.wait(2); // wait 2 secs
|
|
|
2051
2057
|
|
|
2052
2058
|
#### Parameters
|
|
2053
2059
|
|
|
2054
|
-
- `sec` **[number][
|
|
2060
|
+
- `sec` **[number][20]** number of second to wait.
|
|
2055
2061
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2056
2062
|
|
|
2057
2063
|
### waitForClickable
|
|
@@ -2066,9 +2072,9 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
2066
2072
|
|
|
2067
2073
|
#### Parameters
|
|
2068
2074
|
|
|
2069
|
-
- `locator` **([string][
|
|
2075
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2070
2076
|
- `waitTimeout`
|
|
2071
|
-
- `sec` **[number][
|
|
2077
|
+
- `sec` **[number][20]?** (optional, `1` by default) time in seconds to wait
|
|
2072
2078
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2073
2079
|
|
|
2074
2080
|
### waitForDetached
|
|
@@ -2082,8 +2088,8 @@ I.waitForDetached('#popup');
|
|
|
2082
2088
|
|
|
2083
2089
|
#### Parameters
|
|
2084
2090
|
|
|
2085
|
-
- `locator` **([string][
|
|
2086
|
-
- `sec` **[number][
|
|
2091
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2092
|
+
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2087
2093
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2088
2094
|
|
|
2089
2095
|
### waitForElement
|
|
@@ -2098,8 +2104,8 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
2098
2104
|
|
|
2099
2105
|
#### Parameters
|
|
2100
2106
|
|
|
2101
|
-
- `locator` **([string][
|
|
2102
|
-
- `sec` **[number][
|
|
2107
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2108
|
+
- `sec` **[number][20]?** (optional, `1` by default) time in seconds to wait
|
|
2103
2109
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2104
2110
|
|
|
2105
2111
|
### waitForEnabled
|
|
@@ -2109,8 +2115,8 @@ Element can be located by CSS or XPath.
|
|
|
2109
2115
|
|
|
2110
2116
|
#### Parameters
|
|
2111
2117
|
|
|
2112
|
-
- `locator` **([string][
|
|
2113
|
-
- `sec` **[number][
|
|
2118
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2119
|
+
- `sec` **[number][20]** (optional) time in seconds to wait, 1 by default.
|
|
2114
2120
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2115
2121
|
|
|
2116
2122
|
### waitForFunction
|
|
@@ -2130,9 +2136,9 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
2130
2136
|
|
|
2131
2137
|
#### Parameters
|
|
2132
2138
|
|
|
2133
|
-
- `fn` **([string][
|
|
2134
|
-
- `argsOrSec` **([Array][
|
|
2135
|
-
- `sec` **[number][
|
|
2139
|
+
- `fn` **([string][17] | [function][22])** to be executed in browser context.
|
|
2140
|
+
- `argsOrSec` **([Array][25]<any> | [number][20])?** (optional, `1` by default) arguments for function or seconds.
|
|
2141
|
+
- `sec` **[number][20]?** (optional, `1` by default) time in seconds to wait
|
|
2136
2142
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2137
2143
|
|
|
2138
2144
|
### waitForInvisible
|
|
@@ -2146,8 +2152,8 @@ I.waitForInvisible('#popup');
|
|
|
2146
2152
|
|
|
2147
2153
|
#### Parameters
|
|
2148
2154
|
|
|
2149
|
-
- `locator` **([string][
|
|
2150
|
-
- `sec` **[number][
|
|
2155
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2156
|
+
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2151
2157
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2152
2158
|
|
|
2153
2159
|
### waitForText
|
|
@@ -2163,9 +2169,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2163
2169
|
|
|
2164
2170
|
#### Parameters
|
|
2165
2171
|
|
|
2166
|
-
- `text` **[string][
|
|
2167
|
-
- `sec` **[number][
|
|
2168
|
-
- `context` **([string][
|
|
2172
|
+
- `text` **[string][17]** to wait for.
|
|
2173
|
+
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2174
|
+
- `context` **([string][17] | [object][16])?** (optional) element located by CSS|XPath|strict locator.
|
|
2169
2175
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2170
2176
|
|
|
2171
2177
|
### waitForValue
|
|
@@ -2178,9 +2184,9 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2178
2184
|
|
|
2179
2185
|
#### Parameters
|
|
2180
2186
|
|
|
2181
|
-
- `field` **([string][
|
|
2182
|
-
- `value` **[string][
|
|
2183
|
-
- `sec` **[number][
|
|
2187
|
+
- `field` **([string][17] | [object][16])** input field.
|
|
2188
|
+
- `value` **[string][17]** expected value.
|
|
2189
|
+
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2184
2190
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2185
2191
|
|
|
2186
2192
|
### waitForVisible
|
|
@@ -2194,8 +2200,8 @@ I.waitForVisible('#popup');
|
|
|
2194
2200
|
|
|
2195
2201
|
#### Parameters
|
|
2196
2202
|
|
|
2197
|
-
- `locator` **([string][
|
|
2198
|
-
- `sec` **[number][
|
|
2203
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2204
|
+
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2199
2205
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2200
2206
|
|
|
2201
2207
|
### waitInUrl
|
|
@@ -2208,8 +2214,8 @@ I.waitInUrl('/info', 2);
|
|
|
2208
2214
|
|
|
2209
2215
|
#### Parameters
|
|
2210
2216
|
|
|
2211
|
-
- `urlPart` **[string][
|
|
2212
|
-
- `sec` **[number][
|
|
2217
|
+
- `urlPart` **[string][17]** value to check.
|
|
2218
|
+
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2213
2219
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2214
2220
|
|
|
2215
2221
|
### waitNumberOfVisibleElements
|
|
@@ -2222,9 +2228,9 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2222
2228
|
|
|
2223
2229
|
#### Parameters
|
|
2224
2230
|
|
|
2225
|
-
- `locator` **([string][
|
|
2226
|
-
- `num` **[number][
|
|
2227
|
-
- `sec` **[number][
|
|
2231
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2232
|
+
- `num` **[number][20]** number of elements.
|
|
2233
|
+
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2228
2234
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2229
2235
|
|
|
2230
2236
|
### waitToHide
|
|
@@ -2238,8 +2244,8 @@ I.waitToHide('#popup');
|
|
|
2238
2244
|
|
|
2239
2245
|
#### Parameters
|
|
2240
2246
|
|
|
2241
|
-
- `locator` **([string][
|
|
2242
|
-
- `sec` **[number][
|
|
2247
|
+
- `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
|
|
2248
|
+
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2243
2249
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2244
2250
|
|
|
2245
2251
|
### waitUrlEquals
|
|
@@ -2253,74 +2259,74 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2253
2259
|
|
|
2254
2260
|
#### Parameters
|
|
2255
2261
|
|
|
2256
|
-
- `urlPart` **[string][
|
|
2257
|
-
- `sec` **[number][
|
|
2262
|
+
- `urlPart` **[string][17]** value to check.
|
|
2263
|
+
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2258
2264
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2259
2265
|
|
|
2260
|
-
|
|
2266
|
+
: http://webdriver.io/
|
|
2261
2267
|
|
|
2262
2268
|
[2]: https://codecept.io/webdriver/#testing-with-webdriver
|
|
2263
2269
|
|
|
2264
|
-
[3]: http://
|
|
2270
|
+
[3]: http://webdriver.io/guide/getstarted/configuration.html
|
|
2265
2271
|
|
|
2266
|
-
[4]: https://github.
|
|
2272
|
+
[4]: https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/IE/Options.html
|
|
2267
2273
|
|
|
2268
|
-
[5]:
|
|
2274
|
+
[5]: https://aerokube.com/selenoid/latest/
|
|
2269
2275
|
|
|
2270
|
-
[6]:
|
|
2276
|
+
[6]: https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities
|
|
2271
2277
|
|
|
2272
|
-
[7]:
|
|
2278
|
+
[7]: http://webdriver.io/guide/usage/cloudservices.html
|
|
2273
2279
|
|
|
2274
|
-
[8]: https://
|
|
2280
|
+
[8]: https://webdriver.io/docs/sauce-service.html
|
|
2275
2281
|
|
|
2276
|
-
[9]:
|
|
2282
|
+
[9]: https://github.com/puneet0191/codeceptjs-saucehelper/
|
|
2277
2283
|
|
|
2278
|
-
[10]: https://webdriver.io/docs/
|
|
2284
|
+
[10]: https://webdriver.io/docs/browserstack-service.html
|
|
2279
2285
|
|
|
2280
|
-
[11]: https://github.com/
|
|
2286
|
+
[11]: https://github.com/PeterNgTr/codeceptjs-bshelper
|
|
2281
2287
|
|
|
2282
|
-
[12]: https://
|
|
2288
|
+
[12]: https://github.com/testingbot/codeceptjs-tbhelper
|
|
2283
2289
|
|
|
2284
|
-
[13]: https://
|
|
2290
|
+
[13]: https://webdriver.io/docs/testingbot-service.html
|
|
2285
2291
|
|
|
2286
|
-
[14]: https://github.com/
|
|
2292
|
+
[14]: https://github.com/PeterNgTr/codeceptjs-applitoolshelper
|
|
2287
2293
|
|
|
2288
|
-
[15]:
|
|
2294
|
+
[15]: http://webdriver.io/guide/usage/multiremote.html
|
|
2289
2295
|
|
|
2290
|
-
[16]: https://
|
|
2296
|
+
[16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
2291
2297
|
|
|
2292
|
-
[17]:
|
|
2298
|
+
[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
2293
2299
|
|
|
2294
|
-
[18]:
|
|
2300
|
+
[18]: http://jster.net/category/windows-modals-popups
|
|
2295
2301
|
|
|
2296
|
-
[19]: https://
|
|
2302
|
+
[19]: https://webdriver.io/docs/timeouts.html
|
|
2297
2303
|
|
|
2298
|
-
[20]:
|
|
2304
|
+
[20]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
2299
2305
|
|
|
2300
|
-
[21]: https://
|
|
2306
|
+
[21]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
2301
2307
|
|
|
2302
|
-
[22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
2308
|
+
[22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2303
2309
|
|
|
2304
|
-
[23]:
|
|
2310
|
+
[23]: http://webdriver.io/api/protocol/execute.html
|
|
2305
2311
|
|
|
2306
|
-
[24]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
2312
|
+
[24]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2307
2313
|
|
|
2308
|
-
[25]:
|
|
2314
|
+
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
2309
2315
|
|
|
2310
|
-
[26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
2316
|
+
[26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined
|
|
2311
2317
|
|
|
2312
|
-
[27]:
|
|
2318
|
+
[27]: #fillfield
|
|
2313
2319
|
|
|
2314
|
-
[28]:
|
|
2320
|
+
[28]: #click
|
|
2315
2321
|
|
|
2316
|
-
[29]:
|
|
2322
|
+
[29]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
2317
2323
|
|
|
2318
|
-
[30]:
|
|
2324
|
+
[30]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
|
|
2319
2325
|
|
|
2320
|
-
[31]: https://
|
|
2326
|
+
[31]: https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object
|
|
2321
2327
|
|
|
2322
|
-
[32]: https://
|
|
2328
|
+
[32]: https://webdriver.io/docs/api.html
|
|
2323
2329
|
|
|
2324
|
-
[33]:
|
|
2330
|
+
[33]: http://codecept.io/acceptance/#smartwait
|
|
2325
2331
|
|
|
2326
|
-
[34]:
|
|
2332
|
+
[34]: http://webdriver.io/docs/timeouts.html
|