A pytest wrapper with fixtures for Playwright to automate web browsers
Project description
Pytest Playwright
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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest_playwright-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c008240eb271e12fcf7eecb6bf034fc6d413616a38affbc449b9367efb9bdf |
|
MD5 | e8ef921f20e48b98256d26039e0d36a0 |
|
BLAKE2b-256 | dc49d6d3aa219536199958a8b35004b07da4cf43583807af351fa911ed2550e9 |