pytest-playwright-visual
A pytest fixture for visual testing with Playwright
Decision gist · record as of 2026-08-14
Yes, if you need visual regression testing for Playwright-based tests and can tolerate aging maintenance. The plugin is lightweight, has no known vulnerabilities, and solves a real problem—catching visual regressions that functional tests miss. However, verify compatibility with your current Playwright version before adopting, and monitor the repository for updates or consider alternatives if active maintenance becomes critical for your workflow.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Playwright and a compatible browser to be installed; pytest-playwright must be set up first.
- Low install friction with a pure-Python wheel distribution.
- Maintenance is aging—last release was in April 2022 with no updates since, though the repository remains active with a recent commit in April 2025.
License · maintenance · safety
permissive license (permissive) — Licensed under Apache 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions.
last release 2022-04-28 (1569 days) · last repo commit 2025-04-02 · 28 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 109,343 downloads/mo, #12,518 on PyPI
Alternatives
Verify before relying
pip install pytest-playwright-visual
# In your test file:
from pytest_playwright.sync_api import Page
def test_myapp(page: Page, assert_snapshot):
page.goto("https://example.com")
assert_snapshot(page.screenshot())- Whether the package works reliably with modern Playwright versions given the last release was in 2022.
- Performance characteristics when comparing large numbers of snapshots or high-resolution screenshots.
- Community activity and whether issues are being actively triaged despite the aging maintenance status.
What it is and what it does
pytest-playwright-visual is a pytest plugin that automates visual regression testing for web applications. It extends pytest-playwright with an `assert_snapshot` fixture that captures screenshots during test runs and compares them pixel-by-pixel using the pixelmatch algorithm. On first run, snapshots are created; on subsequent runs, actual screenshots are compared against stored baselines with a configurable threshold (default 0.1). When mismatches occur, the plugin generates side-by-side diff images in a `snapshot_tests_failures` folder for manual review.
The plugin manages snapshot organization automatically, storing images in a structured folder hierarchy keyed by test name, browser, and OS. It requires explicit user review before accepting snapshot updates via the `--update-snapshots` flag, preventing accidental regressions from being silently committed. Dependencies are minimal: pytest-playwright for browser automation, Pillow for image handling, and pixelmatch for the comparison algorithm.
Use it for
- Detect unintended visual changes in UI components across browser and OS combinations during CI/CD.
- Establish visual baselines for new features and track pixel-level changes in design systems.
- Catch CSS or layout regressions that unit tests alone would miss, especially in responsive layouts.
- Review and approve visual changes before merging pull requests with generated diff images.
- Maintain visual consistency across browser versions by storing per-browser snapshots.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need visual regression testing for Playwright-based tests and can tolerate aging maintenance.
The plugin is lightweight, has no known vulnerabilities, and solves a real problem—catching visual regressions that functional tests miss. However, verify compatibility with your current Playwright version before adopting, and monitor the repository for updates or consider alternatives if active maintenance becomes critical for your workflow.
Install
pytest-playwright-visual on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Maintenance is aging—last release was in April 2022 with no updates since, though the repository remains active with a recent commit in April 2025.
Requires Playwright and a compatible browser to be installed; pytest-playwright must be set up first.
License in practice
Licensed under Apache 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install pytest-playwright-visual
# In your test file:
from pytest_playwright.sync_api import Page
def test_myapp(page: Page, assert_snapshot):
page.goto("https://example.com")
assert_snapshot(page.screenshot())
Verify before relying
- Whether the package works reliably with modern Playwright versions given the last release was in 2022.
- Performance characteristics when comparing large numbers of snapshots or high-resolution screenshots.
- Community activity and whether issues are being actively triaged despite the aging maintenance status.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagespytest-playwrightPillowpixelmatch |
| Maintenance | Aging 1,569 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 109,343 / month, #12,518 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Framework :: PytestLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: pytest_playwright_visual-2.1.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “screenshot comparison playwright”
- pytest-playwright-visualA pytest plugin that captures and compares visual snapshots of web…
- shot-scraperA CLI tool that automates taking screenshots of websites, recording…
- percy-seleniumIntegrates Percy visual testing into Python Selenium tests, capturing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also pytest-textual-snapshot · pytest-insta · eyes-common · pixelmatch · playwright · pixelhog · pytest-mpl · shot-scraper · percy-selenium · snapshottest