Prompt
I'm building a test suite that needs screenshots, traces, and videos on failure
Latest observation
Oct 26, 2026
OpenAI APIWeb search: off
If you’re using Playwright, the usual setup is to enable screenshot, trace, and video capture only when a test fails.
In playwright.config.ts
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
screenshot: 'only-on-failure',
trace: 'on-first-retry',
video: 'retain-on-failure',
},
});
What these options do
screenshot: 'only-on-failure'
Saves a screenshot when a test fails.trace: 'on-first-retry'
Records a trace for the first retry of a failing test.video: 'retain-on-failure'
Keeps the video only for failed tests.
Notes
- If you want traces for every failing test immediately, use:
trace: 'retain-on-failure' - If you want videos for all tests, use:
video: 'on'
If you want, I can also show you how to attach these artifacts to your CI reports or configure this in Jest/Cypress instead.
Brands