Recipes

Practical patterns lifted from real ferridriver suites. Each page is self-contained and copy-paste ready.

RecipeWhat it covers
Login and saved auth stateSign in once, reuse the session across tests
Network mockingroute() to fulfill / abort / continue; HAR replay
File upload and downloadsetInputFiles, capturing downloads via the download event
Cookies and storageaddCookies, storageState, per-context overrides
Multiple tabs and windowsNew pages, popup handling, switching active tab
Mobile emulationViewport, user agent, touch, device scale factor
Screenshots and tracesFull page, element, masking, Playwright-compatible traces
CI on GitHub ActionsSharded matrix, JUnit upload, video on failure

Each Rust snippet assumes a #[ferritest] body unless noted; each TypeScript snippet assumes @ferridriver/node. The browser calls are identical across languages — only the harness differs.