October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Run Percy Visual Tests in GitHub Actions

Run Percy visual tests in GitHub Actions by adding framework snapshots, protecting the project token as a secret, and wrapping your test command with percy exec.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To run Percy visual tests in GitHub Actions, install the Percy CLI and the SDK for your test framework, add snapshots at the page states you want to compare, and run the test command through percy exec. Save the Percy project token as a GitHub Actions secret and expose it to the workflow as PERCY_TOKEN—never commit it to your repository.

How the Percy workflow fits together

Your browser tests navigate and interact with the application; Percy’s framework SDK records named snapshots at selected states, and the Percy CLI wraps the test run and uploads the snapshots to the project associated with your token. Percy then compares them with a baseline so you can review visual changes. See the BrowserStack guide to Percy in GitHub Actions.

This guide covers browser tests using Playwright or Cypress. If you want to compare generated static pages rather than states reached by tests, Percy also documents a separate percy snapshot workflow for a built directory.

Set up the Percy project token in GitHub

  1. Create or select a Percy web project and retrieve its project token.
  2. In your GitHub repository, open Settings → Secrets and variables → Actions, choose New repository secret, and save the token as PERCY_TOKEN. If your repository uses an environment-specific secret, make sure the job declares that environment.
  3. Expose the secret only to the step that runs Percy by mapping it to the PERCY_TOKEN environment variable. Do not place the token directly in workflow YAML, application code, or a command-line argument.

Percy’s GitHub Actions integration guide and SDK examples use PERCY_TOKEN to associate CI uploads with a Percy project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Choose the integration for your test suite

Playwright

Install the CLI and Playwright SDK as development dependencies:

npm install --save-dev @percy/cli @percy/playwright

Import percySnapshot in a Playwright test and call it after the page reaches a state worth comparing:

import { test } from '@playwright/test';
import percySnapshot from '@percy/playwright';

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

test('product page visual check', async ({ page }) => {
  await page.goto('https://example.com/products/widget');
  await percySnapshot(page, 'Product page');
});

Replace the example URL with a page your test can access and give snapshots stable, useful names. The Percy Playwright client library also documents a drop-in option for existing toHaveScreenshot() assertions. Check its stated version requirements against your installed Playwright and Percy packages before adopting that route.

Cypress

Install the CLI and Cypress SDK:

npm install --save-dev @percy/cli @percy/cypress

Import the SDK in your Cypress support file, following the current setup instructions in the Percy Cypress SDK repository. Then call cy.percySnapshot() at a meaningful point in a test, for example after navigating and asserting that the page has loaded. Run the Cypress command under percy exec so the snapshots are uploaded.

Add a GitHub Actions workflow

Use the workflow below as a template for an npm project whose Playwright tests run with npx playwright test. It maps the repository secret to the Percy step rather than storing the token in the file:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

name: Visual tests

on:
  push:
  pull_request:

jobs:
  percy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
      - run: npm ci
      - name: Run Percy visual tests
        run: npx percy exec -- npx playwright test
        env:
          PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

The action and Node versions shown here are example pins, not a claim that they are the only compatible or permanently current choices. Check current GitHub Actions and runtime support, and keep the CLI, SDK, runtime, and actions maintained. BrowserStack’s Percy Actions example is useful for understanding the workflow shape, but its displayed version pins are older.

Use Cypress instead

Keep the checkout, Node setup, dependency installation, and secret mapping, but change the run command to your Cypress script, commonly:

npx percy exec -- npx cypress run

If your repository uses npm scripts or a custom Cypress configuration, pass the project’s usual command and options after percy exec --.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Capture a static build directory

For generated HTML output, build the site first, then use Percy’s documented percy snapshot command on the output directory instead of adding SDK calls to browser tests. Follow the exact CLI syntax and directory requirements in the Percy GitHub Actions documentation; this workflow compares static output, not interactive states visited by Playwright or Cypress.

Establish and review the baseline

On the first successful run, check the Percy dashboard for the new build and establish or approve the baseline as required by your project workflow. Later builds compare snapshots against that baseline and present visual changes for review. Do not treat the first upload as evidence that future changes are already approved.

For Playwright setups relying on automatic baseline discovery or seeding, verify that Percy is reading the intended Playwright configuration. The Percy example Playwright project notes that discovery reads Playwright’s default config; a custom config path can interfere with mapping screenshots during first-run seeding. The example also describes BrowserStack session requirements for its Automate drop-in, so those requirements apply to that integration path rather than every Percy Playwright workflow.

Troubleshoot missing or unexpected Percy builds

  • No Percy build or snapshots appear: Confirm the command is wrapped as npx percy exec -- <test command>, that the job receives PERCY_TOKEN, and that the secret belongs to the Percy project you intend to update. The SDKs document that snapshots are disabled when tests run without Percy execution and token configuration; see the Playwright library and Cypress SDK.
  • The test passes but a page is absent from the build: Ensure the test actually reaches the snapshot call and that the call follows the relevant navigation, rendering, and interaction. A snapshot call placed before the target state will capture the wrong point in the test.
  • First-run Playwright baseline mapping fails: Check whether your project uses a non-default Playwright config path and whether Percy’s discovery is reading that path. The example project documents default-config discovery as a relevant assumption.
  • An existing screenshot assertion does not integrate as expected: Verify the Playwright, Percy SDK, and drop-in version requirements together before switching from percySnapshot to the toHaveScreenshot() integration. Compatibility is version-sensitive.
  • The first build is visible but comparisons are not useful yet: Review and establish the baseline in Percy before relying on later builds for change review.
  • A workflow copied from an example stops working after updates: Check the current compatibility and support for the pinned GitHub Actions, Node runtime, CLI, and framework SDK. Example repository pins describe that sample, not a universal current matrix.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and cost considerations

The cited integration instructions establish how to capture and upload snapshots, but do not provide a quantitative speed or cost comparison between Playwright, Cypress, and static-directory capture. In practice, choose the workflow that matches the states you need to review and the framework your project already runs; avoid adding duplicate snapshots for states that do not answer a review question.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

CI reliability depends on the test command completing and the Percy wrapper receiving its token. Keep dependencies and action versions intentionally maintained, and make baseline approval part of the team’s visual-review process. The supplied Percy setup materials do not establish a universal runtime, upload SLA, or price figure, so those should not be inferred from the integration examples.

Or skip the browser setup

If you need screenshots through a direct API call rather than Percy snapshots attached to a browser-test build, ScreenshotNeo is a website screenshot API and MCP server for developers. Its one-call GET endpoint can return an image or PDF; its response headers identify the page verdict and billing status. It is a different workflow from Percy’s baseline-based visual testing.

For example, save a screenshot of a page as WebP with cURL:

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

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

See the ScreenshotNeo API documentation for request options and authentication. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for the free plan.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.