pytest-playwright
A pytest wrapper with fixtures for Playwright to automate web browsers
Decision gist · record as of 2026-08-14
Yes. This is a well-maintained, actively developed plugin from Microsoft with no known vulnerabilities, low install friction, and a permissive license. It fills a clear need for teams using pytest who want to write end-to-end browser tests without boilerplate. The only gotcha is that Playwright requires browser binaries to be installed separately, but that is a one-time setup step and is well-documented.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Playwright also requires browser binaries; use `playwright install` after installing the package to download them.
- Low friction install with a pure-Python wheel.
License · maintenance · safety
permissive license (permissive) — Licensed under Apache License 2.0 (permissive). You can use, modify, and distribute the package freely in commercial and private projects, provided you include a copy of the license and note any changes you make.
last release 2026-08-10 (4 days) · last repo commit 2026-08-11 · 556 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 9,625,460 downloads/mo, #1,516 on PyPI
Alternatives
Verify before relying
pip install pytest-playwright
# In a test file:
import pytest
def test_example(page):
page.goto("https://example.com")
assert page.title() == "Example Domain"- Whether pytest-base-url and python-slugify are required at runtime or only for specific test scenarios.
- Whether the plugin automatically handles browser binary installation or if manual setup is needed in CI/CD environments.
What it is and what it does
pytest-playwright is a pytest plugin that wraps the Playwright browser automation library, exposing browser primitives as pytest fixtures so you can write end-to-end tests directly in your test functions. Instead of manually instantiating and managing browser contexts, you declare a `page` fixture (or `browser`, `context` fixtures) in your test signature and pytest-playwright handles the setup and teardown. It supports all modern browsers—Chromium, WebKit, and Firefox—and can run tests in headless or headed mode.
The plugin is maintained by Microsoft (Playwright's creator) and sits at the intersection of pytest's test discovery and fixture system with Playwright's cross-browser automation API. It's designed for teams writing web application tests that need to verify behavior across multiple browsers without writing boilerplate context management code. The package has no known vulnerabilities and is actively developed, with a recent release and steady repository maintenance.
Use it for
- Write end-to-end tests for web applications that verify user workflows across Chromium, Firefox, and WebKit without manual browser setup.
- Run headless browser tests in CI/CD pipelines to validate web app functionality on every commit.
- Test responsive design and cross-browser compatibility by parameterizing tests to run against multiple browser contexts.
- Automate visual regression testing or screenshot capture as part of pytest test suites.
- Verify form submissions, navigation, and DOM interactions in web apps using Playwright's page API within pytest test functions.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is a well-maintained, actively developed plugin from Microsoft with no known vulnerabilities, low install friction, and a permissive license. It fills a clear need for teams using pytest who want to write end-to-end browser tests without boilerplate. The only gotcha is that Playwright requires browser binaries to be installed separately, but that is a one-time setup step and is well-documented.
Install
pytest-playwright on PyPI
Before you install
Low friction install with a pure-Python wheel. Actively maintained with a recent release (4 days old) and steady repository activity. Requires Python 3.10 or later and depends on playwright, pytest, pytest-base-url, and python-slugify—all standard testing and utility packages.
Requires Python 3.10 or later. Playwright also requires browser binaries; use `playwright install` after installing the package to download them.
License in practice
Licensed under Apache License 2.0 (permissive). You can use, modify, and distribute the package freely in commercial and private projects, provided you include a copy of the license and note any changes you make.
Quickstart
pip install pytest-playwright
# In a test file:
import pytest
def test_example(page):
page.goto("https://example.com")
assert page.title() == "Example Domain"
Verify before relying
- Whether pytest-base-url and python-slugify are required at runtime or only for specific test scenarios.
- Whether the plugin automatically handles browser binary installation or if manual setup is needed in CI/CD environments.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesplaywrightpytestpytest-base-urlpython-slugify |
| Maintenance | Actively maintained 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,625,460 / month, #1,516 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.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13 |
Evidence: pytest_playwright-0.9.0-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 › “pytest playwright integration”
- pytest-playwrightA pytest plugin that integrates Playwright browser automation into…
- pytest-playwright-asyncioA pytest plugin that integrates Playwright browser automation with…
- pytest-sugarA pytest plugin that improves test output with a progress bar,…
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-playwright-asyncio · wptserve · playwright · camoufox · scrapy-playwright · pyppeteer · robotframework-browser · testmuai-playwright-bindings · robocorp-browser · eyes-common