Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: document TestOptions.video.size (#10827)

Dmitry Gozman897e41c6c150
diff --git a/docs/src/test-api/class-testoptions.md b/docs/src/test-api/class-testoptions.md
index cee9bc653f..aa802418fc 100644
--- a/docs/src/test-api/class-testoptions.md
+++ b/docs/src/test-api/class-testoptions.md
@@ -199,6 +199,8 @@ Whether to record video for each test. Defaults to `'off'`.
* `'retain-on-failure'`: Record video for each test, but remove all videos from successful test runs.
* `'on-first-retry'`: Record video only when retrying a test for the first time.
+If video size is not specified, it will be equal to [`property: TestOptions.viewport`] scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size.
+
Learn more about [recording video](./test-configuration.md#record-video).
## property: TestOptions.viewport = %%-context-option-viewport-%%
diff --git a/packages/playwright-test/types/test.d.ts b/packages/playwright-test/types/test.d.ts
index b81bad1b4e..13ec5f45d2 100644
--- a/packages/playwright-test/types/test.d.ts
+++ b/packages/playwright-test/types/test.d.ts
@@ -2730,6 +2730,11 @@ export interface PlaywrightWorkerOptions {
* - `'retain-on-failure'`: Record video for each test, but remove all videos from successful test runs.
* - `'on-first-retry'`: Record video only when retrying a test for the first time.
*
+ * If video size is not specified, it will be equal to
+ * [testOptions.viewport](https://playwright.dev/docs/api/class-testoptions#test-options-viewport) scaled down to fit into
+ * 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will
+ * be scaled down if necessary to fit the specified size.
+ *
* Learn more about [recording video](https://playwright.dev/docs/test-configuration#record-video).
*/
video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize };