Skip to main content

ASYNC Pytest plugin for Playwright

Project description

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

Uploaded Source

Built Distribution

pytest_playwright_async-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file pytest-playwright-async-0.1.0.tar.gz.

File metadata

  • Download URL: pytest-playwright-async-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.3 tqdm/4.65.0 importlib-metadata/6.7.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.12

File hashes

Hashes for pytest-playwright-async-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e133f39e7ca43af1d6c66a8b714bbcb56d708f60bb05bc9a97c5186d184c7088
MD5 f92bf91637d4a0e4a74188ccda056dcc
BLAKE2b-256 26ef3faee50ef70fcab047643bb71864595cac279ab6379b9ba68bc8bc4e0f30

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_playwright_async-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.3 tqdm/4.65.0 importlib-metadata/6.7.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.12

File hashes

Hashes for pytest_playwright_async-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08676b603579bdb369c8f0ceb426e29b8baf3a5b4256dde95571b6669a49b3a0
MD5 f63279f0f709e94cce086a8798577f68
BLAKE2b-256 07955fc4274db6eeeaa3dd5f101349994cdecd93a2677743a03c129fec53b729

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