ASYNC Pytest plugin for Playwright
Project description
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest_playwright_async-1.1.0.tar.gz
.
File metadata
- Download URL: pytest_playwright_async-1.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.19.1 CPython/3.10.12 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8db300f4c56968d99e6fe61d9466dc11b7d39782bdd7793f70ab1fc53075159 |
|
MD5 | ee732366536ae71b47f84ada7bd81b63 |
|
BLAKE2b-256 | d0e99da3c3377f6418f7fcd9300062e06fca8082bad3acda6f623b4782a99998 |
File details
Details for the file pytest_playwright_async-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_playwright_async-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.19.1 CPython/3.10.12 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d83d644f9c8fcd4713509bb7dc96def968c6055b1754286df98e6fba748daee3 |
|
MD5 | e709901022af97f988be3b3cd178c2ab |
|
BLAKE2b-256 | 777c22211919612cf5478a4a890f0681bfd673a57b67a0dcbd9f9b4ef0cb24aa |