Vedro + pyppeteer
Project description
Vedro Pyppeteer Plugin
Installation
$ pip3 install vedro-pyppeteer
# ./bootstrap.py
import vedro
from vedro_pyppeteer import PyppeteerPlugin
vedro.run(plugins=[PyppeteerPlugin()])
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 == "/"
$ python3 bootstrap.py --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-0.3.0.tar.gz
(8.5 kB
view hashes)
Built Distribution
Close
Hashes for vedro_pyppeteer-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9aff2645cc89a1fe092adeabf9c1dd3116ec9b550c878fe151d0cd1c251cb46 |
|
MD5 | 413690f413c19c6a532a65693b6013cf |
|
BLAKE2b-256 | a74b9c59fb4c2b1ef30952ab6ee16ba55c0ad2b44cca4836109cf74a0226a5f2 |