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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a80f65aa3444dd9df979f5c87272b75d735fa09f14d26b29f4a6e676c0ba238 |
|
MD5 | 311130cd62c5dd25998b7062e54e576f |
|
BLAKE2b-256 | f4516e51f1e694baa5d7fc0969e33841f63c1c72c855ed114e2d4ae43b8ac640 |
Close
Hashes for pytest_playwright_async-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1180344d1559a4b02f25a1353313fe4a21fb4ce7742c0105b0eb987fc374472d |
|
MD5 | 9ac65a80e1d271d12c8c4d33c889ad69 |
|
BLAKE2b-256 | f7f7fb1dd47e950b34e10dba97b8afc6e58f2fb234d9fa754559f09c7c84afc1 |