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
File details
Details for the file pytest_playwright_async-0.14.2.tar.gz
.
File metadata
- Download URL: pytest_playwright_async-0.14.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.10.4 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e892c992a5845398d2f0e2b4e344bf077909bdef39cbb373565297cd78d02b86 |
|
MD5 | f6be3a054c3cae4010aa526d8d6f4824 |
|
BLAKE2b-256 | 87790f19dc8644461801daf3417444c6d508ec1a0065a5955c4b8a54fb0bc09e |
File details
Details for the file pytest_playwright_async-0.14.2-py3-none-any.whl
.
File metadata
- Download URL: pytest_playwright_async-0.14.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.10.4 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6562bf7de49db714d52d3ece7bcd1cfb847fe6f05ce7267ea3aa54082b81f37c |
|
MD5 | ad1769e06923528bf55dfecee10129a5 |
|
BLAKE2b-256 | 1097131c779d6f320045759f1ab73e29e9c79c62d5296ba1a8c1be1cdf59ccee |