pytest-playwright-asyncio
A pytest wrapper with async fixtures for Playwright to automate web browsers
What it is and what it does
pytest-playwright-asyncio bridges Playwright's browser automation library with pytest's testing framework, enabling you to write async/await-style end-to-end tests. It provides built-in pytest fixtures that inject browser primitives directly into your test functions, eliminating boilerplate setup code. The plugin supports all modern browsers (Chromium, WebKit, Firefox) in both headless and headed modes.
You install it alongside pytest, playwright, pytest-asyncio, and pytest-base-url. Once installed, your test functions can use async/await syntax to control browsers, navigate pages, and assert on page state. The plugin handles fixture lifecycle management, so you focus on writing test logic rather than browser initialization and teardown.
Use it for:
- Test user workflows across multiple browsers to catch rendering or behavior differences before production
- Verify form submission, navigation, and dynamic content loading in single-page applications
- Run headless browser tests in CI/CD pipelines to validate web app functionality on every commit
- Test responsive design by running the same test suite against different viewport sizes
- Validate third-party integrations and API interactions triggered by user actions in the browser
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that integrates Playwright browser automation with async/await syntax, providing fixtures to write end-to-end tests for web applications across Chromium, WebKit, and Firefox.
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive Apache 2.0 license. It directly solves the problem of writing async browser tests with pytest if you're already using Playwright. Install it if you need end-to-end testing for web applications.
Install
pytest-playwright-asyncio on PyPI
pip
pip install pytest-playwright-asynciouv
uv add pytest-playwright-asynciopoetry
poetry add pytest-playwright-asyncioInstalling pytest-playwright-asyncio
Before you install
Low friction install with a wheel distribution. Actively maintained as of 2026-08-11 with recent release activity. Requires Python 3.10 or later and depends on pytest, playwright, and pytest-asyncio.
License in practice
Apache License 2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects provided you include license attribution and note any changes you make.
Quickstart
pip install pytest-playwright-asyncio
# In your test file:
import pytest
from pytest_playwright_asyncio import browser
@pytest.mark.asyncio
async def test_homepage(browser):
await browser.goto('https://example.com')
assert await browser.title() == 'Example Domain'
Requires Python 3.10 or later. Playwright browser binaries must be installed separately (typically via `playwright install` after installing the playwright package).
Verify before relying
- Whether the package provides fixtures for specific browser contexts or just the base browser object
- Support for parallel test execution and any concurrency limitations
- Whether base_url fixture from pytest-base-url is automatically integrated or requires manual setup
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — pytest, playwright, pytest-base-url, python-slugify, pytest-asyncio |
| Maintenance | actively maintained — 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 185,646/month — #10,006 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_playwright_asyncio-0.9.0-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pyppeteerAutomates headless Chrome/Chromium browser…
permissive · top 5,000 on PyPI
pytest-playwrightA pytest plugin that integrates Playwright…
permissive · top 5,000 on PyPI
playwrightAutomate Chromium, Firefox, and WebKit browsers…
permissive · top 1,000 on PyPI
wptserveA Python web server built for testing web…
permissive · top 15,000 on PyPI
scrapy-playwrightIntegrates Playwright browser automation into…
permissive · top 5,000 on PyPI
testmuai-playwright-bindingsRuns exported browser automation tests locally…
permissive · top 15,000 on PyPI
stagehandStagehand is a Python SDK for building browser…
permissive · top 5,000 on PyPI
install-playwrightProvides a Python function to execute the…
permissive · top 15,000 on PyPI
eyes-commonBase SDK package for Applitools Eyes that…
unclear · top 15,000 on PyPI
robocorp-browserA wrapper around Playwright that automates…
permissive · top 15,000 on PyPI