sincecutoff.com
← all changes

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

Check the installed version and the source before using it. Entry JSON

Report a problem with this card