Vedro Playwright Plugin
(forked from vedro-pyppeteer)
Installation
1. Install package
$ pip3 install vedro-playwright
$ playwright install
2. Enable plugin
# ./vedro.cfg.py
import vedro
import vedro_playwright as playwright
class Config(vedro.Config):
class Plugins(vedro.Config.Plugins):
class Playwright(playwright.Playwright):
enabled = True
Usage
# ./scenarios/reset_password.py
import vedro
from vedro_playwright import BrowserEngine as Browser
from vedro_playwright import opened_firefox_page, opened_chromium_page, opened_webkit_page
class Scenario(vedro.Scenario):
subject = "reset password (via {browser})"
@vedro.params(Browser.CHROMIUM, opened_chromium_page)
@vedro.params(Browser.FIREFOX, opened_firefox_page)
@vedro.params(Browser.WEBKIT, opened_webkit_page)
def __init__(self, browser, opened_page):
self.opened_page = opened_page
async def given_opened_app(self):
self.page = await self.opened_page()
await self.page.goto("http://localhost:8080/reset")
async def given_filled_email(self):
form_email = self.page.locator("#form-email")
await form_email.type("user@email")
async def when_user_submits_form(self):
await self.page.click("#form-submit")
async def then_it_should_redirect_to_root_page(self):
pathname = await self.page.evaluate("window.location.pathname")
assert pathname == "/"
$ vedro run --playwright-screenshots=on_fail
Documentation
Plugin
--playwright-screenshots=<mode>
| Mode | Description |
|---|---|
| every_step | Save screenshots for every step |
| only_failed | Save screenshots only for failed steps |
| on_fail | Save screenshots for all steps when scenario fails |
--playwright-screenshots-dir — Set directory for screenshots (default: ./screenshots)
Playwright
Documentation for Playwright available here
Metadata
Release files for vedro-playwright 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vedro-playwright-1.2.1.tar.gz | 11.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vedro_playwright-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.3 kB
Release files / vedro-playwright-1.2.1.tar.gz
| Download URL | vedro-playwright-1.2.1.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c67e4b1ea539ed529d08490afc7ff1a7c0af92da941684b1d532d5e38bfa1871
|
|
BLAKE2b-256 checksum How to use checksums |
04c43fbfea789a01412fcc2b9d302096e8d141a599a2536eb4a3b3706613ffcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / vedro_playwright-1.2.1-py3-none-any.whl
| Download URL | vedro_playwright-1.2.1-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8146d425a5dff0226cb1a161f79eeb181b9f4f07f89326e8b8291c2d264b712d
|
|
BLAKE2b-256 checksum How to use checksums |
a9842087c748dbe042cd51c2d43ee53fb5f7cb4d5489668ee3450c020aaf5c52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|