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

Uploaded Source

Built Distribution

pytest_playwright_async-0.2.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest-playwright-async-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 0a80f65aa3444dd9df979f5c87272b75d735fa09f14d26b29f4a6e676c0ba238
MD5 311130cd62c5dd25998b7062e54e576f
BLAKE2b-256 f4516e51f1e694baa5d7fc0969e33841f63c1c72c855ed114e2d4ae43b8ac640

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_playwright_async-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1180344d1559a4b02f25a1353313fe4a21fb4ce7742c0105b0eb987fc374472d
MD5 9ac65a80e1d271d12c8c4d33c889ad69
BLAKE2b-256 f7f7fb1dd47e950b34e10dba97b8afc6e58f2fb234d9fa754559f09c7c84afc1

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