Add screenshot regression tests by writing Playwright Test assertions with toHaveScreenshot(), then run them in a GitHub Actions job that installs your project and Playwright browsers. Save the resulting report as an Actions artifact so reviewers can inspect failures. The key to useful comparisons is consistency: generate and compare screenshots in a stable environment, and review baseline changes rather than updating them automatically on every pull request.
1. Add screenshot assertions to your Playwright tests
Playwright Test compares a captured screenshot with a reference image. On the first run, it creates the reference; later runs compare against it. Treat that initial screenshot as a proposed baseline: inspect it, then commit approved reference files to the repository along with the test.
As an Amazon Associate I earn from qualifying purchases.
For example, add an assertion to an existing Playwright test:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →await expect(page).toHaveScreenshot('home.png');
The assertion belongs after the page has reached the state you want to verify. Make test data and page state deterministic where possible: wait for the relevant content, use stable test accounts or fixtures, and avoid capturing transient animations or timestamps unless those are intentionally under test. Playwright’s snapshot documentation explains screenshot assertions and reference management: Playwright visual comparisons.
#1 Best Overall
- Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
- Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
- CanaKit Turbine Black Case for the Raspberry Pi 5
- CanaKit Low Noise Bearing System Fan
- Mega Heat Sink - Black Anodized
2. Add the GitHub Actions workflow
Create .github/workflows/visual-tests.yml in your repository. The example below runs on pushes to main and on pull requests, installs dependencies and browser requirements, runs the Playwright suite, and uploads the HTML report when the job is not cancelled.
name: Playwright visual tests
on:
pull_request:
push:
branches: [main]
jobs:
visual-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@<reviewed-version>
- uses: actions/setup-node@<reviewed-version>
with:
node-version: <project-version>
- run: npm ci
- run: npx playwright install --with-deps
- run: npx playwright test
- uses: actions/upload-artifact@<reviewed-version>
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
Replace each action placeholder with a reviewed version and set node-version to a version supported by your project and the current Playwright release. The official Playwright CI example uses this general sequence; consult it for current requirements and workflow details: Playwright CI documentation. The example uses a 30-day report retention period; adjust it to your repository’s retention needs.
What each step does
actions/checkoutmakes the repository contents available to the runner.actions/setup-nodeselects Node.js for the job.npm ciinstalls the dependency versions recorded in the lockfile.npx playwright install --with-depsinstalls Playwright’s browsers and required operating-system dependencies.npx playwright testruns the configured Playwright Test suite, including screenshot assertions.actions/upload-artifactstores the HTML report with the workflow run for later inspection.
Set up the report
Playwright’s HTML reporter writes to playwright-report/ when configured. If your project does not already configure it, add this to playwright.config.ts:
Rank #2
- Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM)
- Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
- CanaKit Turbine Black Case for the Raspberry Pi 5
- CanaKit Low Noise Bearing System Fan
- Mega Heat Sink - Black Anodized
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'html',
});
After a run, open the GitHub Actions run and download the playwright-report artifact to inspect the report. Playwright’s CI introduction describes inspecting test logs, reports, and traces: Playwright CI introduction.
3. Create and review reference screenshots
First run
The first execution creates reference screenshots because there are no existing snapshots to compare. Run the tests locally in the same kind of environment you intend to use in CI, inspect the generated images, and commit only approved baselines. The snapshot files are part of the test’s expected state; include intentional visual changes in the same reviewed change that updates them.
When a comparison fails
Use the report and any attached comparison images to determine whether the difference represents a real UI regression or an environmental fluctuation. If the interface change is intended, regenerate and review the baseline update, then commit it. Do not make ordinary pull-request CI update reference screenshots automatically: that can turn an unintended change into the new expected result without meaningful review.
Rank #3
- CanaKit Raspberry Pi 5 Essentials Starter Kit
4. Make screenshot runs reproducible
Screenshot comparisons are sensitive to the capture environment. Playwright recommends using a consistent environment for screenshot and visual-regression testing; its CI guidance documents a container as one way to achieve that consistency. Keep these factors stable where practical:
Free tools Windows power users keep installed
One-click scans. No signup required.
- Browser version and operating-system libraries.
- Installed fonts and font rendering environment.
- Viewport and device scale settings.
- Test data, authentication state, and the page state being captured.
- Timing-sensitive content such as animations, clocks, or asynchronously loaded data.
If local screenshots differ consistently from CI, first compare the browser, fonts, OS dependencies, and viewport rather than immediately accepting a new baseline. A container can reduce environment drift when local and CI runners otherwise differ.
5. Choose a visual testing workflow
For a team already using Playwright, native screenshot assertions keep the test and reference images in the project’s test workflow. Hosted tools may fit better when their review or publishing workflow is a requirement. The cited integration documentation establishes the capabilities below, not current prices or which option is best for every project.
Rank #4
- All-in-One Complete Kit: This SANOOV RPi 5 bundle comes with Raspberry Pi 5 4GB RAM single board, active cooler, durable ABS case and screwdriver. No extra parts needed, ready to use right out of the box for beginners and hobbyists
- Powerful Single Board Computer: Equipped with 4GB RAM and high-performance processor, delivers fast running speed for 4K playback, AI projects, programming and daily computing tasks. SANOOV for raspberry pi 5 4GB is equipped with broadcom 64 quad-core Arm Cortex A76 processor with gigabit ethernet and upgraded with IEEE 802.11ac Wi-Fi, Bluetooth 5.0 dual-band 2.4Ghz and 5Ghz and Power Over Ethernet (POE). Upgrading delivers 2-3 x speed vs Pi 4, redefining the experience
- Efficient Active Cooler: Effectively lowers operating temperature and prevents performance throttling. Runs quietly even under long-time heavy load, ensures stable operation all day long. SANOOV RPi 5 4GB kit offer an active cooler, which combines an aluminium heatsink with a high-performance PWM fan. Active cooler is fully compatible with the Pi OS, which can effectively reduce the temperature of RPi5 and ensure its good performance during long-term high load operation
- Sturdy ABS Protective Case: Well-fitted for Raspberry Pi 5 board, can be secured with 4 screws to effectively protect the Pi 5 motherboard from damage, reserves full access to all ports and buttons. SANOOV uses ABS material to produce the case, which has a softer texture and feel. Meanwhile, SANOOV case adopts a layered design for easy disassembly and installation. (Tip: The Case cannot install M.2 HAT Add on Board and Solid State Drive!)
- Wide Application & Full Compatibility: Seamlessly compatible with official OS and mainstream peripheral accessories for Raspberry Pi 5. Whether you are a beginner, student, electronics hobbyist or professional developer, this all-in-one kit meets your diverse needs. It excels in IoT projects, robotics design, retro gaming devices, home media servers and other DIY creations. Backed by a large global community, you can easily find guides, technical support and shared projects online
| Approach | What the documentation describes | Consider it when |
|---|---|---|
| ScreenshotNeo | Website screenshot API and MCP server; see the product section below. | You need screenshots through an API or an AI-agent MCP workflow rather than only in test assertions. |
| Playwright-native snapshots | toHaveScreenshot() assertions and reference screenshots associated with Playwright tests. |
You want screenshot assertions and baseline files within the existing test repository. |
| Percy | Playwright integration for snapshot workflows; documentation describes an optional reporter gate that can fail on changes. | Hosted visual review is useful to your team. |
| Chromatic | Documentation provides a GitHub Actions workflow for visual tests and publishing Storybook. | Storybook publishing and visual testing belong in the same workflow. |
For Percy and Chromatic, compare baseline management, review process, CI gating, runtime and repository complexity, and whether hosted review is needed. Their integration documentation is available at Percy’s Playwright integration guide and Chromatic’s GitHub Actions guide.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.6. Troubleshoot common failures
The workflow cannot find the browser
Cause: The runner has Playwright packages but not the browser binaries or operating-system dependencies. Fix: Run npx playwright install --with-deps after installing project dependencies, and check that the Playwright package version matches the project lockfile.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Many pixels differ between local and CI
Cause: The comparison environments may differ in browser, operating system, fonts, viewport, or page state. Fix: Standardize the environment, use the same browser configuration, and verify test data and fonts before regenerating snapshots.
Best Value
- 【What you Get】You will get 1*Pi 5 8GB Single Board,1*RasTech Case,1*Active Cooler,1*Screwdriver,1*Installation instructions,12-month free warranty, lifetime service, 24-hour prompt and friendly response.
- 【More Connectors】There are two USB 3.0 ports(5Gbps simultaneously) and two USB 2.0 ports, which triple total bandwidth ,support any combination of up to two cameras or displays. Peak SD card performance is doubled through support for the SDR104 high-speed mode. It provides a smooth desktop experience for you. Offer Gigabit Ethernet and a PCIe interface, along with dual-band Wi-Fi and Bluetooth 5.0/BLE wireless capability. The RasTech Pi 5 Kit use the new 27W 5.1V 5A USB-C power connector.
- 【 Support Dual 4Kp60 Display 】Each of the two microHDMI sockets can control a 4K display at 60 Hertz, now support HDR, offering super HD video for media streaming projects. RPi 5 is the first RPi model that comes with a PCI Express port (PCIe 2.0 x1 with 500 MB/s) to attach SSDs (requires separate M.2 HAT).
- 【 Excellent Chips And Applications】Pi 5 is a full-size Pi computer using silicon built in-house at Pi. The RP1 “southbridge” provides the bulk of the I/O capabilities for Pi 5. Pi 5 is more friendly and convenient in the development of Internet of Things, Web development, machine identification, automatic control and other electronic equipment applications and network.
- 【 Faster CPU, Better GPU 】 Pi 5 features a Broadcom BCM2712 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz, it delivers a 2–3× increase in CPU performance relative to RaspberryPi 4. The 800MHz VideoCore VII GPU is compatible to OpenGL ES 3.1 and Vulkan 1.2, substantial uplift in graphics performance. Pi 5 Offers lightning-fast CPU speed, a PCI Express interface, a Real Time Clock (RTC) and a power button and runs significantly cooler than Pi 4.
The report artifact is missing
Cause: The report directory may not have been produced, its configured path may differ, or the upload step may not have run. Fix: Confirm the HTML reporter is enabled and writes to playwright-report/; verify the artifact path and inspect the workflow step status. The sample’s if: ${{ !cancelled() }} allows upload after failures while skipping a cancelled run.
A pull request fails on a legitimate design change
Cause: The committed baseline still represents the previous design. Fix: Inspect the rendered change, regenerate the affected reference screenshots using the project’s approved process, and submit those baseline changes for review with the UI change.
Or skip the browser setup
For an independent page capture, ScreenshotNeo takes a screenshot with one GET request. This example saves the response as WebP:
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 options. ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots monthly with no card; paid plans start at $5 for 3,000 screenshots.
Learn about ScreenshotNeo or sign up free for 1,000 screenshots a month with no card.
FAQ
Can Playwright tests run on a CI provider other than GitHub Actions?
Yes. Playwright says its tests can run on any CI provider; GitHub Actions is one supported workflow, not a requirement.
Frequently Asked Questions
Can Playwright tests run on a CI provider other than GitHub Actions?
Yes. Playwright says its tests can run on any CI provider; GitHub Actions is one supported workflow, not a requirement.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallQuick 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.




