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.13.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 134d898ad3647e78792aea2dd1ceea87a4fa91eb15ab206199ac54916b2e7a07 |
|
MD5 | a50d81b64bab6a90047c2c8da33ea524 |
|
BLAKE2b-256 | 3ccea58ba1cf0e9326bedcfb54d2e9e0148e38f181372cff8186c5f57b9e8973 |
Close
Hashes for pytest_playwright_async-0.13.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d300f834b7f159f6fde76e35448c13a5323121f31d6c1ada1c0593567e8d4a |
|
MD5 | c7fad9fb9eb76f07663d5e4aebfaf2b6 |
|
BLAKE2b-256 | 7c0792c29128f1c9e001d48b0e93dda114859dcb3a3b4bdade5ab7a0c1dd4c1a |