codeceptjs 3.3.4 → 3.3.5-beta.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/docs/bdd.md +12 -0
- package/docs/build/Playwright.js +42 -36
- package/docs/build/Puppeteer.js +54 -43
- package/docs/build/REST.js +18 -8
- package/docs/build/WebDriver.js +34 -25
- package/docs/changelog.md +0 -38
- package/docs/community-helpers.md +1 -0
- package/docs/configuration.md +21 -18
- package/docs/helpers/Appium.md +0 -723
- package/docs/helpers/Playwright.md +269 -263
- package/docs/helpers/Puppeteer.md +230 -222
- package/docs/helpers/REST.md +20 -7
- package/docs/helpers/WebDriver.md +265 -259
- package/docs/reports.md +11 -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 +83 -24
- package/lib/helper/Playwright.js +42 -36
- package/lib/helper/Puppeteer.js +54 -43
- package/lib/helper/REST.js +18 -8
- package/lib/helper/WebDriver.js +34 -25
- package/lib/interfaces/gherkin.js +1 -1
- package/lib/secret.js +1 -1
- package/lib/step.js +21 -9
- package/lib/utils.js +1 -6
- package/package.json +3 -3
- package/typings/index.d.ts +158 -0
- package/typings/types.d.ts +340 -94
|
@@ -29,48 +29,56 @@ or
|
|
|
29
29
|
|
|
30
30
|
Using playwright-core package, will prevent the download of browser binaries and allow connecting to an existing browser installation or for connecting to a remote one.
|
|
31
31
|
|
|
32
|
+
|
|
33
|
+
|
|
32
34
|
## Configuration
|
|
33
35
|
|
|
34
|
-
This helper should be configured in codecept.
|
|
36
|
+
This helper should be configured in codecept.conf.js
|
|
37
|
+
|
|
38
|
+
Type: [object][5]
|
|
39
|
+
|
|
40
|
+
### Properties
|
|
35
41
|
|
|
36
|
-
- `url
|
|
37
|
-
- `browser
|
|
38
|
-
- `show
|
|
39
|
-
- `restart
|
|
40
|
-
- 'context' or **false** - restarts [browser context][2] but keeps running browser. Recommended by Playwright team to keep tests isolated.
|
|
42
|
+
- `url` **[string][7]** base url of website to be tested
|
|
43
|
+
- `browser` **[string][7]** a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
|
|
44
|
+
- `show` **[boolean][25]?** show browser window.
|
|
45
|
+
- `restart` **([string][7] | [boolean][25])?** restart strategy between tests. Possible values:- 'context' or **false** - restarts [browser context][32] but keeps running browser. Recommended by Playwright team to keep tests isolated.
|
|
41
46
|
- 'browser' or **true** - closes browser and opens it again between tests.
|
|
42
47
|
- 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with `keepCookies` and `keepBrowserState` options. This behavior was default before CodeceptJS 3.1
|
|
43
|
-
- `timeout
|
|
44
|
-
- `disableScreenshots
|
|
45
|
-
- `emulate
|
|
46
|
-
- `video
|
|
47
|
-
- `trace
|
|
48
|
-
- `fullPageScreenshots`
|
|
49
|
-
- `uniqueScreenshotNames
|
|
50
|
-
- `keepBrowserState
|
|
51
|
-
- `keepCookies
|
|
52
|
-
- `waitForAction
|
|
53
|
-
- `waitForNavigation
|
|
54
|
-
- `pressKeyDelay
|
|
55
|
-
- `getPageTimeout`
|
|
56
|
-
- `waitForTimeout
|
|
57
|
-
- `basicAuth
|
|
58
|
-
- `windowSize
|
|
59
|
-
- `colorScheme
|
|
60
|
-
- `userAgent
|
|
61
|
-
- `locale
|
|
62
|
-
- `manualStart
|
|
63
|
-
- `chromium
|
|
64
|
-
- `electron
|
|
65
|
-
- `channel
|
|
48
|
+
- `timeout` **[number][11]?** - [timeout][33] in ms of all Playwright actions .
|
|
49
|
+
- `disableScreenshots` **[boolean][25]?** don't save screenshot on failure.
|
|
50
|
+
- `emulate` **any?** browser in device emulation mode.
|
|
51
|
+
- `video` **[boolean][25]?** enables video recording for failed tests; videos are saved into `output/videos` folder
|
|
52
|
+
- `trace` **[boolean][25]?** record [tracing information][34] with screenshots and snapshots.
|
|
53
|
+
- `fullPageScreenshots` **[boolean][25]?** make full page screenshots on failure.
|
|
54
|
+
- `uniqueScreenshotNames` **[boolean][25]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
55
|
+
- `keepBrowserState` **[boolean][25]?** keep browser state between tests when `restart` is set to 'session'.
|
|
56
|
+
- `keepCookies` **[boolean][25]?** keep cookies between tests when `restart` is set to 'session'.
|
|
57
|
+
- `waitForAction` **[number][11]?** how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
58
|
+
- `waitForNavigation` **[number][11]?** When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API][35].
|
|
59
|
+
- `pressKeyDelay` **[number][11]?** Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
|
|
60
|
+
- `getPageTimeout` **[number][11]?** config option to set maximum navigation time in milliseconds.
|
|
61
|
+
- `waitForTimeout` **[number][11]?** default wait* timeout in ms. Default: 1000.
|
|
62
|
+
- `basicAuth` **[object][5]?** the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
63
|
+
- `windowSize` **[string][7]?** default window size. Set a dimension like `640x480`.
|
|
64
|
+
- `colorScheme` **[string][7]?** default color scheme. Possible values: `dark` | `light` | `no-preference`.
|
|
65
|
+
- `userAgent` **[string][7]?** user-agent string.
|
|
66
|
+
- `locale` **[string][7]?** locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
|
|
67
|
+
- `manualStart` **[boolean][25]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
|
|
68
|
+
- `chromium` **[object][5]?** pass additional chromium options
|
|
69
|
+
- `electron` **[object][5]?** (pass additional electron options
|
|
70
|
+
- `channel` **any?** (While Playwright can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will support Stable and Beta channels of these browsers. See [Google Chrome & Microsoft Edge][36].
|
|
71
|
+
|
|
72
|
+
|
|
66
73
|
|
|
67
74
|
#### Video Recording Customization
|
|
68
75
|
|
|
69
76
|
By default, video is saved to `output/video` dir. You can customize this path by passing `dir` option to `recordVideo` option.
|
|
70
77
|
|
|
71
|
-
|
|
78
|
+
`video`: enables video recording for failed tests; videos are saved into `output/videos` folder
|
|
79
|
+
|
|
72
80
|
- `keepVideoForPassedTests`: - save videos for passed tests
|
|
73
|
-
- `recordVideo`: [additional options for videos customization][
|
|
81
|
+
- `recordVideo`: [additional options for videos customization][2]
|
|
74
82
|
|
|
75
83
|
#### Trace Recording Customization
|
|
76
84
|
|
|
@@ -123,7 +131,7 @@ Traces will be saved to `output/trace`
|
|
|
123
131
|
}
|
|
124
132
|
```
|
|
125
133
|
|
|
126
|
-
#### Example #4: Connect to remote browser by specifying [websocket endpoint][
|
|
134
|
+
#### Example #4: Connect to remote browser by specifying [websocket endpoint][3]
|
|
127
135
|
|
|
128
136
|
```js
|
|
129
137
|
{
|
|
@@ -141,7 +149,7 @@ Traces will be saved to `output/trace`
|
|
|
141
149
|
|
|
142
150
|
#### Example #5: Testing with Chromium extensions
|
|
143
151
|
|
|
144
|
-
[official docs][
|
|
152
|
+
[official docs][4]
|
|
145
153
|
|
|
146
154
|
```js
|
|
147
155
|
{
|
|
@@ -220,8 +228,6 @@ const { browserContext } = this.helpers.Playwright;
|
|
|
220
228
|
await browserContext.cookies(); // get current browser context
|
|
221
229
|
```
|
|
222
230
|
|
|
223
|
-
## Methods
|
|
224
|
-
|
|
225
231
|
### Parameters
|
|
226
232
|
|
|
227
233
|
- `config`
|
|
@@ -303,13 +309,13 @@ Set current page
|
|
|
303
309
|
|
|
304
310
|
#### Parameters
|
|
305
311
|
|
|
306
|
-
- `page` **[object][
|
|
312
|
+
- `page` **[object][5]** page to set
|
|
307
313
|
|
|
308
314
|
### acceptPopup
|
|
309
315
|
|
|
310
316
|
Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
|
|
311
317
|
Don't confuse popups with modal windows, as created by [various
|
|
312
|
-
libraries][
|
|
318
|
+
libraries][6].
|
|
313
319
|
|
|
314
320
|
### amAcceptingPopups
|
|
315
321
|
|
|
@@ -346,7 +352,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
346
352
|
|
|
347
353
|
#### Parameters
|
|
348
354
|
|
|
349
|
-
- `url` **[string][
|
|
355
|
+
- `url` **[string][7]** url path or global url.
|
|
350
356
|
|
|
351
357
|
Returns **void** automatically synchronized promise with recorder #!
|
|
352
358
|
|
|
@@ -361,8 +367,8 @@ I.appendField('#myTextField', 'appended');
|
|
|
361
367
|
|
|
362
368
|
#### Parameters
|
|
363
369
|
|
|
364
|
-
- `field` **([string][
|
|
365
|
-
- `value` **[string][
|
|
370
|
+
- `field` **([string][7] | [object][5])** located by label|name|CSS|XPath|strict locator
|
|
371
|
+
- `value` **[string][7]** text value to append.
|
|
366
372
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
367
373
|
|
|
368
374
|
### attachFile
|
|
@@ -378,8 +384,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
378
384
|
|
|
379
385
|
#### Parameters
|
|
380
386
|
|
|
381
|
-
- `locator` **([string][
|
|
382
|
-
- `pathToFile` **[string][
|
|
387
|
+
- `locator` **([string][7] | [object][5])** field located by label|name|CSS|XPath|strict locator.
|
|
388
|
+
- `pathToFile` **[string][7]** local file path relative to codecept.json config file.
|
|
383
389
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
384
390
|
|
|
385
391
|
### cancelPopup
|
|
@@ -401,9 +407,9 @@ I.checkOption('agree', '//form');
|
|
|
401
407
|
|
|
402
408
|
#### Parameters
|
|
403
409
|
|
|
404
|
-
- `field` **([string][
|
|
405
|
-
- `context` **([string][
|
|
406
|
-
[!] returns a _promise_ which is synchronized internally by recorder[Additional options][
|
|
410
|
+
- `field` **([string][7] | [object][5])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
411
|
+
- `context` **([string][7]? | [object][5])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
412
|
+
[!] returns a _promise_ which is synchronized internally by recorder[Additional options][8] for check available as 3rd argument.Examples:```js
|
|
407
413
|
// click on element at position
|
|
408
414
|
I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
409
415
|
```> ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
@@ -421,7 +427,7 @@ I.clearCookie('test');
|
|
|
421
427
|
|
|
422
428
|
#### Parameters
|
|
423
429
|
|
|
424
|
-
- `cookie` **[string][
|
|
430
|
+
- `cookie` **[string][7]?** (optional, `null` by default) cookie name
|
|
425
431
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
426
432
|
|
|
427
433
|
### clearField
|
|
@@ -437,7 +443,7 @@ I.clearField('#email');
|
|
|
437
443
|
#### Parameters
|
|
438
444
|
|
|
439
445
|
- `field`
|
|
440
|
-
- `editable` **([string][
|
|
446
|
+
- `editable` **([string][7] | [object][5])** field located by label|name|CSS|XPath|strict locator.
|
|
441
447
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
442
448
|
|
|
443
449
|
### click
|
|
@@ -466,10 +472,10 @@ I.click({css: 'nav a.login'});
|
|
|
466
472
|
|
|
467
473
|
#### Parameters
|
|
468
474
|
|
|
469
|
-
- `locator` **([string][
|
|
470
|
-
- `context` **([string][
|
|
475
|
+
- `locator` **([string][7] | [object][5])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
476
|
+
- `context` **([string][7]? | [object][5] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
471
477
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
472
|
-
- `opts` **any?** [Additional options][
|
|
478
|
+
- `opts` **any?** [Additional options][9] for click available as 3rd argument.Examples:```js
|
|
473
479
|
// click on element at position
|
|
474
480
|
I.click('canvas', '.model', { position: { x: 20, y: 40 } })
|
|
475
481
|
|
|
@@ -514,8 +520,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
514
520
|
|
|
515
521
|
#### Parameters
|
|
516
522
|
|
|
517
|
-
- `text` **[string][
|
|
518
|
-
- `context` **([string][
|
|
523
|
+
- `text` **[string][7]** which is not present.
|
|
524
|
+
- `context` **([string][7] | [object][5])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
519
525
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
520
526
|
|
|
521
527
|
### dontSeeCheckboxIsChecked
|
|
@@ -530,7 +536,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
530
536
|
|
|
531
537
|
#### Parameters
|
|
532
538
|
|
|
533
|
-
- `field` **([string][
|
|
539
|
+
- `field` **([string][7] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
534
540
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
535
541
|
|
|
536
542
|
### dontSeeCookie
|
|
@@ -543,7 +549,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
543
549
|
|
|
544
550
|
#### Parameters
|
|
545
551
|
|
|
546
|
-
- `name` **[string][
|
|
552
|
+
- `name` **[string][7]** cookie name.
|
|
547
553
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
548
554
|
|
|
549
555
|
### dontSeeCurrentUrlEquals
|
|
@@ -558,7 +564,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
558
564
|
|
|
559
565
|
#### Parameters
|
|
560
566
|
|
|
561
|
-
- `url` **[string][
|
|
567
|
+
- `url` **[string][7]** value to check.
|
|
562
568
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
563
569
|
|
|
564
570
|
### dontSeeElement
|
|
@@ -571,7 +577,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
571
577
|
|
|
572
578
|
#### Parameters
|
|
573
579
|
|
|
574
|
-
- `locator` **([string][
|
|
580
|
+
- `locator` **([string][7] | [object][5])** located by CSS|XPath|Strict locator.
|
|
575
581
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
576
582
|
|
|
577
583
|
### dontSeeElementInDOM
|
|
@@ -584,7 +590,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
584
590
|
|
|
585
591
|
#### Parameters
|
|
586
592
|
|
|
587
|
-
- `locator` **([string][
|
|
593
|
+
- `locator` **([string][7] | [object][5])** located by CSS|XPath|Strict locator.
|
|
588
594
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
589
595
|
|
|
590
596
|
### dontSeeInCurrentUrl
|
|
@@ -593,7 +599,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
593
599
|
|
|
594
600
|
#### Parameters
|
|
595
601
|
|
|
596
|
-
- `url` **[string][
|
|
602
|
+
- `url` **[string][7]** value to check.
|
|
597
603
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
598
604
|
|
|
599
605
|
### dontSeeInField
|
|
@@ -608,8 +614,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
608
614
|
|
|
609
615
|
#### Parameters
|
|
610
616
|
|
|
611
|
-
- `field` **([string][
|
|
612
|
-
- `value` **[string][
|
|
617
|
+
- `field` **([string][7] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
618
|
+
- `value` **[string][7]** value to check.
|
|
613
619
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
614
620
|
|
|
615
621
|
### dontSeeInSource
|
|
@@ -623,7 +629,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
623
629
|
#### Parameters
|
|
624
630
|
|
|
625
631
|
- `text`
|
|
626
|
-
- `value` **[string][
|
|
632
|
+
- `value` **[string][7]** to check.
|
|
627
633
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
628
634
|
|
|
629
635
|
### dontSeeInTitle
|
|
@@ -636,7 +642,7 @@ I.dontSeeInTitle('Error');
|
|
|
636
642
|
|
|
637
643
|
#### Parameters
|
|
638
644
|
|
|
639
|
-
- `text` **[string][
|
|
645
|
+
- `text` **[string][7]** value to check.
|
|
640
646
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
641
647
|
|
|
642
648
|
### doubleClick
|
|
@@ -653,8 +659,8 @@ I.doubleClick('.btn.edit');
|
|
|
653
659
|
|
|
654
660
|
#### Parameters
|
|
655
661
|
|
|
656
|
-
- `locator` **([string][
|
|
657
|
-
- `context` **([string][
|
|
662
|
+
- `locator` **([string][7] | [object][5])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
663
|
+
- `context` **([string][7]? | [object][5])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
658
664
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
659
665
|
|
|
660
666
|
### dragAndDrop
|
|
@@ -667,10 +673,10 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
667
673
|
|
|
668
674
|
#### Parameters
|
|
669
675
|
|
|
670
|
-
- `srcElement` **([string][
|
|
671
|
-
- `destElement` **([string][
|
|
676
|
+
- `srcElement` **([string][7] | [object][5])** located by CSS|XPath|strict locator.
|
|
677
|
+
- `destElement` **([string][7] | [object][5])** located by CSS|XPath|strict locator.
|
|
672
678
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
673
|
-
- `options` **any?** [Additional options][
|
|
679
|
+
- `options` **any?** [Additional options][10] can be passed as 3rd argument.```js
|
|
674
680
|
// specify coordinates for source position
|
|
675
681
|
I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
|
|
676
682
|
```> By default option `force: true` is set
|
|
@@ -687,8 +693,8 @@ I.dragSlider('#slider', -70);
|
|
|
687
693
|
|
|
688
694
|
#### Parameters
|
|
689
695
|
|
|
690
|
-
- `locator` **([string][
|
|
691
|
-
- `offsetX` **[number][
|
|
696
|
+
- `locator` **([string][7] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
697
|
+
- `offsetX` **[number][11]** position to drag.
|
|
692
698
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
693
699
|
|
|
694
700
|
### executeScript
|
|
@@ -716,7 +722,7 @@ If a function returns a Promise it will wait for its resolution.
|
|
|
716
722
|
|
|
717
723
|
#### Parameters
|
|
718
724
|
|
|
719
|
-
- `fn` **([string][
|
|
725
|
+
- `fn` **([string][7] | [function][12])** function to be executed in browser context.
|
|
720
726
|
- `arg` **any?** optional argument to pass to the function
|
|
721
727
|
|
|
722
728
|
### fillField
|
|
@@ -737,8 +743,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
737
743
|
|
|
738
744
|
#### Parameters
|
|
739
745
|
|
|
740
|
-
- `field` **([string][
|
|
741
|
-
- `value` **([string][
|
|
746
|
+
- `field` **([string][7] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
747
|
+
- `value` **([string][7] | [object][5])** text value to fill.
|
|
742
748
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
743
749
|
|
|
744
750
|
### forceClick
|
|
@@ -770,8 +776,8 @@ I.forceClick({css: 'nav a.login'});
|
|
|
770
776
|
|
|
771
777
|
#### Parameters
|
|
772
778
|
|
|
773
|
-
- `locator` **([string][
|
|
774
|
-
- `context` **([string][
|
|
779
|
+
- `locator` **([string][7] | [object][5])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
780
|
+
- `context` **([string][7]? | [object][5])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
775
781
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
776
782
|
|
|
777
783
|
### grabAttributeFrom
|
|
@@ -786,10 +792,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
786
792
|
|
|
787
793
|
#### Parameters
|
|
788
794
|
|
|
789
|
-
- `locator` **([string][
|
|
790
|
-
- `attr` **[string][
|
|
795
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
796
|
+
- `attr` **[string][7]** attribute name.
|
|
791
797
|
|
|
792
|
-
Returns **[Promise][
|
|
798
|
+
Returns **[Promise][13]<[string][7]>** attribute value
|
|
793
799
|
|
|
794
800
|
### grabAttributeFromAll
|
|
795
801
|
|
|
@@ -802,10 +808,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
802
808
|
|
|
803
809
|
#### Parameters
|
|
804
810
|
|
|
805
|
-
- `locator` **([string][
|
|
806
|
-
- `attr` **[string][
|
|
811
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
812
|
+
- `attr` **[string][7]** attribute name.
|
|
807
813
|
|
|
808
|
-
Returns **[Promise][
|
|
814
|
+
Returns **[Promise][13]<[Array][14]<[string][7]>>** attribute value
|
|
809
815
|
|
|
810
816
|
### grabBrowserLogs
|
|
811
817
|
|
|
@@ -817,9 +823,9 @@ const errors = logs.map(l => ({ type: l.type(), text: l.text() })).filter(l => l
|
|
|
817
823
|
console.log(JSON.stringify(errors));
|
|
818
824
|
```
|
|
819
825
|
|
|
820
|
-
[Learn more about console messages][
|
|
826
|
+
[Learn more about console messages][15]
|
|
821
827
|
|
|
822
|
-
Returns **[Promise][
|
|
828
|
+
Returns **[Promise][13]<[Array][14]<any>>**
|
|
823
829
|
|
|
824
830
|
### grabCookie
|
|
825
831
|
|
|
@@ -834,9 +840,9 @@ assert(cookie.value, '123456');
|
|
|
834
840
|
|
|
835
841
|
#### Parameters
|
|
836
842
|
|
|
837
|
-
- `name` **[string][
|
|
843
|
+
- `name` **[string][7]?** cookie name.
|
|
838
844
|
|
|
839
|
-
Returns **([Promise][
|
|
845
|
+
Returns **([Promise][13]<[string][7]> | [Promise][13]<[Array][14]<[string][7]>>)** attribute valueReturns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
840
846
|
|
|
841
847
|
### grabCssPropertyFrom
|
|
842
848
|
|
|
@@ -850,10 +856,10 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
850
856
|
|
|
851
857
|
#### Parameters
|
|
852
858
|
|
|
853
|
-
- `locator` **([string][
|
|
854
|
-
- `cssProperty` **[string][
|
|
859
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
860
|
+
- `cssProperty` **[string][7]** CSS property name.
|
|
855
861
|
|
|
856
|
-
Returns **[Promise][
|
|
862
|
+
Returns **[Promise][13]<[string][7]>** CSS value
|
|
857
863
|
|
|
858
864
|
### grabCssPropertyFromAll
|
|
859
865
|
|
|
@@ -866,10 +872,10 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
866
872
|
|
|
867
873
|
#### Parameters
|
|
868
874
|
|
|
869
|
-
- `locator` **([string][
|
|
870
|
-
- `cssProperty` **[string][
|
|
875
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
876
|
+
- `cssProperty` **[string][7]** CSS property name.
|
|
871
877
|
|
|
872
|
-
Returns **[Promise][
|
|
878
|
+
Returns **[Promise][13]<[Array][14]<[string][7]>>** CSS value
|
|
873
879
|
|
|
874
880
|
### grabCurrentUrl
|
|
875
881
|
|
|
@@ -881,7 +887,7 @@ let url = await I.grabCurrentUrl();
|
|
|
881
887
|
console.log(`Current URL is [${url}]`);
|
|
882
888
|
```
|
|
883
889
|
|
|
884
|
-
Returns **[Promise][
|
|
890
|
+
Returns **[Promise][13]<[string][7]>** current URL
|
|
885
891
|
|
|
886
892
|
### grabDataFromPerformanceTiming
|
|
887
893
|
|
|
@@ -906,7 +912,7 @@ let data = await I.grabDataFromPerformanceTiming();
|
|
|
906
912
|
}
|
|
907
913
|
```
|
|
908
914
|
|
|
909
|
-
Returns **[Promise][
|
|
915
|
+
Returns **[Promise][13]<any>** automatically synchronized promise through #recorder
|
|
910
916
|
|
|
911
917
|
### grabElementBoundingRect
|
|
912
918
|
|
|
@@ -930,11 +936,11 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
930
936
|
|
|
931
937
|
#### Parameters
|
|
932
938
|
|
|
933
|
-
- `locator` **([string][
|
|
939
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
934
940
|
- `prop`
|
|
935
|
-
- `elementSize` **[string][
|
|
941
|
+
- `elementSize` **[string][7]?** x, y, width or height of the given element.
|
|
936
942
|
|
|
937
|
-
Returns **([Promise][
|
|
943
|
+
Returns **([Promise][13]<DOMRect> | [Promise][13]<[number][11]>)** Element bounding rectangle
|
|
938
944
|
|
|
939
945
|
### grabHTMLFrom
|
|
940
946
|
|
|
@@ -949,9 +955,9 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
949
955
|
#### Parameters
|
|
950
956
|
|
|
951
957
|
- `locator`
|
|
952
|
-
- `element` **([string][
|
|
958
|
+
- `element` **([string][7] | [object][5])** located by CSS|XPath|strict locator.
|
|
953
959
|
|
|
954
|
-
Returns **[Promise][
|
|
960
|
+
Returns **[Promise][13]<[string][7]>** HTML code for an element
|
|
955
961
|
|
|
956
962
|
### grabHTMLFromAll
|
|
957
963
|
|
|
@@ -965,9 +971,9 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
965
971
|
#### Parameters
|
|
966
972
|
|
|
967
973
|
- `locator`
|
|
968
|
-
- `element` **([string][
|
|
974
|
+
- `element` **([string][7] | [object][5])** located by CSS|XPath|strict locator.
|
|
969
975
|
|
|
970
|
-
Returns **[Promise][
|
|
976
|
+
Returns **[Promise][13]<[Array][14]<[string][7]>>** HTML code for an element
|
|
971
977
|
|
|
972
978
|
### grabNumberOfOpenTabs
|
|
973
979
|
|
|
@@ -978,7 +984,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
978
984
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
979
985
|
```
|
|
980
986
|
|
|
981
|
-
Returns **[Promise][
|
|
987
|
+
Returns **[Promise][13]<[number][11]>** number of open tabs
|
|
982
988
|
|
|
983
989
|
### grabNumberOfVisibleElements
|
|
984
990
|
|
|
@@ -991,9 +997,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
991
997
|
|
|
992
998
|
#### Parameters
|
|
993
999
|
|
|
994
|
-
- `locator` **([string][
|
|
1000
|
+
- `locator` **([string][7] | [object][5])** located by CSS|XPath|strict locator.
|
|
995
1001
|
|
|
996
|
-
Returns **[Promise][
|
|
1002
|
+
Returns **[Promise][13]<[number][11]>** number of visible elements
|
|
997
1003
|
|
|
998
1004
|
### grabPageScrollPosition
|
|
999
1005
|
|
|
@@ -1004,7 +1010,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1004
1010
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1005
1011
|
```
|
|
1006
1012
|
|
|
1007
|
-
Returns **[Promise][
|
|
1013
|
+
Returns **[Promise][13]<PageScrollPosition>** scroll position
|
|
1008
1014
|
|
|
1009
1015
|
### grabPopupText
|
|
1010
1016
|
|
|
@@ -1014,7 +1020,7 @@ Grab the text within the popup. If no popup is visible then it will return null
|
|
|
1014
1020
|
await I.grabPopupText();
|
|
1015
1021
|
```
|
|
1016
1022
|
|
|
1017
|
-
Returns **[Promise][
|
|
1023
|
+
Returns **[Promise][13]<([string][7] | null)>**
|
|
1018
1024
|
|
|
1019
1025
|
### grabSource
|
|
1020
1026
|
|
|
@@ -1025,7 +1031,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1025
1031
|
let pageSource = await I.grabSource();
|
|
1026
1032
|
```
|
|
1027
1033
|
|
|
1028
|
-
Returns **[Promise][
|
|
1034
|
+
Returns **[Promise][13]<[string][7]>** source code
|
|
1029
1035
|
|
|
1030
1036
|
### grabTextFrom
|
|
1031
1037
|
|
|
@@ -1040,9 +1046,9 @@ If multiple elements found returns first element.
|
|
|
1040
1046
|
|
|
1041
1047
|
#### Parameters
|
|
1042
1048
|
|
|
1043
|
-
- `locator` **([string][
|
|
1049
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1044
1050
|
|
|
1045
|
-
Returns **[Promise][
|
|
1051
|
+
Returns **[Promise][13]<[string][7]>** attribute value
|
|
1046
1052
|
|
|
1047
1053
|
### grabTextFromAll
|
|
1048
1054
|
|
|
@@ -1055,9 +1061,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1055
1061
|
|
|
1056
1062
|
#### Parameters
|
|
1057
1063
|
|
|
1058
|
-
- `locator` **([string][
|
|
1064
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1059
1065
|
|
|
1060
|
-
Returns **[Promise][
|
|
1066
|
+
Returns **[Promise][13]<[Array][14]<[string][7]>>** attribute value
|
|
1061
1067
|
|
|
1062
1068
|
### grabTitle
|
|
1063
1069
|
|
|
@@ -1068,7 +1074,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1068
1074
|
let title = await I.grabTitle();
|
|
1069
1075
|
```
|
|
1070
1076
|
|
|
1071
|
-
Returns **[Promise][
|
|
1077
|
+
Returns **[Promise][13]<[string][7]>** title
|
|
1072
1078
|
|
|
1073
1079
|
### grabValueFrom
|
|
1074
1080
|
|
|
@@ -1082,9 +1088,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1082
1088
|
|
|
1083
1089
|
#### Parameters
|
|
1084
1090
|
|
|
1085
|
-
- `locator` **([string][
|
|
1091
|
+
- `locator` **([string][7] | [object][5])** field located by label|name|CSS|XPath|strict locator.
|
|
1086
1092
|
|
|
1087
|
-
Returns **[Promise][
|
|
1093
|
+
Returns **[Promise][13]<[string][7]>** attribute value
|
|
1088
1094
|
|
|
1089
1095
|
### grabValueFromAll
|
|
1090
1096
|
|
|
@@ -1097,16 +1103,16 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1097
1103
|
|
|
1098
1104
|
#### Parameters
|
|
1099
1105
|
|
|
1100
|
-
- `locator` **([string][
|
|
1106
|
+
- `locator` **([string][7] | [object][5])** field located by label|name|CSS|XPath|strict locator.
|
|
1101
1107
|
|
|
1102
|
-
Returns **[Promise][
|
|
1108
|
+
Returns **[Promise][13]<[Array][14]<[string][7]>>** attribute value
|
|
1103
1109
|
|
|
1104
1110
|
### handleDownloads
|
|
1105
1111
|
|
|
1106
1112
|
Handles a file download.Aa file name is required to save the file on disk.
|
|
1107
1113
|
Files are saved to "output" directory.
|
|
1108
1114
|
|
|
1109
|
-
Should be used with [FileSystem helper][
|
|
1115
|
+
Should be used with [FileSystem helper][16] to check that file were downloaded correctly.
|
|
1110
1116
|
|
|
1111
1117
|
```js
|
|
1112
1118
|
I.handleDownloads('downloads/avatar.jpg');
|
|
@@ -1117,9 +1123,9 @@ I.waitForFile('downloads/avatar.jpg', 5);
|
|
|
1117
1123
|
|
|
1118
1124
|
#### Parameters
|
|
1119
1125
|
|
|
1120
|
-
- `fileName` **[string][
|
|
1126
|
+
- `fileName` **[string][7]?** set filename for downloaded file
|
|
1121
1127
|
|
|
1122
|
-
Returns **[Promise][
|
|
1128
|
+
Returns **[Promise][13]<void>**
|
|
1123
1129
|
|
|
1124
1130
|
### haveRequestHeaders
|
|
1125
1131
|
|
|
@@ -1133,11 +1139,11 @@ I.haveRequestHeaders({
|
|
|
1133
1139
|
|
|
1134
1140
|
#### Parameters
|
|
1135
1141
|
|
|
1136
|
-
- `customHeaders` **[object][
|
|
1142
|
+
- `customHeaders` **[object][5]** headers to set
|
|
1137
1143
|
|
|
1138
1144
|
### makeApiRequest
|
|
1139
1145
|
|
|
1140
|
-
Performs [api request][
|
|
1146
|
+
Performs [api request][17] using
|
|
1141
1147
|
the cookies from the current browser session.
|
|
1142
1148
|
|
|
1143
1149
|
```js
|
|
@@ -1150,26 +1156,26 @@ I.makeApiRequest('PATCH', )
|
|
|
1150
1156
|
|
|
1151
1157
|
#### Parameters
|
|
1152
1158
|
|
|
1153
|
-
- `method` **[string][
|
|
1154
|
-
- `url` **[string][
|
|
1155
|
-
- `options` **[object][
|
|
1159
|
+
- `method` **[string][7]** HTTP method
|
|
1160
|
+
- `url` **[string][7]** endpoint
|
|
1161
|
+
- `options` **[object][5]** request options depending on method used
|
|
1156
1162
|
|
|
1157
|
-
Returns **[Promise][
|
|
1163
|
+
Returns **[Promise][13]<[object][5]>** response
|
|
1158
1164
|
|
|
1159
1165
|
### mockRoute
|
|
1160
1166
|
|
|
1161
|
-
Mocks network request using [`browserContext.route`][
|
|
1167
|
+
Mocks network request using [`browserContext.route`][18] of Playwright
|
|
1162
1168
|
|
|
1163
1169
|
```js
|
|
1164
1170
|
I.mockRoute(/(.png$)|(.jpg$)/, route => route.abort());
|
|
1165
1171
|
```
|
|
1166
1172
|
|
|
1167
|
-
This method allows intercepting and mocking requests & responses. [Learn more about it][
|
|
1173
|
+
This method allows intercepting and mocking requests & responses. [Learn more about it][19]
|
|
1168
1174
|
|
|
1169
1175
|
#### Parameters
|
|
1170
1176
|
|
|
1171
|
-
- `url` **([string][
|
|
1172
|
-
- `handler` **[function][
|
|
1177
|
+
- `url` **([string][7] | [RegExp][20])?** URL, regex or pattern for to match URL
|
|
1178
|
+
- `handler` **[function][12]?** a function to process reques
|
|
1173
1179
|
|
|
1174
1180
|
### moveCursorTo
|
|
1175
1181
|
|
|
@@ -1183,9 +1189,9 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1183
1189
|
|
|
1184
1190
|
#### Parameters
|
|
1185
1191
|
|
|
1186
|
-
- `locator` **([string][
|
|
1187
|
-
- `offsetX` **[number][
|
|
1188
|
-
- `offsetY` **[number][
|
|
1192
|
+
- `locator` **([string][7] | [object][5])** located by CSS|XPath|strict locator.
|
|
1193
|
+
- `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
1194
|
+
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
1189
1195
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1190
1196
|
|
|
1191
1197
|
### openNewTab
|
|
@@ -1196,7 +1202,7 @@ Open new tab and automatically switched to new tab
|
|
|
1196
1202
|
I.openNewTab();
|
|
1197
1203
|
```
|
|
1198
1204
|
|
|
1199
|
-
You can pass in [page options][
|
|
1205
|
+
You can pass in [page options][21] to emulate device on this page
|
|
1200
1206
|
|
|
1201
1207
|
```js
|
|
1202
1208
|
// enable mobile
|
|
@@ -1211,7 +1217,7 @@ I.openNewTab({ isMobile: true });
|
|
|
1211
1217
|
|
|
1212
1218
|
Presses a key in the browser (on a focused element).
|
|
1213
1219
|
|
|
1214
|
-
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][
|
|
1220
|
+
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][22].
|
|
1215
1221
|
|
|
1216
1222
|
```js
|
|
1217
1223
|
I.pressKey('Backspace');
|
|
@@ -1270,14 +1276,14 @@ Some of the supported key names are:
|
|
|
1270
1276
|
|
|
1271
1277
|
#### Parameters
|
|
1272
1278
|
|
|
1273
|
-
- `key` **([string][
|
|
1274
|
-
[!] returns a _promise_ which is synchronized internally by recorder_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313][
|
|
1279
|
+
- `key` **([string][7] | [Array][14]<[string][7]>)** key or array of keys to press.
|
|
1280
|
+
[!] returns a _promise_ which is synchronized internally by recorder_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313][23]).
|
|
1275
1281
|
|
|
1276
1282
|
### pressKeyDown
|
|
1277
1283
|
|
|
1278
1284
|
Presses a key in the browser and leaves it in a down state.
|
|
1279
1285
|
|
|
1280
|
-
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][
|
|
1286
|
+
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][24]).
|
|
1281
1287
|
|
|
1282
1288
|
```js
|
|
1283
1289
|
I.pressKeyDown('Control');
|
|
@@ -1287,14 +1293,14 @@ I.pressKeyUp('Control');
|
|
|
1287
1293
|
|
|
1288
1294
|
#### Parameters
|
|
1289
1295
|
|
|
1290
|
-
- `key` **[string][
|
|
1296
|
+
- `key` **[string][7]** name of key to press down.
|
|
1291
1297
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1292
1298
|
|
|
1293
1299
|
### pressKeyUp
|
|
1294
1300
|
|
|
1295
1301
|
Releases a key in the browser which was previously set to a down state.
|
|
1296
1302
|
|
|
1297
|
-
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][
|
|
1303
|
+
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][24]).
|
|
1298
1304
|
|
|
1299
1305
|
```js
|
|
1300
1306
|
I.pressKeyDown('Control');
|
|
@@ -1304,7 +1310,7 @@ I.pressKeyUp('Control');
|
|
|
1304
1310
|
|
|
1305
1311
|
#### Parameters
|
|
1306
1312
|
|
|
1307
|
-
- `key` **[string][
|
|
1313
|
+
- `key` **[string][7]** name of key to release.
|
|
1308
1314
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1309
1315
|
|
|
1310
1316
|
### refreshPage
|
|
@@ -1324,8 +1330,8 @@ First parameter can be set to `maximize`.
|
|
|
1324
1330
|
|
|
1325
1331
|
#### Parameters
|
|
1326
1332
|
|
|
1327
|
-
- `width` **[number][
|
|
1328
|
-
- `height` **[number][
|
|
1333
|
+
- `width` **[number][11]** width in pixels or `maximize`.
|
|
1334
|
+
- `height` **[number][11]** height in pixels.
|
|
1329
1335
|
[!] returns a _promise_ which is synchronized internally by recorderUnlike other drivers Playwright changes the size of a viewport, not the window!
|
|
1330
1336
|
Playwright does not control the window of a browser so it can't adjust its real size.
|
|
1331
1337
|
It also can't maximize a window.Update configuration to change real window size on start:```js
|
|
@@ -1349,8 +1355,8 @@ I.rightClick('Click me', '.context');
|
|
|
1349
1355
|
|
|
1350
1356
|
#### Parameters
|
|
1351
1357
|
|
|
1352
|
-
- `locator` **([string][
|
|
1353
|
-
- `context` **([string][
|
|
1358
|
+
- `locator` **([string][7] | [object][5])** clickable element located by CSS|XPath|strict locator.
|
|
1359
|
+
- `context` **([string][7]? | [object][5])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1354
1360
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1355
1361
|
|
|
1356
1362
|
### saveElementScreenshot
|
|
@@ -1364,8 +1370,8 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1364
1370
|
|
|
1365
1371
|
#### Parameters
|
|
1366
1372
|
|
|
1367
|
-
- `locator` **([string][
|
|
1368
|
-
- `fileName` **[string][
|
|
1373
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1374
|
+
- `fileName` **[string][7]** file name to save.
|
|
1369
1375
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1370
1376
|
|
|
1371
1377
|
### saveScreenshot
|
|
@@ -1381,8 +1387,8 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1381
1387
|
|
|
1382
1388
|
#### Parameters
|
|
1383
1389
|
|
|
1384
|
-
- `fileName` **[string][
|
|
1385
|
-
- `fullPage` **[boolean][
|
|
1390
|
+
- `fileName` **[string][7]** file name to save.
|
|
1391
|
+
- `fullPage` **[boolean][25]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1386
1392
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1387
1393
|
|
|
1388
1394
|
### scrollPageToBottom
|
|
@@ -1417,9 +1423,9 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1417
1423
|
|
|
1418
1424
|
#### Parameters
|
|
1419
1425
|
|
|
1420
|
-
- `locator` **([string][
|
|
1421
|
-
- `offsetX` **[number][
|
|
1422
|
-
- `offsetY` **[number][
|
|
1426
|
+
- `locator` **([string][7] | [object][5])** located by CSS|XPath|strict locator.
|
|
1427
|
+
- `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
1428
|
+
- `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
1423
1429
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1424
1430
|
|
|
1425
1431
|
### see
|
|
@@ -1435,8 +1441,8 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1435
1441
|
|
|
1436
1442
|
#### Parameters
|
|
1437
1443
|
|
|
1438
|
-
- `text` **[string][
|
|
1439
|
-
- `context` **([string][
|
|
1444
|
+
- `text` **[string][7]** expected on page.
|
|
1445
|
+
- `context` **([string][7]? | [object][5])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1440
1446
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1441
1447
|
|
|
1442
1448
|
### seeAttributesOnElements
|
|
@@ -1449,8 +1455,8 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1449
1455
|
|
|
1450
1456
|
#### Parameters
|
|
1451
1457
|
|
|
1452
|
-
- `locator` **([string][
|
|
1453
|
-
- `attributes` **[object][
|
|
1458
|
+
- `locator` **([string][7] | [object][5])** located by CSS|XPath|strict locator.
|
|
1459
|
+
- `attributes` **[object][5]** attributes and their values to check.
|
|
1454
1460
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1455
1461
|
|
|
1456
1462
|
### seeCheckboxIsChecked
|
|
@@ -1465,7 +1471,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1465
1471
|
|
|
1466
1472
|
#### Parameters
|
|
1467
1473
|
|
|
1468
|
-
- `field` **([string][
|
|
1474
|
+
- `field` **([string][7] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
1469
1475
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1470
1476
|
|
|
1471
1477
|
### seeCookie
|
|
@@ -1478,7 +1484,7 @@ I.seeCookie('Auth');
|
|
|
1478
1484
|
|
|
1479
1485
|
#### Parameters
|
|
1480
1486
|
|
|
1481
|
-
- `name` **[string][
|
|
1487
|
+
- `name` **[string][7]** cookie name.
|
|
1482
1488
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1483
1489
|
|
|
1484
1490
|
### seeCssPropertiesOnElements
|
|
@@ -1491,8 +1497,8 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1491
1497
|
|
|
1492
1498
|
#### Parameters
|
|
1493
1499
|
|
|
1494
|
-
- `locator` **([string][
|
|
1495
|
-
- `cssProperties` **[object][
|
|
1500
|
+
- `locator` **([string][7] | [object][5])** located by CSS|XPath|strict locator.
|
|
1501
|
+
- `cssProperties` **[object][5]** object with CSS properties and their values to check.
|
|
1496
1502
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1497
1503
|
|
|
1498
1504
|
### seeCurrentUrlEquals
|
|
@@ -1508,7 +1514,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1508
1514
|
|
|
1509
1515
|
#### Parameters
|
|
1510
1516
|
|
|
1511
|
-
- `url` **[string][
|
|
1517
|
+
- `url` **[string][7]** value to check.
|
|
1512
1518
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1513
1519
|
|
|
1514
1520
|
### seeElement
|
|
@@ -1522,7 +1528,7 @@ I.seeElement('#modal');
|
|
|
1522
1528
|
|
|
1523
1529
|
#### Parameters
|
|
1524
1530
|
|
|
1525
|
-
- `locator` **([string][
|
|
1531
|
+
- `locator` **([string][7] | [object][5])** located by CSS|XPath|strict locator.
|
|
1526
1532
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1527
1533
|
|
|
1528
1534
|
### seeElementInDOM
|
|
@@ -1536,7 +1542,7 @@ I.seeElementInDOM('#modal');
|
|
|
1536
1542
|
|
|
1537
1543
|
#### Parameters
|
|
1538
1544
|
|
|
1539
|
-
- `locator` **([string][
|
|
1545
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1540
1546
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1541
1547
|
|
|
1542
1548
|
### seeInCurrentUrl
|
|
@@ -1549,7 +1555,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1549
1555
|
|
|
1550
1556
|
#### Parameters
|
|
1551
1557
|
|
|
1552
|
-
- `url` **[string][
|
|
1558
|
+
- `url` **[string][7]** a fragment to check
|
|
1553
1559
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1554
1560
|
|
|
1555
1561
|
### seeInField
|
|
@@ -1566,8 +1572,8 @@ I.seeInField('#searchform input','Search');
|
|
|
1566
1572
|
|
|
1567
1573
|
#### Parameters
|
|
1568
1574
|
|
|
1569
|
-
- `field` **([string][
|
|
1570
|
-
- `value` **[string][
|
|
1575
|
+
- `field` **([string][7] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
1576
|
+
- `value` **[string][7]** value to check.
|
|
1571
1577
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1572
1578
|
|
|
1573
1579
|
### seeInPopup
|
|
@@ -1581,7 +1587,7 @@ I.seeInPopup('Popup text');
|
|
|
1581
1587
|
|
|
1582
1588
|
#### Parameters
|
|
1583
1589
|
|
|
1584
|
-
- `text` **[string][
|
|
1590
|
+
- `text` **[string][7]** value to check.
|
|
1585
1591
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1586
1592
|
|
|
1587
1593
|
### seeInSource
|
|
@@ -1594,7 +1600,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1594
1600
|
|
|
1595
1601
|
#### Parameters
|
|
1596
1602
|
|
|
1597
|
-
- `text` **[string][
|
|
1603
|
+
- `text` **[string][7]** value to check.
|
|
1598
1604
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1599
1605
|
|
|
1600
1606
|
### seeInTitle
|
|
@@ -1607,7 +1613,7 @@ I.seeInTitle('Home Page');
|
|
|
1607
1613
|
|
|
1608
1614
|
#### Parameters
|
|
1609
1615
|
|
|
1610
|
-
- `text` **[string][
|
|
1616
|
+
- `text` **[string][7]** text value to check.
|
|
1611
1617
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1612
1618
|
|
|
1613
1619
|
### seeNumberOfElements
|
|
@@ -1621,8 +1627,8 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1621
1627
|
|
|
1622
1628
|
#### Parameters
|
|
1623
1629
|
|
|
1624
|
-
- `locator` **([string][
|
|
1625
|
-
- `num` **[number][
|
|
1630
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1631
|
+
- `num` **[number][11]** number of elements.
|
|
1626
1632
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1627
1633
|
|
|
1628
1634
|
### seeNumberOfVisibleElements
|
|
@@ -1636,8 +1642,8 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1636
1642
|
|
|
1637
1643
|
#### Parameters
|
|
1638
1644
|
|
|
1639
|
-
- `locator` **([string][
|
|
1640
|
-
- `num` **[number][
|
|
1645
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1646
|
+
- `num` **[number][11]** number of elements.
|
|
1641
1647
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1642
1648
|
|
|
1643
1649
|
### seeTextEquals
|
|
@@ -1650,8 +1656,8 @@ I.seeTextEquals('text', 'h1');
|
|
|
1650
1656
|
|
|
1651
1657
|
#### Parameters
|
|
1652
1658
|
|
|
1653
|
-
- `text` **[string][
|
|
1654
|
-
- `context` **([string][
|
|
1659
|
+
- `text` **[string][7]** element value to check.
|
|
1660
|
+
- `context` **([string][7] | [object][5])?** element located by CSS|XPath|strict locator.
|
|
1655
1661
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1656
1662
|
|
|
1657
1663
|
### seeTitleEquals
|
|
@@ -1664,7 +1670,7 @@ I.seeTitleEquals('Test title.');
|
|
|
1664
1670
|
|
|
1665
1671
|
#### Parameters
|
|
1666
1672
|
|
|
1667
|
-
- `text` **[string][
|
|
1673
|
+
- `text` **[string][7]** value to check.
|
|
1668
1674
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1669
1675
|
|
|
1670
1676
|
### selectOption
|
|
@@ -1690,8 +1696,8 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1690
1696
|
|
|
1691
1697
|
#### Parameters
|
|
1692
1698
|
|
|
1693
|
-
- `select` **([string][
|
|
1694
|
-
- `option` **([string][
|
|
1699
|
+
- `select` **([string][7] | [object][5])** field located by label|name|CSS|XPath|strict locator.
|
|
1700
|
+
- `option` **([string][7] | [Array][14]<any>)** visible text or value of option.
|
|
1695
1701
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1696
1702
|
|
|
1697
1703
|
### setCookie
|
|
@@ -1712,7 +1718,7 @@ I.setCookie([
|
|
|
1712
1718
|
|
|
1713
1719
|
#### Parameters
|
|
1714
1720
|
|
|
1715
|
-
- `cookie` **(Cookie | [Array][
|
|
1721
|
+
- `cookie` **(Cookie | [Array][14]<Cookie>)** a cookie object or array of cookie objects.
|
|
1716
1722
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1717
1723
|
|
|
1718
1724
|
### stopMockingRoute
|
|
@@ -1728,8 +1734,8 @@ If no handler is passed, all mock requests for the rote are disabled.
|
|
|
1728
1734
|
|
|
1729
1735
|
#### Parameters
|
|
1730
1736
|
|
|
1731
|
-
- `url` **([string][
|
|
1732
|
-
- `handler` **[function][
|
|
1737
|
+
- `url` **([string][7] | [RegExp][20])?** URL, regex or pattern for to match URL
|
|
1738
|
+
- `handler` **[function][12]?** a function to process reques
|
|
1733
1739
|
|
|
1734
1740
|
### switchTo
|
|
1735
1741
|
|
|
@@ -1742,7 +1748,7 @@ I.switchTo(); // switch back to main page
|
|
|
1742
1748
|
|
|
1743
1749
|
#### Parameters
|
|
1744
1750
|
|
|
1745
|
-
- `locator` **([string][
|
|
1751
|
+
- `locator` **([string][7]? | [object][5])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1746
1752
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1747
1753
|
|
|
1748
1754
|
### switchToNextTab
|
|
@@ -1756,7 +1762,7 @@ I.switchToNextTab(2);
|
|
|
1756
1762
|
|
|
1757
1763
|
#### Parameters
|
|
1758
1764
|
|
|
1759
|
-
- `num` **[number][
|
|
1765
|
+
- `num` **[number][11]**
|
|
1760
1766
|
|
|
1761
1767
|
### switchToPreviousTab
|
|
1762
1768
|
|
|
@@ -1769,13 +1775,13 @@ I.switchToPreviousTab(2);
|
|
|
1769
1775
|
|
|
1770
1776
|
#### Parameters
|
|
1771
1777
|
|
|
1772
|
-
- `num` **[number][
|
|
1778
|
+
- `num` **[number][11]**
|
|
1773
1779
|
|
|
1774
1780
|
### type
|
|
1775
1781
|
|
|
1776
1782
|
Types out the given text into an active field.
|
|
1777
1783
|
To slow down typing use a second parameter, to set interval between key presses.
|
|
1778
|
-
_Note:_ Should be used when [`fillField`][
|
|
1784
|
+
_Note:_ Should be used when [`fillField`][22] is not an option.
|
|
1779
1785
|
|
|
1780
1786
|
```js
|
|
1781
1787
|
// passing in a string
|
|
@@ -1791,9 +1797,9 @@ I.type(['T', 'E', 'X', 'T']);
|
|
|
1791
1797
|
#### Parameters
|
|
1792
1798
|
|
|
1793
1799
|
- `keys`
|
|
1794
|
-
- `delay` **[number][
|
|
1800
|
+
- `delay` **[number][11]?** (optional) delay in ms between key presses
|
|
1795
1801
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1796
|
-
- `key` **([string][
|
|
1802
|
+
- `key` **([string][7] | [Array][14]<[string][7]>)** or array of keys to type.
|
|
1797
1803
|
|
|
1798
1804
|
### uncheckOption
|
|
1799
1805
|
|
|
@@ -1810,9 +1816,9 @@ I.uncheckOption('agree', '//form');
|
|
|
1810
1816
|
|
|
1811
1817
|
#### Parameters
|
|
1812
1818
|
|
|
1813
|
-
- `field` **([string][
|
|
1814
|
-
- `context` **([string][
|
|
1815
|
-
[!] returns a _promise_ which is synchronized internally by recorder[Additional options][
|
|
1819
|
+
- `field` **([string][7] | [object][5])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1820
|
+
- `context` **([string][7]? | [object][5])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1821
|
+
[!] returns a _promise_ which is synchronized internally by recorder[Additional options][26] for uncheck available as 3rd argument.Examples:```js
|
|
1816
1822
|
// click on element at position
|
|
1817
1823
|
I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
1818
1824
|
```> ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
@@ -1825,7 +1831,7 @@ Use Playwright API inside a test.
|
|
|
1825
1831
|
First argument is a description of an action.
|
|
1826
1832
|
Second argument is async function that gets this helper as parameter.
|
|
1827
1833
|
|
|
1828
|
-
{ [`page`][
|
|
1834
|
+
{ [`page`][27], [`browserContext`][28] [`browser`][29] } objects from Playwright API are available.
|
|
1829
1835
|
|
|
1830
1836
|
```js
|
|
1831
1837
|
I.usePlaywrightTo('emulate offline mode', async ({ browserContext }) => {
|
|
@@ -1835,8 +1841,8 @@ I.usePlaywrightTo('emulate offline mode', async ({ browserContext }) => {
|
|
|
1835
1841
|
|
|
1836
1842
|
#### Parameters
|
|
1837
1843
|
|
|
1838
|
-
- `description` **[string][
|
|
1839
|
-
- `fn` **[function][
|
|
1844
|
+
- `description` **[string][7]** used to show in logs.
|
|
1845
|
+
- `fn` **[function][12]** async function that executed with Playwright helper as argumen
|
|
1840
1846
|
|
|
1841
1847
|
### wait
|
|
1842
1848
|
|
|
@@ -1848,7 +1854,7 @@ I.wait(2); // wait 2 secs
|
|
|
1848
1854
|
|
|
1849
1855
|
#### Parameters
|
|
1850
1856
|
|
|
1851
|
-
- `sec` **[number][
|
|
1857
|
+
- `sec` **[number][11]** number of second to wait.
|
|
1852
1858
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1853
1859
|
|
|
1854
1860
|
### waitForClickable
|
|
@@ -1863,9 +1869,9 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
1863
1869
|
|
|
1864
1870
|
#### Parameters
|
|
1865
1871
|
|
|
1866
|
-
- `locator` **([string][
|
|
1872
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1867
1873
|
- `waitTimeout`
|
|
1868
|
-
- `sec` **[number][
|
|
1874
|
+
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1869
1875
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1870
1876
|
|
|
1871
1877
|
### waitForDetached
|
|
@@ -1879,8 +1885,8 @@ I.waitForDetached('#popup');
|
|
|
1879
1885
|
|
|
1880
1886
|
#### Parameters
|
|
1881
1887
|
|
|
1882
|
-
- `locator` **([string][
|
|
1883
|
-
- `sec` **[number][
|
|
1888
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1889
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1884
1890
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1885
1891
|
|
|
1886
1892
|
### waitForElement
|
|
@@ -1895,8 +1901,8 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1895
1901
|
|
|
1896
1902
|
#### Parameters
|
|
1897
1903
|
|
|
1898
|
-
- `locator` **([string][
|
|
1899
|
-
- `sec` **[number][
|
|
1904
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1905
|
+
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1900
1906
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1901
1907
|
|
|
1902
1908
|
### waitForEnabled
|
|
@@ -1906,8 +1912,8 @@ Element can be located by CSS or XPath.
|
|
|
1906
1912
|
|
|
1907
1913
|
#### Parameters
|
|
1908
1914
|
|
|
1909
|
-
- `locator` **([string][
|
|
1910
|
-
- `sec` **[number][
|
|
1915
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1916
|
+
- `sec` **[number][11]** (optional) time in seconds to wait, 1 by default.
|
|
1911
1917
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1912
1918
|
|
|
1913
1919
|
### waitForFunction
|
|
@@ -1927,9 +1933,9 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1927
1933
|
|
|
1928
1934
|
#### Parameters
|
|
1929
1935
|
|
|
1930
|
-
- `fn` **([string][
|
|
1931
|
-
- `argsOrSec` **([Array][
|
|
1932
|
-
- `sec` **[number][
|
|
1936
|
+
- `fn` **([string][7] | [function][12])** to be executed in browser context.
|
|
1937
|
+
- `argsOrSec` **([Array][14]<any> | [number][11])?** (optional, `1` by default) arguments for function or seconds.
|
|
1938
|
+
- `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
1933
1939
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1934
1940
|
|
|
1935
1941
|
### waitForInvisible
|
|
@@ -1943,15 +1949,15 @@ I.waitForInvisible('#popup');
|
|
|
1943
1949
|
|
|
1944
1950
|
#### Parameters
|
|
1945
1951
|
|
|
1946
|
-
- `locator` **([string][
|
|
1947
|
-
- `sec` **[number][
|
|
1952
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1953
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
1948
1954
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1949
1955
|
|
|
1950
1956
|
### waitForNavigation
|
|
1951
1957
|
|
|
1952
1958
|
Waits for navigation to finish. By default takes configured `waitForNavigation` option.
|
|
1953
1959
|
|
|
1954
|
-
See [Playwright's reference][
|
|
1960
|
+
See [Playwright's reference][30]
|
|
1955
1961
|
|
|
1956
1962
|
#### Parameters
|
|
1957
1963
|
|
|
@@ -1968,8 +1974,8 @@ I.waitForRequest(request => request.url() === 'http://example.com' && request.me
|
|
|
1968
1974
|
|
|
1969
1975
|
#### Parameters
|
|
1970
1976
|
|
|
1971
|
-
- `urlOrPredicate` **([string][
|
|
1972
|
-
- `sec` **[number][
|
|
1977
|
+
- `urlOrPredicate` **([string][7] | [function][12])**
|
|
1978
|
+
- `sec` **[number][11]?** seconds to wait
|
|
1973
1979
|
|
|
1974
1980
|
### waitForResponse
|
|
1975
1981
|
|
|
@@ -1982,8 +1988,8 @@ I.waitForResponse(response => response.url() === 'https://example.com' && respon
|
|
|
1982
1988
|
|
|
1983
1989
|
#### Parameters
|
|
1984
1990
|
|
|
1985
|
-
- `urlOrPredicate` **([string][
|
|
1986
|
-
- `sec` **[number][
|
|
1991
|
+
- `urlOrPredicate` **([string][7] | [function][12])**
|
|
1992
|
+
- `sec` **[number][11]?** number of seconds to wait
|
|
1987
1993
|
|
|
1988
1994
|
### waitForText
|
|
1989
1995
|
|
|
@@ -1998,9 +2004,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1998
2004
|
|
|
1999
2005
|
#### Parameters
|
|
2000
2006
|
|
|
2001
|
-
- `text` **[string][
|
|
2002
|
-
- `sec` **[number][
|
|
2003
|
-
- `context` **([string][
|
|
2007
|
+
- `text` **[string][7]** to wait for.
|
|
2008
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2009
|
+
- `context` **([string][7] | [object][5])?** (optional) element located by CSS|XPath|strict locator.
|
|
2004
2010
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2005
2011
|
|
|
2006
2012
|
### waitForValue
|
|
@@ -2013,9 +2019,9 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2013
2019
|
|
|
2014
2020
|
#### Parameters
|
|
2015
2021
|
|
|
2016
|
-
- `field` **([string][
|
|
2017
|
-
- `value` **[string][
|
|
2018
|
-
- `sec` **[number][
|
|
2022
|
+
- `field` **([string][7] | [object][5])** input field.
|
|
2023
|
+
- `value` **[string][7]** expected value.
|
|
2024
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2019
2025
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2020
2026
|
|
|
2021
2027
|
### waitForVisible
|
|
@@ -2029,9 +2035,9 @@ I.waitForVisible('#popup');
|
|
|
2029
2035
|
|
|
2030
2036
|
#### Parameters
|
|
2031
2037
|
|
|
2032
|
-
- `locator` **([string][
|
|
2033
|
-
- `sec` **[number][
|
|
2034
|
-
[!] returns a _promise_ which is synchronized internally by recorderThis method accepts [React selectors][
|
|
2038
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
2039
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2040
|
+
[!] returns a _promise_ which is synchronized internally by recorderThis method accepts [React selectors][31].
|
|
2035
2041
|
|
|
2036
2042
|
### waitInUrl
|
|
2037
2043
|
|
|
@@ -2043,8 +2049,8 @@ I.waitInUrl('/info', 2);
|
|
|
2043
2049
|
|
|
2044
2050
|
#### Parameters
|
|
2045
2051
|
|
|
2046
|
-
- `urlPart` **[string][
|
|
2047
|
-
- `sec` **[number][
|
|
2052
|
+
- `urlPart` **[string][7]** value to check.
|
|
2053
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2048
2054
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2049
2055
|
|
|
2050
2056
|
### waitNumberOfVisibleElements
|
|
@@ -2057,9 +2063,9 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2057
2063
|
|
|
2058
2064
|
#### Parameters
|
|
2059
2065
|
|
|
2060
|
-
- `locator` **([string][
|
|
2061
|
-
- `num` **[number][
|
|
2062
|
-
- `sec` **[number][
|
|
2066
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
2067
|
+
- `num` **[number][11]** number of elements.
|
|
2068
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2063
2069
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2064
2070
|
|
|
2065
2071
|
### waitToHide
|
|
@@ -2073,8 +2079,8 @@ I.waitToHide('#popup');
|
|
|
2073
2079
|
|
|
2074
2080
|
#### Parameters
|
|
2075
2081
|
|
|
2076
|
-
- `locator` **([string][
|
|
2077
|
-
- `sec` **[number][
|
|
2082
|
+
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
|
|
2083
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2078
2084
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2079
2085
|
|
|
2080
2086
|
### waitUrlEquals
|
|
@@ -2088,78 +2094,78 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2088
2094
|
|
|
2089
2095
|
#### Parameters
|
|
2090
2096
|
|
|
2091
|
-
- `urlPart` **[string][
|
|
2092
|
-
- `sec` **[number][
|
|
2097
|
+
- `urlPart` **[string][7]** value to check.
|
|
2098
|
+
- `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2093
2099
|
[!] returns a _promise_ which is synchronized internally by recorder
|
|
2094
2100
|
|
|
2095
|
-
|
|
2101
|
+
: https://github.com/microsoft/playwright
|
|
2096
2102
|
|
|
2097
|
-
[2]: https://playwright.dev/docs/api/class-
|
|
2103
|
+
[2]: https://playwright.dev/docs/next/api/class-browser#browser-new-context
|
|
2098
2104
|
|
|
2099
|
-
[3]: https://playwright.dev/docs/api/class-
|
|
2105
|
+
[3]: https://playwright.dev/docs/api/class-browsertype#browsertypeconnectparams
|
|
2100
2106
|
|
|
2101
|
-
[4]: https://playwright.
|
|
2107
|
+
[4]: https://github.com/microsoft/playwright/blob/v0.11.0/docs/api.md#working-with-chrome-extensions
|
|
2102
2108
|
|
|
2103
|
-
[5]: https://
|
|
2109
|
+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
2104
2110
|
|
|
2105
|
-
[6]:
|
|
2111
|
+
[6]: http://jster.net/category/windows-modals-popups
|
|
2106
2112
|
|
|
2107
|
-
[7]: https://
|
|
2113
|
+
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
2108
2114
|
|
|
2109
|
-
[8]: https://playwright.dev/docs/api/class-
|
|
2115
|
+
[8]: https://playwright.dev/docs/api/class-elementhandle#element-handle-check
|
|
2110
2116
|
|
|
2111
|
-
[9]: https://
|
|
2117
|
+
[9]: https://playwright.dev/docs/api/class-page#page-click
|
|
2112
2118
|
|
|
2113
|
-
[10]: https://
|
|
2119
|
+
[10]: https://playwright.dev/docs/api/class-page#page-drag-and-drop
|
|
2114
2120
|
|
|
2115
|
-
[11]:
|
|
2121
|
+
[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
2116
2122
|
|
|
2117
|
-
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
2123
|
+
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2118
2124
|
|
|
2119
|
-
[13]: https://
|
|
2125
|
+
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2120
2126
|
|
|
2121
|
-
[14]: https://
|
|
2127
|
+
[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
2122
2128
|
|
|
2123
|
-
[15]: https://playwright.dev/docs/api/class-
|
|
2129
|
+
[15]: https://playwright.dev/docs/api/class-consolemessage
|
|
2124
2130
|
|
|
2125
|
-
[16]: https://
|
|
2131
|
+
[16]: https://codecept.io/helpers/FileSystem
|
|
2126
2132
|
|
|
2127
|
-
[17]: https://
|
|
2133
|
+
[17]: https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get
|
|
2128
2134
|
|
|
2129
|
-
[18]: https://
|
|
2135
|
+
[18]: https://playwright.dev/docs/api/class-browsercontext#browser-context-route
|
|
2130
2136
|
|
|
2131
|
-
[19]: https://
|
|
2137
|
+
[19]: https://playwright.dev/docs/network#handle-requests
|
|
2132
2138
|
|
|
2133
|
-
[20]: https://
|
|
2139
|
+
[20]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp
|
|
2134
2140
|
|
|
2135
|
-
[21]: https://
|
|
2141
|
+
[21]: https://github.com/microsoft/playwright/blob/main/docs/api.md#browsernewpageoptions
|
|
2136
2142
|
|
|
2137
|
-
[22]:
|
|
2143
|
+
[22]: #fillfield
|
|
2138
2144
|
|
|
2139
|
-
[23]: https://
|
|
2145
|
+
[23]: https://github.com/GoogleChrome/puppeteer/issues/1313
|
|
2140
2146
|
|
|
2141
|
-
[24]:
|
|
2147
|
+
[24]: #click
|
|
2142
2148
|
|
|
2143
|
-
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
2149
|
+
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
2144
2150
|
|
|
2145
|
-
[26]: https://
|
|
2151
|
+
[26]: https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck
|
|
2146
2152
|
|
|
2147
|
-
[27]:
|
|
2153
|
+
[27]: https://github.com/microsoft/playwright/blob/main/docs/src/api/class-page.md
|
|
2148
2154
|
|
|
2149
|
-
[28]: https://github.com/
|
|
2155
|
+
[28]: https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browsercontext.md
|
|
2150
2156
|
|
|
2151
|
-
[29]:
|
|
2157
|
+
[29]: https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browser.md
|
|
2152
2158
|
|
|
2153
|
-
[30]: https://
|
|
2159
|
+
[30]: https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions
|
|
2154
2160
|
|
|
2155
|
-
[31]: https://
|
|
2161
|
+
[31]: https://codecept.io/react
|
|
2156
2162
|
|
|
2157
|
-
[32]: https://
|
|
2163
|
+
[32]: https://playwright.dev/docs/api/class-browsercontext
|
|
2158
2164
|
|
|
2159
|
-
[33]: https://
|
|
2165
|
+
[33]: https://playwright.dev/docs/api/class-page#page-set-default-timeout
|
|
2160
2166
|
|
|
2161
|
-
[34]: https://
|
|
2167
|
+
[34]: https://playwright.dev/docs/trace-viewer
|
|
2162
2168
|
|
|
2163
|
-
[35]: https://
|
|
2169
|
+
[35]: https://github.com/microsoft/playwright/blob/main/docs/api.md#pagewaitfornavigationoptions
|
|
2164
2170
|
|
|
2165
|
-
[36]: https://
|
|
2171
|
+
[36]: https://playwright.dev/docs/browsers/#google-chrome--microsoft-edge
|