Description
# Pytest plugin for Playwright [](https://pypi.org/project/pytest-playwright/) Write end-to-end tests for your web apps with [Playwright](https://github.com/microsoft/playwright-python) and [pytest](https://docs.pytest.org/en/stable/). - Support for **all modern browsers** including Chromium, WebKit and Firefox. - Support for **headless and headed** execution. - **Built-in fixtures** that provide browser primitives to test functions. **Note**: If you are looking for an asyncio version of this plugin, check out [pytest-playwright-asyncio](https://pypi.org/project/pytest-playwright-asyncio/). ## Documentation See on [playwright.dev](https://playwright.dev/python/docs/test-runners) for examples and more detailed information.
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 0.7.2 | Imported from PyPI (0.7.2) | Low | 4/21/2026 |
| v0.7.2 | ## What's Changed * chore(deps): bump django from 4.2.22 to 4.2.24 by @dependabot[bot] in https://github.com/microsoft/playwright-pytest/pull/292 * chore: drop Python 3.9 by @mxschmitt in https://github.com/microsoft/playwright-pytest/pull/299 * chore: support Pytest v9 by @mxschmitt in https://github.com/microsoft/playwright-pytest/pull/300 * fix: check common name for incompatible plugin by @JamesYFC in https://github.com/microsoft/playwright-pytest/pull/294 ## New Contributors * @Jame | Low | 11/20/2025 |
| v0.7.1 | Bugfixes: * fix: use png screenshot type after Playwright v1.55.0 alignment by @mxschmitt in https://github.com/microsoft/playwright-pytest/pull/290 * feat: add async/sync compatibility check by @mecampbellsoup in https://github.com/microsoft/playwright-pytest/pull/282 ## New Contributors * @roberfi made their first contribution in https://github.com/microsoft/playwright-pytest/pull/285 * @mecampbellsoup made their first contribution in https://github.com/microsoft/playwright-pytest/pul | Low | 9/8/2025 |
| v0.7.0 | Allow declaring `connect_options` fixture to connect to remote browsers. | Low | 1/31/2025 |
| v0.6.2 | Bugfixes: - devops: publish wheels in https://github.com/microsoft/playwright-pytest/pull/261 | Low | 11/26/2024 |
| v0.6.1 | Fix conda publishing | Low | 11/25/2024 |
| v0.6.0 | ## What's Changed * feat: pytest-playwright-asyncio as separate plugin in https://github.com/microsoft/playwright-pytest/pull/257 * feat: expose output_path fixture in https://github.com/microsoft/playwright-pytest/pull/248 * chore: drop Python 3.8 in https://github.com/microsoft/playwright-pytest/pull/253 **Full Changelog**: https://github.com/microsoft/playwright-pytest/compare/v0.5.2...v0.6.0 | Low | 11/25/2024 |
| v0.5.2 | Bugfixes: * chore: add py.typed file in https://github.com/microsoft/playwright-pytest/pull/245 * chore: hide internal methods in https://github.com/microsoft/playwright-pytest/pull/236 * Update conda dependencies to match setup.py in https://github.com/microsoft/playwright-pytest/pull/242 * Fix conda build and publish workflow in https://github.com/microsoft/playwright-pytest/pull/243 **Full Changelog**: https://github.com/microsoft/playwright-pytest/compare/v0.5.1...v0.5.2 | Low | 9/6/2024 |
| v0.5.1 | Bugfixes * fix: catch PermissionError when cleaning the tests results with multiple threads (#224) in https://github.com/microsoft/playwright-pytest/pull/230 | Low | 7/3/2024 |
| v0.5.0 | Bugfixes: * fix: improve video naming in https://github.com/microsoft/playwright-pytest/pull/217 * feat: support artifact collection with multiple contexts in https://github.com/microsoft/playwright-pytest/pull/216 * fix: clean up videos after each test in https://github.com/microsoft/playwright-pytest/pull/221 * fix: migrate artifacts_folder to session fixture in https://github.com/microsoft/playwright-pytest/pull/223 **Full Changelog**: https://github.com/microsoft/playwright-pytest/c | Low | 5/6/2024 |
| v0.4.4 | Bugfixes: * fix: use best-effort artifacts folder removal in https://github.com/microsoft/playwright-pytest/pull/191 * chore: support Pytest v8 in https://github.com/microsoft/playwright-pytest/pull/203 | Low | 2/2/2024 |
| v0.4.3 | Bugfixes: * fix: mark.browser_context_args should clear for the next test in https://github.com/microsoft/playwright-pytest/pull/189 **Full Changelog**: https://github.com/microsoft/playwright-pytest/compare/v0.4.2...v0.4.3 | Low | 10/9/2023 |
| v0.4.2 | Fix conda publishing | Low | 8/9/2023 |
| v0.4.1 | Fix conda publishing | Low | 8/7/2023 |
| v0.4.0 | ## What's Changed * Full Page Screenshots by @CGBassPlayer in https://github.com/microsoft/playwright-pytest/pull/148 * Allow user to overwrite `browser_context_args` using a marker by @aklajnert in https://github.com/microsoft/playwright-pytest/pull/146 * Adding conda recipe by @owenlamont in https://github.com/microsoft/playwright-pytest/pull/176 **Full Changelog**: https://github.com/microsoft/playwright-pytest/compare/v0.3.3...v0.4.0 | Low | 8/7/2023 |
| v0.3.3 | ## What's Changed * fix: have correct trace title by @mxschmitt in https://github.com/microsoft/playwright-pytest/pull/157 * Update to allow the latest `python-slugify` by @jensenbox in https://github.com/microsoft/playwright-pytest/pull/160 * fix: support long test names by @mxschmitt in https://github.com/microsoft/playwright-pytest/pull/165 ## New Contributors * @jensenbox made their first contribution in https://github.com/microsoft/playwright-pytest/pull/160 **Full Changelog** | Low | 4/24/2023 |
| v0.3.2 | ## What's Changed * fix: respect manual base_url fixture override in https://github.com/microsoft/playwright-pytest/pull/154 | Low | 3/10/2023 |
| v0.3.1 | ### Bugfixes - [BUG] Implement best-effort support when dealing with busy folders. https://github.com/microsoft/playwright-python/issues/1781 | Low | 2/28/2023 |
| v0.3.0 | ## What's Changed * chore: enable sources for trace collection by @mxschmitt in https://github.com/microsoft/playwright-pytest/pull/104 * remove unused event_loop session-scoped fixture by @skarzi in https://github.com/microsoft/playwright-pytest/pull/106 * chore: launch the browser headed by default if the vscode debugger is attached by @mxschmitt in https://github.com/microsoft/playwright-pytest/pull/107 ## New Contributors * @skarzi made their first contribution in https://github.com | Low | 3/16/2022 |
| v0.2.3 | ## What's Changed * fix: Ignore FileNotFoundError when cleaning up output_dir by @shadowwolf899 in https://github.com/microsoft/playwright-pytest/pull/97 * fix: Added check for if rep_call is missing by @shadowwolf899 in https://github.com/microsoft/playwright-pytest/pull/96 ## New Contributors * @shadowwolf899 made their first contribution in https://github.com/microsoft/playwright-pytest/pull/97 **Full Changelog**: https://github.com/microsoft/playwright-pytest/compare/v0.2.2...v0.2 | Low | 2/10/2022 |
| v0.2.2 | ## What's Changed ### Fixes * chore: change browser_context_args back to session fixture by @mxschmitt in https://github.com/microsoft/playwright-pytest/pull/85 (fixes https://github.com/microsoft/playwright-pytest/issues/73) * test: add test for launching persistent context with session scope by @mxschmitt in https://github.com/microsoft/playwright-pytest/pull/86 **Full Changelog**: https://github.com/microsoft/playwright-pytest/compare/v0.2.1...v0.2.2 | Low | 10/28/2021 |
| v0.2.1 | ## What's Changed * fix: tempfile handling when recording videos by @mxschmitt in https://github.com/microsoft/playwright-pytest/pull/83 (Fixes #81) **Full Changelog**: https://github.com/microsoft/playwright-pytest/compare/v0.2.0...v0.2.1 | Low | 10/11/2021 |
| v0.2.0 | ## Features - feat: add more testing goodies (screenshot, video, tracing) (#70) - feat: device emulation via CLI parameter (#61) ## Breaking - browser_context_args fixture scope has changed from `session` to `function` | Low | 8/16/2021 |
| v0.1.2 | Changes: - fix: make it compatible with `unittest.TestCase` and pytest-bdd (#56) | Low | 6/7/2021 |
| v0.1.1 | Enhanced support for usage with launch_persistent_context (#51) | Low | 5/19/2021 |
| v0.1.0 | - chore: replace headful with headed option (#48) - feat: added browser channel argument (#47) - feat: added slowmo option (#45) | Low | 4/1/2021 |
| v0.0.12 | Supports now Playwright >= 1.9.0 | Low | 2/25/2021 |
| v0.0.11 | Update to use Playwright 1.8.0a1 | Low | 1/21/2021 |
| v0.0.10 | Bugfixes: - fix(screenshot): handle if there is no Page fixture available (#30) - fix: compatible with Playwright 0.170.0 (#32) | Low | 12/16/2020 |
| v0.0.9 | Bugfixes: - fix: don't paramaterize test functions that don't use browser fixtures (#28) Chore: - fix(django): configure DJANGO_SETTINGS_MODULE in conftest.py (88a4079) - fix(pre-commit): fix mypy error (727a5f7) - lint: follow up to the last commit (858a9b4) | Low | 11/24/2020 |
| v0.0.8 | Bugfixes: - fix: device emulation (#22) Documentation: - docs(readme): add config for pytest.ini (#13) - docs: add examples for custom fixtures (#16) Chore: - chore: test and add support for Python 3.9 (#17) | Low | 11/10/2020 |
| v0.0.7 | Bugfixes: - fix(django): usage with class based tests (#12) Docs: - docs(readme): update structure (#9) | Low | 10/3/2020 |
| v0.0.6 | **BREAKING**: - chore(typo): fix browse to browser (#8) Documentation: - docs: fix screenshot section (#7) - docs: add guide about debugging Playwright Python (#5) | Low | 9/29/2020 |
| v0.0.5 | Changes: - feat: migrated project over to Microsoft namespace (#1) - fix: use greater than as Playwright requirement(#3) - fix: report not valid browser names as error (#4) **BREAKING**: - enh: renamed fixtures for better readability (#2) | Low | 8/5/2020 |
