codeceptjs 3.5.8 → 3.5.9-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/build/Appium.js +24 -24
- package/docs/build/Nightmare.js +51 -52
- package/docs/build/Playwright.js +137 -76
- package/docs/build/Protractor.js +64 -65
- package/docs/build/Puppeteer.js +74 -75
- package/docs/build/TestCafe.js +54 -55
- package/docs/build/WebDriver.js +79 -80
- package/docs/changelog.md +1 -571
- package/docs/community-helpers.md +4 -8
- package/docs/examples.md +2 -8
- package/docs/helpers/Appium.md +19 -19
- package/docs/helpers/Nightmare.md +75 -77
- package/docs/helpers/Playwright.md +350 -314
- package/docs/helpers/Protractor.md +153 -155
- package/docs/helpers/Puppeteer.md +146 -148
- package/docs/helpers/TestCafe.md +124 -126
- package/docs/helpers/WebDriver.md +155 -157
- package/docs/internal-api.md +111 -0
- package/docs/plugins.md +4 -2
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- package/docs/webapi/blur.mustache +1 -1
- package/docs/webapi/checkOption.mustache +1 -1
- package/docs/webapi/clearCookie.mustache +1 -2
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +1 -1
- package/docs/webapi/clickLink.mustache +1 -1
- package/docs/webapi/closeCurrentTab.mustache +1 -1
- package/docs/webapi/closeOtherTabs.mustache +1 -1
- package/docs/webapi/dontSee.mustache +1 -1
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeCookie.mustache +1 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -1
- package/docs/webapi/dontSeeInTitle.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +1 -1
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragAndDrop.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/focus.mustache +1 -1
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.mustache +1 -1
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +1 -1
- package/docs/webapi/moveCursorTo.mustache +1 -1
- package/docs/webapi/openNewTab.mustache +1 -1
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/pressKeyDown.mustache +1 -1
- package/docs/webapi/pressKeyUp.mustache +1 -1
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
- package/docs/webapi/refreshPage.mustache +1 -1
- package/docs/webapi/resizeWindow.mustache +1 -1
- package/docs/webapi/rightClick.mustache +1 -1
- package/docs/webapi/saveElementScreenshot.mustache +1 -1
- package/docs/webapi/saveScreenshot.mustache +1 -1
- package/docs/webapi/say.mustache +1 -1
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/docs/webapi/scrollPageToBottom.mustache +1 -1
- package/docs/webapi/scrollPageToTop.mustache +1 -1
- package/docs/webapi/scrollTo.mustache +1 -1
- package/docs/webapi/see.mustache +1 -1
- package/docs/webapi/seeAttributesOnElements.mustache +1 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/seeCookie.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInCurrentUrl.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/webapi/seeInPopup.mustache +1 -1
- package/docs/webapi/seeInSource.mustache +1 -1
- package/docs/webapi/seeInTitle.mustache +1 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -1
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/seeTextEquals.mustache +1 -1
- package/docs/webapi/seeTitleEquals.mustache +1 -1
- package/docs/webapi/selectOption.mustache +1 -1
- package/docs/webapi/setCookie.mustache +1 -1
- package/docs/webapi/setGeoLocation.mustache +1 -1
- package/docs/webapi/switchTo.mustache +1 -1
- package/docs/webapi/switchToNextTab.mustache +1 -1
- package/docs/webapi/switchToPreviousTab.mustache +1 -1
- package/docs/webapi/type.mustache +1 -1
- package/docs/webapi/uncheckOption.mustache +1 -1
- package/docs/webapi/wait.mustache +1 -1
- package/docs/webapi/waitForClickable.mustache +1 -1
- package/docs/webapi/waitForDetached.mustache +1 -1
- package/docs/webapi/waitForElement.mustache +1 -1
- package/docs/webapi/waitForEnabled.mustache +1 -1
- package/docs/webapi/waitForFunction.mustache +1 -1
- package/docs/webapi/waitForInvisible.mustache +1 -1
- package/docs/webapi/waitForText.mustache +1 -1
- package/docs/webapi/waitForValue.mustache +1 -1
- package/docs/webapi/waitForVisible.mustache +1 -1
- package/docs/webapi/waitInUrl.mustache +1 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/waitToHide.mustache +1 -1
- package/docs/webapi/waitUrlEquals.mustache +1 -1
- package/lib/command/run-multiple.js +1 -1
- package/lib/command/run-workers.js +30 -4
- package/lib/command/workers/runTests.js +23 -0
- package/lib/event.js +2 -0
- package/lib/helper/Appium.js +10 -10
- package/lib/helper/Playwright.js +78 -7
- package/lib/helper/Puppeteer.js +7 -3
- package/lib/helper/WebDriver.js +6 -2
- package/lib/interfaces/gherkin.js +8 -1
- package/lib/interfaces/scenarioConfig.js +1 -0
- package/lib/locator.js +2 -2
- package/lib/plugin/autoLogin.js +4 -2
- package/lib/plugin/retryFailedStep.js +5 -0
- package/lib/plugin/stepByStepReport.js +2 -2
- package/lib/ui.js +1 -0
- package/lib/workers.js +2 -0
- package/package.json +4 -4
- package/typings/promiseBasedTypes.d.ts +449 -1008
- package/typings/types.d.ts +452 -425
|
@@ -39,46 +39,47 @@ Using playwright-core package, will prevent the download of browser binaries and
|
|
|
39
39
|
|
|
40
40
|
This helper should be configured in codecept.conf.(js|ts)
|
|
41
41
|
|
|
42
|
-
Type: [object][
|
|
42
|
+
Type: [object][6]
|
|
43
43
|
|
|
44
44
|
### Properties
|
|
45
45
|
|
|
46
|
-
- `url` **[string][
|
|
46
|
+
- `url` **[string][9]?** base url of website to be tested
|
|
47
47
|
- `browser` **(`"chromium"` | `"firefox"` | `"webkit"` | `"electron"`)?** a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
|
|
48
|
-
- `show` **[boolean][
|
|
49
|
-
- `restart` **([string][
|
|
48
|
+
- `show` **[boolean][26]?** show browser window.
|
|
49
|
+
- `restart` **([string][9] | [boolean][26])?** restart strategy between tests. Possible values:- 'context' or **false** - restarts [browser context][44] but keeps running browser. Recommended by Playwright team to keep tests isolated.
|
|
50
50
|
- 'browser' or **true** - closes browser and opens it again between tests.
|
|
51
51
|
- '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
|
|
52
|
-
- `timeout` **[number][20]?** - [timeout][
|
|
53
|
-
- `disableScreenshots` **[boolean][
|
|
52
|
+
- `timeout` **[number][20]?** - [timeout][45] in ms of all Playwright actions .
|
|
53
|
+
- `disableScreenshots` **[boolean][26]?** don't save screenshot on failure.
|
|
54
54
|
- `emulate` **any?** browser in device emulation mode.
|
|
55
|
-
- `video` **[boolean][
|
|
56
|
-
- `keepVideoForPassedTests` **[boolean][
|
|
57
|
-
- `trace` **[boolean][
|
|
58
|
-
- `keepTraceForPassedTests` **[boolean][
|
|
59
|
-
- `fullPageScreenshots` **[boolean][
|
|
60
|
-
- `uniqueScreenshotNames` **[boolean][
|
|
61
|
-
- `keepBrowserState` **[boolean][
|
|
62
|
-
- `keepCookies` **[boolean][
|
|
55
|
+
- `video` **[boolean][26]?** enables video recording for failed tests; videos are saved into `output/videos` folder
|
|
56
|
+
- `keepVideoForPassedTests` **[boolean][26]?** save videos for passed tests; videos are saved into `output/videos` folder
|
|
57
|
+
- `trace` **[boolean][26]?** record [tracing information][46] with screenshots and snapshots.
|
|
58
|
+
- `keepTraceForPassedTests` **[boolean][26]?** save trace for passed tests.
|
|
59
|
+
- `fullPageScreenshots` **[boolean][26]?** make full page screenshots on failure.
|
|
60
|
+
- `uniqueScreenshotNames` **[boolean][26]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
61
|
+
- `keepBrowserState` **[boolean][26]?** keep browser state between tests when `restart` is set to 'session'.
|
|
62
|
+
- `keepCookies` **[boolean][26]?** keep cookies between tests when `restart` is set to 'session'.
|
|
63
63
|
- `waitForAction` **[number][20]?** how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
64
|
-
- `waitForNavigation` **(`"load"` | `"domcontentloaded"` | `"commit"`)?** When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `commit`. Choose one of those options is possible. See [Playwright API][
|
|
64
|
+
- `waitForNavigation` **(`"load"` | `"domcontentloaded"` | `"commit"`)?** When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `commit`. Choose one of those options is possible. See [Playwright API][42].
|
|
65
65
|
- `pressKeyDelay` **[number][20]?** Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
|
|
66
66
|
- `getPageTimeout` **[number][20]?** config option to set maximum navigation time in milliseconds.
|
|
67
67
|
- `waitForTimeout` **[number][20]?** default wait* timeout in ms. Default: 1000.
|
|
68
|
-
- `basicAuth` **[object][
|
|
69
|
-
- `windowSize` **[string][
|
|
68
|
+
- `basicAuth` **[object][6]?** the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
69
|
+
- `windowSize` **[string][9]?** default window size. Set a dimension like `640x480`.
|
|
70
70
|
- `colorScheme` **(`"dark"` | `"light"` | `"no-preference"`)?** default color scheme. Possible values: `dark` | `light` | `no-preference`.
|
|
71
|
-
- `userAgent` **[string][
|
|
72
|
-
- `locale` **[string][
|
|
73
|
-
- `manualStart` **[boolean][
|
|
74
|
-
- `chromium` **[object][
|
|
75
|
-
- `firefox` **[object][
|
|
76
|
-
- `electron` **[object][
|
|
77
|
-
- `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][
|
|
78
|
-
- `ignoreLog` **[Array][10]<[string][
|
|
79
|
-
- `ignoreHTTPSErrors` **[boolean][
|
|
80
|
-
- `bypassCSP` **[boolean][
|
|
81
|
-
- `highlightElement` **[boolean][
|
|
71
|
+
- `userAgent` **[string][9]?** user-agent string.
|
|
72
|
+
- `locale` **[string][9]?** locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
|
|
73
|
+
- `manualStart` **[boolean][26]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
|
|
74
|
+
- `chromium` **[object][6]?** pass additional chromium options
|
|
75
|
+
- `firefox` **[object][6]?** pass additional firefox options
|
|
76
|
+
- `electron` **[object][6]?** (pass additional electron options
|
|
77
|
+
- `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][47].
|
|
78
|
+
- `ignoreLog` **[Array][10]<[string][9]>?** 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][48].
|
|
79
|
+
- `ignoreHTTPSErrors` **[boolean][26]?** Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
|
|
80
|
+
- `bypassCSP` **[boolean][26]?** bypass Content Security Policy or CSP
|
|
81
|
+
- `highlightElement` **[boolean][26]?** highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
82
|
+
- `recordHar` **[object][6]?** record HAR and will be saved to `output/har`. See more of [HAR options][3].
|
|
82
83
|
|
|
83
84
|
|
|
84
85
|
|
|
@@ -99,6 +100,19 @@ Traces will be saved to `output/trace`
|
|
|
99
100
|
- `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder
|
|
100
101
|
- `keepTraceForPassedTests`: - save trace for passed tests
|
|
101
102
|
|
|
103
|
+
#### HAR Recording Customization
|
|
104
|
+
|
|
105
|
+
A HAR file is an HTTP Archive file that contains a record of all the network requests that are made when a page is loaded.
|
|
106
|
+
It contains information about the request and response headers, cookies, content, timings, and more. You can use HAR files to mock network requests in your tests.
|
|
107
|
+
HAR will be saved to `output/har`. More info could be found here [https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har][3].
|
|
108
|
+
|
|
109
|
+
...
|
|
110
|
+
recordHar: {
|
|
111
|
+
mode: 'minimal', // possible values: 'minimal'|'full'.
|
|
112
|
+
content: 'embed' // possible values: "omit"|"embed"|"attach".
|
|
113
|
+
}
|
|
114
|
+
...
|
|
115
|
+
|
|
102
116
|
#### Example #1: Wait for 0 network connections.
|
|
103
117
|
|
|
104
118
|
```js
|
|
@@ -142,7 +156,7 @@ Traces will be saved to `output/trace`
|
|
|
142
156
|
}
|
|
143
157
|
```
|
|
144
158
|
|
|
145
|
-
#### Example #4: Connect to remote browser by specifying [websocket endpoint][
|
|
159
|
+
#### Example #4: Connect to remote browser by specifying [websocket endpoint][4]
|
|
146
160
|
|
|
147
161
|
```js
|
|
148
162
|
{
|
|
@@ -160,7 +174,7 @@ Traces will be saved to `output/trace`
|
|
|
160
174
|
|
|
161
175
|
#### Example #5: Testing with Chromium extensions
|
|
162
176
|
|
|
163
|
-
[official docs][
|
|
177
|
+
[official docs][5]
|
|
164
178
|
|
|
165
179
|
```js
|
|
166
180
|
{
|
|
@@ -283,7 +297,7 @@ Usually it should be run from a custom helper after call of `_startBrowser()`
|
|
|
283
297
|
|
|
284
298
|
#### Parameters
|
|
285
299
|
|
|
286
|
-
- `contextOptions` **[object][
|
|
300
|
+
- `contextOptions` **[object][6]?** See [https://playwright.dev/docs/api/class-browser#browser-new-context][7]
|
|
287
301
|
|
|
288
302
|
### _getPageUrl
|
|
289
303
|
|
|
@@ -359,13 +373,13 @@ Set current page
|
|
|
359
373
|
|
|
360
374
|
#### Parameters
|
|
361
375
|
|
|
362
|
-
- `page` **[object][
|
|
376
|
+
- `page` **[object][6]** page to set
|
|
363
377
|
|
|
364
378
|
### acceptPopup
|
|
365
379
|
|
|
366
380
|
Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
|
|
367
381
|
Don't confuse popups with modal windows, as created by [various
|
|
368
|
-
libraries][
|
|
382
|
+
libraries][8].
|
|
369
383
|
|
|
370
384
|
### amAcceptingPopups
|
|
371
385
|
|
|
@@ -402,9 +416,9 @@ I.amOnPage('/login'); // opens a login page
|
|
|
402
416
|
|
|
403
417
|
#### Parameters
|
|
404
418
|
|
|
405
|
-
- `url` **[string][
|
|
419
|
+
- `url` **[string][9]** url path or global url.
|
|
406
420
|
|
|
407
|
-
Returns **
|
|
421
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
408
422
|
|
|
409
423
|
### appendField
|
|
410
424
|
|
|
@@ -419,10 +433,10 @@ I.appendField('password', secret('123456'));
|
|
|
419
433
|
|
|
420
434
|
#### Parameters
|
|
421
435
|
|
|
422
|
-
- `field` **([string][
|
|
423
|
-
- `value` **[string][
|
|
436
|
+
- `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator
|
|
437
|
+
- `value` **[string][9]** text value to append.
|
|
424
438
|
|
|
425
|
-
Returns **
|
|
439
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
426
440
|
|
|
427
441
|
### attachFile
|
|
428
442
|
|
|
@@ -437,10 +451,10 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
437
451
|
|
|
438
452
|
#### Parameters
|
|
439
453
|
|
|
440
|
-
- `locator` **([string][
|
|
441
|
-
- `pathToFile` **[string][
|
|
454
|
+
- `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
455
|
+
- `pathToFile` **[string][9]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
442
456
|
|
|
443
|
-
Returns **
|
|
457
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
444
458
|
|
|
445
459
|
### blockTraffic
|
|
446
460
|
|
|
@@ -461,7 +475,7 @@ I.blockTraffic(['http://example.com/css/style.css', 'http://example.com/css/*.cs
|
|
|
461
475
|
|
|
462
476
|
#### Parameters
|
|
463
477
|
|
|
464
|
-
- `urls` **([string][
|
|
478
|
+
- `urls` **([string][9] | [Array][10] | [RegExp][11])** URL or a list of URLs to block . URL can contain * for wildcards. Example: [https://www.example.com**][12] to block all traffic for that domain. Regexp are also supported.
|
|
465
479
|
|
|
466
480
|
### blur
|
|
467
481
|
|
|
@@ -483,10 +497,10 @@ I.dontSee('#add-to-cart-btn');
|
|
|
483
497
|
|
|
484
498
|
#### Parameters
|
|
485
499
|
|
|
486
|
-
- `locator` **([string][
|
|
500
|
+
- `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
487
501
|
- `options` **any?** Playwright only: [Additional options][14] for available options object as 2nd argument.
|
|
488
502
|
|
|
489
|
-
Returns **
|
|
503
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
490
504
|
|
|
491
505
|
### cancelPopup
|
|
492
506
|
|
|
@@ -507,11 +521,11 @@ I.checkOption('agree', '//form');
|
|
|
507
521
|
|
|
508
522
|
#### Parameters
|
|
509
523
|
|
|
510
|
-
- `field` **([string][
|
|
511
|
-
- `context` **([string][
|
|
524
|
+
- `field` **([string][9] | [object][6])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
525
|
+
- `context` **([string][9]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
512
526
|
- `options`
|
|
513
527
|
|
|
514
|
-
Returns **
|
|
528
|
+
Returns **void** automatically synchronized promise through #recorder[Additional options][15] for check available as 3rd argument.Examples:```js
|
|
515
529
|
// click on element at position
|
|
516
530
|
I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
517
531
|
```> ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
@@ -523,14 +537,12 @@ if none provided clears all cookies.
|
|
|
523
537
|
|
|
524
538
|
```js
|
|
525
539
|
I.clearCookie();
|
|
526
|
-
I.clearCookie('test');
|
|
540
|
+
I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
|
|
527
541
|
```
|
|
528
542
|
|
|
529
543
|
#### Parameters
|
|
530
544
|
|
|
531
|
-
- `cookie` **[string][
|
|
532
|
-
|
|
533
|
-
Returns **[Promise][9]<void>** automatically synchronized promise through #recorder
|
|
545
|
+
- `cookie` **[string][9]?** (optional, `null` by default) cookie name
|
|
534
546
|
|
|
535
547
|
### clearField
|
|
536
548
|
|
|
@@ -549,7 +561,7 @@ Use `force` to bypass the [actionability][16] checks.
|
|
|
549
561
|
|
|
550
562
|
#### Parameters
|
|
551
563
|
|
|
552
|
-
- `locator` **([string][
|
|
564
|
+
- `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
553
565
|
- `options` **any?** [Additional options][17] for available options object as 2nd argument.
|
|
554
566
|
|
|
555
567
|
### click
|
|
@@ -578,8 +590,8 @@ I.click({css: 'nav a.login'});
|
|
|
578
590
|
|
|
579
591
|
#### Parameters
|
|
580
592
|
|
|
581
|
-
- `locator` **([string][
|
|
582
|
-
- `context` **([string][
|
|
593
|
+
- `locator` **([string][9] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
594
|
+
- `context` **([string][9]? | [object][6] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
583
595
|
- `options` **any?** [Additional options][18] for click available as 3rd argument.Examples:```js
|
|
584
596
|
// click on element at position
|
|
585
597
|
I.click('canvas', '.model', { position: { x: 20, y: 40 } })
|
|
@@ -588,7 +600,7 @@ I.click({css: 'nav a.login'});
|
|
|
588
600
|
I.click('.edit', null, { modifiers: ['Ctrl'] } )
|
|
589
601
|
```
|
|
590
602
|
|
|
591
|
-
Returns **
|
|
603
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
592
604
|
|
|
593
605
|
### clickLink
|
|
594
606
|
|
|
@@ -627,10 +639,10 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
627
639
|
|
|
628
640
|
#### Parameters
|
|
629
641
|
|
|
630
|
-
- `text` **[string][
|
|
631
|
-
- `context` **([string][
|
|
642
|
+
- `text` **[string][9]** which is not present.
|
|
643
|
+
- `context` **([string][9] | [object][6])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
632
644
|
|
|
633
|
-
Returns **
|
|
645
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
634
646
|
|
|
635
647
|
### dontSeeCheckboxIsChecked
|
|
636
648
|
|
|
@@ -644,9 +656,9 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
644
656
|
|
|
645
657
|
#### Parameters
|
|
646
658
|
|
|
647
|
-
- `field` **([string][
|
|
659
|
+
- `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
648
660
|
|
|
649
|
-
Returns **
|
|
661
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
650
662
|
|
|
651
663
|
### dontSeeCookie
|
|
652
664
|
|
|
@@ -658,9 +670,9 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
658
670
|
|
|
659
671
|
#### Parameters
|
|
660
672
|
|
|
661
|
-
- `name` **[string][
|
|
673
|
+
- `name` **[string][9]** cookie name.
|
|
662
674
|
|
|
663
|
-
Returns **
|
|
675
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
664
676
|
|
|
665
677
|
### dontSeeCurrentUrlEquals
|
|
666
678
|
|
|
@@ -674,9 +686,9 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
674
686
|
|
|
675
687
|
#### Parameters
|
|
676
688
|
|
|
677
|
-
- `url` **[string][
|
|
689
|
+
- `url` **[string][9]** value to check.
|
|
678
690
|
|
|
679
|
-
Returns **
|
|
691
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
680
692
|
|
|
681
693
|
### dontSeeElement
|
|
682
694
|
|
|
@@ -688,9 +700,9 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
688
700
|
|
|
689
701
|
#### Parameters
|
|
690
702
|
|
|
691
|
-
- `locator` **([string][
|
|
703
|
+
- `locator` **([string][9] | [object][6])** located by CSS|XPath|Strict locator.
|
|
692
704
|
|
|
693
|
-
Returns **
|
|
705
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
694
706
|
|
|
695
707
|
### dontSeeElementInDOM
|
|
696
708
|
|
|
@@ -702,9 +714,9 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
702
714
|
|
|
703
715
|
#### Parameters
|
|
704
716
|
|
|
705
|
-
- `locator` **([string][
|
|
717
|
+
- `locator` **([string][9] | [object][6])** located by CSS|XPath|Strict locator.
|
|
706
718
|
|
|
707
|
-
Returns **
|
|
719
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
708
720
|
|
|
709
721
|
### dontSeeInCurrentUrl
|
|
710
722
|
|
|
@@ -712,9 +724,9 @@ Checks that current url does not contain a provided fragment.
|
|
|
712
724
|
|
|
713
725
|
#### Parameters
|
|
714
726
|
|
|
715
|
-
- `url` **[string][
|
|
727
|
+
- `url` **[string][9]** value to check.
|
|
716
728
|
|
|
717
|
-
Returns **
|
|
729
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
718
730
|
|
|
719
731
|
### dontSeeInField
|
|
720
732
|
|
|
@@ -728,10 +740,10 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
728
740
|
|
|
729
741
|
#### Parameters
|
|
730
742
|
|
|
731
|
-
- `field` **([string][
|
|
732
|
-
- `value` **([string][
|
|
743
|
+
- `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
744
|
+
- `value` **([string][9] | [object][6])** value to check.
|
|
733
745
|
|
|
734
|
-
Returns **
|
|
746
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
735
747
|
|
|
736
748
|
### dontSeeInSource
|
|
737
749
|
|
|
@@ -744,9 +756,9 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
744
756
|
#### Parameters
|
|
745
757
|
|
|
746
758
|
- `text`
|
|
747
|
-
- `value` **[string][
|
|
759
|
+
- `value` **[string][9]** to check.
|
|
748
760
|
|
|
749
|
-
Returns **
|
|
761
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
750
762
|
|
|
751
763
|
### dontSeeInTitle
|
|
752
764
|
|
|
@@ -758,9 +770,9 @@ I.dontSeeInTitle('Error');
|
|
|
758
770
|
|
|
759
771
|
#### Parameters
|
|
760
772
|
|
|
761
|
-
- `text` **[string][
|
|
773
|
+
- `text` **[string][9]** value to check.
|
|
762
774
|
|
|
763
|
-
Returns **
|
|
775
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
764
776
|
|
|
765
777
|
### dontSeeTraffic
|
|
766
778
|
|
|
@@ -775,9 +787,9 @@ I.dontSeeTraffic({ name: 'Unexpected API Call of "user" endpoint', url: /api.exa
|
|
|
775
787
|
|
|
776
788
|
#### Parameters
|
|
777
789
|
|
|
778
|
-
- `opts` **[Object][
|
|
779
|
-
- `opts.name` **[string][
|
|
780
|
-
- `opts.url` **([string][
|
|
790
|
+
- `opts` **[Object][6]** options when checking the traffic network.
|
|
791
|
+
- `opts.name` **[string][9]** A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
|
|
792
|
+
- `opts.url` **([string][9] | [RegExp][11])** Expected URL of request in network traffic. Can be a string or a regular expression.
|
|
781
793
|
|
|
782
794
|
### doubleClick
|
|
783
795
|
|
|
@@ -793,10 +805,10 @@ I.doubleClick('.btn.edit');
|
|
|
793
805
|
|
|
794
806
|
#### Parameters
|
|
795
807
|
|
|
796
|
-
- `locator` **([string][
|
|
797
|
-
- `context` **([string][
|
|
808
|
+
- `locator` **([string][9] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
809
|
+
- `context` **([string][9]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
798
810
|
|
|
799
|
-
Returns **
|
|
811
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
800
812
|
|
|
801
813
|
### dragAndDrop
|
|
802
814
|
|
|
@@ -808,14 +820,14 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
808
820
|
|
|
809
821
|
#### Parameters
|
|
810
822
|
|
|
811
|
-
- `srcElement` **([string][
|
|
812
|
-
- `destElement` **([string][
|
|
823
|
+
- `srcElement` **([string][9] | [object][6])** located by CSS|XPath|strict locator.
|
|
824
|
+
- `destElement` **([string][9] | [object][6])** located by CSS|XPath|strict locator.
|
|
813
825
|
- `options` **any?** [Additional options][19] can be passed as 3rd argument.```js
|
|
814
826
|
// specify coordinates for source position
|
|
815
827
|
I.dragAndDrop('img.src', 'img.dst', { sourcePosition: {x: 10, y: 10} })
|
|
816
828
|
```> When no option is set, custom drag and drop would be used, to use the dragAndDrop API from Playwright, please set options, for example `force: true`
|
|
817
829
|
|
|
818
|
-
Returns **
|
|
830
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
819
831
|
|
|
820
832
|
### dragSlider
|
|
821
833
|
|
|
@@ -829,10 +841,10 @@ I.dragSlider('#slider', -70);
|
|
|
829
841
|
|
|
830
842
|
#### Parameters
|
|
831
843
|
|
|
832
|
-
- `locator` **([string][
|
|
844
|
+
- `locator` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
833
845
|
- `offsetX` **[number][20]** position to drag.
|
|
834
846
|
|
|
835
|
-
Returns **
|
|
847
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
836
848
|
|
|
837
849
|
### executeScript
|
|
838
850
|
|
|
@@ -859,10 +871,10 @@ If a function returns a Promise it will wait for its resolution.
|
|
|
859
871
|
|
|
860
872
|
#### Parameters
|
|
861
873
|
|
|
862
|
-
- `fn` **([string][
|
|
874
|
+
- `fn` **([string][9] | [function][21])** function to be executed in browser context.
|
|
863
875
|
- `arg` **any?** optional argument to pass to the function
|
|
864
876
|
|
|
865
|
-
Returns **[Promise][
|
|
877
|
+
Returns **[Promise][22]<any>**
|
|
866
878
|
|
|
867
879
|
### fillField
|
|
868
880
|
|
|
@@ -882,10 +894,10 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
882
894
|
|
|
883
895
|
#### Parameters
|
|
884
896
|
|
|
885
|
-
- `field` **([string][
|
|
886
|
-
- `value` **([string][
|
|
897
|
+
- `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
898
|
+
- `value` **([string][9] | [object][6])** text value to fill.
|
|
887
899
|
|
|
888
|
-
Returns **
|
|
900
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
889
901
|
|
|
890
902
|
### flushNetworkTraffics
|
|
891
903
|
|
|
@@ -909,10 +921,10 @@ I.see('#add-to-cart-bnt');
|
|
|
909
921
|
|
|
910
922
|
#### Parameters
|
|
911
923
|
|
|
912
|
-
- `locator` **([string][
|
|
913
|
-
- `options` **any?** Playwright only: [Additional options][
|
|
924
|
+
- `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
925
|
+
- `options` **any?** Playwright only: [Additional options][23] for available options object as 2nd argument.
|
|
914
926
|
|
|
915
|
-
Returns **
|
|
927
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
916
928
|
|
|
917
929
|
### forceClick
|
|
918
930
|
|
|
@@ -943,10 +955,10 @@ I.forceClick({css: 'nav a.login'});
|
|
|
943
955
|
|
|
944
956
|
#### Parameters
|
|
945
957
|
|
|
946
|
-
- `locator` **([string][
|
|
947
|
-
- `context` **([string][
|
|
958
|
+
- `locator` **([string][9] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
959
|
+
- `context` **([string][9]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
948
960
|
|
|
949
|
-
Returns **
|
|
961
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
950
962
|
|
|
951
963
|
### grabAttributeFrom
|
|
952
964
|
|
|
@@ -960,10 +972,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
960
972
|
|
|
961
973
|
#### Parameters
|
|
962
974
|
|
|
963
|
-
- `locator` **([string][
|
|
964
|
-
- `attr` **[string][
|
|
975
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
976
|
+
- `attr` **[string][9]** attribute name.
|
|
965
977
|
|
|
966
|
-
Returns **[Promise][
|
|
978
|
+
Returns **[Promise][22]<[string][9]>** attribute value
|
|
967
979
|
|
|
968
980
|
### grabAttributeFromAll
|
|
969
981
|
|
|
@@ -976,10 +988,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
976
988
|
|
|
977
989
|
#### Parameters
|
|
978
990
|
|
|
979
|
-
- `locator` **([string][
|
|
980
|
-
- `attr` **[string][
|
|
991
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
992
|
+
- `attr` **[string][9]** attribute name.
|
|
981
993
|
|
|
982
|
-
Returns **[Promise][
|
|
994
|
+
Returns **[Promise][22]<[Array][10]<[string][9]>>** attribute value
|
|
983
995
|
|
|
984
996
|
### grabBrowserLogs
|
|
985
997
|
|
|
@@ -991,9 +1003,9 @@ const errors = logs.map(l => ({ type: l.type(), text: l.text() })).filter(l => l
|
|
|
991
1003
|
console.log(JSON.stringify(errors));
|
|
992
1004
|
```
|
|
993
1005
|
|
|
994
|
-
[Learn more about console messages][
|
|
1006
|
+
[Learn more about console messages][24]
|
|
995
1007
|
|
|
996
|
-
Returns **[Promise][
|
|
1008
|
+
Returns **[Promise][22]<[Array][10]<any>>**
|
|
997
1009
|
|
|
998
1010
|
### grabCheckedElementStatus
|
|
999
1011
|
|
|
@@ -1001,10 +1013,10 @@ Return the checked status of given element.
|
|
|
1001
1013
|
|
|
1002
1014
|
#### Parameters
|
|
1003
1015
|
|
|
1004
|
-
- `locator` **([string][
|
|
1005
|
-
- `options` **[object][
|
|
1016
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1017
|
+
- `options` **[object][6]?** See [https://playwright.dev/docs/api/class-locator#locator-is-checked][25]
|
|
1006
1018
|
|
|
1007
|
-
Returns **[Promise][
|
|
1019
|
+
Returns **[Promise][22]<[boolean][26]>**
|
|
1008
1020
|
|
|
1009
1021
|
### grabCookie
|
|
1010
1022
|
|
|
@@ -1019,7 +1031,7 @@ assert(cookie.value, '123456');
|
|
|
1019
1031
|
|
|
1020
1032
|
#### Parameters
|
|
1021
1033
|
|
|
1022
|
-
- `name` **[string][
|
|
1034
|
+
- `name` **[string][9]?** cookie name.
|
|
1023
1035
|
|
|
1024
1036
|
Returns **any** attribute valueReturns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
1025
1037
|
|
|
@@ -1035,10 +1047,10 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
1035
1047
|
|
|
1036
1048
|
#### Parameters
|
|
1037
1049
|
|
|
1038
|
-
- `locator` **([string][
|
|
1039
|
-
- `cssProperty` **[string][
|
|
1050
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1051
|
+
- `cssProperty` **[string][9]** CSS property name.
|
|
1040
1052
|
|
|
1041
|
-
Returns **[Promise][
|
|
1053
|
+
Returns **[Promise][22]<[string][9]>** CSS value
|
|
1042
1054
|
|
|
1043
1055
|
### grabCssPropertyFromAll
|
|
1044
1056
|
|
|
@@ -1051,10 +1063,10 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
1051
1063
|
|
|
1052
1064
|
#### Parameters
|
|
1053
1065
|
|
|
1054
|
-
- `locator` **([string][
|
|
1055
|
-
- `cssProperty` **[string][
|
|
1066
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1067
|
+
- `cssProperty` **[string][9]** CSS property name.
|
|
1056
1068
|
|
|
1057
|
-
Returns **[Promise][
|
|
1069
|
+
Returns **[Promise][22]<[Array][10]<[string][9]>>** CSS value
|
|
1058
1070
|
|
|
1059
1071
|
### grabCurrentUrl
|
|
1060
1072
|
|
|
@@ -1066,7 +1078,7 @@ let url = await I.grabCurrentUrl();
|
|
|
1066
1078
|
console.log(`Current URL is [${url}]`);
|
|
1067
1079
|
```
|
|
1068
1080
|
|
|
1069
|
-
Returns **[Promise][
|
|
1081
|
+
Returns **[Promise][22]<[string][9]>** current URL
|
|
1070
1082
|
|
|
1071
1083
|
### grabDataFromPerformanceTiming
|
|
1072
1084
|
|
|
@@ -1091,7 +1103,7 @@ let data = await I.grabDataFromPerformanceTiming();
|
|
|
1091
1103
|
}
|
|
1092
1104
|
```
|
|
1093
1105
|
|
|
1094
|
-
Returns **
|
|
1106
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1095
1107
|
|
|
1096
1108
|
### grabDisabledElementStatus
|
|
1097
1109
|
|
|
@@ -1099,10 +1111,10 @@ Return the disabled status of given element.
|
|
|
1099
1111
|
|
|
1100
1112
|
#### Parameters
|
|
1101
1113
|
|
|
1102
|
-
- `locator` **([string][
|
|
1103
|
-
- `options` **[object][
|
|
1114
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1115
|
+
- `options` **[object][6]?** See [https://playwright.dev/docs/api/class-locator#locator-is-disabled][27]
|
|
1104
1116
|
|
|
1105
|
-
Returns **[Promise][
|
|
1117
|
+
Returns **[Promise][22]<[boolean][26]>**
|
|
1106
1118
|
|
|
1107
1119
|
### grabElementBoundingRect
|
|
1108
1120
|
|
|
@@ -1126,11 +1138,11 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
1126
1138
|
|
|
1127
1139
|
#### Parameters
|
|
1128
1140
|
|
|
1129
|
-
- `locator` **([string][
|
|
1141
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1130
1142
|
- `prop`
|
|
1131
|
-
- `elementSize` **[string][
|
|
1143
|
+
- `elementSize` **[string][9]?** x, y, width or height of the given element.
|
|
1132
1144
|
|
|
1133
|
-
Returns **([Promise][
|
|
1145
|
+
Returns **([Promise][22]<DOMRect> | [Promise][22]<[number][20]>)** Element bounding rectangle
|
|
1134
1146
|
|
|
1135
1147
|
### grabHTMLFrom
|
|
1136
1148
|
|
|
@@ -1145,9 +1157,9 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1145
1157
|
#### Parameters
|
|
1146
1158
|
|
|
1147
1159
|
- `locator`
|
|
1148
|
-
- `element` **([string][
|
|
1160
|
+
- `element` **([string][9] | [object][6])** located by CSS|XPath|strict locator.
|
|
1149
1161
|
|
|
1150
|
-
Returns **[Promise][
|
|
1162
|
+
Returns **[Promise][22]<[string][9]>** HTML code for an element
|
|
1151
1163
|
|
|
1152
1164
|
### grabHTMLFromAll
|
|
1153
1165
|
|
|
@@ -1161,9 +1173,9 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1161
1173
|
#### Parameters
|
|
1162
1174
|
|
|
1163
1175
|
- `locator`
|
|
1164
|
-
- `element` **([string][
|
|
1176
|
+
- `element` **([string][9] | [object][6])** located by CSS|XPath|strict locator.
|
|
1165
1177
|
|
|
1166
|
-
Returns **[Promise][
|
|
1178
|
+
Returns **[Promise][22]<[Array][10]<[string][9]>>** HTML code for an element
|
|
1167
1179
|
|
|
1168
1180
|
### grabMetrics
|
|
1169
1181
|
|
|
@@ -1217,7 +1229,7 @@ const metrics = await I.grabMetrics();
|
|
|
1217
1229
|
]
|
|
1218
1230
|
```
|
|
1219
1231
|
|
|
1220
|
-
Returns **[Promise][
|
|
1232
|
+
Returns **[Promise][22]<[Array][10]<[Object][6]>>**
|
|
1221
1233
|
|
|
1222
1234
|
### grabNumberOfOpenTabs
|
|
1223
1235
|
|
|
@@ -1228,7 +1240,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1228
1240
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1229
1241
|
```
|
|
1230
1242
|
|
|
1231
|
-
Returns **[Promise][
|
|
1243
|
+
Returns **[Promise][22]<[number][20]>** number of open tabs
|
|
1232
1244
|
|
|
1233
1245
|
### grabNumberOfVisibleElements
|
|
1234
1246
|
|
|
@@ -1241,9 +1253,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1241
1253
|
|
|
1242
1254
|
#### Parameters
|
|
1243
1255
|
|
|
1244
|
-
- `locator` **([string][
|
|
1256
|
+
- `locator` **([string][9] | [object][6])** located by CSS|XPath|strict locator.
|
|
1245
1257
|
|
|
1246
|
-
Returns **[Promise][
|
|
1258
|
+
Returns **[Promise][22]<[number][20]>** number of visible elements
|
|
1247
1259
|
|
|
1248
1260
|
### grabPageScrollPosition
|
|
1249
1261
|
|
|
@@ -1254,7 +1266,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1254
1266
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1255
1267
|
```
|
|
1256
1268
|
|
|
1257
|
-
Returns **[Promise][
|
|
1269
|
+
Returns **[Promise][22]<PageScrollPosition>** scroll position
|
|
1258
1270
|
|
|
1259
1271
|
### grabPopupText
|
|
1260
1272
|
|
|
@@ -1264,7 +1276,7 @@ Grab the text within the popup. If no popup is visible then it will return null
|
|
|
1264
1276
|
await I.grabPopupText();
|
|
1265
1277
|
```
|
|
1266
1278
|
|
|
1267
|
-
Returns **[Promise][
|
|
1279
|
+
Returns **[Promise][22]<([string][9] | null)>**
|
|
1268
1280
|
|
|
1269
1281
|
### grabRecordedNetworkTraffics
|
|
1270
1282
|
|
|
@@ -1277,7 +1289,7 @@ expect(traffics[0].response.status).to.equal(200);
|
|
|
1277
1289
|
expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
|
|
1278
1290
|
```
|
|
1279
1291
|
|
|
1280
|
-
Returns **[Promise][
|
|
1292
|
+
Returns **[Promise][22]<[Array][10]<any>>**
|
|
1281
1293
|
|
|
1282
1294
|
### grabSource
|
|
1283
1295
|
|
|
@@ -1288,7 +1300,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1288
1300
|
let pageSource = await I.grabSource();
|
|
1289
1301
|
```
|
|
1290
1302
|
|
|
1291
|
-
Returns **[Promise][
|
|
1303
|
+
Returns **[Promise][22]<[string][9]>** source code
|
|
1292
1304
|
|
|
1293
1305
|
### grabTextFrom
|
|
1294
1306
|
|
|
@@ -1303,9 +1315,9 @@ If multiple elements found returns first element.
|
|
|
1303
1315
|
|
|
1304
1316
|
#### Parameters
|
|
1305
1317
|
|
|
1306
|
-
- `locator` **([string][
|
|
1318
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1307
1319
|
|
|
1308
|
-
Returns **[Promise][
|
|
1320
|
+
Returns **[Promise][22]<[string][9]>** attribute value
|
|
1309
1321
|
|
|
1310
1322
|
### grabTextFromAll
|
|
1311
1323
|
|
|
@@ -1318,9 +1330,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1318
1330
|
|
|
1319
1331
|
#### Parameters
|
|
1320
1332
|
|
|
1321
|
-
- `locator` **([string][
|
|
1333
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1322
1334
|
|
|
1323
|
-
Returns **[Promise][
|
|
1335
|
+
Returns **[Promise][22]<[Array][10]<[string][9]>>** attribute value
|
|
1324
1336
|
|
|
1325
1337
|
### grabTitle
|
|
1326
1338
|
|
|
@@ -1331,7 +1343,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1331
1343
|
let title = await I.grabTitle();
|
|
1332
1344
|
```
|
|
1333
1345
|
|
|
1334
|
-
Returns **[Promise][
|
|
1346
|
+
Returns **[Promise][22]<[string][9]>** title
|
|
1335
1347
|
|
|
1336
1348
|
### grabTrafficUrl
|
|
1337
1349
|
|
|
@@ -1339,12 +1351,12 @@ Returns full URL of request matching parameter "urlMatch".
|
|
|
1339
1351
|
|
|
1340
1352
|
#### Parameters
|
|
1341
1353
|
|
|
1342
|
-
- `urlMatch` **([string][
|
|
1354
|
+
- `urlMatch` **([string][9] | [RegExp][11])** Expected URL of request in network traffic. Can be a string or a regular expression.Examples:```js
|
|
1343
1355
|
I.grabTrafficUrl('https://api.example.com/session');
|
|
1344
1356
|
I.grabTrafficUrl(/session.*start/);
|
|
1345
1357
|
```
|
|
1346
1358
|
|
|
1347
|
-
Returns **[Promise][
|
|
1359
|
+
Returns **[Promise][22]<any>**
|
|
1348
1360
|
|
|
1349
1361
|
### grabValueFrom
|
|
1350
1362
|
|
|
@@ -1358,9 +1370,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1358
1370
|
|
|
1359
1371
|
#### Parameters
|
|
1360
1372
|
|
|
1361
|
-
- `locator` **([string][
|
|
1373
|
+
- `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
1362
1374
|
|
|
1363
|
-
Returns **[Promise][
|
|
1375
|
+
Returns **[Promise][22]<[string][9]>** attribute value
|
|
1364
1376
|
|
|
1365
1377
|
### grabValueFromAll
|
|
1366
1378
|
|
|
@@ -1373,9 +1385,9 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1373
1385
|
|
|
1374
1386
|
#### Parameters
|
|
1375
1387
|
|
|
1376
|
-
- `locator` **([string][
|
|
1388
|
+
- `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
1377
1389
|
|
|
1378
|
-
Returns **[Promise][
|
|
1390
|
+
Returns **[Promise][22]<[Array][10]<[string][9]>>** attribute value
|
|
1379
1391
|
|
|
1380
1392
|
### grabWebSocketMessages
|
|
1381
1393
|
|
|
@@ -1388,7 +1400,7 @@ Returns **[Array][10]<any>**
|
|
|
1388
1400
|
Handles a file download. A file name is required to save the file on disk.
|
|
1389
1401
|
Files are saved to "output" directory.
|
|
1390
1402
|
|
|
1391
|
-
Should be used with [FileSystem helper][
|
|
1403
|
+
Should be used with [FileSystem helper][28] to check that file were downloaded correctly.
|
|
1392
1404
|
|
|
1393
1405
|
```js
|
|
1394
1406
|
I.handleDownloads('downloads/avatar.jpg');
|
|
@@ -1399,13 +1411,13 @@ I.waitForFile('avatar.jpg', 5);
|
|
|
1399
1411
|
|
|
1400
1412
|
#### Parameters
|
|
1401
1413
|
|
|
1402
|
-
- `fileName` **[string][
|
|
1414
|
+
- `fileName` **[string][9]** set filename for downloaded file
|
|
1403
1415
|
|
|
1404
|
-
Returns **[Promise][
|
|
1416
|
+
Returns **[Promise][22]<void>**
|
|
1405
1417
|
|
|
1406
1418
|
### makeApiRequest
|
|
1407
1419
|
|
|
1408
|
-
Performs [api request][
|
|
1420
|
+
Performs [api request][29] using
|
|
1409
1421
|
the cookies from the current browser session.
|
|
1410
1422
|
|
|
1411
1423
|
```js
|
|
@@ -1418,25 +1430,25 @@ I.makeApiRequest('PATCH', )
|
|
|
1418
1430
|
|
|
1419
1431
|
#### Parameters
|
|
1420
1432
|
|
|
1421
|
-
- `method` **[string][
|
|
1422
|
-
- `url` **[string][
|
|
1423
|
-
- `options` **[object][
|
|
1433
|
+
- `method` **[string][9]** HTTP method
|
|
1434
|
+
- `url` **[string][9]** endpoint
|
|
1435
|
+
- `options` **[object][6]** request options depending on method used
|
|
1424
1436
|
|
|
1425
|
-
Returns **[Promise][
|
|
1437
|
+
Returns **[Promise][22]<[object][6]>** response
|
|
1426
1438
|
|
|
1427
1439
|
### mockRoute
|
|
1428
1440
|
|
|
1429
|
-
Mocks network request using [`browserContext.route`][
|
|
1441
|
+
Mocks network request using [`browserContext.route`][30] of Playwright
|
|
1430
1442
|
|
|
1431
1443
|
```js
|
|
1432
1444
|
I.mockRoute(/(.png$)|(.jpg$)/, route => route.abort());
|
|
1433
1445
|
```
|
|
1434
1446
|
|
|
1435
|
-
This method allows intercepting and mocking requests & responses. [Learn more about it][
|
|
1447
|
+
This method allows intercepting and mocking requests & responses. [Learn more about it][31]
|
|
1436
1448
|
|
|
1437
1449
|
#### Parameters
|
|
1438
1450
|
|
|
1439
|
-
- `url` **([string][
|
|
1451
|
+
- `url` **([string][9] | [RegExp][11])?** URL, regex or pattern for to match URL
|
|
1440
1452
|
- `handler` **[function][21]?** a function to process reques
|
|
1441
1453
|
|
|
1442
1454
|
### mockTraffic
|
|
@@ -1470,11 +1482,11 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1470
1482
|
|
|
1471
1483
|
#### Parameters
|
|
1472
1484
|
|
|
1473
|
-
- `locator` **([string][
|
|
1485
|
+
- `locator` **([string][9] | [object][6])** located by CSS|XPath|strict locator.
|
|
1474
1486
|
- `offsetX` **[number][20]** (optional, `0` by default) X-axis offset.
|
|
1475
1487
|
- `offsetY` **[number][20]** (optional, `0` by default) Y-axis offset.
|
|
1476
1488
|
|
|
1477
|
-
Returns **
|
|
1489
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1478
1490
|
|
|
1479
1491
|
### openNewTab
|
|
1480
1492
|
|
|
@@ -1484,7 +1496,7 @@ Open new tab and automatically switched to new tab
|
|
|
1484
1496
|
I.openNewTab();
|
|
1485
1497
|
```
|
|
1486
1498
|
|
|
1487
|
-
You can pass in [page options][
|
|
1499
|
+
You can pass in [page options][32] to emulate device on this page
|
|
1488
1500
|
|
|
1489
1501
|
```js
|
|
1490
1502
|
// enable mobile
|
|
@@ -1499,7 +1511,7 @@ I.openNewTab({ isMobile: true });
|
|
|
1499
1511
|
|
|
1500
1512
|
Presses a key in the browser (on a focused element).
|
|
1501
1513
|
|
|
1502
|
-
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][
|
|
1514
|
+
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][33].
|
|
1503
1515
|
|
|
1504
1516
|
```js
|
|
1505
1517
|
I.pressKey('Backspace');
|
|
@@ -1558,15 +1570,15 @@ Some of the supported key names are:
|
|
|
1558
1570
|
|
|
1559
1571
|
#### Parameters
|
|
1560
1572
|
|
|
1561
|
-
- `key` **([string][
|
|
1573
|
+
- `key` **([string][9] | [Array][10]<[string][9]>)** key or array of keys to press.
|
|
1562
1574
|
|
|
1563
|
-
Returns **
|
|
1575
|
+
Returns **void** automatically synchronized promise through #recorder_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313][34]).
|
|
1564
1576
|
|
|
1565
1577
|
### pressKeyDown
|
|
1566
1578
|
|
|
1567
1579
|
Presses a key in the browser and leaves it in a down state.
|
|
1568
1580
|
|
|
1569
|
-
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][
|
|
1581
|
+
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][35]).
|
|
1570
1582
|
|
|
1571
1583
|
```js
|
|
1572
1584
|
I.pressKeyDown('Control');
|
|
@@ -1576,15 +1588,15 @@ I.pressKeyUp('Control');
|
|
|
1576
1588
|
|
|
1577
1589
|
#### Parameters
|
|
1578
1590
|
|
|
1579
|
-
- `key` **[string][
|
|
1591
|
+
- `key` **[string][9]** name of key to press down.
|
|
1580
1592
|
|
|
1581
|
-
Returns **
|
|
1593
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1582
1594
|
|
|
1583
1595
|
### pressKeyUp
|
|
1584
1596
|
|
|
1585
1597
|
Releases a key in the browser which was previously set to a down state.
|
|
1586
1598
|
|
|
1587
|
-
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][
|
|
1599
|
+
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][35]).
|
|
1588
1600
|
|
|
1589
1601
|
```js
|
|
1590
1602
|
I.pressKeyDown('Control');
|
|
@@ -1594,9 +1606,9 @@ I.pressKeyUp('Control');
|
|
|
1594
1606
|
|
|
1595
1607
|
#### Parameters
|
|
1596
1608
|
|
|
1597
|
-
- `key` **[string][
|
|
1609
|
+
- `key` **[string][9]** name of key to release.
|
|
1598
1610
|
|
|
1599
|
-
Returns **
|
|
1611
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1600
1612
|
|
|
1601
1613
|
### refreshPage
|
|
1602
1614
|
|
|
@@ -1606,7 +1618,27 @@ Reload the current page.
|
|
|
1606
1618
|
I.refreshPage();
|
|
1607
1619
|
```
|
|
1608
1620
|
|
|
1609
|
-
Returns **
|
|
1621
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1622
|
+
|
|
1623
|
+
### replayFromHar
|
|
1624
|
+
|
|
1625
|
+
Replaying from HAR
|
|
1626
|
+
|
|
1627
|
+
```js
|
|
1628
|
+
// Replay API requests from HAR.
|
|
1629
|
+
// Either use a matching response from the HAR,
|
|
1630
|
+
// or abort the request if nothing matches.
|
|
1631
|
+
I.replayFromHar('./output/har/something.har', { url: "*/**/api/v1/fruits" });
|
|
1632
|
+
I.amOnPage('https://demo.playwright.dev/api-mocking');
|
|
1633
|
+
I.see('CodeceptJS');
|
|
1634
|
+
```
|
|
1635
|
+
|
|
1636
|
+
#### Parameters
|
|
1637
|
+
|
|
1638
|
+
- `harFilePath` **[string][9]** Path to recorded HAR file
|
|
1639
|
+
- `opts` **[object][6]?** [Options for replaying from HAR][36]
|
|
1640
|
+
|
|
1641
|
+
Returns **any** Promise<void>
|
|
1610
1642
|
|
|
1611
1643
|
### resizeWindow
|
|
1612
1644
|
|
|
@@ -1618,7 +1650,7 @@ First parameter can be set to `maximize`.
|
|
|
1618
1650
|
- `width` **[number][20]** width in pixels or `maximize`.
|
|
1619
1651
|
- `height` **[number][20]** height in pixels.
|
|
1620
1652
|
|
|
1621
|
-
Returns **
|
|
1653
|
+
Returns **void** automatically synchronized promise through #recorderUnlike other drivers Playwright changes the size of a viewport, not the window!
|
|
1622
1654
|
Playwright does not control the window of a browser so it can't adjust its real size.
|
|
1623
1655
|
It also can't maximize a window.Update configuration to change real window size on start:```js
|
|
1624
1656
|
// inside codecept.conf.js
|
|
@@ -1641,7 +1673,7 @@ I.restartBrowser({ permissions: ['clipboard-read', 'clipboard-write'] });
|
|
|
1641
1673
|
|
|
1642
1674
|
#### Parameters
|
|
1643
1675
|
|
|
1644
|
-
- `contextOptions` **[object][
|
|
1676
|
+
- `contextOptions` **[object][6]?** [Options for browser context][7] when starting new browser
|
|
1645
1677
|
|
|
1646
1678
|
### rightClick
|
|
1647
1679
|
|
|
@@ -1658,10 +1690,10 @@ I.rightClick('Click me', '.context');
|
|
|
1658
1690
|
|
|
1659
1691
|
#### Parameters
|
|
1660
1692
|
|
|
1661
|
-
- `locator` **([string][
|
|
1662
|
-
- `context` **([string][
|
|
1693
|
+
- `locator` **([string][9] | [object][6])** clickable element located by CSS|XPath|strict locator.
|
|
1694
|
+
- `context` **([string][9]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1663
1695
|
|
|
1664
|
-
Returns **
|
|
1696
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1665
1697
|
|
|
1666
1698
|
### saveElementScreenshot
|
|
1667
1699
|
|
|
@@ -1674,10 +1706,10 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1674
1706
|
|
|
1675
1707
|
#### Parameters
|
|
1676
1708
|
|
|
1677
|
-
- `locator` **([string][
|
|
1678
|
-
- `fileName` **[string][
|
|
1709
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1710
|
+
- `fileName` **[string][9]** file name to save.
|
|
1679
1711
|
|
|
1680
|
-
Returns **
|
|
1712
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1681
1713
|
|
|
1682
1714
|
### saveScreenshot
|
|
1683
1715
|
|
|
@@ -1692,10 +1724,10 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1692
1724
|
|
|
1693
1725
|
#### Parameters
|
|
1694
1726
|
|
|
1695
|
-
- `fileName` **[string][
|
|
1696
|
-
- `fullPage` **[boolean][
|
|
1727
|
+
- `fileName` **[string][9]** file name to save.
|
|
1728
|
+
- `fullPage` **[boolean][26]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1697
1729
|
|
|
1698
|
-
Returns **
|
|
1730
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1699
1731
|
|
|
1700
1732
|
### scrollPageToBottom
|
|
1701
1733
|
|
|
@@ -1705,7 +1737,7 @@ Scroll page to the bottom.
|
|
|
1705
1737
|
I.scrollPageToBottom();
|
|
1706
1738
|
```
|
|
1707
1739
|
|
|
1708
|
-
Returns **
|
|
1740
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1709
1741
|
|
|
1710
1742
|
### scrollPageToTop
|
|
1711
1743
|
|
|
@@ -1715,7 +1747,7 @@ Scroll page to the top.
|
|
|
1715
1747
|
I.scrollPageToTop();
|
|
1716
1748
|
```
|
|
1717
1749
|
|
|
1718
|
-
Returns **
|
|
1750
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1719
1751
|
|
|
1720
1752
|
### scrollTo
|
|
1721
1753
|
|
|
@@ -1729,11 +1761,11 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1729
1761
|
|
|
1730
1762
|
#### Parameters
|
|
1731
1763
|
|
|
1732
|
-
- `locator` **([string][
|
|
1764
|
+
- `locator` **([string][9] | [object][6])** located by CSS|XPath|strict locator.
|
|
1733
1765
|
- `offsetX` **[number][20]** (optional, `0` by default) X-axis offset.
|
|
1734
1766
|
- `offsetY` **[number][20]** (optional, `0` by default) Y-axis offset.
|
|
1735
1767
|
|
|
1736
|
-
Returns **
|
|
1768
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1737
1769
|
|
|
1738
1770
|
### see
|
|
1739
1771
|
|
|
@@ -1748,10 +1780,10 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1748
1780
|
|
|
1749
1781
|
#### Parameters
|
|
1750
1782
|
|
|
1751
|
-
- `text` **[string][
|
|
1752
|
-
- `context` **([string][
|
|
1783
|
+
- `text` **[string][9]** expected on page.
|
|
1784
|
+
- `context` **([string][9]? | [object][6])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1753
1785
|
|
|
1754
|
-
Returns **
|
|
1786
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1755
1787
|
|
|
1756
1788
|
### seeAttributesOnElements
|
|
1757
1789
|
|
|
@@ -1763,10 +1795,10 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1763
1795
|
|
|
1764
1796
|
#### Parameters
|
|
1765
1797
|
|
|
1766
|
-
- `locator` **([string][
|
|
1767
|
-
- `attributes` **[object][
|
|
1798
|
+
- `locator` **([string][9] | [object][6])** located by CSS|XPath|strict locator.
|
|
1799
|
+
- `attributes` **[object][6]** attributes and their values to check.
|
|
1768
1800
|
|
|
1769
|
-
Returns **
|
|
1801
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1770
1802
|
|
|
1771
1803
|
### seeCheckboxIsChecked
|
|
1772
1804
|
|
|
@@ -1780,9 +1812,9 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1780
1812
|
|
|
1781
1813
|
#### Parameters
|
|
1782
1814
|
|
|
1783
|
-
- `field` **([string][
|
|
1815
|
+
- `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
1784
1816
|
|
|
1785
|
-
Returns **
|
|
1817
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1786
1818
|
|
|
1787
1819
|
### seeCookie
|
|
1788
1820
|
|
|
@@ -1794,9 +1826,9 @@ I.seeCookie('Auth');
|
|
|
1794
1826
|
|
|
1795
1827
|
#### Parameters
|
|
1796
1828
|
|
|
1797
|
-
- `name` **[string][
|
|
1829
|
+
- `name` **[string][9]** cookie name.
|
|
1798
1830
|
|
|
1799
|
-
Returns **
|
|
1831
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1800
1832
|
|
|
1801
1833
|
### seeCssPropertiesOnElements
|
|
1802
1834
|
|
|
@@ -1808,10 +1840,10 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1808
1840
|
|
|
1809
1841
|
#### Parameters
|
|
1810
1842
|
|
|
1811
|
-
- `locator` **([string][
|
|
1812
|
-
- `cssProperties` **[object][
|
|
1843
|
+
- `locator` **([string][9] | [object][6])** located by CSS|XPath|strict locator.
|
|
1844
|
+
- `cssProperties` **[object][6]** object with CSS properties and their values to check.
|
|
1813
1845
|
|
|
1814
|
-
Returns **
|
|
1846
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1815
1847
|
|
|
1816
1848
|
### seeCurrentUrlEquals
|
|
1817
1849
|
|
|
@@ -1826,9 +1858,9 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1826
1858
|
|
|
1827
1859
|
#### Parameters
|
|
1828
1860
|
|
|
1829
|
-
- `url` **[string][
|
|
1861
|
+
- `url` **[string][9]** value to check.
|
|
1830
1862
|
|
|
1831
|
-
Returns **
|
|
1863
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1832
1864
|
|
|
1833
1865
|
### seeElement
|
|
1834
1866
|
|
|
@@ -1841,9 +1873,9 @@ I.seeElement('#modal');
|
|
|
1841
1873
|
|
|
1842
1874
|
#### Parameters
|
|
1843
1875
|
|
|
1844
|
-
- `locator` **([string][
|
|
1876
|
+
- `locator` **([string][9] | [object][6])** located by CSS|XPath|strict locator.
|
|
1845
1877
|
|
|
1846
|
-
Returns **
|
|
1878
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1847
1879
|
|
|
1848
1880
|
### seeElementInDOM
|
|
1849
1881
|
|
|
@@ -1856,9 +1888,9 @@ I.seeElementInDOM('#modal');
|
|
|
1856
1888
|
|
|
1857
1889
|
#### Parameters
|
|
1858
1890
|
|
|
1859
|
-
- `locator` **([string][
|
|
1891
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1860
1892
|
|
|
1861
|
-
Returns **
|
|
1893
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1862
1894
|
|
|
1863
1895
|
### seeInCurrentUrl
|
|
1864
1896
|
|
|
@@ -1870,9 +1902,9 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1870
1902
|
|
|
1871
1903
|
#### Parameters
|
|
1872
1904
|
|
|
1873
|
-
- `url` **[string][
|
|
1905
|
+
- `url` **[string][9]** a fragment to check
|
|
1874
1906
|
|
|
1875
|
-
Returns **
|
|
1907
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1876
1908
|
|
|
1877
1909
|
### seeInField
|
|
1878
1910
|
|
|
@@ -1888,10 +1920,10 @@ I.seeInField('#searchform input','Search');
|
|
|
1888
1920
|
|
|
1889
1921
|
#### Parameters
|
|
1890
1922
|
|
|
1891
|
-
- `field` **([string][
|
|
1892
|
-
- `value` **([string][
|
|
1923
|
+
- `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
1924
|
+
- `value` **([string][9] | [object][6])** value to check.
|
|
1893
1925
|
|
|
1894
|
-
Returns **
|
|
1926
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1895
1927
|
|
|
1896
1928
|
### seeInPopup
|
|
1897
1929
|
|
|
@@ -1904,9 +1936,9 @@ I.seeInPopup('Popup text');
|
|
|
1904
1936
|
|
|
1905
1937
|
#### Parameters
|
|
1906
1938
|
|
|
1907
|
-
- `text` **[string][
|
|
1939
|
+
- `text` **[string][9]** value to check.
|
|
1908
1940
|
|
|
1909
|
-
Returns **
|
|
1941
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1910
1942
|
|
|
1911
1943
|
### seeInSource
|
|
1912
1944
|
|
|
@@ -1918,9 +1950,9 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1918
1950
|
|
|
1919
1951
|
#### Parameters
|
|
1920
1952
|
|
|
1921
|
-
- `text` **[string][
|
|
1953
|
+
- `text` **[string][9]** value to check.
|
|
1922
1954
|
|
|
1923
|
-
Returns **
|
|
1955
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1924
1956
|
|
|
1925
1957
|
### seeInTitle
|
|
1926
1958
|
|
|
@@ -1932,9 +1964,9 @@ I.seeInTitle('Home Page');
|
|
|
1932
1964
|
|
|
1933
1965
|
#### Parameters
|
|
1934
1966
|
|
|
1935
|
-
- `text` **[string][
|
|
1967
|
+
- `text` **[string][9]** text value to check.
|
|
1936
1968
|
|
|
1937
|
-
Returns **
|
|
1969
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1938
1970
|
|
|
1939
1971
|
### seeNumberOfElements
|
|
1940
1972
|
|
|
@@ -1947,10 +1979,10 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1947
1979
|
|
|
1948
1980
|
#### Parameters
|
|
1949
1981
|
|
|
1950
|
-
- `locator` **([string][
|
|
1982
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1951
1983
|
- `num` **[number][20]** number of elements.
|
|
1952
1984
|
|
|
1953
|
-
Returns **
|
|
1985
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1954
1986
|
|
|
1955
1987
|
### seeNumberOfVisibleElements
|
|
1956
1988
|
|
|
@@ -1963,10 +1995,10 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1963
1995
|
|
|
1964
1996
|
#### Parameters
|
|
1965
1997
|
|
|
1966
|
-
- `locator` **([string][
|
|
1998
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1967
1999
|
- `num` **[number][20]** number of elements.
|
|
1968
2000
|
|
|
1969
|
-
Returns **
|
|
2001
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1970
2002
|
|
|
1971
2003
|
### seeTextEquals
|
|
1972
2004
|
|
|
@@ -1978,10 +2010,10 @@ I.seeTextEquals('text', 'h1');
|
|
|
1978
2010
|
|
|
1979
2011
|
#### Parameters
|
|
1980
2012
|
|
|
1981
|
-
- `text` **[string][
|
|
1982
|
-
- `context` **([string][
|
|
2013
|
+
- `text` **[string][9]** element value to check.
|
|
2014
|
+
- `context` **([string][9] | [object][6])?** element located by CSS|XPath|strict locator.
|
|
1983
2015
|
|
|
1984
|
-
Returns **
|
|
2016
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1985
2017
|
|
|
1986
2018
|
### seeTitleEquals
|
|
1987
2019
|
|
|
@@ -1993,9 +2025,9 @@ I.seeTitleEquals('Test title.');
|
|
|
1993
2025
|
|
|
1994
2026
|
#### Parameters
|
|
1995
2027
|
|
|
1996
|
-
- `text` **[string][
|
|
2028
|
+
- `text` **[string][9]** value to check.
|
|
1997
2029
|
|
|
1998
|
-
Returns **
|
|
2030
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1999
2031
|
|
|
2000
2032
|
### seeTraffic
|
|
2001
2033
|
|
|
@@ -2030,14 +2062,14 @@ await I.seeTraffic({
|
|
|
2030
2062
|
|
|
2031
2063
|
#### Parameters
|
|
2032
2064
|
|
|
2033
|
-
- `opts` **[Object][
|
|
2034
|
-
- `opts.name` **[string][
|
|
2035
|
-
- `opts.url` **[string][
|
|
2036
|
-
- `opts.parameters` **[Object][
|
|
2037
|
-
- `opts.requestPostData` **[Object][
|
|
2065
|
+
- `opts` **[Object][6]** options when checking the traffic network.
|
|
2066
|
+
- `opts.name` **[string][9]** A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
|
|
2067
|
+
- `opts.url` **[string][9]** Expected URL of request in network traffic
|
|
2068
|
+
- `opts.parameters` **[Object][6]?** Expected parameters of that request in network traffic
|
|
2069
|
+
- `opts.requestPostData` **[Object][6]?** Expected that request contains post data in network traffic
|
|
2038
2070
|
- `opts.timeout` **[number][20]?** Timeout to wait for request in seconds. Default is 10 seconds.
|
|
2039
2071
|
|
|
2040
|
-
Returns **[Promise][
|
|
2072
|
+
Returns **[Promise][22]<any>**
|
|
2041
2073
|
|
|
2042
2074
|
### selectOption
|
|
2043
2075
|
|
|
@@ -2062,10 +2094,10 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
2062
2094
|
|
|
2063
2095
|
#### Parameters
|
|
2064
2096
|
|
|
2065
|
-
- `select` **([string][
|
|
2066
|
-
- `option` **([string][
|
|
2097
|
+
- `select` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
2098
|
+
- `option` **([string][9] | [Array][10]<any>)** visible text or value of option.
|
|
2067
2099
|
|
|
2068
|
-
Returns **
|
|
2100
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2069
2101
|
|
|
2070
2102
|
### setCookie
|
|
2071
2103
|
|
|
@@ -2087,7 +2119,7 @@ I.setCookie([
|
|
|
2087
2119
|
|
|
2088
2120
|
- `cookie` **(Cookie | [Array][10]<Cookie>)** a cookie object or array of cookie objects.
|
|
2089
2121
|
|
|
2090
|
-
Returns **
|
|
2122
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2091
2123
|
|
|
2092
2124
|
### setPlaywrightRequestHeaders
|
|
2093
2125
|
|
|
@@ -2101,7 +2133,7 @@ I.setPlaywrightRequestHeaders({
|
|
|
2101
2133
|
|
|
2102
2134
|
#### Parameters
|
|
2103
2135
|
|
|
2104
|
-
- `customHeaders` **[object][
|
|
2136
|
+
- `customHeaders` **[object][6]** headers to set
|
|
2105
2137
|
|
|
2106
2138
|
### startRecordingTraffic
|
|
2107
2139
|
|
|
@@ -2136,7 +2168,7 @@ If no handler is passed, all mock requests for the rote are disabled.
|
|
|
2136
2168
|
|
|
2137
2169
|
#### Parameters
|
|
2138
2170
|
|
|
2139
|
-
- `url` **([string][
|
|
2171
|
+
- `url` **([string][9] | [RegExp][11])?** URL, regex or pattern for to match URL
|
|
2140
2172
|
- `handler` **[function][21]?** a function to process reques
|
|
2141
2173
|
|
|
2142
2174
|
### stopRecordingTraffic
|
|
@@ -2166,9 +2198,9 @@ I.switchTo(); // switch back to main page
|
|
|
2166
2198
|
|
|
2167
2199
|
#### Parameters
|
|
2168
2200
|
|
|
2169
|
-
- `locator` **([string][
|
|
2201
|
+
- `locator` **([string][9]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
2170
2202
|
|
|
2171
|
-
Returns **
|
|
2203
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2172
2204
|
|
|
2173
2205
|
### switchToNextTab
|
|
2174
2206
|
|
|
@@ -2200,7 +2232,7 @@ I.switchToPreviousTab(2);
|
|
|
2200
2232
|
|
|
2201
2233
|
Types out the given text into an active field.
|
|
2202
2234
|
To slow down typing use a second parameter, to set interval between key presses.
|
|
2203
|
-
_Note:_ Should be used when [`fillField`][
|
|
2235
|
+
_Note:_ Should be used when [`fillField`][33] is not an option.
|
|
2204
2236
|
|
|
2205
2237
|
```js
|
|
2206
2238
|
// passing in a string
|
|
@@ -2220,9 +2252,9 @@ I.type(secret('123456'));
|
|
|
2220
2252
|
|
|
2221
2253
|
- `keys`
|
|
2222
2254
|
- `delay` **[number][20]?** (optional) delay in ms between key presses
|
|
2223
|
-
- `key` **([string][
|
|
2255
|
+
- `key` **([string][9] | [Array][10]<[string][9]>)** or array of keys to type.
|
|
2224
2256
|
|
|
2225
|
-
Returns **
|
|
2257
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2226
2258
|
|
|
2227
2259
|
### uncheckOption
|
|
2228
2260
|
|
|
@@ -2239,11 +2271,11 @@ I.uncheckOption('agree', '//form');
|
|
|
2239
2271
|
|
|
2240
2272
|
#### Parameters
|
|
2241
2273
|
|
|
2242
|
-
- `field` **([string][
|
|
2243
|
-
- `context` **([string][
|
|
2274
|
+
- `field` **([string][9] | [object][6])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
2275
|
+
- `context` **([string][9]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2244
2276
|
- `options`
|
|
2245
2277
|
|
|
2246
|
-
Returns **
|
|
2278
|
+
Returns **void** automatically synchronized promise through #recorder[Additional options][37] for uncheck available as 3rd argument.Examples:```js
|
|
2247
2279
|
// click on element at position
|
|
2248
2280
|
I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
|
|
2249
2281
|
```> ⚠️ To avoid flakiness, option `force: true` is set by default
|
|
@@ -2255,7 +2287,7 @@ Use Playwright API inside a test.
|
|
|
2255
2287
|
First argument is a description of an action.
|
|
2256
2288
|
Second argument is async function that gets this helper as parameter.
|
|
2257
2289
|
|
|
2258
|
-
{ [`page`][
|
|
2290
|
+
{ [`page`][38], [`browserContext`][39] [`browser`][40] } objects from Playwright API are available.
|
|
2259
2291
|
|
|
2260
2292
|
```js
|
|
2261
2293
|
I.usePlaywrightTo('emulate offline mode', async ({ browserContext }) => {
|
|
@@ -2265,7 +2297,7 @@ I.usePlaywrightTo('emulate offline mode', async ({ browserContext }) => {
|
|
|
2265
2297
|
|
|
2266
2298
|
#### Parameters
|
|
2267
2299
|
|
|
2268
|
-
- `description` **[string][
|
|
2300
|
+
- `description` **[string][9]** used to show in logs.
|
|
2269
2301
|
- `fn` **[function][21]** async function that executed with Playwright helper as argumen
|
|
2270
2302
|
|
|
2271
2303
|
### wait
|
|
@@ -2280,7 +2312,7 @@ I.wait(2); // wait 2 secs
|
|
|
2280
2312
|
|
|
2281
2313
|
- `sec` **[number][20]** number of second to wait.
|
|
2282
2314
|
|
|
2283
|
-
Returns **
|
|
2315
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2284
2316
|
|
|
2285
2317
|
### waitForClickable
|
|
2286
2318
|
|
|
@@ -2294,11 +2326,11 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
2294
2326
|
|
|
2295
2327
|
#### Parameters
|
|
2296
2328
|
|
|
2297
|
-
- `locator` **([string][
|
|
2329
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2298
2330
|
- `waitTimeout`
|
|
2299
2331
|
- `sec` **[number][20]?** (optional, `1` by default) time in seconds to wait
|
|
2300
2332
|
|
|
2301
|
-
Returns **
|
|
2333
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2302
2334
|
|
|
2303
2335
|
### waitForDetached
|
|
2304
2336
|
|
|
@@ -2311,10 +2343,10 @@ I.waitForDetached('#popup');
|
|
|
2311
2343
|
|
|
2312
2344
|
#### Parameters
|
|
2313
2345
|
|
|
2314
|
-
- `locator` **([string][
|
|
2346
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2315
2347
|
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2316
2348
|
|
|
2317
|
-
Returns **
|
|
2349
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2318
2350
|
|
|
2319
2351
|
### waitForElement
|
|
2320
2352
|
|
|
@@ -2328,10 +2360,10 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
2328
2360
|
|
|
2329
2361
|
#### Parameters
|
|
2330
2362
|
|
|
2331
|
-
- `locator` **([string][
|
|
2363
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2332
2364
|
- `sec` **[number][20]?** (optional, `1` by default) time in seconds to wait
|
|
2333
2365
|
|
|
2334
|
-
Returns **
|
|
2366
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2335
2367
|
|
|
2336
2368
|
### waitForEnabled
|
|
2337
2369
|
|
|
@@ -2340,10 +2372,10 @@ Element can be located by CSS or XPath.
|
|
|
2340
2372
|
|
|
2341
2373
|
#### Parameters
|
|
2342
2374
|
|
|
2343
|
-
- `locator` **([string][
|
|
2375
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2344
2376
|
- `sec` **[number][20]** (optional) time in seconds to wait, 1 by default.
|
|
2345
2377
|
|
|
2346
|
-
Returns **
|
|
2378
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2347
2379
|
|
|
2348
2380
|
### waitForFunction
|
|
2349
2381
|
|
|
@@ -2362,11 +2394,11 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
2362
2394
|
|
|
2363
2395
|
#### Parameters
|
|
2364
2396
|
|
|
2365
|
-
- `fn` **([string][
|
|
2397
|
+
- `fn` **([string][9] | [function][21])** to be executed in browser context.
|
|
2366
2398
|
- `argsOrSec` **([Array][10]<any> | [number][20])?** (optional, `1` by default) arguments for function or seconds.
|
|
2367
2399
|
- `sec` **[number][20]?** (optional, `1` by default) time in seconds to wait
|
|
2368
2400
|
|
|
2369
|
-
Returns **
|
|
2401
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2370
2402
|
|
|
2371
2403
|
### waitForInvisible
|
|
2372
2404
|
|
|
@@ -2379,16 +2411,16 @@ I.waitForInvisible('#popup');
|
|
|
2379
2411
|
|
|
2380
2412
|
#### Parameters
|
|
2381
2413
|
|
|
2382
|
-
- `locator` **([string][
|
|
2414
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2383
2415
|
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2384
2416
|
|
|
2385
|
-
Returns **
|
|
2417
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2386
2418
|
|
|
2387
2419
|
### waitForNavigation
|
|
2388
2420
|
|
|
2389
2421
|
Waits for navigation to finish. By default, it takes configured `waitForNavigation` option.
|
|
2390
2422
|
|
|
2391
|
-
See [Playwright's reference][
|
|
2423
|
+
See [Playwright's reference][41]
|
|
2392
2424
|
|
|
2393
2425
|
#### Parameters
|
|
2394
2426
|
|
|
@@ -2405,7 +2437,7 @@ I.waitForRequest(request => request.url() === 'http://example.com' && request.me
|
|
|
2405
2437
|
|
|
2406
2438
|
#### Parameters
|
|
2407
2439
|
|
|
2408
|
-
- `urlOrPredicate` **([string][
|
|
2440
|
+
- `urlOrPredicate` **([string][9] | [function][21])**
|
|
2409
2441
|
- `sec` **[number][20]?** seconds to wait
|
|
2410
2442
|
|
|
2411
2443
|
### waitForResponse
|
|
@@ -2419,7 +2451,7 @@ I.waitForResponse(response => response.url() === 'https://example.com' && respon
|
|
|
2419
2451
|
|
|
2420
2452
|
#### Parameters
|
|
2421
2453
|
|
|
2422
|
-
- `urlOrPredicate` **([string][
|
|
2454
|
+
- `urlOrPredicate` **([string][9] | [function][21])**
|
|
2423
2455
|
- `sec` **[number][20]?** number of seconds to wait
|
|
2424
2456
|
|
|
2425
2457
|
### waitForText
|
|
@@ -2435,21 +2467,21 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2435
2467
|
|
|
2436
2468
|
#### Parameters
|
|
2437
2469
|
|
|
2438
|
-
- `text` **[string][
|
|
2470
|
+
- `text` **[string][9]** to wait for.
|
|
2439
2471
|
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2440
|
-
- `context` **([string][
|
|
2472
|
+
- `context` **([string][9] | [object][6])?** (optional) element located by CSS|XPath|strict locator.
|
|
2441
2473
|
|
|
2442
|
-
Returns **
|
|
2474
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2443
2475
|
|
|
2444
2476
|
### waitForURL
|
|
2445
2477
|
|
|
2446
2478
|
Waits for page navigates to a new URL or reloads. By default, it takes configured `waitForNavigation` option.
|
|
2447
2479
|
|
|
2448
|
-
See [Playwright's reference][
|
|
2480
|
+
See [Playwright's reference][42]
|
|
2449
2481
|
|
|
2450
2482
|
#### Parameters
|
|
2451
2483
|
|
|
2452
|
-
- `url` **([string][
|
|
2484
|
+
- `url` **([string][9] | [RegExp][11])** A glob pattern, regex pattern or predicate receiving URL to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string.
|
|
2453
2485
|
- `options` **any**
|
|
2454
2486
|
|
|
2455
2487
|
### waitForValue
|
|
@@ -2462,11 +2494,11 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2462
2494
|
|
|
2463
2495
|
#### Parameters
|
|
2464
2496
|
|
|
2465
|
-
- `field` **([string][
|
|
2466
|
-
- `value` **[string][
|
|
2497
|
+
- `field` **([string][9] | [object][6])** input field.
|
|
2498
|
+
- `value` **[string][9]** expected value.
|
|
2467
2499
|
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2468
2500
|
|
|
2469
|
-
Returns **
|
|
2501
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2470
2502
|
|
|
2471
2503
|
### waitForVisible
|
|
2472
2504
|
|
|
@@ -2479,10 +2511,10 @@ I.waitForVisible('#popup');
|
|
|
2479
2511
|
|
|
2480
2512
|
#### Parameters
|
|
2481
2513
|
|
|
2482
|
-
- `locator` **([string][
|
|
2514
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2483
2515
|
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2484
2516
|
|
|
2485
|
-
Returns **
|
|
2517
|
+
Returns **void** automatically synchronized promise through #recorderThis method accepts [React selectors][43].
|
|
2486
2518
|
|
|
2487
2519
|
### waitInUrl
|
|
2488
2520
|
|
|
@@ -2494,10 +2526,10 @@ I.waitInUrl('/info', 2);
|
|
|
2494
2526
|
|
|
2495
2527
|
#### Parameters
|
|
2496
2528
|
|
|
2497
|
-
- `urlPart` **[string][
|
|
2529
|
+
- `urlPart` **[string][9]** value to check.
|
|
2498
2530
|
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2499
2531
|
|
|
2500
|
-
Returns **
|
|
2532
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2501
2533
|
|
|
2502
2534
|
### waitNumberOfVisibleElements
|
|
2503
2535
|
|
|
@@ -2509,11 +2541,11 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2509
2541
|
|
|
2510
2542
|
#### Parameters
|
|
2511
2543
|
|
|
2512
|
-
- `locator` **([string][
|
|
2544
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2513
2545
|
- `num` **[number][20]** number of elements.
|
|
2514
2546
|
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2515
2547
|
|
|
2516
|
-
Returns **
|
|
2548
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2517
2549
|
|
|
2518
2550
|
### waitToHide
|
|
2519
2551
|
|
|
@@ -2526,10 +2558,10 @@ I.waitToHide('#popup');
|
|
|
2526
2558
|
|
|
2527
2559
|
#### Parameters
|
|
2528
2560
|
|
|
2529
|
-
- `locator` **([string][
|
|
2561
|
+
- `locator` **([string][9] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2530
2562
|
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2531
2563
|
|
|
2532
|
-
Returns **
|
|
2564
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2533
2565
|
|
|
2534
2566
|
### waitUrlEquals
|
|
2535
2567
|
|
|
@@ -2542,28 +2574,28 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2542
2574
|
|
|
2543
2575
|
#### Parameters
|
|
2544
2576
|
|
|
2545
|
-
- `urlPart` **[string][
|
|
2577
|
+
- `urlPart` **[string][9]** value to check.
|
|
2546
2578
|
- `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
|
|
2547
2579
|
|
|
2548
|
-
Returns **
|
|
2580
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
2549
2581
|
|
|
2550
2582
|
[1]: https://github.com/microsoft/playwright
|
|
2551
2583
|
|
|
2552
2584
|
[2]: https://playwright.dev/docs/next/api/class-browser#browser-new-context
|
|
2553
2585
|
|
|
2554
|
-
[3]: https://playwright.dev/docs/api/class-
|
|
2586
|
+
[3]: https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har
|
|
2555
2587
|
|
|
2556
|
-
[4]: https://
|
|
2588
|
+
[4]: https://playwright.dev/docs/api/class-browsertype#browsertypeconnectparams
|
|
2557
2589
|
|
|
2558
|
-
[5]: https://
|
|
2590
|
+
[5]: https://github.com/microsoft/playwright/blob/v0.11.0/docs/api.md#working-with-chrome-extensions
|
|
2559
2591
|
|
|
2560
|
-
[6]: https://
|
|
2592
|
+
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
2561
2593
|
|
|
2562
|
-
[7]:
|
|
2594
|
+
[7]: https://playwright.dev/docs/api/class-browser#browser-new-context
|
|
2563
2595
|
|
|
2564
|
-
[8]:
|
|
2596
|
+
[8]: http://jster.net/category/windows-modals-popups
|
|
2565
2597
|
|
|
2566
|
-
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
2598
|
+
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
2567
2599
|
|
|
2568
2600
|
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
2569
2601
|
|
|
@@ -2589,52 +2621,56 @@ Returns **[Promise][9]<void>** automatically synchronized promise through #re
|
|
|
2589
2621
|
|
|
2590
2622
|
[21]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
2591
2623
|
|
|
2592
|
-
[22]: https://
|
|
2624
|
+
[22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2625
|
+
|
|
2626
|
+
[23]: https://playwright.dev/docs/api/class-locator#locator-focus
|
|
2627
|
+
|
|
2628
|
+
[24]: https://playwright.dev/docs/api/class-consolemessage
|
|
2593
2629
|
|
|
2594
|
-
[
|
|
2630
|
+
[25]: https://playwright.dev/docs/api/class-locator#locator-is-checked
|
|
2595
2631
|
|
|
2596
|
-
[
|
|
2632
|
+
[26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
2597
2633
|
|
|
2598
|
-
[
|
|
2634
|
+
[27]: https://playwright.dev/docs/api/class-locator#locator-is-disabled
|
|
2599
2635
|
|
|
2600
|
-
[
|
|
2636
|
+
[28]: https://codecept.io/helpers/FileSystem
|
|
2601
2637
|
|
|
2602
|
-
[
|
|
2638
|
+
[29]: https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get
|
|
2603
2639
|
|
|
2604
|
-
[
|
|
2640
|
+
[30]: https://playwright.dev/docs/api/class-browsercontext#browser-context-route
|
|
2605
2641
|
|
|
2606
|
-
[
|
|
2642
|
+
[31]: https://playwright.dev/docs/network#handle-requests
|
|
2607
2643
|
|
|
2608
|
-
[
|
|
2644
|
+
[32]: https://github.com/microsoft/playwright/blob/main/docs/api.md#browsernewpageoptions
|
|
2609
2645
|
|
|
2610
|
-
[
|
|
2646
|
+
[33]: #fillfield
|
|
2611
2647
|
|
|
2612
|
-
[
|
|
2648
|
+
[34]: https://github.com/GoogleChrome/puppeteer/issues/1313
|
|
2613
2649
|
|
|
2614
|
-
[
|
|
2650
|
+
[35]: #click
|
|
2615
2651
|
|
|
2616
|
-
[
|
|
2652
|
+
[36]: https://playwright.dev/docs/api/class-page#page-route-from-har
|
|
2617
2653
|
|
|
2618
|
-
[
|
|
2654
|
+
[37]: https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck
|
|
2619
2655
|
|
|
2620
|
-
[
|
|
2656
|
+
[38]: https://github.com/microsoft/playwright/blob/main/docs/src/api/class-page.md
|
|
2621
2657
|
|
|
2622
|
-
[
|
|
2658
|
+
[39]: https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browsercontext.md
|
|
2623
2659
|
|
|
2624
|
-
[
|
|
2660
|
+
[40]: https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browser.md
|
|
2625
2661
|
|
|
2626
|
-
[
|
|
2662
|
+
[41]: https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions
|
|
2627
2663
|
|
|
2628
|
-
[
|
|
2664
|
+
[42]: https://playwright.dev/docs/api/class-page#page-wait-for-url
|
|
2629
2665
|
|
|
2630
|
-
[
|
|
2666
|
+
[43]: https://codecept.io/react
|
|
2631
2667
|
|
|
2632
|
-
[
|
|
2668
|
+
[44]: https://playwright.dev/docs/api/class-browsercontext
|
|
2633
2669
|
|
|
2634
|
-
[
|
|
2670
|
+
[45]: https://playwright.dev/docs/api/class-page#page-set-default-timeout
|
|
2635
2671
|
|
|
2636
|
-
[
|
|
2672
|
+
[46]: https://playwright.dev/docs/trace-viewer
|
|
2637
2673
|
|
|
2638
|
-
[
|
|
2674
|
+
[47]: https://playwright.dev/docs/browsers/#google-chrome--microsoft-edge
|
|
2639
2675
|
|
|
2640
|
-
[
|
|
2676
|
+
[48]: https://playwright.dev/docs/api/class-consolemessage#console-message-type
|