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

Use Playwright Test to capture screenshots of important Magento storefront pages and states, then compare future runs with expect(page).toHaveScreenshot(). Keep the browser, operating system, viewport, test data, and rendering conditions consistent between baseline creation and comparison. Screenshot checks reveal visual changes; pair them with functional tests to verify that the store still behaves correctly.

What to decide before writing visual tests

Identify the storefront stack and supported browsers

“Magento storefront” can refer to different storefront implementations. First identify whether the site is Adobe Commerce or Magento Open Source, which storefront stack it uses, and which browser-support policy applies. For Adobe Commerce Storefront, Adobe directs teams to check the @dropins/tools entry in package.json and match it to the corresponding storefront browser compatibility table. That table is tied to particular boilerplate suites, so its browser versions should not be treated as a timeless Magento-wide list.

Adobe’s guidance recommends testing the oldest and newest supported major versions of each browser the project cares about, plus real phones and tablets and common viewport widths. Choose the actual matrix from the current support table and your project’s requirements, rather than assuming one fixed set of browsers covers every Magento storefront.

Pick routes and states that matter to shoppers

Begin with pages where a rendering fault could interfere with finding or buying a product. A practical starting set is the homepage, category or product-listing page, product-detail page, search results, cart, and checkout entry. Add states that exist in your store and matter to the user journey, such as an open navigation menu, selected product variant, validation message, empty cart, or populated cart. This is a project-specific test plan, not a route list prescribed by Adobe.

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.

Make screenshots repeatable

A screenshot assertion compares rendered pixels, so uncontrolled changes can create noise. Playwright notes that rendering can vary with the host OS, browser version and settings, hardware, power source, headless mode, and other factors. Run baseline generation and comparison in the same controlled environment wherever possible.

  • Use the same operating system and Playwright browser build for baseline creation and CI comparison.
  • Fix the viewport and device settings for each test case; name cases so the route and viewport are clear.
  • Use repeatable product, inventory, cart, account, locale, currency, and consent state. Reset or seed test data rather than relying on a changing live store.
  • Wait for the specific content under test and for fonts to load before capturing.
  • Disable animations and avoid rotating promotions, timestamps, or other changing content unless that movement or content is what the test is intended to check.
  • Make navigation and authentication deterministic. If a test needs a signed-in customer or a particular cart, establish that state explicitly.

These controls are implementation recommendations: they reduce incidental differences so reviewers can focus on meaningful changes.

Set up Playwright screenshot assertions

Use the Playwright Test runner for toHaveScreenshot(). The first run creates expected snapshots; later runs compare the captured rendering with those references. Keep snapshot generation, review, and updates within the same test workflow.

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.

Install the test runner

In an existing Node.js project, install Playwright Test and its browser binaries:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npm init playwright@latest

Follow the installer prompts for the project’s language and test directory. In an existing Playwright project, use its installed Playwright Test dependency and ensure the CI image has the matching browser binaries installed. Playwright’s screenshot comparison documentation covers snapshot behavior and configuration.

Write a small, runnable visual test

For example, save this as tests/storefront.visual.spec.ts. Replace the base URL and selectors with those used by the target storefront.

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.
import { test, expect } from '@playwright/test';

test('homepage visual baseline', async ({ page }) => {
  await page.setViewportSize({ width: 1440, height: 1000 });
  await page.goto('https://store.example.com/', { waitUntil: 'domcontentloaded' });
  await page.locator('main').waitFor({ state: 'visible' });
  await page.evaluate(() => document.fonts.ready);

  await expect(page).toHaveScreenshot('homepage-desktop.png', {
    fullPage: true,
    animations: 'disabled'
  });
});

The domain is an example: point the test at a controlled test or staging storefront. The assertion captures a full-page image and disables animations for that assertion. For a viewport-only capture, omit fullPage or set it to false. If a reliable page landmark is not available, wait for a store-specific selector that indicates the intended content is ready.

Create and review the baseline

  1. Run the visual test in the chosen baseline environment: npx playwright test tests/storefront.visual.spec.ts.
  2. Inspect the generated expected screenshot and confirm that it shows the intended route, state, and viewport. The first run establishes the reference rather than proving the page is correct.
  3. Commit reviewed baseline files with the test code so later runs have a known reference.
  4. Run the same test in the same environment after changes. Playwright reports a mismatch when the new rendering differs from the expected image.
  5. Inspect the expected image, actual image, and diff before deciding whether the change is a defect or an intended redesign.
  6. Update snapshots only after reviewing the change. Run npx playwright test --update-snapshots deliberately, then inspect and commit the new baselines alongside the relevant code change.

Expand coverage without making the suite noisy

Organize a route-and-state matrix

