{
  "slug": "playwright-screenshots-support-webp-snapshots-0a3412526edd",
  "title": "Playwright screenshots support WebP snapshots",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-07-24T21:55:03.000Z",
  "announced_at": "2026-07-24T21:55:03.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When storing visual comparison snapshots or standalone screenshots as WebP in Playwright v1.62.0, use a `.webp` snapshot name or screenshot path; for standalone screenshots, optionally set `type: 'webp'` and `quality` below 100 for lossy compression.",
    "examples": [
      "await expect(page).toHaveScreenshot('homepage.webp');",
      "await expect(locator).toHaveScreenshot('image.webp');",
      "await page.screenshot({ path: 'homepage.webp', quality: 50 });"
    ],
    "gotchas": [
      "Version: v1.62.0",
      "name (required): Snapshot name; `.webp` selects WebP format. Both PNG and WebP snapshots are lossless.",
      "path: Output file path; screenshot type is inferred from its extension. A `.webp` path selects WebP.",
      "type: Screenshot type; accepts `png`, `jpeg`, or `webp`. Defaults to `png`.",
      "quality: Image quality from 0 to 100. For WebP, 100 (default) is lossless; lower values use lossy compression.",
      "Prerequisite: Screenshot assertions work only with the Playwright test runner.",
      "Visual comparisons store the golden snapshot as lossless WebP.",
      "Standalone screenshots can use lossy WebP; quality `100` is lossless by default and lower values use lossy compression."
    ]
  },
  "why_it_matters": "Store visual comparison snapshots or standalone screenshots as WebP in a test workflow.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.62.0",
    "https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1",
    "https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-screenshot-1",
    "https://playwright.dev/docs/api/class-page#page-screenshot"
  ],
  "rank": 0.9703,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-48c92cac04e84aed-2:gate",
    "evidence_hash": "b17276139b84e8e6a01d64416d3a7c27f07ddffc91b7a327300bf595585d287e"
  },
  "review": {
    "draft_hash": "dd4ead68e2c19e1eb4dbee039e84d69b3ce1014951613796e047fd304ea5f4a8",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.72 (>= 0.6 needed)."
  }
}
