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

Use Playwright Test’s built-in toHaveScreenshot() assertion to detect visual changes in a website from GitHub Actions. Playwright saves a reference image on the first run and compares later screenshots against it. Review and commit the initial references, run comparisons in a consistent browser environment, and update baselines deliberately when a visual change is intentional.

How Playwright screenshot checks work

A screenshot assertion captures a page or component and compares the result with a reference image stored alongside the test project. The first run creates that reference; subsequent runs report differences. These checks complement functional assertions: a matching screenshot does not prove buttons, forms, navigation, or other behavior work correctly.

Playwright documents the assertion and reference-image workflow in its Visual comparisons documentation.

Set up screenshot checks in a repository

  1. Choose stable pages and states

    Pick representative pages or interface states that matter to the change review. Make test data, authentication, and page state predictable so the capture reflects the intended UI rather than incidental content.

    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.
  2. Write a screenshot assertion

    For a project with Playwright Test configured, a basic test can look like this:

    import { test, expect } from '@playwright/test';
    
    test('home page visual appearance', async ({ page }) => {
      await page.goto('http://127.0.0.1:3000');
      await expect(page).toHaveScreenshot();
    });

    Replace the example address with the predictable local or test deployment URL used by your project. Add separate tests for other pages or meaningful UI states rather than relying on one screenshot to represent the entire site.

  3. Create and review the first baselines

    Run the Playwright test command used by your project. On the first execution, Playwright creates reference screenshots. Inspect these files as expected output before committing them with the tests. An incorrect initial reference makes later comparisons misleading.

    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.
  4. Run Playwright in GitHub Actions

    Set up a workflow that checks out the repository, installs the runtime and project dependencies, and runs the project’s Playwright test command. Playwright’s Continuous Integration guide covers CI setup. Ensure any application server or test site the tests need is available before the screenshot tests run.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  5. Review failures and update intentional changes

    When a screenshot differs, inspect the captured output and diff before deciding whether it is a regression or a planned design change. For an accepted visual change, update the references deliberately with npx playwright test --update-snapshots, review the new images, and commit them with the code change. Playwright documents this baseline-update option in its snapshot update guidance.

Keep CI screenshots stable

Pixel comparisons depend on rendering conditions. Playwright warns that output can vary with host operating system, browser version and settings, hardware, power source, and headless mode. Where possible, use the same operating-system and browser environment to create baselines and run CI; a consistent container or runner configuration can help. See Playwright’s visual comparison notes.

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.

Also reduce avoidable variation in the page itself. Use predictable test data and state, and avoid capturing content that changes on each run unless the test specifically needs it. If a page depends on animation or delayed content, arrange the test so that the captured state is repeatable.

Set screenshot comparison tolerance carefully

Playwright provides options including threshold and maxDiffPixels to control acceptable differences. They are useful for managing known rendering variation, but they do not make a flaky test reliable. Tune them against reviewed examples: generous tolerance can conceal a real visual regression. Consult the documented screenshot assertion options and adjust only when you understand the differences being allowed.

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

Choose local baselines or hosted visual review

Approach What the documented workflow supports Consider it when
Playwright screenshot assertions Captures and compares against reference images; references can be updated with --update-snapshots. You want local baseline files and control over their review and updates.
Percy with Playwright Percy documents a Playwright client integration for snapshots and an optional visual-change gate. See its client library and Playwright guide. You want a hosted snapshot review workflow; confirm current integration behavior and service terms for your project.
Chromatic Chromatic documents GitHub Actions automation and Playwright visual testing. See its GitHub Actions guide and Playwright setup. Your team wants a hosted review process or already uses a related Storybook or Playwright workflow; check current setup and service terms.

These documentation sources establish different workflows, not a universal winner on accuracy, cost, or ease of use. Choose based on whether local reference management or hosted visual review best matches how your team inspects and accepts changes.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. It is for capturing pages, not a replacement for Playwright’s baseline comparison assertion; use it when you want to request screenshots without maintaining browser-capture setup in your own workflow.

One GET request returns an image or PDF. For example, this cURL request saves a WebP screenshot:

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 parameters. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for free.

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

Troubleshoot common failures

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.