To capture a baseline for Cypress visual regression testing, first drive the application into a repeatable, meaningful state; then use a visual-testing plugin or service to capture the image, compare it with an approved baseline, and review differences. Cypress’s built-in cy.screenshot() captures an image but does not compare it with a baseline. Make the browser, viewport, data, time, and page state consistent so a reported difference reflects a UI change rather than incidental variation.
What a Cypress visual baseline does—and what it does not do
A baseline is an approved image of a particular application state. On later runs, a visual-testing tool captures the corresponding state and compares it with that approved image. The resulting diff helps reveal changes to layout, styling, or rendered content.
cy.screenshot() is Cypress’s screenshot command, not a visual regression system. It can save an image for inspection, but baseline storage, image comparison, and an approval workflow require a separate plugin or service. Cypress’s own visual-testing guide names integrations and open-source options, but their commands and workflows differ. Don’t treat an example command such as cy.compareSnapshot() as a built-in Cypress command.
Set up a stable state before capturing
The most important step is to make the page reproducible. A screenshot taken while data is loading, an animation is running, or a date-dependent message is changing can fail even when the UI has not meaningfully regressed.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
- Use the same rendering environment: run baseline generation and comparison with the same CI image and browser. Pin browser versions where possible; operating system, fonts, and display scaling can affect pixels.
- Set the viewport explicitly: use the same viewport for baseline and comparison. If responsive behavior matters, capture separate intentional viewport cases rather than relying on whichever size a runner happens to use.
- Control network data: use
cy.intercept()with fixtures or stable responses for APIs that return changing content. - Control time: use
cy.clock()when displayed dates, times, or countdowns would otherwise vary. - Wait for the actual UI state: assert that expected content is present and that relevant rendering has completed before capturing. Prefer a condition tied to the app over an arbitrary delay.
- Handle animation deliberately: suppress animation in test setup where practical, or wait for it to finish. Cypress’s
waitForAnimationsandanimationDistanceThresholdoptions apply to action commands; they do not guarantee that an unrelated animation will not be in progress when a screenshot is taken.
Screenshot capture is asynchronous. Cypress documents that it takes around 100 ms, and the application can change between issuing the command and the completed capture. Stabilize the state before the command rather than assuming the screenshot freezes the app at the instant it is called.
Write the Cypress test around a meaningful state
Use ordinary Cypress actions and functional assertions to reach and verify the state you want to protect. Then call the snapshot command provided by your chosen visual-testing tool. Since that command is tool-specific, the example below deliberately leaves it as an integration point rather than pretending Cypress provides a universal comparison API.
it('renders a completed todo consistently', () => {
cy.visit('/')
cy.viewport(1280, 800)
cy.get('.new-todo').type('write tests{enter}')
cy.contains('.todo-list li', 'write tests').find('.toggle').check()
cy.contains('.todo-list li.completed', 'write tests')
// Replace this integration point with the command and options
// documented by your selected visual-testing plugin or service.
// It should capture this state and compare it with an approved baseline.
})
The test demonstrates state setup and an assertion, not a complete comparison. Add the exact capture, naming, masking, and approval syntax from the provider you adopt. Keep a functional assertion even when a visual check exists: an image diff is not a substitute for verifying that the intended behavior occurred.
Choose the right screenshot scope
Cypress documents viewport, full-page, and runner capture modes; an element screenshot is also available by calling cy.screenshot() from a command that yields a single DOM element. The screenshot command’s documented capture choices are viewport, fullPage, and runner, with fullPage listed as the default. An element screenshot ignores that option.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- Element-level: use it when a component or region is the design contract you want to protect. A narrower capture can help identify which component owns a difference and avoid unrelated page changes creating noise.
- Viewport: use it when the visible screen at a specific viewport is the intended test unit.
- Full page: use it for page-wide layout regressions when the whole page is the meaningful unit. It can also make a diff harder to diagnose if unrelated regions change.
- Runner: choose it only when including the Cypress runner is useful to your workflow, rather than as a substitute for an application-focused snapshot.
Cypress saves screenshots to cypress/screenshots by default. Named screenshots use the supplied name; duplicates receive a numeric suffix unless overwrite: true is set. Cypress organizes screenshots relative to the spec path and test name. For baseline comparisons, follow the chosen integration’s own naming and storage conventions instead of assuming Cypress’s debugging screenshot folder is also its baseline store.
Choose a comparison workflow
| Approach | What it provides | Trade-offs to assess |
|---|---|---|
| Local open-source plugin | Image capture and comparison can run locally or in CI, with baselines and review artifacts under team control. | Your team manages baseline updates, artifact storage and review, environment consistency, and plugin maintenance. |
| Hosted visual service | Depending on the service, it can manage rendering or capture, baseline storage, comparison, and review. Some support multiple browsers or viewport widths. | Compare supported browsers and viewports, CI or pull-request workflow, rendering consistency, review process, and current service terms. |
Cypress’s visual-testing guide names commercial integrations including Applitools Eyes, Argos, Chromatic, Happo, LambdaTest SmartUI, Percy, Sauce Labs Visual, SmartBear VisualTest, and Wopee.io. It also points to open-source options including Cypress Image Diff, Cypress Image Snapshot, Cypress Visual Regression, Visual Regression Diff, and Pixeleye. These are options to investigate, not interchangeable implementations: capture models, comparison methods, supported test types, and review experiences vary. Check each provider’s current official documentation and compatibility information before choosing or adding tool-specific test code.
Cypress describes local plugins as free and self-managed, with the team responsible for baselines and review. Hosted services trade a subscription for managed features; the exact feature set depends on the provider. There is no universally best comparison method: consider how the tool handles rendering noise, useful defect detection, explainability, masking, and thresholds.
Review and update baselines responsibly
- Run the visual test against the approved baseline and inspect the difference produced by the selected tool.
- If the change is intended, approve or regenerate the baseline using that tool’s documented workflow.
- If the change is unintended, fix the UI and rerun the comparison.
- Keep captures focused and purposeful. Each changed snapshot creates review work; broad, indiscriminate coverage can make reviewers more likely to approve diffs without examining them.
Use masking only for unavoidable dynamic regions and keep it narrow. A page-wide threshold is not a good substitute for stabilizing known variable inputs. Visual comparisons also do not establish accessibility: pair them with accessibility checks, since an image diff does not determine whether text contrast meets a standard.
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 matchRank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
What Cypress screenshots do on failure
During cypress run, Cypress captures screenshots on test failure by default; it does not do so automatically during cypress open. These failure screenshots are useful debugging artifacts, not approved visual baselines or evidence that a visual comparison has run.
The screenshot API also documents blackout selectors for hiding sensitive content, plus defaults affecting capture behavior, timers, and animations. Confirm the desired options against the Cypress version used in your project. Do not assume defaults from another version or a plugin apply to your setup.
Troubleshooting common visual-test failures
The test fails on every run even though the UI looks unchanged
Check for changing API responses, dates, countdowns, animations, ads, or other asynchronous content. Stub relevant requests, freeze time where appropriate, assert on the rendered state, and use the same browser and CI image for baseline and comparison. Mask only genuinely unavoidable variability.
The screenshot is blank or captures the wrong state
Verify that the test navigated to the expected page and that an assertion confirms the target content before the snapshot call. Wait for a meaningful application condition rather than taking the screenshot immediately after navigation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
A page-level diff is too noisy to review
Decide whether the whole page is actually the intended failure unit. If not, capture a meaningful component or region instead. Also check for unrelated dynamic sections and stabilize or narrowly mask them.
The test passes locally but differs in CI
Compare the browser, operating system image, fonts, viewport, and display scaling between the two environments. Generate and compare baselines in the same controlled environment where possible, and pin browser versions when practical.
The test uses cy.compareSnapshot() but Cypress reports an unknown command
That command is not built into Cypress. Install and configure a visual-testing integration that provides the command, then use the exact API documented by that tool. Cypress’s example illustrates the general idea; it does not define a universal plugin interface.
A failed test has a screenshot, but there is no baseline diff
Cypress’s automatic failure screenshot is a debugging capture. Add and configure a separate visual-testing plugin or service to store approved baselines, compare captures, and provide a review workflow.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Or skip the browser setup
ScreenshotNeo is a screenshot API and MCP server, not a Cypress baseline-comparison plugin. It can be useful when you need a clean screenshot of a URL without setting up a browser capture flow; a visual regression workflow still needs a tool that manages approved baselines and comparisons. Its cookie-banner acceptance and cleanup can remove cookie or consent banners, newsletter popups, and chat widgets before capture, with each step configurable. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers report the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
One GET request returns an image or PDF; this example saves a WebP screenshot of a page:
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 offers 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000. Sign up for free ScreenshotNeo access.
Frequently Asked Questions
Can Cypress visual tests check accessibility compliance?
No. A visual diff can reveal rendered changes, but it does not determine whether a page meets accessibility standards; use accessibility checks alongside visual testing.
Recommended Free Tools
Should every Cypress test have a screenshot baseline?
No. Choose snapshots where the visual state has a clear purpose and an owner; excessive snapshots create review work without necessarily improving defect detection.
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.

