skillfed

pytest-playwright-asyncio

A pytest wrapper with async fixtures for Playwright to automate web browsers

pytest-playwright-asyncio v0.9.0 185.6K downloads/30d#10,006 on PyPI556
Permissive 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) Active released

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-asyncio

uv

uv add pytest-playwright-asyncio

poetry

poetry add pytest-playwright-asyncio

Installing 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

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

Tags

pytest playwright async fixturesend-to-end web testingbrowser automation testingplaywright pytest pluginasync web app testingcross-browser e2e testsheadless browser testing
browser-automationasync-testinge2e-testing

More Testing packages