Playwright testOptions.video adds trace-aligned recording modes
Introduced 2026-06-15 · score 0.94
HOW TO USE IT
When configuring test video retention to follow a run’s recording policy, set `video` in the Playwright Test `use` config to one of the three modes below. Choose its recording and retention behavior from the video modes table.
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
video: 'on-all-retries', // or 'retain-on-first-failure' or 'retain-on-failure-and-retries'
},
});WHY THIS HELPS
Configure test video retention to match the trace recording and retention policy used by a test run.
REQUIREMENTS AND LIMITATIONS
- Version: v1.61.0
- video: Recording mode. `on-all-retries` records and keeps video for every retry; `retain-on-first-failure` records only the first run and keeps it if that run failed; `retain-on-failure-and-retries` records every run and keeps it when that run failed or was a retry.
FIRST-PARTY EVIDENCE
- https://github.com/microsoft/playwright/releases/tag/v1.61.0
- https://playwright.dev/docs/api/class-testoptions#test-options-video
- https://playwright.dev/docs/test-use-options#video-modes
Check the installed version and the source before using it. Entry JSON