Update only the snapshots you intend to change, run the tests in the same environment that produced the existing baselines, and inspect every changed image before committing it. For a focused update, use npx playwright test --update-snapshots=changed; reserve all for deliberate full regenerations. Playwright’s commands and defaults can vary by version, so check the CLI reference for the version pinned in your project.
What a baseline update does—and why review matters
Playwright screenshot assertions compare a rendered page or element with a reference image. Updating baselines replaces or creates those reference files; it does not determine whether a visual change is correct. A failing comparison is a reason to investigate first, not an instruction to accept the new output. Playwright’s visual comparison guidance recommends reviewing changed snapshot files and committing approved snapshots to version control.
Use the following workflow when an intentional UI change should alter expected screenshots:
- Confirm the application change is intentional and identify which screenshot assertions it should affect.
- Run the relevant test or project in the environment that owns the existing baselines.
- Update only the snapshots appropriate to the change.
- Inspect each generated or changed image against its previous baseline.
- Commit the reviewed snapshot files with the application change that explains them.
Use the narrowest snapshot update mode
For mismatches caused by an intentional UI change, the focused command is:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchnpx playwright test --update-snapshots=changed
The CLI documents four update modes. Without an update flag, the current documented default is missing: Playwright creates absent snapshots, but the tests that create them fail. The short -u flag without a mode currently defaults to changed. Both behaviors are version-sensitive; check the CLI reference for your installed version before encoding them in team instructions or automation.
| Mode | Effect | Use it when |
|---|---|---|
changed |
Updates snapshots that do not match the current output. | An intentional change should update only mismatching baselines. |
missing |
Creates snapshots that do not exist. Under the current documented default, tests that generate them fail. | New screenshot assertions need reference files, and you will confirm those files are expected. |
all |
Regenerates every snapshot, including snapshots that already match. | You are deliberately regenerating all baselines, such as after an environment migration, and are prepared to review a broad diff. |
none |
Does not update snapshots; mismatches remain failures. | A run must prohibit baseline updates. |
To explicitly prohibit updates in a run, use:
npx playwright test --update-snapshots=none
Do not choose all just to clear a failure: it rewrites matching snapshots too, making it harder to distinguish necessary changes from broad regeneration.
Match the environment that produced the baseline
Playwright warns that screenshots can vary with host operating system, browser version, settings, hardware, power source, and headless mode. Its guidance is to run tests in the same environment where the baselines were generated. A difference caused by an environment change can look like an application regression—or can obscure one.
- Use the same operating system and relevant browser configuration as the baseline-generating environment.
- Keep Playwright and its browser binaries aligned. When updating Playwright, install the browser dependencies as documented in the browser installation guide, then run tests in the intended environment.
- Treat a deliberate browser, Playwright, or headless-mode change as a migration: review the resulting images rather than accepting them automatically.
- Check the release notes for the Playwright version in use if update-mode behavior is in question; update behavior has changed over time.
There is no universal test-selection command or repository approval policy prescribed for every project. Use your team’s established test filters and review process rather than treating a particular selection convention as a Playwright requirement.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Run the affected browser and device projects
Playwright projects can group tests by browser, device, or other configuration. A project name can also distinguish snapshot filenames. Consequently, a baseline update in one project does not establish that another project’s rendering is correct.
- Identify which projects contain the screenshot assertions affected by the UI change.
- Run those projects using the repository’s configured test selection.
- Inspect the project-specific snapshot artifacts and confirm each expected browser or device variant is covered.
Playwright’s visual comparison documentation explains snapshot naming and configuration, and its project documentation describes project-specific test execution: visual comparisons and test projects.
Rank #4
Review the image diff before committing
Open each changed image and compare it with the previous baseline. Check that visible differences follow from the intended interface change; investigate unexpected movement, missing content, changed fonts, or broad shifts before accepting the file. Keep approved baselines in version control alongside the application change so reviewers can understand why expected output changed.
When a CI failure is unexplained, use the Trace Viewer to examine the test timeline, DOM snapshots, and network requests. Tracing every test by default can be performance-heavy, so use tracing as a debugging aid rather than a replacement for reviewing image differences. See Playwright’s Trace Viewer and trace configuration documentation.
Best Value
Or skip the browser setup
Playwright baselines are still the right fit for repository-based visual tests and reviewed snapshot updates. If you need a standalone website screenshot instead, ScreenshotNeo can return an image or PDF from one API request. For example, save a screenshot of a public URL with cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses indicate the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan.
Frequently Asked Questions
Should I update snapshots when a visual test fails?
Not automatically. First determine whether the difference is an intended UI change; update and approve the reference image only when it is.
Does updating a Chromium baseline validate Firefox or WebKit too?
No. Run and inspect the affected browser or device projects separately; their screenshots can have distinct expected images.
Can I use Playwright screenshot baselines for arbitrary websites?
Playwright baselines are reference images for screenshot assertions in your tests. For a standalone website screenshot, a screenshot API such as ScreenshotNeo may be more direct.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




