Skip to main content

A pytest wrapper with fixtures for Playwright to automate web browsers

Project description

Pytest Playwright Plugin

CI PyPI Coverage Status black

A Pytest wrapper for Playwright to automate web browsers (Chromium, Firefox, WebKit).

Features

  • Have a separate new page and context for each test with Pytest fixtures
  • Run your end-to-end tests on multiple browsers by a CLI argument
  • Run them headful with the --headful argument to debug them easily
  • Using base-url to only use the relative URL in your Page.goto calls

Fixtures

browser_name - session scope

A string which contains the current browser name.

browser - session scope

A Playwright browser instance for the whole test run.

context - function scope

A separate Playwright context instance for each new test.

page - function scope

A separate Playwright page instance for each new test.

launch_arguments - session scope

A fixture which you can define to overwrite the launch arguments. It should return a Dict.

context_arguments - session scope

A fixture which you can define to overwrite the context arguments. It should return a Dict.

is_chromium, is_firefox, is_webkit - session scope

A fixture which is a boolean if a specific execution is made by the specified browser.

CLI arguments

--browser

Per default, the tests run on all the browsers. You can pass multiple times the --browser flag to run it on different browsers or a single time to run it only on a specific browser.

Possible values: chromium, firefox, webkit

--headful

Per default, the tests run in headless mode. You can pass the --headful CLI flag to run the browser in headful mode.

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

Uploaded Source

Built Distribution

pytest_playwright-0.0.4-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file pytest-playwright-0.0.4.tar.gz.

File metadata

  • Download URL: pytest-playwright-0.0.4.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for pytest-playwright-0.0.4.tar.gz
Algorithm Hash digest
SHA256 bb67ad0e0da41e9ded553d1479d3372f2d965aa455695de9b7983736d1e1ad8b
MD5 a0e16460532ae9ee0ccd4de8a871654b
BLAKE2b-256 2362290b4b400aab9df6f46e2d37f58bb72fe72a8f58582963a8281bb3b6c7f7

See more details on using hashes here.

File details

Details for the file pytest_playwright-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pytest_playwright-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for pytest_playwright-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b94008ffbc2a0bed8674541655b7aa945e2a1c2ebf25b416229ab266a3f769c1
MD5 1786fbf6ea3ad89919ec4023e4aa2335
BLAKE2b-256 db47caf68ad83febb1edcac051b8eb4ddf47bb27fd77032480032e5780d817e4

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