Skip to main content

Vedro + pyppeteer

Project description

Vedro Pyppeteer Plugin

Codecov PyPI PyPI - Downloads Python Version

Vedro + pyppeteer

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.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

vedro_pyppeteer-1.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file vedro-pyppeteer-1.1.0.tar.gz.

File metadata

  • Download URL: vedro-pyppeteer-1.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for vedro-pyppeteer-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e6ebfa44708df0cb63808d12ddda3fee37da29f47c8cd3ffc8192425f6cb05a4
MD5 a7624a2f5ac8576ea53a909cd420c98d
BLAKE2b-256 0a7ac5ff9acaf9c5c6334b76f7cf7848abf61f5c17e02f80de01d5f2b2aaaa44

See more details on using hashes here.

File details

Details for the file vedro_pyppeteer-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vedro_pyppeteer-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59b97d52431dcd590ba8ba5d62a5868dc0b8a010277d2c27c9e5e92072220c1a
MD5 b5a701639c5f2fab44cbd3fcfcc83298
BLAKE2b-256 8701513d7a853076d716be019d59fa152cbdad77d71b34b9ddea3c7290cb5800

See more details on using hashes here.

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