Vedro + pyppeteer
Project description
Vedro Pyppeteer Plugin
Installation
1. Install package
$ pip3 install vedro-pyppeteer
2. Enable plugin
# ./vedro.cfg.py
import vedro
import vedro_pyppeteer as p
class Config(vedro.Config):
class Plugins(vedro.Config.Plugins):
class Pyppeteer(p.Pyppeteer):
enabled = True
Usage
# ./scenarios/reset_password.py
import vedro
from vedro_pyppeteer import opened_browser_page
class Scenario(vedro.Scenario):
subject = "reset password"
async def given_opened_app(self):
self.page = await opened_browser_page()
await self.page.goto("http://localhost/reset")
async def given_filled_email(self):
form_email = await self.page.querySelector("#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 --pyppeteer-screenshots=on_fail
Documentation
--pyppeteer-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 |
--pyppeteer-screenshots-dir
— Set directory for screenshots (default: ./screenshots)
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
vedro-pyppeteer-1.0.0.tar.gz
(8.7 kB
view hashes)
Built Distribution
Close
Hashes for vedro_pyppeteer-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aec02d9e03a2e2254540a82c8634466a1097645be21fce0f80388d7bbf4b90a3 |
|
MD5 | 2b3b2006d6ad9b9e8937d8f63f2cdeef |
|
BLAKE2b-256 | f48683b58756a46956d6700eb414fa519a3c7722da4309fcd22ba59f82920dcb |