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

Use Playwright in a GitHub Actions workflow, then upload the generated files with actions/upload-artifact. The reliable sequence is: check out the repository, install Node dependencies, install Playwright browsers and Linux dependencies, run the screenshot test, and preserve the output as an artifact. For visual regression, replace a one-off capture with Playwright Test’s toHaveScreenshot() assertion and commit the reviewed baseline.

What you need before creating the workflow

  • A JavaScript or TypeScript project with a working package.json.
  • Playwright Test installed as a development dependency, for example with npm install --save-dev @playwright/test.
  • A screenshot test file and a known output directory.
  • Permission for the workflow to read the repository and write artifacts. Screenshots, traces and reports can contain credentials, source code or private application data, so limit artifact access to trusted collaborators.

GitHub Actions reads workflow YAML files from .github/workflows. A workflow can run on pushes, pull requests, schedules or a manual workflow_dispatch event.

Create a screenshot test

Capture an image for inspection

This test navigates to a page and writes a screenshot under Playwright’s test-results directory:

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

test('capture homepage', async ({ page }) => {
  await page.goto('https://example.com', { waitUntil: 'networkidle' });
  await page.screenshot({ path: 'test-results/homepage.png', fullPage: true });
});

Use your deployed URL or a local server instead of https://example.com. If the application is started by the workflow, configure Playwright’s webServer setting or add a separate start step before the test.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
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

Compare against a visual baseline

For regression testing, let Playwright manage the expected image:

import { test, expect } from '@playwright/test';

test('homepage visual baseline', async ({ page }) => {
  await page.goto('https://example.com');
  await expect(page).toHaveScreenshot('homepage.png');
});

The first execution creates the reference screenshot. Later executions compare the rendered page with that reference and fail when the difference exceeds the configured tolerance. Commit the baseline with the test code. When a deliberate design change is reviewed, update it intentionally with:

npx playwright test --update-snapshots

Do not approve updated images merely to make a failed build green; inspect the diff first.

Add the GitHub Actions workflow

Create .github/workflows/screenshots.yml:

name: Website screenshots

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  workflow_dispatch:

