Skip to main content

ASYNC Pytest plugin for Playwright

Project description

Playwright Async Pytest -- ASYNC Pytest plugin for Playwright

pypi

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

pytest_playwright_async-0.11.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

pytest_playwright_async-0.11.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file pytest_playwright_async-0.11.0.tar.gz.

File metadata

File hashes

Hashes for pytest_playwright_async-0.11.0.tar.gz
Algorithm Hash digest
SHA256 212eda1ec75066e1f51f5f0b734e855fbf1a627381c4ca0b6b614c872072e842
MD5 22775d9cd4ac5a826bb37152b59794c8
BLAKE2b-256 41e105ad86a1e8d2f4b6cc2c383efdcf63393d0f18346dd967f547943eba4ea1

See more details on using hashes here.

File details

Details for the file pytest_playwright_async-0.11.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_playwright_async-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb0502c140fc209e85ac9ea224035470d85098f8e8a57b730e8973f0f2a89375
MD5 30a6852af13971859d6e1783da30d053
BLAKE2b-256 b8fbfac115a4e7d0401a9df065eed9a4f0c5efde9638c180b03bd81b763d42fa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page