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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

To run visual tests in Cypress, install one visual snapshot plugin or service, register it as its documentation requires, drive the app to a stable state, and take a snapshot at a meaningful checkpoint. The tool compares that capture with a baseline and reports visual differences for review. Cypress itself provides the browser-testing foundation; snapshot comparison comes from an integration.

What a Cypress visual snapshot test does

A visual snapshot records how a page or component looks at a particular point in a test. On later runs, the integration compares the new capture with an approved baseline and flags differences. This complements functional assertions: a test can confirm that a button exists and works, while a visual comparison can catch an unexpected shift in layout, typography, or styling.

Cypress’s documentation describes visual testing as “a great complement to functional testing.” A visual diff is not automatically a defect: it is evidence of a change that someone should assess. The review step distinguishes an intended redesign from an accidental regression.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Choose a local plugin or hosted service

Start by deciding where snapshots and baselines should live, how they will be reviewed, and which rendering environments you need. Cypress lists both local/open-source options and hosted integrations. The catalog changes, so check current Cypress compatibility metadata and package versions before installing.

Approach Examples listed by Cypress What to plan for
Local or open source Cypress Image Diff, Cypress Image Snapshot, Visual Regression Diff, and Pixeleye Your team manages baseline storage and updates, CI artifacts and review, and rendering consistency.
Hosted service Percy, Sauce Labs Visual, Happo, LambdaTest SmartUI, SmartBear VisualTest, and Wopee.io These products generally provide capture or upload workflows, cloud rendering, comparisons, and web-based review. Capabilities differ by service; verify the current integration and plan details.

Compare candidates on baseline location, image versus DOM capture, supported browsers and viewport widths, element masking, component-test support, pull-request review, baseline-update workflow, and subscription or infrastructure cost. Do not assume every integration offers the same coverage or review controls.

Percy’s Cypress integration uses cy.percySnapshot() to capture DOM snapshots, then renders them across browsers and responsive widths in its cloud review workflow (Percy Cypress integration). Sauce Labs Visual provides baseline creation, region ignoring, DOM capture, and platform review; consult its current Visual documentation for setup. If you are evaluating screenshot APIs or services rather than Cypress snapshot integrations, ScreenshotNeo is an option to consider first: it removes known consent banners, popups, and chat widgets before capture, and bills only clean shots.

Install and register one integration

Use one plugin or service integration for a given comparison workflow unless you have a specific reason to maintain separate systems. Each tool has its own package, configuration, authentication, and command-registration steps; follow its current installation guide rather than copying setup for a different plugin.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Select the integration. Check the current Cypress catalog entry and the tool’s own documentation for supported Cypress versions and whether the integration fits end-to-end tests, component tests, or both.
  2. Install and configure it. Follow the documented package installation and registration steps. For a hosted service, configure credentials using your CI secret-management system instead of committing tokens to the repository.
  3. Confirm the command is available. Run a small test and verify that Cypress recognizes the integration’s snapshot command. Cypress’s illustrative command is cy.compareSnapshot('completed-todo'); Percy’s command is cy.percySnapshot(). These commands belong to their respective integrations and are not built-in Cypress commands.
  4. Make a baseline deliberately. Run the tool’s documented baseline-creation workflow, inspect the resulting image or review entry, and ensure the baseline corresponds to the intended application state.

Cypress’s catalog showed @frsource/[email protected] and @simonsmith/[email protected] as updated in September 2026, with compatibility metadata. Treat those as catalog observations, not a universal recommendation; check the live entry and package instructions before choosing a version.

Build a deterministic visual test

The most important reliability rule is to snapshot only after the page has stopped changing. Cypress puts it plainly: “Best Practice: Take a snapshot only after you confirm the page is done changing.” A capture taken while data, fonts, animations, or images are still loading can differ between runs without any code change.

Wait for a meaningful readiness condition

Prefer an observable application state over a fixed delay. Wait for the loading indicator to disappear, a result heading to appear, or another element that proves the view is ready. For variable API data, use cy.intercept() with a fixture or otherwise control the response so the same content is rendered every run.

Control the rendering inputs

  • Set a consistent viewport for the checkpoint.
  • Keep the browser version and operating environment consistent between baseline creation and CI comparison where the tool allows it.
  • Use stable test data and deterministic API responses.
  • Ensure required fonts and images have loaded before capture.
  • Avoid uncontrolled time-dependent content, random values, rotating promotions, and animations.

