ASYNC Pytest plugin for Playwright
Project description
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
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.10.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | df891359cfe5f4980534566343a542b12fedb9474940faf20dedc7d8891868c4 |
|
MD5 | db40a0d29c57a03de11b69ed4b510c2b |
|
BLAKE2b-256 | c831e88ef8191cac0a1ae84fdba5e8d72c27e83ce30ec38bead1864621a807b9 |
Close
Hashes for pytest_playwright_async-0.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b98b1f1639157305f10c664116385b48fe8de107ae1983c28e433400b9741784 |
|
MD5 | 08610994225c0fd84f7170d52d7a718c |
|
BLAKE2b-256 | 750d14cb16261b927eb76fad39b1a2611e1302db144099f23dcd164a72324b93 |