Migrate from Playwright toHaveScreenshot to Argos
Move from Playwright's built-in toHaveScreenshot() snapshots to Argos. Stop committing PNG baselines to Git and review visual changes on the pull request.
If you use Playwright's built-in toHaveScreenshot(), you already have visual tests — you're just storing the baselines in your repository and diffing them on the CI machine. This guide moves those tests to Argos so baselines live in the cloud, review happens on the pull request, and you stop fighting cross-platform PNG mismatches.
Why teams move off native snapshots
Playwright's snapshots work, but they push three problems onto your team:
Baselines are committed PNGs. Every screenshot lives in a
*-snapshots/folder in Git. They bloat the repo, clutter diffs, and cause merge conflicts.Snapshots are platform-specific. A baseline captured on macOS won't match Linux CI (
-darwinvs-linuxsuffixes), so teams end up running snapshots only in Docker or CI to stay consistent.There is no review UI. A failing
toHaveScreenshot()is a red test. To accept an intended change you re-run with--update-snapshotsand commit new PNGs — there's no place to see the before/after or have a teammate approve it.
Argos keeps your Playwright tests but removes all three: baselines are selected from your Git history in the cloud, rendering happens the same way every run, and changes are reviewed and approved on the pull request.
What changes semantically
With native snapshots, a visual difference fails the test. With Argos, argosScreenshot uploads the image and the comparison runs in Argos — the visual result becomes a commit status and PR check you review and approve, decoupled from whether the test itself passed. This is what lets you approve intended changes without editing files.
Concept mapping
expect(page).toHaveScreenshot("name.png")
argosScreenshot(page, "name")
expect(locator).toHaveScreenshot()
argosScreenshot(locator, "name")
Committed *-snapshots/ PNG folders
Cloud baselines from Git history
--update-snapshots
Approve in the Argos review UI
maxDiffPixels / threshold
Diff fails the test
Diff becomes a PR check to review + approve
Migrate the project
Seed the baseline and wire up CI
Run your tests in CI with ARGOS_TOKEN set. Run on your default branch first so Argos has a baseline; until then, pull request builds stay orphan.
ARGOS_TOKEN comes from Settings → General → Token. On GitHub Actions you can use OIDC or tokenless authentication instead.
Frequently asked questions
Next steps
Argos vs Playwright screenshots — a side-by-side comparison with
toHaveScreenshot().
Last updated
Was this helpful?