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.
# conftest.py
import asyncio
import pytest_asyncio
@pytest_asyncio.fixture(scope='session')
def event_loop(): # https://pytest-asyncio.readthedocs.io/en/latest/reference/fixtures.html#fixtures
policy = asyncio.get_event_loop_policy()
loop = policy.new_event_loop()
yield loop
loop.close()
# test_playwright.py
import pytest
from playwright.async_api import Page
@pytest.mark.asyncio
async def test_page_async(page_async: Page):
await page_async.goto('https://playwright.dev/')
assert (
await page_async.title()
== 'Fast and reliable end-to-end testing for modern web apps | Playwright'
)
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
Close
Hashes for pytest_playwright_async-0.16.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0535b3e740b943f00feb95e22227c95653285ddb4d17d229aaa99f577f46f88 |
|
MD5 | 2c4c9fa7beb9ee1dc19584e561aa594c |
|
BLAKE2b-256 | 5e8543d084e6810ef0f2e5b340825a61f6c612e25a93441804c88c3acb3c7771 |
Close
Hashes for pytest_playwright_async-0.16.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0281c623d0519579febdf38344a36b23a262c1050ed61e02e9c55822a3d85be3 |
|
MD5 | 69465be6cd8e01807de78f04a928b2ce |
|
BLAKE2b-256 | 634c84d1a0b7ae83fa8faaadbaa8243eeae722b85054ee8949c2e70f13c59421 |