To compare a single-page app (SPA) after navigation, trigger the in-app route change, wait for a destination-specific UI condition, then use Playwright Test’s screenshot assertion to compare the rendered state with a saved baseline. A URL change or navigation event alone does not prove the new view is ready: an SPA can update its interface without loading a new document. [Playwright: Navigations]
Capture the destination view, not just the route change
In an SPA, client-side navigation commonly replaces or updates part of the page while the browser remains on the same document. Wait for something users can see in the destination view—such as its heading or a key panel—before taking the screenshot. Playwright’s navigation guidance distinguishes browser navigation events from application-specific readiness. [Playwright: Navigations]
For example, if a click opens an account page, wait for the account heading rather than assuming that the click or a URL update means the page is visually ready. Use a condition tied to the view under test; a generic delay can be too short on a slow run and needlessly long on a fast one.
Compare the view with Playwright Test
Playwright Test provides toHaveScreenshot() to compare a captured page with a stored reference image. On the first run it creates a baseline; later runs compare the current screenshot against that reference. Review new and changed baselines deliberately, and commit approved reference images with the test code. [Playwright: Visual comparisons]
#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
import { test, expect } from '@playwright/test';
test('account view matches its visual baseline after navigation', async ({ page }) => {
await page.goto('http://localhost:3000/');
await page.getByRole('link', { name: 'Account' }).click();
// Wait for the destination view, not merely the click or URL change.
await expect(page.getByRole('heading', { name: 'Account' })).toBeVisible();
await expect(page).toHaveScreenshot('account-view.png');
});
Replace the example URL and accessible link and heading names with those used by your app. Keep the route-changing action, readiness condition, and screenshot assertion in the same test so the captured state follows the interaction being checked.
Capture only a relevant component
If the question is whether one panel or widget changed, a locator screenshot assertion can narrow the comparison to that element rather than the whole page. This reduces unrelated page regions in the comparison, but the element still needs to be visible and in its intended state before capture. [Playwright: Visual comparisons]
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
Make baselines and test runs comparable
Visual output can vary with operating system, browser version, browser settings, hardware, power source, and headless mode. Playwright recommends generating and testing baselines in the same environment. Use a consistent browser and operating-system setup, stable test data, and a deliberate viewport; otherwise, a diff may reflect the environment rather than an app change. [Playwright: Visual comparisons]
Dynamic content can also create noise. If timestamps, rotating content, or other changing regions are not part of what the test should verify, use a screenshot stylesheet or another appropriate masking approach to remove them from the visual comparison. Playwright supports configuring screenshot styles and pixel-difference tolerances. Choose tolerances in light of the variation you expect; a threshold is not proof that every remaining difference is harmless. Inspect the changed images before accepting them. [Playwright: Visual comparisons]
Recommended Free Tools
Rank #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.
Animations and screenshot stability
Playwright’s screenshot assertion waits for two consecutive screenshots to match before comparison. Finite animations are fast-forwarded to completion; infinite animations are canceled to their initial state during capture and then resumed. This helps with capture stability, but it does not replace controlling genuinely volatile content or choosing the correct destination state. [Playwright: Visual comparisons]
Review and update a visual diff
When a comparison fails, first inspect the actual and expected images. Decide whether the change is an intended design update, an unintended regression, or capture noise. Correct the cause or approve the design change before updating the reference. Playwright supports updating snapshots with --update-snapshots; use it only after reviewing the proposed new baseline. [Playwright: Visual comparisons]
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
- Confirm the state: check that the destination-specific condition was reached and the screenshot shows the intended view.
- Check the difference: identify whether the changed pixels reflect a product change, unstable data, or an inconsistent test environment.
- Fix or approve: adjust the app or test for an unintended change, or approve the intentional update.
- Update deliberately: run Playwright with
--update-snapshotsand review the resulting baseline changes before committing them.
Local Playwright or hosted visual review?
Playwright’s documented workflow stores reference snapshots for its assertions. Percy documents a Playwright integration that routes screenshot assertions through its hosted visual-testing workflow. The practical decision is whether local references and diffs suit your team, or whether you need a hosted review workflow shared across the team. Whichever you choose, keep rendering conditions consistent with the baseline. [Playwright: Visual comparisons] [Percy: Playwright integration]
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If you need a screenshot of a URL without writing a browser test, ScreenshotNeo returns an image or PDF from one GET request. For a website screenshot API, it is the first alternative to try: it removes cookie banners, popups, and chat widgets before the shot, and bills only clean shots—not bot checks, blank pages, or failed loads. Its MCP server lets AI agents take screenshots. This is a URL capture, not a replacement for the in-app navigation and state assertions in a Playwright visual regression test.
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 documentation for API options. Free includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for free.
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.
Frequently Asked Questions
Does a changed SPA URL mean the destination is ready for a screenshot?
No. Wait for a destination-specific UI condition, such as the view’s heading becoming visible.
Why can a screenshot diff appear when the app code has not changed?
Rendering environment differences and volatile page content can change the captured pixels. Keep the environment consistent and control regions that are not part of the comparison.
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.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →

