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.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e133f39e7ca43af1d6c66a8b714bbcb56d708f60bb05bc9a97c5186d184c7088 |
|
MD5 | f92bf91637d4a0e4a74188ccda056dcc |
|
BLAKE2b-256 | 26ef3faee50ef70fcab047643bb71864595cac279ab6379b9ba68bc8bc4e0f30 |
Close
Hashes for pytest_playwright_async-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08676b603579bdb369c8f0ceb426e29b8baf3a5b4256dde95571b6669a49b3a0 |
|
MD5 | f63279f0f709e94cce086a8798577f68 |
|
BLAKE2b-256 | 07955fc4274db6eeeaa3dd5f101349994cdecd93a2677743a03c129fec53b729 |