Playwright Async Pytest -- ASYNC Pytest plugin for Playwright
There an official playwright plugin for pytest: PyPI / playwright-pytest / intro. But if you need an async version, here is it!
Installation
pip install pytest-playwright-async
Example
Here you can find more examples.
# tests/async/conftest.py
import pytest
# install anyio
# install uvloop
@pytest.fixture(
scope='session',
params=[
# https://anyio.readthedocs.io/en/stable/testing.html#specifying-the-backends-to-run-on
pytest.param(('asyncio', {'use_uvloop': True}), id='asyncio+uvloop'),
pytest.param(('asyncio', {'use_uvloop': False}), id='asyncio'),
# pytest.param(('trio', {'restrict_keyboard_interrupt_to_checkpoints': True}), id='trio'),
],
autouse=True,
)
def anyio_backend(request):
return request.param
# tests/async/test_for_readme.py
from playwright.async_api import Page
async def test_page_async(page_async: Page):
print(f'\n{page_async = }')
await page_async.goto('https://playwright.dev/')
assert 'Playwright' in await page_async.title()
Release files for pytest_playwright_async 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_playwright_async-1.1.0.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_playwright_async-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / pytest_playwright_async-1.1.0.tar.gz
| Download URL | pytest_playwright_async-1.1.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8db300f4c56968d99e6fe61d9466dc11b7d39782bdd7793f70ab1fc53075159
|
|
BLAKE2b-256 checksum How to use checksums |
d0e99da3c3377f6418f7fcd9300062e06fca8082bad3acda6f623b4782a99998
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.19.1 CPython/3.10.12 Linux/6.8.0-1014-azure
|
Release files / pytest_playwright_async-1.1.0-py3-none-any.whl
| Download URL | pytest_playwright_async-1.1.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d83d644f9c8fcd4713509bb7dc96def968c6055b1754286df98e6fba748daee3
|
|
BLAKE2b-256 checksum How to use checksums |
777c22211919612cf5478a4a890f0681bfd673a57b67a0dcbd9f9b4ef0cb24aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.19.1 CPython/3.10.12 Linux/6.8.0-1014-azure
|