codeceptjs 3.3.6 → 3.3.7
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/basics.md +2 -3
- package/docs/bdd.md +33 -0
- package/docs/best.md +8 -8
- package/docs/build/Appium.js +60 -22
- package/docs/build/GraphQL.js +6 -6
- package/docs/build/Nightmare.js +4 -4
- package/docs/build/Playwright.js +102 -39
- package/docs/build/Polly.js +0 -0
- package/docs/build/Protractor.js +25 -25
- package/docs/build/Puppeteer.js +7 -7
- package/docs/build/SeleniumWebdriver.js +0 -0
- package/docs/build/TestCafe.js +12 -12
- package/docs/build/WebDriver.js +32 -32
- package/docs/changelog.md +36 -1
- package/docs/helpers/Appium.md +103 -79
- package/docs/helpers/GraphQL.md +6 -6
- package/docs/helpers/Playwright.md +280 -245
- package/docs/helpers/Puppeteer.md +1 -1
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/WebDriver.md +2 -2
- package/docs/playwright.md +14 -0
- package/docs/quickstart.md +40 -13
- package/docs/translation.md +83 -56
- package/docs/typescript.md +49 -3
- package/docs/wiki/Books-&-Posts.md +0 -0
- package/docs/wiki/Community-Helpers-&-Plugins.md +0 -0
- package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +0 -0
- package/docs/wiki/Examples.md +0 -0
- package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +0 -0
- package/docs/wiki/Home.md +0 -0
- package/docs/wiki/Release-Process.md +0 -0
- package/docs/wiki/Roadmap.md +0 -0
- package/docs/wiki/Tests.md +0 -0
- package/docs/wiki/Upgrading-to-CodeceptJS-3.md +0 -0
- package/docs/wiki/Videos.md +0 -0
- package/lib/codecept.js +3 -1
- package/lib/command/definitions.js +26 -2
- package/lib/command/generate.js +23 -9
- package/lib/command/init.js +32 -7
- package/lib/command/run.js +5 -1
- package/lib/container.js +15 -15
- package/lib/helper/Appium.js +60 -22
- package/lib/helper/GraphQL.js +6 -6
- package/lib/helper/Nightmare.js +4 -4
- package/lib/helper/Playwright.js +102 -39
- package/lib/helper/Protractor.js +25 -25
- package/lib/helper/Puppeteer.js +7 -7
- package/lib/helper/TestCafe.js +12 -12
- package/lib/helper/WebDriver.js +32 -32
- package/lib/helper/errors/ElementNotFound.js +1 -1
- package/lib/helper/extras/PlaywrightRestartOpts.js +0 -2
- package/lib/interfaces/bdd.js +26 -1
- package/lib/listener/artifacts.js +19 -0
- package/lib/rerun.js +12 -13
- package/lib/step.js +5 -5
- package/lib/translation.js +32 -0
- package/package.json +11 -17
- package/translations/ru-RU.js +1 -0
- package/typings/index.d.ts +29 -1
- package/typings/promiseBasedTypes.d.ts +10466 -0
- package/typings/types.d.ts +62 -12
- package/CHANGELOG.md +0 -2340
|
@@ -39,36 +39,39 @@ Type: [object][5]
|
|
|
39
39
|
|
|
40
40
|
### Properties
|
|
41
41
|
|
|
42
|
-
- `url` **[string][
|
|
43
|
-
- `browser` **[string][
|
|
44
|
-
- `show` **[boolean][
|
|
45
|
-
- `restart` **([string][
|
|
42
|
+
- `url` **[string][8]** base url of website to be tested
|
|
43
|
+
- `browser` **[string][8]?** a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
|
|
44
|
+
- `show` **[boolean][26]?** show browser window.
|
|
45
|
+
- `restart` **([string][8] | [boolean][26])?** restart strategy between tests. Possible values:- 'context' or **false** - restarts [browser context][33] but keeps running browser. Recommended by Playwright team to keep tests isolated.
|
|
46
46
|
- 'browser' or **true** - closes browser and opens it again between tests.
|
|
47
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
|
|
48
|
-
- `timeout` **[number][
|
|
49
|
-
- `disableScreenshots` **[boolean][
|
|
48
|
+
- `timeout` **[number][12]?** - [timeout][34] in ms of all Playwright actions .
|
|
49
|
+
- `disableScreenshots` **[boolean][26]?** don't save screenshot on failure.
|
|
50
50
|
- `emulate` **any?** browser in device emulation mode.
|
|
51
|
-
- `video` **[boolean][
|
|
52
|
-
- `keepVideoForPassedTests` **[boolean][
|
|
53
|
-
- `trace` **[boolean][
|
|
54
|
-
- `fullPageScreenshots` **[boolean][
|
|
55
|
-
- `uniqueScreenshotNames` **[boolean][
|
|
56
|
-
- `keepBrowserState` **[boolean][
|
|
57
|
-
- `keepCookies` **[boolean][
|
|
58
|
-
- `waitForAction` **[number][
|
|
59
|
-
- `waitForNavigation` **[string][
|
|
60
|
-
- `pressKeyDelay` **[number][
|
|
61
|
-
- `getPageTimeout` **[number][
|
|
62
|
-
- `waitForTimeout` **[number][
|
|
51
|
+
- `video` **[boolean][26]?** enables video recording for failed tests; videos are saved into `output/videos` folder
|
|
52
|
+
- `keepVideoForPassedTests` **[boolean][26]?** save videos for passed tests; videos are saved into `output/videos` folder
|
|
53
|
+
- `trace` **[boolean][26]?** record [tracing information][35] with screenshots and snapshots.
|
|
54
|
+
- `fullPageScreenshots` **[boolean][26]?** make full page screenshots on failure.
|
|
55
|
+
- `uniqueScreenshotNames` **[boolean][26]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
56
|
+
- `keepBrowserState` **[boolean][26]?** keep browser state between tests when `restart` is set to 'session'.
|
|
57
|
+
- `keepCookies` **[boolean][26]?** keep cookies between tests when `restart` is set to 'session'.
|
|
58
|
+
- `waitForAction` **[number][12]?** how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
59
|
+
- `waitForNavigation` **[string][8]?** When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API][36].
|
|
60
|
+
- `pressKeyDelay` **[number][12]?** Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
|
|
61
|
+
- `getPageTimeout` **[number][12]?** config option to set maximum navigation time in milliseconds.
|
|
62
|
+
- `waitForTimeout` **[number][12]?** default wait* timeout in ms. Default: 1000.
|
|
63
63
|
- `basicAuth` **[object][5]?** the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
64
|
-
- `windowSize` **[string][
|
|
65
|
-
- `colorScheme` **[string][
|
|
66
|
-
- `userAgent` **[string][
|
|
67
|
-
- `locale` **[string][
|
|
68
|
-
- `manualStart` **[boolean][
|
|
64
|
+
- `windowSize` **[string][8]?** default window size. Set a dimension like `640x480`.
|
|
65
|
+
- `colorScheme` **[string][8]?** default color scheme. Possible values: `dark` | `light` | `no-preference`.
|
|
66
|
+
- `userAgent` **[string][8]?** user-agent string.
|
|
67
|
+
- `locale` **[string][8]?** locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
|
|
68
|
+
- `manualStart` **[boolean][26]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
|
|
69
69
|
- `chromium` **[object][5]?** pass additional chromium options
|
|
70
|
+
- `firefox` **[object][5]?** pass additional firefox options
|
|
70
71
|
- `electron` **[object][5]?** (pass additional electron options
|
|
71
|
-
- `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][
|
|
72
|
+
- `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][37].
|
|
73
|
+
- `ignoreLog` **[Array][15]<[string][8]>?** An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values][38].
|
|
74
|
+
- `ignoreHTTPSErrors` **[boolean][26]?** Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
|
|
72
75
|
|
|
73
76
|
|
|
74
77
|
|
|
@@ -249,6 +252,15 @@ Grab Locator if called within Context
|
|
|
249
252
|
|
|
250
253
|
- `locator` **any**
|
|
251
254
|
|
|
255
|
+
### _createContextPage
|
|
256
|
+
|
|
257
|
+
Create a new browser context with a page.
|
|
258
|
+
Usually it should be run from a custom helper after call of `_startBrowser()`
|
|
259
|
+
|
|
260
|
+
#### Parameters
|
|
261
|
+
|
|
262
|
+
- `contextOptions` **[object][5]?** See [https://playwright.dev/docs/api/class-browser#browser-new-context][6]
|
|
263
|
+
|
|
252
264
|
### _getPageUrl
|
|
253
265
|
|
|
254
266
|
Gets page URL including hash.
|
|
@@ -316,7 +328,7 @@ Set current page
|
|
|
316
328
|
|
|
317
329
|
Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
|
|
318
330
|
Don't confuse popups with modal windows, as created by [various
|
|
319
|
-
libraries][
|
|
331
|
+
libraries][7].
|
|
320
332
|
|
|
321
333
|
### amAcceptingPopups
|
|
322
334
|
|
|
@@ -353,7 +365,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
353
365
|
|
|
354
366
|
#### Parameters
|
|
355
367
|
|
|
356
|
-
- `url` **[string][
|
|
368
|
+
- `url` **[string][8]** url path or global url.
|
|
357
369
|
|
|
358
370
|
Returns **void** automatically synchronized promise with recorder #!
|
|
359
371
|
|
|
@@ -368,8 +380,8 @@ I.appendField('#myTextField', 'appended');
|
|
|
368
380
|
|
|
369
381
|
#### Parameters
|
|
370
382
|
|
|
371
|
-
- `field` **([string][
|
|
372
|
-
- `value` **[string][
|
|
383
|
+
- `field` **([string][8] | [object][5])** located by label|name|CSS|XPath|strict locator
|
|
384
|
+
- `value` **[string][8]** text value to append.
|
|
373
385
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
374
386
|
|
|
375
387
|
### attachFile
|
|
@@ -385,8 +397,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
385
397
|
|
|
386
398
|
#### Parameters
|
|
387
399
|
|
|
388
|
-
- `locator` **([string][
|
|
389
|
-
- `pathToFile` **[string][
|
|
400
|
+
- `locator` **([string][8] | [object][5])** field located by label|name|CSS|XPath|strict locator.
|
|
401
|
+
- `pathToFile` **[string][8]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
390
402
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
391
403
|
|
|
392
404
|
### cancelPopup
|
|
@@ -408,9 +420,9 @@ I.checkOption('agree', '//form');
|
|
|
408
420
|
|
|
409
421
|
#### Parameters
|
|
410
422
|
|
|
411
|
-
- `field` **([string][
|
|
412
|
-
- `context` **([string][
|
|
413
|
-
⚠️ returns a _promise_ which is synchronized internally by recorder[Additional options][
|
|
423
|
+
- `field` **([string][8] | [object][5])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
424
|
+
- `context` **([string][8]? | [object][5])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
425
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder[Additional options][9] for check available as 3rd argument.Examples:```js
|
|
414
426
|
// click on element at position
|
|
415
427
|
I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
416
428
|
```> ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
@@ -428,7 +440,7 @@ I.clearCookie('test');
|
|
|
428
440
|
|
|
429
441
|
#### Parameters
|
|
430
442
|
|
|
431
|
-
- `cookie` **[string][
|
|
443
|
+
- `cookie` **[string][8]?** (optional, `null` by default) cookie name
|
|
432
444
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
433
445
|
|
|
434
446
|
### clearField
|
|
@@ -444,7 +456,7 @@ I.clearField('#email');
|
|
|
444
456
|
#### Parameters
|
|
445
457
|
|
|
446
458
|
- `field`
|
|
447
|
-
- `editable` **([string][
|
|
459
|
+
- `editable` **([string][8] | [object][5])** field located by label|name|CSS|XPath|strict locator.
|
|
448
460
|
⚠️ returns a _promise_ which is synchronized internally by recorder.
|
|
449
461
|
|
|
450
462
|
### click
|
|
@@ -473,10 +485,10 @@ I.click({css: 'nav a.login'});
|
|
|
473
485
|
|
|
474
486
|
#### Parameters
|
|
475
487
|
|
|
476
|
-
- `locator` **([string][
|
|
477
|
-
- `context` **([string][
|
|
488
|
+
- `locator` **([string][8] | [object][5])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
489
|
+
- `context` **([string][8]? | [object][5] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
478
490
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
479
|
-
- `opts` **any?** [Additional options][
|
|
491
|
+
- `opts` **any?** [Additional options][10] for click available as 3rd argument.Examples:```js
|
|
480
492
|
// click on element at position
|
|
481
493
|
I.click('canvas', '.model', { position: { x: 20, y: 40 } })
|
|
482
494
|
|
|
@@ -521,8 +533,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
521
533
|
|
|
522
534
|
#### Parameters
|
|
523
535
|
|
|
524
|
-
- `text` **[string][
|
|
525
|
-
- `context` **([string][
|
|
536
|
+
- `text` **[string][8]** which is not present.
|
|
537
|
+
- `context` **([string][8] | [object][5])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
526
538
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
527
539
|
|
|
528
540
|
### dontSeeCheckboxIsChecked
|
|
@@ -537,7 +549,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
537
549
|
|
|
538
550
|
#### Parameters
|
|
539
551
|
|
|
540
|
-
- `field` **([string][
|
|
552
|
+
- `field` **([string][8] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
541
553
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
542
554
|
|
|
543
555
|
### dontSeeCookie
|
|
@@ -550,7 +562,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
550
562
|
|
|
551
563
|
#### Parameters
|
|
552
564
|
|
|
553
|
-
- `name` **[string][
|
|
565
|
+
- `name` **[string][8]** cookie name.
|
|
554
566
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
555
567
|
|
|
556
568
|
### dontSeeCurrentUrlEquals
|
|
@@ -565,7 +577,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
565
577
|
|
|
566
578
|
#### Parameters
|
|
567
579
|
|
|
568
|
-
- `url` **[string][
|
|
580
|
+
- `url` **[string][8]** value to check.
|
|
569
581
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
570
582
|
|
|
571
583
|
### dontSeeElement
|
|
@@ -578,7 +590,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
578
590
|
|
|
579
591
|
#### Parameters
|
|
580
592
|
|
|
581
|
-
- `locator` **([string][
|
|
593
|
+
- `locator` **([string][8] | [object][5])** located by CSS|XPath|Strict locator.
|
|
582
594
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
583
595
|
|
|
584
596
|
### dontSeeElementInDOM
|
|
@@ -591,7 +603,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
591
603
|
|
|
592
604
|
#### Parameters
|
|
593
605
|
|
|
594
|
-
- `locator` **([string][
|
|
606
|
+
- `locator` **([string][8] | [object][5])** located by CSS|XPath|Strict locator.
|
|
595
607
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
596
608
|
|
|
597
609
|
### dontSeeInCurrentUrl
|
|
@@ -600,7 +612,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
600
612
|
|
|
601
613
|
#### Parameters
|
|
602
614
|
|
|
603
|
-
- `url` **[string][
|
|
615
|
+
- `url` **[string][8]** value to check.
|
|
604
616
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
605
617
|
|
|
606
618
|
### dontSeeInField
|
|
@@ -615,8 +627,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
615
627
|
|
|
616
628
|
#### Parameters
|
|
617
629
|
|
|
618
|
-
- `field` **([string][
|
|
619
|
-
- `value` **[string][
|
|
630
|
+
- `field` **([string][8] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
631
|
+
- `value` **[string][8]** value to check.
|
|
620
632
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
621
633
|
|
|
622
634
|
### dontSeeInSource
|
|
@@ -630,7 +642,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
630
642
|
#### Parameters
|
|
631
643
|
|
|
632
644
|
- `text`
|
|
633
|
-
- `value` **[string][
|
|
645
|
+
- `value` **[string][8]** to check.
|
|
634
646
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
635
647
|
|
|
636
648
|
### dontSeeInTitle
|
|
@@ -643,7 +655,7 @@ I.dontSeeInTitle('Error');
|
|
|
643
655
|
|
|
644
656
|
#### Parameters
|
|
645
657
|
|
|
646
|
-
- `text` **[string][
|
|
658
|
+
- `text` **[string][8]** value to check.
|
|
647
659
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
648
660
|
|
|
649
661
|
### doubleClick
|
|
@@ -660,8 +672,8 @@ I.doubleClick('.btn.edit');
|
|
|
660
672
|
|
|
661
673
|
#### Parameters
|
|
662
674
|
|
|
663
|
-
- `locator` **([string][
|
|
664
|
-
- `context` **([string][
|
|
675
|
+
- `locator` **([string][8] | [object][5])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
676
|
+
- `context` **([string][8]? | [object][5])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
665
677
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
666
678
|
|
|
667
679
|
### dragAndDrop
|
|
@@ -674,10 +686,10 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
674
686
|
|
|
675
687
|
#### Parameters
|
|
676
688
|
|
|
677
|
-
- `srcElement` **([string][
|
|
678
|
-
- `destElement` **([string][
|
|
689
|
+
- `srcElement` **([string][8] | [object][5])** located by CSS|XPath|strict locator.
|
|
690
|
+
- `destElement` **([string][8] | [object][5])** located by CSS|XPath|strict locator.
|
|
679
691
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
680
|
-
- `options` **any?** [Additional options][
|
|
692
|
+
- `options` **any?** [Additional options][11] can be passed as 3rd argument.```js
|
|
681
693
|
// specify coordinates for source position
|
|
682
694
|
I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
|
|
683
695
|
```> By default option `force: true` is set
|
|
@@ -694,8 +706,8 @@ I.dragSlider('#slider', -70);
|
|
|
694
706
|
|
|
695
707
|
#### Parameters
|
|
696
708
|
|
|
697
|
-
- `locator` **([string][
|
|
698
|
-
- `offsetX` **[number][
|
|
709
|
+
- `locator` **([string][8] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
710
|
+
- `offsetX` **[number][12]** position to drag.
|
|
699
711
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
700
712
|
|
|
701
713
|
### executeScript
|
|
@@ -723,9 +735,11 @@ If a function returns a Promise it will wait for its resolution.
|
|
|
723
735
|
|
|
724
736
|
#### Parameters
|
|
725
737
|
|
|
726
|
-
- `fn` **([string][
|
|
738
|
+
- `fn` **([string][8] | [function][13])** function to be executed in browser context.
|
|
727
739
|
- `arg` **any?** optional argument to pass to the function
|
|
728
740
|
|
|
741
|
+
Returns **[Promise][14]<any>**
|
|
742
|
+
|
|
729
743
|
### fillField
|
|
730
744
|
|
|
731
745
|
Fills a text field or textarea, after clearing its value, with the given string.
|
|
@@ -744,8 +758,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
744
758
|
|
|
745
759
|
#### Parameters
|
|
746
760
|
|
|
747
|
-
- `field` **([string][
|
|
748
|
-
- `value` **([string][
|
|
761
|
+
- `field` **([string][8] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
762
|
+
- `value` **([string][8] | [object][5])** text value to fill.
|
|
749
763
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
750
764
|
|
|
751
765
|
### forceClick
|
|
@@ -777,8 +791,8 @@ I.forceClick({css: 'nav a.login'});
|
|
|
777
791
|
|
|
778
792
|
#### Parameters
|
|
779
793
|
|
|
780
|
-
- `locator` **([string][
|
|
781
|
-
- `context` **([string][
|
|
794
|
+
- `locator` **([string][8] | [object][5])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
795
|
+
- `context` **([string][8]? | [object][5])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
782
796
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
783
797
|
|
|
784
798
|
### grabAttributeFrom
|
|
@@ -793,10 +807,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
793
807
|
|
|
794
808
|
#### Parameters
|
|
795
809
|
|
|
796
|
-
- `locator` **([string][
|
|
797
|
-
- `attr` **[string][
|
|
810
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
811
|
+
- `attr` **[string][8]** attribute name.
|
|
798
812
|
|
|
799
|
-
Returns **[Promise][
|
|
813
|
+
Returns **[Promise][14]<[string][8]>** attribute value
|
|
800
814
|
|
|
801
815
|
### grabAttributeFromAll
|
|
802
816
|
|
|
@@ -809,10 +823,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
809
823
|
|
|
810
824
|
#### Parameters
|
|
811
825
|
|
|
812
|
-
- `locator` **([string][
|
|
813
|
-
- `attr` **[string][
|
|
826
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
827
|
+
- `attr` **[string][8]** attribute name.
|
|
814
828
|
|
|
815
|
-
Returns **[Promise][
|
|
829
|
+
Returns **[Promise][14]<[Array][15]<[string][8]>>** attribute value
|
|
816
830
|
|
|
817
831
|
### grabBrowserLogs
|
|
818
832
|
|
|
@@ -824,9 +838,9 @@ const errors = logs.map(l => ({ type: l.type(), text: l.text() })).filter(l => l
|
|
|
824
838
|
console.log(JSON.stringify(errors));
|
|
825
839
|
```
|
|
826
840
|
|
|
827
|
-
[Learn more about console messages][
|
|
841
|
+
[Learn more about console messages][16]
|
|
828
842
|
|
|
829
|
-
Returns **[Promise][
|
|
843
|
+
Returns **[Promise][14]<[Array][15]<any>>**
|
|
830
844
|
|
|
831
845
|
### grabCookie
|
|
832
846
|
|
|
@@ -841,9 +855,9 @@ assert(cookie.value, '123456');
|
|
|
841
855
|
|
|
842
856
|
#### Parameters
|
|
843
857
|
|
|
844
|
-
- `name` **[string][
|
|
858
|
+
- `name` **[string][8]?** cookie name.
|
|
845
859
|
|
|
846
|
-
Returns **([Promise][
|
|
860
|
+
Returns **([Promise][14]<[string][8]> | [Promise][14]<[Array][15]<[string][8]>>)** attribute valueReturns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
847
861
|
|
|
848
862
|
### grabCssPropertyFrom
|
|
849
863
|
|
|
@@ -857,10 +871,10 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
857
871
|
|
|
858
872
|
#### Parameters
|
|
859
873
|
|
|
860
|
-
- `locator` **([string][
|
|
861
|
-
- `cssProperty` **[string][
|
|
874
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
875
|
+
- `cssProperty` **[string][8]** CSS property name.
|
|
862
876
|
|
|
863
|
-
Returns **[Promise][
|
|
877
|
+
Returns **[Promise][14]<[string][8]>** CSS value
|
|
864
878
|
|
|
865
879
|
### grabCssPropertyFromAll
|
|
866
880
|
|
|
@@ -873,10 +887,10 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
873
887
|
|
|
874
888
|
#### Parameters
|
|
875
889
|
|
|
876
|
-
- `locator` **([string][
|
|
877
|
-
- `cssProperty` **[string][
|
|
890
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
891
|
+
- `cssProperty` **[string][8]** CSS property name.
|
|
878
892
|
|
|
879
|
-
Returns **[Promise][
|
|
893
|
+
Returns **[Promise][14]<[Array][15]<[string][8]>>** CSS value
|
|
880
894
|
|
|
881
895
|
### grabCurrentUrl
|
|
882
896
|
|
|
@@ -888,7 +902,7 @@ let url = await I.grabCurrentUrl();
|
|
|
888
902
|
console.log(`Current URL is [${url}]`);
|
|
889
903
|
```
|
|
890
904
|
|
|
891
|
-
Returns **[Promise][
|
|
905
|
+
Returns **[Promise][14]<[string][8]>** current URL
|
|
892
906
|
|
|
893
907
|
### grabDataFromPerformanceTiming
|
|
894
908
|
|
|
@@ -913,7 +927,7 @@ let data = await I.grabDataFromPerformanceTiming();
|
|
|
913
927
|
}
|
|
914
928
|
```
|
|
915
929
|
|
|
916
|
-
Returns **[Promise][
|
|
930
|
+
Returns **[Promise][14]<any>** automatically synchronized promise through #recorder
|
|
917
931
|
|
|
918
932
|
### grabElementBoundingRect
|
|
919
933
|
|
|
@@ -937,11 +951,11 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
937
951
|
|
|
938
952
|
#### Parameters
|
|
939
953
|
|
|
940
|
-
- `locator` **([string][
|
|
954
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
941
955
|
- `prop`
|
|
942
|
-
- `elementSize` **[string][
|
|
956
|
+
- `elementSize` **[string][8]?** x, y, width or height of the given element.
|
|
943
957
|
|
|
944
|
-
Returns **([Promise][
|
|
958
|
+
Returns **([Promise][14]<DOMRect> | [Promise][14]<[number][12]>)** Element bounding rectangle
|
|
945
959
|
|
|
946
960
|
### grabHTMLFrom
|
|
947
961
|
|
|
@@ -956,9 +970,9 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
956
970
|
#### Parameters
|
|
957
971
|
|
|
958
972
|
- `locator`
|
|
959
|
-
- `element` **([string][
|
|
973
|
+
- `element` **([string][8] | [object][5])** located by CSS|XPath|strict locator.
|
|
960
974
|
|
|
961
|
-
Returns **[Promise][
|
|
975
|
+
Returns **[Promise][14]<[string][8]>** HTML code for an element
|
|
962
976
|
|
|
963
977
|
### grabHTMLFromAll
|
|
964
978
|
|
|
@@ -972,9 +986,9 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
972
986
|
#### Parameters
|
|
973
987
|
|
|
974
988
|
- `locator`
|
|
975
|
-
- `element` **([string][
|
|
989
|
+
- `element` **([string][8] | [object][5])** located by CSS|XPath|strict locator.
|
|
976
990
|
|
|
977
|
-
Returns **[Promise][
|
|
991
|
+
Returns **[Promise][14]<[Array][15]<[string][8]>>** HTML code for an element
|
|
978
992
|
|
|
979
993
|
### grabNumberOfOpenTabs
|
|
980
994
|
|
|
@@ -985,7 +999,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
985
999
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
986
1000
|
```
|
|
987
1001
|
|
|
988
|
-
Returns **[Promise][
|
|
1002
|
+
Returns **[Promise][14]<[number][12]>** number of open tabs
|
|
989
1003
|
|
|
990
1004
|
### grabNumberOfVisibleElements
|
|
991
1005
|
|
|
@@ -998,9 +1012,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
998
1012
|
|
|
999
1013
|
#### Parameters
|
|
1000
1014
|
|
|
1001
|
-
- `locator` **([string][
|
|
1015
|
+
- `locator` **([string][8] | [object][5])** located by CSS|XPath|strict locator.
|
|
1002
1016
|
|
|
1003
|
-
Returns **[Promise][
|
|
1017
|
+
Returns **[Promise][14]<[number][12]>** number of visible elements
|
|
1004
1018
|
|
|
1005
1019
|
### grabPageScrollPosition
|
|
1006
1020
|
|
|
@@ -1011,7 +1025,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1011
1025
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1012
1026
|
```
|
|
1013
1027
|
|
|
1014
|
-
Returns **[Promise][
|
|
1028
|
+
Returns **[Promise][14]<PageScrollPosition>** scroll position
|
|
1015
1029
|
|
|
1016
1030
|
### grabPopupText
|
|
1017
1031
|
|
|
@@ -1021,7 +1035,7 @@ Grab the text within the popup. If no popup is visible then it will return null
|
|
|
1021
1035
|
await I.grabPopupText();
|
|
1022
1036
|
```
|
|
1023
1037
|
|
|
1024
|
-
Returns **[Promise][
|
|
1038
|
+
Returns **[Promise][14]<([string][8] | null)>**
|
|
1025
1039
|
|
|
1026
1040
|
### grabSource
|
|
1027
1041
|
|
|
@@ -1032,7 +1046,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1032
1046
|
let pageSource = await I.grabSource();
|
|
1033
1047
|
```
|
|
1034
1048
|
|
|
1035
|
-
Returns **[Promise][
|
|
1049
|
+
Returns **[Promise][14]<[string][8]>** source code
|
|
1036
1050
|
|
|
1037
1051
|
### grabTextFrom
|
|
1038
1052
|
|
|
@@ -1047,9 +1061,9 @@ If multiple elements found returns first element.
|
|
|
1047
1061
|
|
|
1048
1062
|
#### Parameters
|
|
1049
1063
|
|
|
1050
|
-
- `locator` **([string][
|
|
1064
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1051
1065
|
|
|
1052
|
-
Returns **[Promise][
|
|
1066
|
+
Returns **[Promise][14]<[string][8]>** attribute value
|
|
1053
1067
|
|
|
1054
1068
|
### grabTextFromAll
|
|
1055
1069
|
|
|
@@ -1062,9 +1076,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1062
1076
|
|
|
1063
1077
|
#### Parameters
|
|
1064
1078
|
|
|
1065
|
-
- `locator` **([string][
|
|
1079
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1066
1080
|
|
|
1067
|
-
Returns **[Promise][
|
|
1081
|
+
Returns **[Promise][14]<[Array][15]<[string][8]>>** attribute value
|
|
1068
1082
|
|
|
1069
1083
|
### grabTitle
|
|
1070
1084
|
|
|
@@ -1075,7 +1089,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1075
1089
|
let title = await I.grabTitle();
|
|
1076
1090
|
```
|
|
1077
1091
|
|
|
1078
|
-
Returns **[Promise][
|
|
1092
|
+
Returns **[Promise][14]<[string][8]>** title
|
|
1079
1093
|
|
|
1080
1094
|
### grabValueFrom
|
|
1081
1095
|
|
|
@@ -1089,9 +1103,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1089
1103
|
|
|
1090
1104
|
#### Parameters
|
|
1091
1105
|
|
|
1092
|
-
- `locator` **([string][
|
|
1106
|
+
- `locator` **([string][8] | [object][5])** field located by label|name|CSS|XPath|strict locator.
|
|
1093
1107
|
|
|
1094
|
-
Returns **[Promise][
|
|
1108
|
+
Returns **[Promise][14]<[string][8]>** attribute value
|
|
1095
1109
|
|
|
1096
1110
|
### grabValueFromAll
|
|
1097
1111
|
|
|
@@ -1104,29 +1118,29 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1104
1118
|
|
|
1105
1119
|
#### Parameters
|
|
1106
1120
|
|
|
1107
|
-
- `locator` **([string][
|
|
1121
|
+
- `locator` **([string][8] | [object][5])** field located by label|name|CSS|XPath|strict locator.
|
|
1108
1122
|
|
|
1109
|
-
Returns **[Promise][
|
|
1123
|
+
Returns **[Promise][14]<[Array][15]<[string][8]>>** attribute value
|
|
1110
1124
|
|
|
1111
1125
|
### handleDownloads
|
|
1112
1126
|
|
|
1113
|
-
Handles a file download.
|
|
1127
|
+
Handles a file download. A file name is required to save the file on disk.
|
|
1114
1128
|
Files are saved to "output" directory.
|
|
1115
1129
|
|
|
1116
|
-
Should be used with [FileSystem helper][
|
|
1130
|
+
Should be used with [FileSystem helper][17] to check that file were downloaded correctly.
|
|
1117
1131
|
|
|
1118
1132
|
```js
|
|
1119
1133
|
I.handleDownloads('downloads/avatar.jpg');
|
|
1120
1134
|
I.click('Download Avatar');
|
|
1121
1135
|
I.amInPath('output/downloads');
|
|
1122
|
-
I.waitForFile('
|
|
1136
|
+
I.waitForFile('avatar.jpg', 5);
|
|
1123
1137
|
```
|
|
1124
1138
|
|
|
1125
1139
|
#### Parameters
|
|
1126
1140
|
|
|
1127
|
-
- `fileName` **[string][
|
|
1141
|
+
- `fileName` **[string][8]?** set filename for downloaded file
|
|
1128
1142
|
|
|
1129
|
-
Returns **[Promise][
|
|
1143
|
+
Returns **[Promise][14]<void>**
|
|
1130
1144
|
|
|
1131
1145
|
### haveRequestHeaders
|
|
1132
1146
|
|
|
@@ -1144,7 +1158,7 @@ I.haveRequestHeaders({
|
|
|
1144
1158
|
|
|
1145
1159
|
### makeApiRequest
|
|
1146
1160
|
|
|
1147
|
-
Performs [api request][
|
|
1161
|
+
Performs [api request][18] using
|
|
1148
1162
|
the cookies from the current browser session.
|
|
1149
1163
|
|
|
1150
1164
|
```js
|
|
@@ -1157,26 +1171,26 @@ I.makeApiRequest('PATCH', )
|
|
|
1157
1171
|
|
|
1158
1172
|
#### Parameters
|
|
1159
1173
|
|
|
1160
|
-
- `method` **[string][
|
|
1161
|
-
- `url` **[string][
|
|
1174
|
+
- `method` **[string][8]** HTTP method
|
|
1175
|
+
- `url` **[string][8]** endpoint
|
|
1162
1176
|
- `options` **[object][5]** request options depending on method used
|
|
1163
1177
|
|
|
1164
|
-
Returns **[Promise][
|
|
1178
|
+
Returns **[Promise][14]<[object][5]>** response
|
|
1165
1179
|
|
|
1166
1180
|
### mockRoute
|
|
1167
1181
|
|
|
1168
|
-
Mocks network request using [`browserContext.route`][
|
|
1182
|
+
Mocks network request using [`browserContext.route`][19] of Playwright
|
|
1169
1183
|
|
|
1170
1184
|
```js
|
|
1171
1185
|
I.mockRoute(/(.png$)|(.jpg$)/, route => route.abort());
|
|
1172
1186
|
```
|
|
1173
1187
|
|
|
1174
|
-
This method allows intercepting and mocking requests & responses. [Learn more about it][
|
|
1188
|
+
This method allows intercepting and mocking requests & responses. [Learn more about it][20]
|
|
1175
1189
|
|
|
1176
1190
|
#### Parameters
|
|
1177
1191
|
|
|
1178
|
-
- `url` **([string][
|
|
1179
|
-
- `handler` **[function][
|
|
1192
|
+
- `url` **([string][8] | [RegExp][21])?** URL, regex or pattern for to match URL
|
|
1193
|
+
- `handler` **[function][13]?** a function to process reques
|
|
1180
1194
|
|
|
1181
1195
|
### moveCursorTo
|
|
1182
1196
|
|
|
@@ -1190,9 +1204,9 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1190
1204
|
|
|
1191
1205
|
#### Parameters
|
|
1192
1206
|
|
|
1193
|
-
- `locator` **([string][
|
|
1194
|
-
- `offsetX` **[number][
|
|
1195
|
-
- `offsetY` **[number][
|
|
1207
|
+
- `locator` **([string][8] | [object][5])** located by CSS|XPath|strict locator.
|
|
1208
|
+
- `offsetX` **[number][12]** (optional, `0` by default) X-axis offset.
|
|
1209
|
+
- `offsetY` **[number][12]** (optional, `0` by default) Y-axis offset.
|
|
1196
1210
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1197
1211
|
|
|
1198
1212
|
### openNewTab
|
|
@@ -1203,7 +1217,7 @@ Open new tab and automatically switched to new tab
|
|
|
1203
1217
|
I.openNewTab();
|
|
1204
1218
|
```
|
|
1205
1219
|
|
|
1206
|
-
You can pass in [page options][
|
|
1220
|
+
You can pass in [page options][22] to emulate device on this page
|
|
1207
1221
|
|
|
1208
1222
|
```js
|
|
1209
1223
|
// enable mobile
|
|
@@ -1218,7 +1232,7 @@ I.openNewTab({ isMobile: true });
|
|
|
1218
1232
|
|
|
1219
1233
|
Presses a key in the browser (on a focused element).
|
|
1220
1234
|
|
|
1221
|
-
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][
|
|
1235
|
+
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][23].
|
|
1222
1236
|
|
|
1223
1237
|
```js
|
|
1224
1238
|
I.pressKey('Backspace');
|
|
@@ -1277,14 +1291,14 @@ Some of the supported key names are:
|
|
|
1277
1291
|
|
|
1278
1292
|
#### Parameters
|
|
1279
1293
|
|
|
1280
|
-
- `key` **([string][
|
|
1281
|
-
⚠️ returns a _promise_ which is synchronized internally by recorder_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313][
|
|
1294
|
+
- `key` **([string][8] | [Array][15]<[string][8]>)** key or array of keys to press.
|
|
1295
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313][24]).
|
|
1282
1296
|
|
|
1283
1297
|
### pressKeyDown
|
|
1284
1298
|
|
|
1285
1299
|
Presses a key in the browser and leaves it in a down state.
|
|
1286
1300
|
|
|
1287
|
-
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][
|
|
1301
|
+
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][25]).
|
|
1288
1302
|
|
|
1289
1303
|
```js
|
|
1290
1304
|
I.pressKeyDown('Control');
|
|
@@ -1294,14 +1308,14 @@ I.pressKeyUp('Control');
|
|
|
1294
1308
|
|
|
1295
1309
|
#### Parameters
|
|
1296
1310
|
|
|
1297
|
-
- `key` **[string][
|
|
1311
|
+
- `key` **[string][8]** name of key to press down.
|
|
1298
1312
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1299
1313
|
|
|
1300
1314
|
### pressKeyUp
|
|
1301
1315
|
|
|
1302
1316
|
Releases a key in the browser which was previously set to a down state.
|
|
1303
1317
|
|
|
1304
|
-
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][
|
|
1318
|
+
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][25]).
|
|
1305
1319
|
|
|
1306
1320
|
```js
|
|
1307
1321
|
I.pressKeyDown('Control');
|
|
@@ -1311,7 +1325,7 @@ I.pressKeyUp('Control');
|
|
|
1311
1325
|
|
|
1312
1326
|
#### Parameters
|
|
1313
1327
|
|
|
1314
|
-
- `key` **[string][
|
|
1328
|
+
- `key` **[string][8]** name of key to release.
|
|
1315
1329
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1316
1330
|
|
|
1317
1331
|
### refreshPage
|
|
@@ -1331,8 +1345,8 @@ First parameter can be set to `maximize`.
|
|
|
1331
1345
|
|
|
1332
1346
|
#### Parameters
|
|
1333
1347
|
|
|
1334
|
-
- `width` **[number][
|
|
1335
|
-
- `height` **[number][
|
|
1348
|
+
- `width` **[number][12]** width in pixels or `maximize`.
|
|
1349
|
+
- `height` **[number][12]** height in pixels.
|
|
1336
1350
|
⚠️ returns a _promise_ which is synchronized internally by recorderUnlike other drivers Playwright changes the size of a viewport, not the window!
|
|
1337
1351
|
Playwright does not control the window of a browser so it can't adjust its real size.
|
|
1338
1352
|
It also can't maximize a window.Update configuration to change real window size on start:```js
|
|
@@ -1341,6 +1355,23 @@ First parameter can be set to `maximize`.
|
|
|
1341
1355
|
{ setWindowSize } = require('@codeceptjs/configure');
|
|
1342
1356
|
```
|
|
1343
1357
|
|
|
1358
|
+
### restartBrowser
|
|
1359
|
+
|
|
1360
|
+
Restart browser with a new context and a new page
|
|
1361
|
+
|
|
1362
|
+
```js
|
|
1363
|
+
// Restart browser and use a new timezone
|
|
1364
|
+
I.restartBrowser({ timezoneId: 'America/Phoenix' });
|
|
1365
|
+
// Open URL in a new page in changed timezone
|
|
1366
|
+
I.amOnPage('/');
|
|
1367
|
+
// Restart browser, allow reading/copying of text from/into clipboard in Chrome
|
|
1368
|
+
I.restartBrowser({ permissions: ['clipboard-read', 'clipboard-write'] });
|
|
1369
|
+
```
|
|
1370
|
+
|
|
1371
|
+
#### Parameters
|
|
1372
|
+
|
|
1373
|
+
- `contextOptions` **[object][5]?** [Options for browser context][6] when starting new browser
|
|
1374
|
+
|
|
1344
1375
|
### rightClick
|
|
1345
1376
|
|
|
1346
1377
|
Performs right click on a clickable element matched by semantic locator, CSS or XPath.
|
|
@@ -1356,8 +1387,8 @@ I.rightClick('Click me', '.context');
|
|
|
1356
1387
|
|
|
1357
1388
|
#### Parameters
|
|
1358
1389
|
|
|
1359
|
-
- `locator` **([string][
|
|
1360
|
-
- `context` **([string][
|
|
1390
|
+
- `locator` **([string][8] | [object][5])** clickable element located by CSS|XPath|strict locator.
|
|
1391
|
+
- `context` **([string][8]? | [object][5])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1361
1392
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1362
1393
|
|
|
1363
1394
|
### saveElementScreenshot
|
|
@@ -1371,8 +1402,8 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1371
1402
|
|
|
1372
1403
|
#### Parameters
|
|
1373
1404
|
|
|
1374
|
-
- `locator` **([string][
|
|
1375
|
-
- `fileName` **[string][
|
|
1405
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1406
|
+
- `fileName` **[string][8]** file name to save.
|
|
1376
1407
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1377
1408
|
|
|
1378
1409
|
### saveScreenshot
|
|
@@ -1388,8 +1419,8 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1388
1419
|
|
|
1389
1420
|
#### Parameters
|
|
1390
1421
|
|
|
1391
|
-
- `fileName` **[string][
|
|
1392
|
-
- `fullPage` **[boolean][
|
|
1422
|
+
- `fileName` **[string][8]** file name to save.
|
|
1423
|
+
- `fullPage` **[boolean][26]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1393
1424
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1394
1425
|
|
|
1395
1426
|
### scrollPageToBottom
|
|
@@ -1424,9 +1455,9 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1424
1455
|
|
|
1425
1456
|
#### Parameters
|
|
1426
1457
|
|
|
1427
|
-
- `locator` **([string][
|
|
1428
|
-
- `offsetX` **[number][
|
|
1429
|
-
- `offsetY` **[number][
|
|
1458
|
+
- `locator` **([string][8] | [object][5])** located by CSS|XPath|strict locator.
|
|
1459
|
+
- `offsetX` **[number][12]** (optional, `0` by default) X-axis offset.
|
|
1460
|
+
- `offsetY` **[number][12]** (optional, `0` by default) Y-axis offset.
|
|
1430
1461
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1431
1462
|
|
|
1432
1463
|
### see
|
|
@@ -1442,8 +1473,8 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1442
1473
|
|
|
1443
1474
|
#### Parameters
|
|
1444
1475
|
|
|
1445
|
-
- `text` **[string][
|
|
1446
|
-
- `context` **([string][
|
|
1476
|
+
- `text` **[string][8]** expected on page.
|
|
1477
|
+
- `context` **([string][8]? | [object][5])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1447
1478
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1448
1479
|
|
|
1449
1480
|
### seeAttributesOnElements
|
|
@@ -1456,7 +1487,7 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1456
1487
|
|
|
1457
1488
|
#### Parameters
|
|
1458
1489
|
|
|
1459
|
-
- `locator` **([string][
|
|
1490
|
+
- `locator` **([string][8] | [object][5])** located by CSS|XPath|strict locator.
|
|
1460
1491
|
- `attributes` **[object][5]** attributes and their values to check.
|
|
1461
1492
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1462
1493
|
|
|
@@ -1472,7 +1503,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1472
1503
|
|
|
1473
1504
|
#### Parameters
|
|
1474
1505
|
|
|
1475
|
-
- `field` **([string][
|
|
1506
|
+
- `field` **([string][8] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
1476
1507
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1477
1508
|
|
|
1478
1509
|
### seeCookie
|
|
@@ -1485,7 +1516,7 @@ I.seeCookie('Auth');
|
|
|
1485
1516
|
|
|
1486
1517
|
#### Parameters
|
|
1487
1518
|
|
|
1488
|
-
- `name` **[string][
|
|
1519
|
+
- `name` **[string][8]** cookie name.
|
|
1489
1520
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1490
1521
|
|
|
1491
1522
|
### seeCssPropertiesOnElements
|
|
@@ -1498,7 +1529,7 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1498
1529
|
|
|
1499
1530
|
#### Parameters
|
|
1500
1531
|
|
|
1501
|
-
- `locator` **([string][
|
|
1532
|
+
- `locator` **([string][8] | [object][5])** located by CSS|XPath|strict locator.
|
|
1502
1533
|
- `cssProperties` **[object][5]** object with CSS properties and their values to check.
|
|
1503
1534
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1504
1535
|
|
|
@@ -1515,7 +1546,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1515
1546
|
|
|
1516
1547
|
#### Parameters
|
|
1517
1548
|
|
|
1518
|
-
- `url` **[string][
|
|
1549
|
+
- `url` **[string][8]** value to check.
|
|
1519
1550
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1520
1551
|
|
|
1521
1552
|
### seeElement
|
|
@@ -1529,7 +1560,7 @@ I.seeElement('#modal');
|
|
|
1529
1560
|
|
|
1530
1561
|
#### Parameters
|
|
1531
1562
|
|
|
1532
|
-
- `locator` **([string][
|
|
1563
|
+
- `locator` **([string][8] | [object][5])** located by CSS|XPath|strict locator.
|
|
1533
1564
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1534
1565
|
|
|
1535
1566
|
### seeElementInDOM
|
|
@@ -1543,7 +1574,7 @@ I.seeElementInDOM('#modal');
|
|
|
1543
1574
|
|
|
1544
1575
|
#### Parameters
|
|
1545
1576
|
|
|
1546
|
-
- `locator` **([string][
|
|
1577
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1547
1578
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1548
1579
|
|
|
1549
1580
|
### seeInCurrentUrl
|
|
@@ -1556,7 +1587,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1556
1587
|
|
|
1557
1588
|
#### Parameters
|
|
1558
1589
|
|
|
1559
|
-
- `url` **[string][
|
|
1590
|
+
- `url` **[string][8]** a fragment to check
|
|
1560
1591
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1561
1592
|
|
|
1562
1593
|
### seeInField
|
|
@@ -1573,8 +1604,8 @@ I.seeInField('#searchform input','Search');
|
|
|
1573
1604
|
|
|
1574
1605
|
#### Parameters
|
|
1575
1606
|
|
|
1576
|
-
- `field` **([string][
|
|
1577
|
-
- `value` **[string][
|
|
1607
|
+
- `field` **([string][8] | [object][5])** located by label|name|CSS|XPath|strict locator.
|
|
1608
|
+
- `value` **[string][8]** value to check.
|
|
1578
1609
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1579
1610
|
|
|
1580
1611
|
### seeInPopup
|
|
@@ -1588,7 +1619,7 @@ I.seeInPopup('Popup text');
|
|
|
1588
1619
|
|
|
1589
1620
|
#### Parameters
|
|
1590
1621
|
|
|
1591
|
-
- `text` **[string][
|
|
1622
|
+
- `text` **[string][8]** value to check.
|
|
1592
1623
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1593
1624
|
|
|
1594
1625
|
### seeInSource
|
|
@@ -1601,7 +1632,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1601
1632
|
|
|
1602
1633
|
#### Parameters
|
|
1603
1634
|
|
|
1604
|
-
- `text` **[string][
|
|
1635
|
+
- `text` **[string][8]** value to check.
|
|
1605
1636
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1606
1637
|
|
|
1607
1638
|
### seeInTitle
|
|
@@ -1614,7 +1645,7 @@ I.seeInTitle('Home Page');
|
|
|
1614
1645
|
|
|
1615
1646
|
#### Parameters
|
|
1616
1647
|
|
|
1617
|
-
- `text` **[string][
|
|
1648
|
+
- `text` **[string][8]** text value to check.
|
|
1618
1649
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1619
1650
|
|
|
1620
1651
|
### seeNumberOfElements
|
|
@@ -1628,8 +1659,8 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1628
1659
|
|
|
1629
1660
|
#### Parameters
|
|
1630
1661
|
|
|
1631
|
-
- `locator` **([string][
|
|
1632
|
-
- `num` **[number][
|
|
1662
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1663
|
+
- `num` **[number][12]** number of elements.
|
|
1633
1664
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1634
1665
|
|
|
1635
1666
|
### seeNumberOfVisibleElements
|
|
@@ -1643,8 +1674,8 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1643
1674
|
|
|
1644
1675
|
#### Parameters
|
|
1645
1676
|
|
|
1646
|
-
- `locator` **([string][
|
|
1647
|
-
- `num` **[number][
|
|
1677
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1678
|
+
- `num` **[number][12]** number of elements.
|
|
1648
1679
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1649
1680
|
|
|
1650
1681
|
### seeTextEquals
|
|
@@ -1657,8 +1688,8 @@ I.seeTextEquals('text', 'h1');
|
|
|
1657
1688
|
|
|
1658
1689
|
#### Parameters
|
|
1659
1690
|
|
|
1660
|
-
- `text` **[string][
|
|
1661
|
-
- `context` **([string][
|
|
1691
|
+
- `text` **[string][8]** element value to check.
|
|
1692
|
+
- `context` **([string][8] | [object][5])?** element located by CSS|XPath|strict locator.
|
|
1662
1693
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1663
1694
|
|
|
1664
1695
|
### seeTitleEquals
|
|
@@ -1671,7 +1702,7 @@ I.seeTitleEquals('Test title.');
|
|
|
1671
1702
|
|
|
1672
1703
|
#### Parameters
|
|
1673
1704
|
|
|
1674
|
-
- `text` **[string][
|
|
1705
|
+
- `text` **[string][8]** value to check.
|
|
1675
1706
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1676
1707
|
|
|
1677
1708
|
### selectOption
|
|
@@ -1697,8 +1728,8 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1697
1728
|
|
|
1698
1729
|
#### Parameters
|
|
1699
1730
|
|
|
1700
|
-
- `select` **([string][
|
|
1701
|
-
- `option` **([string][
|
|
1731
|
+
- `select` **([string][8] | [object][5])** field located by label|name|CSS|XPath|strict locator.
|
|
1732
|
+
- `option` **([string][8] | [Array][15]<any>)** visible text or value of option.
|
|
1702
1733
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1703
1734
|
|
|
1704
1735
|
### setCookie
|
|
@@ -1719,7 +1750,7 @@ I.setCookie([
|
|
|
1719
1750
|
|
|
1720
1751
|
#### Parameters
|
|
1721
1752
|
|
|
1722
|
-
- `cookie` **(Cookie | [Array][
|
|
1753
|
+
- `cookie` **(Cookie | [Array][15]<Cookie>)** a cookie object or array of cookie objects.
|
|
1723
1754
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1724
1755
|
|
|
1725
1756
|
### stopMockingRoute
|
|
@@ -1735,8 +1766,8 @@ If no handler is passed, all mock requests for the rote are disabled.
|
|
|
1735
1766
|
|
|
1736
1767
|
#### Parameters
|
|
1737
1768
|
|
|
1738
|
-
- `url` **([string][
|
|
1739
|
-
- `handler` **[function][
|
|
1769
|
+
- `url` **([string][8] | [RegExp][21])?** URL, regex or pattern for to match URL
|
|
1770
|
+
- `handler` **[function][13]?** a function to process reques
|
|
1740
1771
|
|
|
1741
1772
|
### switchTo
|
|
1742
1773
|
|
|
@@ -1749,7 +1780,7 @@ I.switchTo(); // switch back to main page
|
|
|
1749
1780
|
|
|
1750
1781
|
#### Parameters
|
|
1751
1782
|
|
|
1752
|
-
- `locator` **([string][
|
|
1783
|
+
- `locator` **([string][8]? | [object][5])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1753
1784
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1754
1785
|
|
|
1755
1786
|
### switchToNextTab
|
|
@@ -1763,7 +1794,7 @@ I.switchToNextTab(2);
|
|
|
1763
1794
|
|
|
1764
1795
|
#### Parameters
|
|
1765
1796
|
|
|
1766
|
-
- `num` **[number][
|
|
1797
|
+
- `num` **[number][12]**
|
|
1767
1798
|
|
|
1768
1799
|
### switchToPreviousTab
|
|
1769
1800
|
|
|
@@ -1776,13 +1807,13 @@ I.switchToPreviousTab(2);
|
|
|
1776
1807
|
|
|
1777
1808
|
#### Parameters
|
|
1778
1809
|
|
|
1779
|
-
- `num` **[number][
|
|
1810
|
+
- `num` **[number][12]**
|
|
1780
1811
|
|
|
1781
1812
|
### type
|
|
1782
1813
|
|
|
1783
1814
|
Types out the given text into an active field.
|
|
1784
1815
|
To slow down typing use a second parameter, to set interval between key presses.
|
|
1785
|
-
_Note:_ Should be used when [`fillField`][
|
|
1816
|
+
_Note:_ Should be used when [`fillField`][23] is not an option.
|
|
1786
1817
|
|
|
1787
1818
|
```js
|
|
1788
1819
|
// passing in a string
|
|
@@ -1798,9 +1829,9 @@ I.type(['T', 'E', 'X', 'T']);
|
|
|
1798
1829
|
#### Parameters
|
|
1799
1830
|
|
|
1800
1831
|
- `keys`
|
|
1801
|
-
- `delay` **[number][
|
|
1832
|
+
- `delay` **[number][12]?** (optional) delay in ms between key presses
|
|
1802
1833
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1803
|
-
- `key` **([string][
|
|
1834
|
+
- `key` **([string][8] | [Array][15]<[string][8]>)** or array of keys to type.
|
|
1804
1835
|
|
|
1805
1836
|
### uncheckOption
|
|
1806
1837
|
|
|
@@ -1817,9 +1848,9 @@ I.uncheckOption('agree', '//form');
|
|
|
1817
1848
|
|
|
1818
1849
|
#### Parameters
|
|
1819
1850
|
|
|
1820
|
-
- `field` **([string][
|
|
1821
|
-
- `context` **([string][
|
|
1822
|
-
⚠️ returns a _promise_ which is synchronized internally by recorder[Additional options][
|
|
1851
|
+
- `field` **([string][8] | [object][5])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1852
|
+
- `context` **([string][8]? | [object][5])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1853
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder[Additional options][27] for uncheck available as 3rd argument.Examples:```js
|
|
1823
1854
|
// click on element at position
|
|
1824
1855
|
I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
1825
1856
|
```> ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
@@ -1832,7 +1863,7 @@ Use Playwright API inside a test.
|
|
|
1832
1863
|
First argument is a description of an action.
|
|
1833
1864
|
Second argument is async function that gets this helper as parameter.
|
|
1834
1865
|
|
|
1835
|
-
{ [`page`][
|
|
1866
|
+
{ [`page`][28], [`browserContext`][29] [`browser`][30] } objects from Playwright API are available.
|
|
1836
1867
|
|
|
1837
1868
|
```js
|
|
1838
1869
|
I.usePlaywrightTo('emulate offline mode', async ({ browserContext }) => {
|
|
@@ -1842,8 +1873,8 @@ I.usePlaywrightTo('emulate offline mode', async ({ browserContext }) => {
|
|
|
1842
1873
|
|
|
1843
1874
|
#### Parameters
|
|
1844
1875
|
|
|
1845
|
-
- `description` **[string][
|
|
1846
|
-
- `fn` **[function][
|
|
1876
|
+
- `description` **[string][8]** used to show in logs.
|
|
1877
|
+
- `fn` **[function][13]** async function that executed with Playwright helper as argumen
|
|
1847
1878
|
|
|
1848
1879
|
### wait
|
|
1849
1880
|
|
|
@@ -1855,7 +1886,7 @@ I.wait(2); // wait 2 secs
|
|
|
1855
1886
|
|
|
1856
1887
|
#### Parameters
|
|
1857
1888
|
|
|
1858
|
-
- `sec` **[number][
|
|
1889
|
+
- `sec` **[number][12]** number of second to wait.
|
|
1859
1890
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1860
1891
|
|
|
1861
1892
|
### waitForClickable
|
|
@@ -1870,9 +1901,9 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
1870
1901
|
|
|
1871
1902
|
#### Parameters
|
|
1872
1903
|
|
|
1873
|
-
- `locator` **([string][
|
|
1904
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1874
1905
|
- `waitTimeout`
|
|
1875
|
-
- `sec` **[number][
|
|
1906
|
+
- `sec` **[number][12]?** (optional, `1` by default) time in seconds to wait
|
|
1876
1907
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1877
1908
|
|
|
1878
1909
|
### waitForDetached
|
|
@@ -1886,8 +1917,8 @@ I.waitForDetached('#popup');
|
|
|
1886
1917
|
|
|
1887
1918
|
#### Parameters
|
|
1888
1919
|
|
|
1889
|
-
- `locator` **([string][
|
|
1890
|
-
- `sec` **[number][
|
|
1920
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1921
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
1891
1922
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1892
1923
|
|
|
1893
1924
|
### waitForElement
|
|
@@ -1902,8 +1933,8 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1902
1933
|
|
|
1903
1934
|
#### Parameters
|
|
1904
1935
|
|
|
1905
|
-
- `locator` **([string][
|
|
1906
|
-
- `sec` **[number][
|
|
1936
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1937
|
+
- `sec` **[number][12]?** (optional, `1` by default) time in seconds to wait
|
|
1907
1938
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1908
1939
|
|
|
1909
1940
|
### waitForEnabled
|
|
@@ -1913,8 +1944,8 @@ Element can be located by CSS or XPath.
|
|
|
1913
1944
|
|
|
1914
1945
|
#### Parameters
|
|
1915
1946
|
|
|
1916
|
-
- `locator` **([string][
|
|
1917
|
-
- `sec` **[number][
|
|
1947
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1948
|
+
- `sec` **[number][12]** (optional) time in seconds to wait, 1 by default.
|
|
1918
1949
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1919
1950
|
|
|
1920
1951
|
### waitForFunction
|
|
@@ -1934,9 +1965,9 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1934
1965
|
|
|
1935
1966
|
#### Parameters
|
|
1936
1967
|
|
|
1937
|
-
- `fn` **([string][
|
|
1938
|
-
- `argsOrSec` **([Array][
|
|
1939
|
-
- `sec` **[number][
|
|
1968
|
+
- `fn` **([string][8] | [function][13])** to be executed in browser context.
|
|
1969
|
+
- `argsOrSec` **([Array][15]<any> | [number][12])?** (optional, `1` by default) arguments for function or seconds.
|
|
1970
|
+
- `sec` **[number][12]?** (optional, `1` by default) time in seconds to wait
|
|
1940
1971
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1941
1972
|
|
|
1942
1973
|
### waitForInvisible
|
|
@@ -1950,15 +1981,15 @@ I.waitForInvisible('#popup');
|
|
|
1950
1981
|
|
|
1951
1982
|
#### Parameters
|
|
1952
1983
|
|
|
1953
|
-
- `locator` **([string][
|
|
1954
|
-
- `sec` **[number][
|
|
1984
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
1985
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
1955
1986
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1956
1987
|
|
|
1957
1988
|
### waitForNavigation
|
|
1958
1989
|
|
|
1959
1990
|
Waits for navigation to finish. By default takes configured `waitForNavigation` option.
|
|
1960
1991
|
|
|
1961
|
-
See [Playwright's reference][
|
|
1992
|
+
See [Playwright's reference][31]
|
|
1962
1993
|
|
|
1963
1994
|
#### Parameters
|
|
1964
1995
|
|
|
@@ -1975,8 +2006,8 @@ I.waitForRequest(request => request.url() === 'http://example.com' && request.me
|
|
|
1975
2006
|
|
|
1976
2007
|
#### Parameters
|
|
1977
2008
|
|
|
1978
|
-
- `urlOrPredicate` **([string][
|
|
1979
|
-
- `sec` **[number][
|
|
2009
|
+
- `urlOrPredicate` **([string][8] | [function][13])**
|
|
2010
|
+
- `sec` **[number][12]?** seconds to wait
|
|
1980
2011
|
|
|
1981
2012
|
### waitForResponse
|
|
1982
2013
|
|
|
@@ -1989,8 +2020,8 @@ I.waitForResponse(response => response.url() === 'https://example.com' && respon
|
|
|
1989
2020
|
|
|
1990
2021
|
#### Parameters
|
|
1991
2022
|
|
|
1992
|
-
- `urlOrPredicate` **([string][
|
|
1993
|
-
- `sec` **[number][
|
|
2023
|
+
- `urlOrPredicate` **([string][8] | [function][13])**
|
|
2024
|
+
- `sec` **[number][12]?** number of seconds to wait
|
|
1994
2025
|
|
|
1995
2026
|
### waitForText
|
|
1996
2027
|
|
|
@@ -2005,9 +2036,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2005
2036
|
|
|
2006
2037
|
#### Parameters
|
|
2007
2038
|
|
|
2008
|
-
- `text` **[string][
|
|
2009
|
-
- `sec` **[number][
|
|
2010
|
-
- `context` **([string][
|
|
2039
|
+
- `text` **[string][8]** to wait for.
|
|
2040
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
2041
|
+
- `context` **([string][8] | [object][5])?** (optional) element located by CSS|XPath|strict locator.
|
|
2011
2042
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2012
2043
|
|
|
2013
2044
|
### waitForValue
|
|
@@ -2020,9 +2051,9 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2020
2051
|
|
|
2021
2052
|
#### Parameters
|
|
2022
2053
|
|
|
2023
|
-
- `field` **([string][
|
|
2024
|
-
- `value` **[string][
|
|
2025
|
-
- `sec` **[number][
|
|
2054
|
+
- `field` **([string][8] | [object][5])** input field.
|
|
2055
|
+
- `value` **[string][8]** expected value.
|
|
2056
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
2026
2057
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2027
2058
|
|
|
2028
2059
|
### waitForVisible
|
|
@@ -2036,9 +2067,9 @@ I.waitForVisible('#popup');
|
|
|
2036
2067
|
|
|
2037
2068
|
#### Parameters
|
|
2038
2069
|
|
|
2039
|
-
- `locator` **([string][
|
|
2040
|
-
- `sec` **[number][
|
|
2041
|
-
⚠️ returns a _promise_ which is synchronized internally by recorderThis method accepts [React selectors][
|
|
2070
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
2071
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
2072
|
+
⚠️ returns a _promise_ which is synchronized internally by recorderThis method accepts [React selectors][32].
|
|
2042
2073
|
|
|
2043
2074
|
### waitInUrl
|
|
2044
2075
|
|
|
@@ -2050,8 +2081,8 @@ I.waitInUrl('/info', 2);
|
|
|
2050
2081
|
|
|
2051
2082
|
#### Parameters
|
|
2052
2083
|
|
|
2053
|
-
- `urlPart` **[string][
|
|
2054
|
-
- `sec` **[number][
|
|
2084
|
+
- `urlPart` **[string][8]** value to check.
|
|
2085
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
2055
2086
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2056
2087
|
|
|
2057
2088
|
### waitNumberOfVisibleElements
|
|
@@ -2064,9 +2095,9 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2064
2095
|
|
|
2065
2096
|
#### Parameters
|
|
2066
2097
|
|
|
2067
|
-
- `locator` **([string][
|
|
2068
|
-
- `num` **[number][
|
|
2069
|
-
- `sec` **[number][
|
|
2098
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
2099
|
+
- `num` **[number][12]** number of elements.
|
|
2100
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
2070
2101
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2071
2102
|
|
|
2072
2103
|
### waitToHide
|
|
@@ -2080,8 +2111,8 @@ I.waitToHide('#popup');
|
|
|
2080
2111
|
|
|
2081
2112
|
#### Parameters
|
|
2082
2113
|
|
|
2083
|
-
- `locator` **([string][
|
|
2084
|
-
- `sec` **[number][
|
|
2114
|
+
- `locator` **([string][8] | [object][5])** element located by CSS|XPath|strict locator.
|
|
2115
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
2085
2116
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2086
2117
|
|
|
2087
2118
|
### waitUrlEquals
|
|
@@ -2095,11 +2126,11 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2095
2126
|
|
|
2096
2127
|
#### Parameters
|
|
2097
2128
|
|
|
2098
|
-
- `urlPart` **[string][
|
|
2099
|
-
- `sec` **[number][
|
|
2129
|
+
- `urlPart` **[string][8]** value to check.
|
|
2130
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
2100
2131
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
2101
2132
|
|
|
2102
|
-
: https://github.com/microsoft/playwright
|
|
2133
|
+
[1]: https://github.com/microsoft/playwright
|
|
2103
2134
|
|
|
2104
2135
|
[2]: https://playwright.dev/docs/next/api/class-browser#browser-new-context
|
|
2105
2136
|
|
|
@@ -2109,64 +2140,68 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2109
2140
|
|
|
2110
2141
|
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
2111
2142
|
|
|
2112
|
-
[6]:
|
|
2143
|
+
[6]: https://playwright.dev/docs/api/class-browser#browser-new-context
|
|
2144
|
+
|
|
2145
|
+
[7]: http://jster.net/category/windows-modals-popups
|
|
2146
|
+
|
|
2147
|
+
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
2113
2148
|
|
|
2114
|
-
[
|
|
2149
|
+
[9]: https://playwright.dev/docs/api/class-elementhandle#element-handle-check
|
|
2115
2150
|
|
|
2116
|
-
[
|
|
2151
|
+
[10]: https://playwright.dev/docs/api/class-page#page-click
|
|
2117
2152
|
|
|
2118
|
-
[
|
|
2153
|
+
[11]: https://playwright.dev/docs/api/class-page#page-drag-and-drop
|
|
2119
2154
|
|
|
2120
|
-
[
|
|
2155
|
+
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
2121
2156
|
|
|
2122
|
-
[
|
|
2157
|
+
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2123
2158
|
|
|
2124
|
-
[
|
|
2159
|
+
[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2125
2160
|
|
|
2126
|
-
[
|
|
2161
|
+
[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
2127
2162
|
|
|
2128
|
-
[
|
|
2163
|
+
[16]: https://playwright.dev/docs/api/class-consolemessage
|
|
2129
2164
|
|
|
2130
|
-
[
|
|
2165
|
+
[17]: https://codecept.io/helpers/FileSystem
|
|
2131
2166
|
|
|
2132
|
-
[
|
|
2167
|
+
[18]: https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get
|
|
2133
2168
|
|
|
2134
|
-
[
|
|
2169
|
+
[19]: https://playwright.dev/docs/api/class-browsercontext#browser-context-route
|
|
2135
2170
|
|
|
2136
|
-
[
|
|
2171
|
+
[20]: https://playwright.dev/docs/network#handle-requests
|
|
2137
2172
|
|
|
2138
|
-
[
|
|
2173
|
+
[21]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp
|
|
2139
2174
|
|
|
2140
|
-
[
|
|
2175
|
+
[22]: https://github.com/microsoft/playwright/blob/main/docs/api.md#browsernewpageoptions
|
|
2141
2176
|
|
|
2142
|
-
[
|
|
2177
|
+
[23]: #fillfield
|
|
2143
2178
|
|
|
2144
|
-
[
|
|
2179
|
+
[24]: https://github.com/GoogleChrome/puppeteer/issues/1313
|
|
2145
2180
|
|
|
2146
|
-
[
|
|
2181
|
+
[25]: #click
|
|
2147
2182
|
|
|
2148
|
-
[
|
|
2183
|
+
[26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
2149
2184
|
|
|
2150
|
-
[
|
|
2185
|
+
[27]: https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck
|
|
2151
2186
|
|
|
2152
|
-
[
|
|
2187
|
+
[28]: https://github.com/microsoft/playwright/blob/main/docs/src/api/class-page.md
|
|
2153
2188
|
|
|
2154
|
-
[
|
|
2189
|
+
[29]: https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browsercontext.md
|
|
2155
2190
|
|
|
2156
|
-
[
|
|
2191
|
+
[30]: https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browser.md
|
|
2157
2192
|
|
|
2158
|
-
[
|
|
2193
|
+
[31]: https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions
|
|
2159
2194
|
|
|
2160
|
-
[
|
|
2195
|
+
[32]: https://codecept.io/react
|
|
2161
2196
|
|
|
2162
|
-
[
|
|
2197
|
+
[33]: https://playwright.dev/docs/api/class-browsercontext
|
|
2163
2198
|
|
|
2164
|
-
[
|
|
2199
|
+
[34]: https://playwright.dev/docs/api/class-page#page-set-default-timeout
|
|
2165
2200
|
|
|
2166
|
-
[
|
|
2201
|
+
[35]: https://playwright.dev/docs/trace-viewer
|
|
2167
2202
|
|
|
2168
|
-
[
|
|
2203
|
+
[36]: https://playwright.dev/docs/api/class-page#page-wait-for-navigation
|
|
2169
2204
|
|
|
2170
|
-
[
|
|
2205
|
+
[37]: https://playwright.dev/docs/browsers/#google-chrome--microsoft-edge
|
|
2171
2206
|
|
|
2172
|
-
[
|
|
2207
|
+
[38]: https://playwright.dev/docs/api/class-consolemessage#console-message-type
|