Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

How to Set a Visual Testing Baseline and Update Screenshot Results

Update Playwright references with --update-snapshots after intentional UI changes, then inspect every changed image before committing it.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A visual testing baseline is an approved reference screenshot that later test captures are compared against. In Playwright Test, update local screenshot references with npx playwright test --update-snapshots after an intentional UI change—but inspect every changed image before committing. The command writes new references; it does not decide whether a visual difference is acceptable.

What a visual testing baseline does

A baseline is the accepted screenshot used as the reference for a later visual comparison. A test captures the current page, compares that image with the baseline, and reports differences. When a page changes deliberately, the reference must be updated through a reviewed process; otherwise, the test continues comparing against the older appearance.

As an Amazon Associate I earn from qualifying purchases.

Do not treat every difference as a reason to replace the reference. A changed screenshot may reflect an intended design update, or it may reveal an unintended regression. The reviewer—not the update command—makes that distinction.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Update Playwright screenshot baselines

Establish the initial reference

Run the visual tests that capture the page. If a reference snapshot is missing, Playwright can write the actual screenshot as the initial reference. The exact first-run behavior depends on the test and whether snapshots already exist.

After an intentional UI change

  1. Make the planned UI change and run the relevant visual tests.
  2. Update the reference screenshots with:
    npx playwright test --update-snapshots
  3. Inspect each modified snapshot image in your code review. Confirm that the difference is intentional and limited to the UI change under review.
  4. Commit approved snapshots alongside the implementation or test change. Playwright recommends reviewing snapshot changes and committing the snapshot directory to version control.

Use the command in the project that has Playwright Test configured, and check the installed project version if command behavior is in question. The flag updates references; it does not approve them. If an unexpected difference appears, investigate it instead of accepting the new image.

Keep the rendering environment consistent

Screenshot output can vary with its rendering environment. Playwright recommends generating tests in the same environment used to create the baseline screenshots. Differences in environment can therefore create image changes that are unrelated to the UI change being reviewed.

Review a baseline change instead of blindly accepting it

For local Playwright snapshots, review the changed image files in code review and decide whether each difference is expected. Keep the review tied to the corresponding UI change: a broad or unexplained screenshot update deserves investigation, not automatic approval.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Hosted visual-review workflows make the decision explicit. Applitools describes accepting a difference to save the new checkpoint as the future baseline, or rejecting it to retain the old baseline when the difference indicates a bug. In its Playwright report integration, only approved users can modify baselines; users who are not authenticated must log in to accept or reject a change.

  • Accept a difference when the reviewed visual change is intentional.
  • Reject a difference when it is unintended, so the previous baseline remains.

Local snapshots or hosted visual review?

These approaches differ in where references are managed and how a team reviews changes. Choose based on the existing test stack and approval process rather than assuming one workflow fits every project.

Consideration Local Playwright snapshots Hosted review workflow
Where references live Screenshot files in the test repository. References managed by the service; Applitools describes baselines associated with visual checkpoints.
How changes are reviewed Inspect modified image files in code review. Review differences in a visual report and accept or reject them.
Who can approve a change People with the relevant repository review permissions. For the Applitools Playwright report integration, approved users can modify baselines, and authentication is required.
Setup and existing-project behavior Run the Playwright visual tests and manage snapshots with the project. Follow the service and integration’s setup flow; commands and behavior are product- and version-specific.

Percy setup is a separate, version-sensitive path

Percy’s Playwright repository describes npx percy playwright:setup-baseline as a deliberate baseline-setup command for an existing project. It also says an ordinary percy exec run on an existing project does not automatically re-baseline it, and that setup uses committed Playwright screenshots. Check the current Percy integration and installed version before relying on this flow.

Rank #4
The Web Testing Handbook
  • Used Book in Good Condition

Troubleshoot unexpected screenshot changes

  • Many snapshots change after a small UI edit: inspect the full set of modified images and verify that the screenshots correspond to the intended test changes before accepting them.
  • Images differ between local runs and CI: check whether baseline generation and test execution use the same rendering environment, as Playwright recommends.
  • The update command changed references unexpectedly: review the resulting snapshot files before committing. The update flag writes references; it is not a selective approval mechanism.
  • You cannot accept or reject a hosted change: for the Applitools Playwright report workflow, confirm that you are authenticated and are an approved user.
  • A Percy run did not establish a baseline: for an existing project, Percy documents a deliberate setup command rather than ordinary-run re-baselining. Verify the current integration/version and use its applicable setup path.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For capturing a clean website screenshot outside a test-baseline workflow, ScreenshotNeo offers a single GET request. This creates a screenshot; it does not replace the review and approval step for visual-test baselines.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ScreenshotNeo API documentation

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, and failed loads are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server provides screenshot tools for AI agents, and the Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. See ScreenshotNeo or the API documentation.

Sign up free for 1,000 screenshots a month with no card.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.