DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

How to Test CSS Animations and Transitions in Visual Regression Screenshots

Learn when to disable CSS motion for stable screenshot baselines and how to capture deliberate states when animation behavior itself matters.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For stable visual-regression baselines, wait until the page is ready and suppress incidental motion before capturing. Playwright’s toHaveScreenshot() disables CSS animations, transitions, and Web Animations by default. If the animation itself is what you need to test, define deliberate checkpoints and capture them at controlled states rather than relying on an arbitrary instant.

Why animations make screenshot tests flaky

A screenshot records the pixels present at capture time. If an element is moving, fading, or changing size, two otherwise identical test runs can capture different intermediate frames. A diff may then report a visual change that is only timing variation, not a regression in the page’s settled appearance. Cypress likewise recommends confirming that the page has finished changing before taking a snapshot. Cypress visual testing guidance

As an Amazon Associate I earn from qualifying purchases.

Make appearance baselines deterministic

Playwright: use the screenshot assertion default

Playwright Test’s toHaveScreenshot() creates a reference screenshot on its first execution and compares subsequent runs with that reference. It waits until two consecutive screenshots match before comparing. The assertion’s animations option defaults to "disabled", so the ordinary baseline path is to wait for application readiness and take the assertion without enabling animation. Playwright visual comparisons

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { test, expect } from '@playwright/test';

test('checkout page has a stable visual baseline', async ({ page }) => {
  await page.goto('https://example.com/checkout');
  await page.getByRole('heading', { name: 'Checkout' }).waitFor();

  // The default animations setting is "disabled".
  await expect(page).toHaveScreenshot('checkout.png');
});

If you want the intent visible in the test, set the option explicitly:

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • 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
await expect(page).toHaveScreenshot('checkout.png', {
  animations: 'disabled',
});

The accepted values are "disabled" and "allow". Disabling animations is not a neutral pause: Playwright fast-forwards finite animations to completion and fires transitionend; infinite animations are canceled at their initial state for the capture and played over afterward. That behavior can matter if your app or test observes animation events or expects a specific state. Playwright screenshot assertion API

Control page-specific dynamic styling when needed

For page-specific visual noise beyond motion, Playwright’s visual comparison documentation includes project-level configuration and the stylePath option for applying a stylesheet during screenshot capture. Use that only when the stylesheet expresses a deliberate test condition; otherwise it can hide a real visual regression. Playwright visual comparisons

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • 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

Cypress: do not confuse action waits with screenshot control

Cypress recommends waiting for the page to stabilize or disabling animations as appropriate before taking a snapshot. Its waitForAnimations and animationDistanceThreshold settings concern action commands such as clicking: they help ensure the target element is not moving before interaction. They do not globally stop an unrelated animation elsewhere on the page when a screenshot is captured. Treat screenshot stabilization as a separate step. Cypress visual testing guidance

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

When the animation is what you are testing

Do not suppress motion if the requirement is that an animation or transition works. Instead, decide which states matter and make the test reach each state intentionally. Typical checkpoints include the pre-interaction appearance, the state immediately after the triggering action, and the intended final state. Capture or assert those states using application-controlled state changes or other explicit synchronization. The official guidance cited here explains how to stabilize visual screenshots; it does not prescribe a universal frame-by-frame animation-testing recipe.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • 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.

With Playwright, animations: 'allow' preserves animation rather than applying the screenshot assertion’s disabling behavior. Use it only when the animated state is deliberately part of the screenshot and your test controls when capture occurs. Merely allowing animation does not make a capture deterministic: if the test takes the screenshot at an uncontrolled time, the captured frame can still vary. Playwright screenshot assertion API

Choose the screenshot scope and stabilize other inputs

  • Keep rendering conditions consistent. Differences in rendering environment, fonts, timing, or test data can change screenshots even when the application has not meaningfully changed. Use controlled data and a consistent environment. Cypress visual testing guidance
  • Capture only what the test needs. If a component or element is sufficient, prefer a focused screenshot over a full-page image; every additional region can introduce unrelated sources of diff noise. Cypress visual testing guidance
  • Separate static appearance checks from behavior checks. A stable baseline answers whether the settled visual appearance changed. A motion test answers whether the intended transition occurs. Combining both goals in one uncontrolled capture makes failures harder to interpret.
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 a screenshot endpoint rather than an in-test animation assertion, ScreenshotNeo accepts one GET request with a URL and returns an image or PDF. Its capture cleanup accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. It is useful for capturing a deliberately settled state, but it does not replace a browser test that verifies animation behavior.

Example cURL request (replace the target URL and supply your API key):

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • 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
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【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.

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.