Skip to content

Recipes ​

Complete, runnable how-tos for one task each. Every recipe shows all of its files, was run end to end against a Pyro build, and pastes real output. Start from the one closest to what you are building.

Before the first @povio/pyro release

The recipes use the new names (@povio/pyro, pyro run, Pyro). Until the package is published under that name, install it as described in Before the first @povio/pyro release.

Coming from Playwright ​

You have a Playwright suite and want it to run on Pyro without rewriting tests.

RecipeWhat it covers
Sign in once with a setup project's storageStateWhy a setup project fails under pyro run, and a globalSetup that signs in once and shares the state with every test.
Run a large suite in CI without --shardSizing workers, splitting files across CI jobs by size or tag, a GitHub Actions matrix.
Run the same suite on Chromium and PyroOne switch for the browser, separate baselines, a script that lists tests whose results differ, and fair timing.
Triage the first red runChecks before the first run, grouping failures, and the six failures you are most likely to see, with fixes.

Fastest E2E tests ​

You are writing a new suite in the native page.run([...]) style.

RecipeWhat it covers
Project layout for a new E2E suiteFolders, scripts, a setup module that starts the API and seeds, one profile per role, specs, JUnit.
Signing in onceSign in once per role in fork mode, one snapshot per feature with base, and keeping tests independent.
API seeding and cleanupUnique data per test, defer cleanup, a leak check, and asserting request bodies with check.request.
Mocking backend statesError, empty and slow states with mock, hold and release, so spinners and banners are tested deterministically.
Visual regression in CIBaselines per OS, updating them, and uploading the diff images when a check fails.

Scraping and automation ​

You keep signed-in identities on disk and run jobs with them.

RecipeWhat it covers
A pool of signed-in identitiesStored profiles with a proxy and user agent each, least-recently-used assignment, a limit per identity, re-sign-in on expiry, atomic saves.
Fork-mode signed-in jobsOne booted profile per identity on pyro serve --fork; every job a fork that starts signed in. When to choose this over state files.
Data from single-page appsWhy a page can look empty after goto, and five ways to get data loaded by fetch, plus pagination and infinite scroll.
A batch of URLs to PDFBounded concurrency, A4 and print media, embedded fonts, and checking each PDF's text.
Moving profiles between machines securelyEncrypting profiles at rest, using them on another machine, key rotation and revocation.

AGPL-3.0-only. A derivative of Lightpanda. Built by Povio.