[Feature]: Support compression effort option for WebP screenshots and visual regression
I maintainer di solito rispondono entro 1 giorno
@yury-s ci sta già lavorando.
Dal 5/10/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript, wasm
- Ambito
- testing-qa
Direzione di ricerca
Start by tracing WebP encoding for page.screenshot(), locator.screenshot(), and expect(page).toHaveScreenshot(), including the playwright.config.ts expect settings and bundled libwebp WASM module. Done means all listed APIs accept an integer effort from 0 to 6 with a default of 0, and lossless screenshots remain pixel-identical while supporting the requested compression setting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🚀 Feature Request
Add an effort option (integer from 0 to 6, defaulting to 0) for WebP screenshots across:
-
page.screenshot() -
locator.screenshot() -
expect(page).toHaveScreenshot()- Per assertion
- Via
playwright.config.ts
Example
playwright.config.ts
import { defineConfig } from '@playwright/test';
export default defineConfig({
expect: {
toHaveScreenshot: {
type: 'webp',
effort: 4, // Baseline snapshots encoded with method 4
},
},
});
Per screenshot / assertion
// Direct screenshot
await page.screenshot({
path: 'snapshot.webp',
type: 'webp',
effort: 6,
});
// Visual regression
await expect(page).toHaveScreenshot('landing.webp', {
effort: 4,
});
Motivation
WebP is already supported in Playwright for both direct screenshots and visual regression snapshots (toHaveScreenshot()). Lossless WebP snapshots can provide 20–30%+ file size reductions compared to PNG.
In libwebp, the compression effort (method, range 0–6) controls how intensively the encoder searches for spatial and entropy redundancies.
Because the compression is strictly lossless:
effort: 0andeffort: 6produce 100% pixel-identical RGBA buffers.effort: 0encodes quickly with minimal CPU usage, making it suitable for test-run screenshots and comparisons.effort: 4–6can significantly reduce file size, making it suitable for baseline/golden files committed to Git repositories.
Currently, Playwright's bundled libwebp WASM module does not expose the method parameter.
Adding this option would allow users to:
- Store smaller WebP baseline snapshots in their repositories and reduce repository bloat.
- Keep CI runs fast by generating comparison screenshots with
effort: 0while validating against high-effort baselines with zero pixel difference.
- Lingua principale
- TypeScript
- Stelle
- 100k
- Fork
- 6.9k
- Merge medio
- 16h 8m
- PR unite (30g)
- 281
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/playwright
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
microsoft/playwright#44289 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-triage-done
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/playwright#44264 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] WebKit keeps every removed iframe's JS heap alive (memory grows until the page crashes)Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
microsoft/playwright#44290 ·
I maintainer di solito rispondono entro 1 giorno
-
[Regression]: requestFullscreen() in a popup rejects with "not granted" in 1.65 (Chromium 159)Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
microsoft/playwright#44288 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: page.goto never returns for a load started as a newer service worker takes over (Chromium)Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
microsoft/playwright#44287 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/playwright
Issue simili
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
openclaw/openclaw#203385 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nwverse/persona#12800 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 Mezza giornata Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
WISE-Community/WISE-Client#2404 ·
I maintainer di solito rispondono entro 1 giorno