Skip to main content

Vedro + pyppeteer

Project description

Vedro Pyppeteer Plugin

Codecov PyPI PyPI - Downloads Python Version

Vedro + pyppeteer

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

Documentation

--pyppeteer-screenshots — Enable screenshots

--pyppeteer-screenshots-dir — Set directory for screenshots (default: ./screenshots)

--pyppeteer-screenshots-only-failed — Save screenshots only for failed scenarios

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.2.0.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

vedro_pyppeteer-0.2.0-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

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