docs: add videos to verification doc (#4071)
* docs: add videos to verification doc * review changes
This commit is contained in:
parent
ad58e49201
commit
aafe5dac0d
|
|
@ -1,6 +1,7 @@
|
|||
# Verification
|
||||
|
||||
<!-- GEN:toc-top-level -->
|
||||
- [Videos](#videos)
|
||||
- [Screenshots](#screenshots)
|
||||
- [Console logs](#console-logs)
|
||||
- [Page errors](#page-errors)
|
||||
|
|
@ -9,6 +10,30 @@
|
|||
|
||||
<br/>
|
||||
|
||||
## Videos
|
||||
|
||||
Playwright can record videos for all pages in a [browser context](core-concepts.md#browser-contexts).
|
||||
|
||||
```js
|
||||
// With browser.newContext()
|
||||
const context = await browser.newContext({ videosPath: 'videos/' });
|
||||
|
||||
// With browser.newPage()
|
||||
const page = await browser.newPage({ videosPath: 'videos/' });
|
||||
|
||||
// [Optional] Specify video size; defaults to viewport size
|
||||
const context = await browser.newContext({
|
||||
videosPath: 'videos/',
|
||||
videoSize: { width: 800, height: 600 }
|
||||
});
|
||||
```
|
||||
|
||||
#### API reference
|
||||
|
||||
- [class `BrowserContext`](./api.md#class-browsercontext)
|
||||
- [browser.newContext([options])](./api.md#browsernewcontextoptions)
|
||||
- [browser.newPage([options])](./api.md#browsernewpageoptions)
|
||||
|
||||
## Screenshots
|
||||
|
||||
```js
|
||||
|
|
|
|||
Loading…
Reference in a new issue