[Feature]: Support compression effort option for WebP screenshots and visual regression
Maintainer thường phản hồi trong vòng 1 ngày
@yury-s đang làm issue này rồi.
Từ ngày 5/10/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript, wasm
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🚀 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.
- Ngôn ngữ chính
- TypeScript
- Star
- 100k
- Fork
- 6.9k
- Merge trung bình
- 16 giờ 8 phút
- Pull request đã merge (30 ngày)
- 281
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/playwright
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/playwright#44289 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-triage-done
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/playwright#44264 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] WebKit keeps every removed iframe's JS heap alive (memory grows until the page crashes)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
microsoft/playwright#44290 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Regression]: requestFullscreen() in a popup rejects with "not granted" in 1.65 (Chromium 159)Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
microsoft/playwright#44288 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: page.goto never returns for a load started as a newer service worker takes over (Chromium)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
microsoft/playwright#44287 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/playwright
Issue tương tự
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
openclaw/openclaw#203385 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nwverse/persona#12800 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
WISE-Community/WISE-Client#2404 ·
Maintainer thường phản hồi trong vòng 1 ngày