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.

# tests/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()
# tests/test_for_readme.py
from playwright.async_api import Page
import pytest


@pytest.mark.asyncio
async def test_page_async(page_async: Page):
    print(f'\n{page_async = }')
    await page_async.goto('https://playwright.dev/')
    assert 'Playwright' in await page_async.title()

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.17.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

pytest_playwright_async-0.17.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_playwright_async-0.17.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.15.3 CPython/3.10.12 Linux/6.5.0-1021-azure

File hashes

Hashes for pytest_playwright_async-0.17.0.tar.gz
Algorithm Hash digest
SHA256 286c9addf0cf4cb1a1216517f2f5044857bddbf7f8509914ad1e3d247ba80661
MD5 5bc182893066151dec84cda66b4a8af5
BLAKE2b-256 38622c487cf2c7a8bb54e8bd9f83f4311b00f0acc73d2bf7a6745f940646da78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_playwright_async-0.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a99d6ebfa3a9b9163cbc714e73724cf860442273b379d8a828b7e084c42302b
MD5 b82dbe4d8df390cc02166a079ed99c9b
BLAKE2b-256 e2ab316c5e0ae1fd1efee86ac04f8d1e4e3a5f727a67dd3c7a6a4aa1f289e730

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