Playwright screenshot assertions can store unnamed screenshots as WebP
Introduced 2026-10-07 · score 0.97
HOW TO USE IT
When you want unnamed `toHaveScreenshot` snapshots stored as WebP, set `expect.toHaveScreenshot.type` to `'webp'` in the Playwright test configuration.
export default defineConfig({
expect: {
toHaveScreenshot: { type: 'webp' },
},
});WHY THIS HELPS
Configure screenshot assertions to store unnamed screenshots as WebP.
REQUIREMENTS AND LIMITATIONS
- Version: v1.64.0
- expect.toHaveScreenshot.type: Set to `'webp'` to store unnamed screenshots as WebP.
- The option stores unnamed screenshots as WebP.
FIRST-PARTY EVIDENCE
- https://github.com/microsoft/playwright/releases/tag/v1.64.0
- https://playwright.dev/docs/next/release-notes
Check the installed version and the source before using it. Entry JSON