--- id: pytest-playwright version: "0.9.0" 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) license_treatment: permissive maintenance: active --- # pytest-playwright — A pytest wrapper with fixtures for Playwright to automate web browsers License: permissive · Maintenance: active · Downloads: 9.6M/mo ## 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 above — verify before relying. A pytest plugin that integrates Playwright browser automation into pytest test functions via built-in fixtures, enabling end-to-end testing across Chromium, WebKit, and Firefox in headless or headed mode. 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 pip install pytest-playwright uv add pytest-playwright poetry add pytest-playwright ## Installing pytest-playwright 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. 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" Requires Python 3.10 or later. Playwright also requires browser binaries; use `playwright install` after installing the package to download them. 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: 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_current - Install friction: low - Maintenance: active - Downloads: 9.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest playwright integration, end-to-end web testing, browser automation testing, pytest browser fixtures, cross-browser e2e tests, playwright pytest plugin, web app testing framework, e2e-testing, browser-automation, pytest-plugin [View on SkillFed](https://skillfed.io/packages/pytest-playwright) · [View on PyPI](https://pypi.org/project/pytest-playwright/)