Skip to main content

Playwright Async Pytest -- ASYNC Pytest plugin for Playwright

pypi

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)

Source distribution for pytest_playwright_async 1.1.0
File Size Uploaded
pytest_playwright_async-1.1.0.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest_playwright_async 1.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.14.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.11.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page