What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use Playwright Test’s toHaveScreenshot() assertion to create a visual baseline and compare later runs against it. Choose page to check a whole page or a locator to check one component. Keep baseline and comparison runs in a consistent environment, stabilize content that changes unpredictably, and review image diffs before updating snapshots.
Choose what the test should compare
Playwright Test provides two screenshot assertions. Use the page assertion when the page as a whole is the visual contract; use the locator assertion when only a component or region matters. A narrower target can avoid unrelated page changes obscuring the component-level check.
import { test, expect } from '@playwright/test';
test('landing page visual baseline', async ({ page }) => {
await page.goto('https://example.com');
await expect(page).toHaveScreenshot('landing.png');
});
test('navigation visual baseline', async ({ page }) => {
await page.goto('https://example.com');
await expect(page.locator('nav')).toHaveScreenshot('navigation.png');
});
The examples use Playwright Test’s expect assertions; they are not plain browser screenshots. See the PageAssertions API for page and locator screenshot assertions.
How Playwright creates and compares a baseline
On the first run, Playwright captures screenshots until two consecutive captures match, then saves the last one as the reference. Commit generated snapshots to version control so later test runs can compare against the same reviewed files. On subsequent runs, the assertion captures the page or locator and compares it with the saved expectation.
Recommended Free Tools
#1 Best Overall
- 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.
- Add a
toHaveScreenshot()assertion to the test. - Run the test once to generate its reference screenshot.
- Inspect the generated image and commit the snapshot alongside the test.
- Run the test again after code changes; inspect any reported image difference to determine whether it is a regression or an intended change.
The official visual comparisons guide describes this baseline workflow. Snapshot files are test assets, not disposable output: changes to them should be reviewed like changes to application code.
Make captures more deterministic
Keep the rendering environment consistent
Playwright warns that rendering can vary with the host operating system, browser version and settings, hardware, power source, headless mode, and other factors. Generate and compare snapshots using the same host and browser configuration where visual consistency matters. A baseline created on one environment may produce differences when tests run elsewhere.
Rank #2
- 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.
Wait for stable content and control animation
The screenshot assertion waits for two consecutive matching captures, which helps avoid saving an image while rendering is still changing. The screenshot assertion API disables animations by default. That does not make external or time-varying content deterministic, so check whether a changing region is part of what the test is meant to verify.
Hide content outside the visual contract
If an iframe or other volatile element is irrelevant to the assertion, use stylePath to apply CSS that hides it during the screenshot. For example:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesRank #3
- 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.
await expect(page).toHaveScreenshot('landing.png', {
stylePath: './tests/visual-snapshot.css',
});
/* tests/visual-snapshot.css */
iframe {
visibility: hidden !important;
}
Use this selectively. Hiding a region makes the test insensitive to changes there, so do not remove content that the visual check is supposed to protect.
Set a difference tolerance deliberately
maxDiffPixels sets the maximum number of differing pixels accepted by a screenshot assertion. Use a project-level or per-assertion allowance only after deciding which differences are acceptable. A larger allowance can make tests less sensitive and may let a meaningful visual regression pass; there is no universally correct threshold established by the documentation.
Rank #4
- 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
await expect(page).toHaveScreenshot('landing.png', {
maxDiffPixels: 100,
});
The number above is an illustrative configuration value, not a recommended default or benchmark. The SnapshotAssertions API also documents maxDiffPixelRatio and a perceived-color threshold for generic value snapshots. Choose settings appropriate to the assertion and the visual changes the test should catch; do not widen them simply to silence a failure.
Review and update snapshots for intentional changes
When a design change is intentional, update the reference with:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Best Value
- 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.
npx playwright test --update-snapshots
Inspect the updated images and their diffs before committing them. Updating snapshots without review can turn an unintended regression into the new expected result.
Troubleshoot visual test failures
- Differences appear only on another machine or CI runner: compare the host operating system, browser version and settings, headless mode, and hardware configuration. Run baseline creation and comparison in a consistent environment.
- The snapshot changes between runs: identify animated or time-varying content. The assertion waits for consecutive matching captures and disables animations by default; hide irrelevant unstable regions with
stylePathrather than masking the whole page. - A full-page test fails because of an unrelated region: narrow the assertion to a stable locator if that component is the actual visual contract.
- A small rendering shift causes a failure: inspect the diff first. If the change is acceptable, set a carefully scoped difference allowance such as
maxDiffPixels; increasing tolerance can conceal real regressions. - An intended redesign keeps failing against the old image: run
npx playwright test --update-snapshots, review the new baseline, and commit the reviewed snapshot.
Or skip the browser setup
If your goal is to capture a website image rather than maintain Playwright visual-regression baselines, ScreenshotNeo offers a one-request screenshot API and an MCP server. It accepts cookie banners and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. AI agents can use its MCP tools to take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. This is a capture service, not a replacement for Playwright’s committed-baseline comparison workflow.
For API options, see the ScreenshotNeo documentation. Example cURL request:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Sign up for 1,000 free screenshots a month—no card required.
Frequently Asked Questions
Can I compare only one component instead of a whole page?
Yes. Use await expect(locator).toHaveScreenshot() to define the visual check around a locator.
Does Playwright document a universally best pixel threshold?
No. maxDiffPixels is an option for setting an allowance, not an empirical recommendation for a particular project.
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.

