@snapvisor/puppeteer
v7.0.0
Published
Puppeteer SDK for visual testing with Snapvisor.
Readme
Official Argos Puppeteer integration
Capture stable Argos screenshots from your Puppeteer tests.
Visit the Puppeteer SDK documentation for guides, the API reference, and more.
Installation
Install the SDK alongside the Argos CLI, which uploads the screenshots to Argos:
npm install --save-dev @snapvisor/puppeteer @snapvisor/cliUsage
Use argosScreenshot to stabilize the UI and capture a screenshot:
import puppeteer from "puppeteer";
import { argosScreenshot } from "@snapvisor/puppeteer";
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("http://localhost:3000");
await argosScreenshot(page, "homepage");
await browser.close();Screenshots are saved locally (in ./screenshots/argos by default). Upload them to Argos with the Argos CLI, usually at the end of your CI job:
npx @snapvisor/cli upload ./screenshots