jobs:
  screenshots:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: actions/checkout@v6

      - uses: actions/setup-node@v6
        with:
          node-version: lts/*

      - run: npm ci
      - run: npx playwright install --with-deps
      - run: npx playwright test

      - uses: actions/upload-artifact@v5
        if: ${{ !cancelled() }}
        with:
          name: website-screenshots-and-report
          path: |
            test-results/
            playwright-report/
          retention-days: 30

npm ci installs the lockfile-defined dependency set. The Playwright install command downloads matching browser binaries and, on Linux, required system packages. The test command runs the suite, while the final step uploads screenshots, failure diagnostics and the HTML report even when an earlier step fails (unless the job was cancelled).

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

Make the workflow match your repository

Change triggers and runtime versions

Replace main with the branches you actually protect. Keep workflow_dispatch when maintainers need an on-demand capture. Pin a supported Node version if your project does not use the current LTS line; otherwise lts/* follows the latest LTS available to the setup action.

Capture a deployed site

When screenshots must represent a successful deployment, run the screenshot job after deployment and pass the target URL to Playwright. A common pattern is to expose an environment variable and read it in the test:

const target = process.env.SCREENSHOT_URL ?? 'http://127.0.0.1:3000';
await page.goto(target, { waitUntil: 'networkidle' });

Store deployment credentials in GitHub Actions secrets, never in YAML or committed test files. If the deployment and screenshots are separate jobs, pass the URL through job outputs or an environment value and make the screenshot job depend on the deployment job.

Keep browser rendering deterministic

Snapshot comparisons are sensitive to operating system, browser version, fonts, viewport, device scale factor, animation, time, locale, network responses and headless settings. Create baselines in the same environment used by CI. Installing browsers on the runner is simple; a Playwright container can provide a more tightly aligned browser and operating-system dependency set.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
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.

Wait for meaningful page readiness rather than an arbitrary short delay. For animated interfaces, disable animations in test CSS or wait for the component state you intend to compare. Fix viewport, timezone and locale where those values affect layout or text. Avoid live, nondeterministic data in a visual baseline.

Artifacts, caching and retention

An artifact is the output of a particular run: screenshots, reports, traces and logs that reviewers can download after the job. Retention is configurable within the limits set by the repository, organization or enterprise; choose a period that matches your review and audit needs.

Artifacts are not dependency caches. Use caching for reusable inputs such as package-manager data; upload artifacts for run-specific screenshots and reports. If a suite is split across jobs, upload each shard’s output and merge the reports in a later job. Larger Playwright suites can be sharded across jobs to reduce wall-clock time, provided each shard has a predictable output path.

One-off screenshots versus visual regression

Goal Implementation Build result What to review
Keep an image from a run page.screenshot({ path }) Usually succeeds unless navigation or capture fails The uploaded file and its page state
Detect an unintended visual change expect(page).toHaveScreenshot() Fails when the rendered output differs from the baseline Diff image, baseline environment and intended design change

Choose the first approach for documentation, deployment evidence or debugging. Choose the second when a changed pixel should require review.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
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

Troubleshooting failed screenshot jobs

“Executable doesn’t exist” or browser launch errors

The runner has the Playwright package but not its browser binaries, or the binaries do not match the package version. Run npx playwright install --with-deps after npm ci. If you use a custom container, install the browser and its system dependencies inside that container.

Timeout while loading a page

Check the URL from the runner, DNS and deployment readiness. A page that works on your laptop may require authentication, a firewall allow-list or a longer server startup. Wait for a stable selector or network idle only when the page can actually reach that state; otherwise wait for the specific application element and investigate requests that never finish.

Snapshot mismatch on every pull request

Compare operating system, browser version, viewport, fonts, device scale, locale, timezone and headless mode between baseline creation and CI. Also check animations, timestamps, random data, ads and third-party widgets. Regenerate snapshots only after confirming the rendering difference is intentional.

The artifact is missing

Verify that the path in actions/upload-artifact matches the paths produced by your tests. The if: ${{ !cancelled() }} condition allows upload after test failure, but it cannot upload a directory that was never created. Print a directory listing in a diagnostic step if the output location is uncertain.

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.

Reports expose secrets

Review screenshots, traces, videos and HTML reports before sharing them. Redact tokens and personal data, use trusted artifact storage, restrict repository access and select the shortest retention period that satisfies your process.

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 accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and response headers identify the page verdict and whether the request was billed. Its MCP tools—take_screenshot, get_page_info and capture_pdf—work with Claude, Cursor and other MCP clients.

Use one GET request from a workflow instead of installing a browser:

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 documentation for authentication, output options and workflow integration. The service also supports full-page captures with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets plus custom viewports, retina scale, PDF paper size and page ranges, custom CSS and JavaScript, clicks, selector or network-idle waits, request and resource blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API and an OpenAPI specification.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The Free plan includes 1,000 shots each month without a card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account and use the included shots to run your first CI capture.

Practical CI checklist

  • Commit the workflow under .github/workflows.
  • Run npm ci from a committed lockfile.
  • Install matching Playwright browsers with Linux dependencies.
  • Use a stable URL, selector and test data.
  • Keep baseline and CI rendering environments aligned.
  • Upload screenshots and reports with an explicit retention period.
  • Protect artifacts that may contain credentials or private data.
  • Use sharding only after output paths and report merging are defined.

Frequently Asked Questions

Can GitHub Actions take screenshots without Playwright?

Yes, but this workflow uses Playwright because it supplies browser automation, screenshot capture and baseline comparison in one test runner. A hosted API such as ScreenshotNeo is another option when you do not want browser installation in the runner.

Where do I download screenshots from a run?

Open the completed workflow run on GitHub and download the artifact named in the upload step, such as website-screenshots-and-report.

Should visual baselines be stored as artifacts only?

No. Store reviewed expected images with the test code so pull requests show baseline changes. Use artifacts for the run’s actual screenshots, reports and diagnostics.

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

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.