Start with a small number of high-value combinations, then add cases when they protect a meaningful customer path or a supported device. A matrix helps make omissions visible:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Case Example coverage State to control
Homepage Desktop and a common mobile width Promotions, consent state, navigation
Category or search results Desktop and mobile; relevant filters if used Stable products, sort order, inventory
Product detail Representative product and supported viewport Selected variant, price, stock, gallery
Cart Empty and populated, if both are important Seeded cart contents and customer state
Checkout entry Relevant device and customer path Address, locale, validation and consent state

This is a planning aid, not a universal requirement to test every combination. Prefer stable, representative cases over multiplying routes, browsers, and viewport sizes without a support or risk reason.

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

Choose browser and device runs from the support policy

Use the storefront’s current browser-support matrix to choose browser versions, and include the oldest and newest supported major versions that matter to the project. Add real phones and tablets when the site supports them; emulated viewports are useful for layout checks but do not establish behavior on every physical device. Recheck the Adobe compatibility table when the storefront boilerplate suite changes, since its listed support corresponds to suite versions.

Run visual tests in CI

CI is useful only when its rendering conditions are aligned with the baselines. Use a stable browser image and fixed settings, and avoid generating snapshots on one operating system and comparing them on another. Have the pipeline publish or retain the expected, actual, and diff images when its test setup makes those artifacts available, so a failure can be reviewed without guessing from a pass/fail status.

Run visual tests alongside, not instead of, functional tests. Adobe’s Commerce Testing portal covers Adobe Commerce and Magento Open Source testing resources. Adobe’s Cloud application-testing guidance recommends thorough application testing before launch and discusses the Magento Functional Testing Framework (MFTF) for application testing and Codeception for PHP code intended for contribution to Cloud package repositories. MFTF’s getting-started documentation says the latest Adobe Commerce or Magento Open Source 2.4.x release supports MFTF 3.x; check the documentation for the installation’s applicable release before relying on that compatibility statement. Functional tests check behavior; screenshot assertions check rendered appearance.

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

When a hosted review workflow may help

Playwright Test snapshots keep screenshot assertions in the test runner and baselines in the project’s workflow. A hosted visual-review service is another option if collaboration, review history, or baseline management becomes difficult to operate in that setup. Percy documents a Playwright client in its Playwright client repository. Compare options on environment control, diff review, baseline ownership, browser and viewport coverage, CI integration, maintenance effort, data handling, and total cost. The cited integration documentation does not establish Percy’s current pricing or commercial terms, so verify those directly before choosing a plan.

Troubleshoot mismatches and failures

Snapshots differ on every run

  • Likely cause: The page includes animation, rotating content, timestamps, random data, or changing inventory.
  • Fix: Disable motion for the capture, freeze or seed changing data, and wait for the intended content. Keep only the dynamic behavior that the test is meant to evaluate.

Local runs pass but CI fails

  • Likely cause: Different OS, browser build, fonts, rendering mode, viewport, or hardware environment.
  • Fix: Align local baseline generation and CI comparison environments, pin the Playwright/browser setup, and explicitly set viewport and device options.

The screenshot is blank or incomplete

  • Likely cause: The test captures before the storefront has rendered the relevant route or content.
  • Fix: Wait for a meaningful page landmark or store-specific selector, then ensure fonts and required content have loaded before the assertion. Do not rely on an arbitrary delay if a page condition can be awaited.

A mismatch appears after a legitimate redesign

  • Likely cause: The baseline still represents the previous intended design.
  • Fix: Review the actual and diff images against the approved change, update only the affected snapshots, and commit the reviewed baseline change. Avoid updating all snapshots just to clear failures.

Browser support is unclear

  • Likely cause: A generic Magento browser list does not match the storefront’s boilerplate suite.
  • Fix: Check the project’s @dropins/tools version in package.json and consult Adobe’s suite-specific compatibility page for the current support range.

Or skip the browser setup

If you need a clean screenshot endpoint rather than a Playwright baseline suite, ScreenshotNeo can capture a URL in one GET request. It is a screenshot API and MCP server for developers. Its documented options include PNG, JPEG, WebP, or PDF output; full-page and element captures; viewport and device settings; custom CSS and JavaScript; waits; and request blocking. Those captures can help create or inspect images, but they do not replace a version-controlled Playwright assertion that compares a storefront against an approved baseline.

For example, request a screenshot of the test storefront with cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://store.example.com -o shot.webp

See the ScreenshotNeo API documentation for authentication and request options. ScreenshotNeo removes cookie banners, popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

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

Sign up for ScreenshotNeo’s free plan to try the capture API without a card.

Frequently Asked Questions

Can a screenshot test prove that Magento checkout works?

No. It can reveal a visual change in checkout, but behavior such as validation, payment, and order submission needs functional tests.

Should every product page have a separate visual baseline?

Not necessarily. Choose representative templates and product states based on risk; add cases where product-specific rendering or shopping behavior warrants them.

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.

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