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
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.12.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33632ebba0b4f1d9f7e25d9eda5cfbca5c983025ceb28989fb46fd2bc947b808 |
|
MD5 | bd840e3702826b6f23d8dd482973ee4b |
|
BLAKE2b-256 | 00da37200764e9cc501dbff896cf3f636f49fa26bc33e3facd489fe989928415 |
Close
Hashes for pytest_playwright_async-0.12.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcf564a30d3cd979ed4f7cb96529946b72162ab9ab59a518dcdfe1dd041bc7c4 |
|
MD5 | bef86da8b57a9d79f1d5ff1ee74a9bb3 |
|
BLAKE2b-256 | 9207562fd7f2a084f32e056c4442c40dc398f0339c9357b4be25492c0a33b6b1 |