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.

Playwright Test’s built-in screenshot assertions are the most direct way to add visual regression checks: use toHaveScreenshot() for a page or locator. Reliable results depend on comparing screenshots in a consistent rendering environment, stabilizing the page state, and reviewing every proposed baseline change before accepting it.

How Playwright visual testing works

A screenshot assertion captures rendered output and compares it with a reference image stored alongside the test. The first run creates that reference; later runs compare new captures against it. Screenshot assertions require the Playwright test runner. Page screenshot assertions are documented as available since Playwright v1.23; check the current visual comparisons guide for behavior in your installed version.

Use a page assertion when the entire page is the target. Use a locator assertion when you want to protect a stable component or region without making unrelated page changes part of the comparison.

Write a visual regression test

Compare a full page

This TypeScript test uses Playwright Test’s standard page fixture:

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.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
import { test, expect } from '@playwright/test';

test('home page visual appearance', async ({ page }) => {
  await page.goto('/');
  await expect(page).toHaveScreenshot('home.png');
});

Run the test once to produce the initial reference, inspect the image, and commit the approved snapshot with the test. On later runs, a mismatch should be treated as a finding to investigate—not automatically as a defect or as an acceptable update.

Compare one component

For a component-level check, locate the element and assert its screenshot instead of the whole page:

import { test, expect } from '@playwright/test';

test('navigation appearance', async ({ page }) => {
  await page.goto('/');
  await expect(page.getByRole('navigation')).toHaveScreenshot('navigation.png');
});

Choose a locator that consistently identifies the intended visual region. A focused capture reduces noise from unrelated page areas, but it will not detect a defect outside that region.

Keep screenshots reproducible

Pin the rendering environment

Pixels can differ across operating systems, browser versions, settings, hardware, power conditions, and headless modes. Playwright’s visual comparisons guide advises running tests in the same environment used to create baselines; its best-practices guide specifically recommends using the same operating system and browser versions.

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

In practice, create and compare snapshots in a consistent CI image with a pinned Playwright and browser version. Do not assume a baseline created on one operating system will be pixel-identical on another. If multiple browser projects or environments are part of your coverage, generate and review separate baselines for each. Snapshot filenames include browser and platform context, or the configured project name.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Control the page state and data

Make the capture represent a deliberate, user-visible state: use stable test data, a known viewport, and predictable navigation. Timestamps, random avatars, rotating promotions, animations, live data, and third-party embeds can create noisy diffs. Prefer fixing the test data or application state so the page is deterministic.

For content that cannot reasonably be stabilized, Playwright supports stylePath to apply a stylesheet during screenshot capture. Use it narrowly to hide or neutralize only the volatile region, and document why the exclusion is safe. A broad mask can conceal the layout regression the test is meant to catch.

Understand screenshot waiting and animation behavior

Screenshot assertions wait until two consecutive captures match before comparing the final image to its reference. Animations are disabled by default for screenshot assertions: finite animations are fast-forwarded, while infinite animations are canceled for the capture and then allowed to resume. These measures improve repeatability, but do not remove every source of nondeterminism. See the PageAssertions API for the current assertion options.

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

Set comparison tolerance deliberately

Playwright uses pixelmatch for screenshot comparison. The assertion API documents a threshold for acceptable perceived color difference in YIQ color space, with a documented default of 0.2. Configuration also supports maxDiffPixels and maxDiffPixelRatio to allow a specified number or proportion of differing pixels. See the assertion API and TestConfig API for details.

Start with the default or a strict tolerance, then adjust only if you have reviewed recurring benign variation. A tolerance is not evidence that a difference is harmless: an overly permissive setting can allow a genuine defect to pass. Prefer a small, documented, project- or assertion-specific allowance that matches the visual risk of the component.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Review and update baselines safely

When a comparison fails, inspect the expected, actual, and diff images. Decide whether the cause is an intended design change, an unintended regression, or rendering-environment drift before changing the reference. Playwright UI Mode can show screenshot attachments and compare images with a diff and overlay slider; see the UI Mode guide.

  1. Run the failing test in the environment used for baseline comparison.
  2. Inspect expected, actual, and diff images and identify the changed region.
  3. Check whether the difference is an approved interface change, a bug, or a source of nondeterminism.
  4. Only for an approved interface change, run npx playwright test --update-snapshots.
  5. Review the regenerated images and commit them with the code change.

Snapshots live in a directory associated with the test file and should be version-controlled. Avoid blanket snapshot updates: accepting new images without review can hide a real regression.

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

Choose the right visual coverage

Visual assertions verify appearance, not whether a control works or whether content is accessible. Keep behavioral assertions for functionality and accessibility checks for semantics. Playwright’s best-practices guide also recommends testing user-visible behavior, isolating tests, controlling database data, and using stable staging data where applicable.

Prioritize pages and components according to user impact and visual risk. Core navigation, sign-in and purchase or submission flows, shared design-system components, and responsive layouts are reasonable candidates. Where responsive behavior matters, choose explicit viewport or device projects and maintain reviewed baselines for them.

Run visual tests in CI and diagnose failures

Playwright recommends running tests frequently, ideally for each commit and pull request. Keep CI’s OS, browser, and Playwright version aligned with the baseline environment. If tests cover several browser projects, account for their separate expected images.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

For a difficult failure, use Trace Viewer to inspect the test timeline, DOM snapshots, and network activity. The best-practices guide notes that recording traces for every test can be performance-heavy, so configure tracing with that cost in mind. UI Mode and the HTML report can also help inspect screenshot differences.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common Playwright visual-test failures

The first run creates a snapshot instead of passing or failing

This is expected when no reference image exists yet. Inspect the created screenshot and commit it only if it represents the intended UI in the project’s chosen rendering environment.

A test fails repeatedly with small pixel differences

First confirm that baseline and test use the same OS, browser version, project, and screenshot settings. Then remove sources of unstable content or use a narrowly scoped stylePath for genuinely volatile content. Consider a tolerance only after inspecting the recurring difference and deciding it is benign.

A baseline changed after an OS or browser update

Rendering differences can follow changes to the operating system, browser version, settings, or headless environment. Restore the pinned comparison environment if the change was accidental. If the upgrade is intentional, review and regenerate the affected project-specific snapshots as part of the upgrade.

The whole-page comparison is noisy

If the intended contract is a particular component, switch to a locator screenshot assertion. If the whole page matters, keep the full-page check and stabilize the changing regions rather than narrowing coverage merely to make the test pass.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

A snapshot update appears to accept a defect

Do not update the baseline until the visual difference is understood and approved. Revert the generated snapshot change, fix the page or test state, and rerun the comparison against the existing reference.

Or skip the browser setup

For capturing a website screenshot as an API call rather than testing your application with Playwright Test, ScreenshotNeo returns an image or PDF from one GET request. It is a screenshot API and MCP server, not a replacement for Playwright’s snapshot assertions or visual-test runner.

Example using cURL; see the ScreenshotNeo documentation for request options:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
  • Cookie and consent banners, newsletter popups, and chat widgets are removed before capture; each removal step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers indicate 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.
  • The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

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

Frequently Asked Questions

Can Playwright visual assertions replace functional tests?

No. They check rendered appearance; use behavioral assertions to verify interactions and accessibility checks to verify semantics.

Do Playwright screenshot snapshots work across operating systems?

They can be stored for different projects or platforms, but rendering may vary. Create and compare baselines in consistent environments.

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.