Choose the right snapshot boundary

Capture a key component or region when the goal is to catch a localized change with a reviewable diff. Component tests are particularly useful for this: they render one component with controlled data and a smaller surface area. Use full-page captures for page-level layout regressions when the additional review work is worthwhile. Cypress recommends choosing visual checkpoints deliberately because every snapshot adds review overhead.

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

Mask only genuinely variable content

Third-party widgets, advertisements, animated media, and other changing regions can produce noise. Use the integration’s ignore or mask controls for the smallest practical area rather than loosening a page-wide threshold. Masking too much can conceal genuine regressions, so keep excluded regions narrow and documented.

Take and review snapshots

After the test has reached the intended state, invoke the command documented by your integration. For a plugin using Cypress’s illustrative API, the checkpoint may look like this:

cy.compareSnapshot('completed-todo')

For Percy, the documented command is:

cy.percySnapshot()

These examples illustrate plugin-specific commands; they are not interchangeable. A useful checkpoint name identifies the state being tested, such as a completed task view, rather than a vague label like “page.”

  1. Run the test and let the selected integration produce its image or DOM comparison.
  2. Inspect the reported diff in local output, CI artifacts, or the hosted review interface.
  3. Decide whether the change is intended by checking the relevant application change and surrounding UI.
  4. Approve or update the baseline only after that review. Do not accept every new image automatically just to clear a failing build.

Local tools leave baseline storage, artifact retention, and the review process to your team. Hosted services add a web-based review and approval flow, but you still need a human decision about whether a difference is correct.

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

Why Cypress visual tests are flaky

  • Snapshot runs before rendering finishes: wait for a visible state change or application readiness signal, not an arbitrary short timeout.
  • API data changes between runs: stub changing responses with cy.intercept() and fixtures, or use stable test data.
  • Animation or media varies: disable or control animation where feasible and mask only the small, unavoidable dynamic region.
  • Fonts or assets load inconsistently: ensure they are available before capture and use a consistent environment.
  • Viewport or browser differs: standardize viewport dimensions and browser version for baseline and comparison runs.
  • Large snapshots create noisy reviews: prefer component or element-level checkpoints when they answer the question; reserve full-page snapshots for layout coverage.
  • Baseline updates are accepted without review: inspect the difference first, then update the baseline only for an intended visual change.

Or skip the browser setup

For a screenshot of a URL outside your Cypress test workflow, ScreenshotNeo offers a one-request capture. It is a screenshot API and MCP server for developers; it does not replace a visual regression test’s baseline comparison and review.

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. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for free and take 1,000 screenshots a month with no card.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting setup and comparison failures

Cypress does not recognize the snapshot command

The package may not be installed or its support file, plugin registration, or configuration may be missing or out of date. Recheck the selected tool’s current Cypress setup instructions and confirm that the test loads the registered command before invoking it.

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

Every run produces a different diff

First check readiness, changing API responses, animation, fonts, browser version, and viewport. Stabilize the earliest variable source you find; increasing a global comparison threshold can hide real layout changes rather than fix the cause.

The baseline is missing or the test reports a new snapshot

Follow the chosen integration’s documented baseline creation or update flow, and verify that the test uses the intended snapshot name and environment. With a local plugin, also check that baseline files and CI artifacts are stored and retrieved as your team expects.

A hosted review differs from the local browser

Check which browser and viewport the service rendered, whether it captures a DOM snapshot or an image, and whether local fonts, assets, or data are available to its rendering environment. Align the test inputs and consult that service’s integration guidance before approving a baseline.

Or skip the browser setup

Developers who need direct website captures can also use ScreenshotNeo’s Python or Node.js request example; use the API rather than a Cypress snapshot command when you need an image or PDF from a URL, not a baseline diff.

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

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo supports PNG, JPEG, WebP, and PDF output. Its response identifies page verdict and billing status with X-Page-Verdict and X-Billed headers. Other options include full-page captures with lazy images loaded, CSS-selector element capture, device and viewport selection, retina scale, PDF page settings, custom CSS or JavaScript, selector waits, request blocking, custom headers and cookies, caching, signed public image links, asynchronous jobs, bulk capture, and an MCP server. These are capture capabilities, not Cypress visual-diff assertions.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

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

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.