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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Use Playwright in a GitHub Actions workflow, then upload its output as an artifact. The reliable sequence is checkout, install Node dependencies, install Playwright browsers and Linux dependencies, run a screenshot test, and upload test-results/ or playwright-report/. For visual regression, use Playwright Test’s toHaveScreenshot() assertion instead of merely saving an image.

What you need before writing the workflow

  • A repository containing a JavaScript or TypeScript project and a committed package-lock.json (or the lockfile used by your package manager).
  • Playwright Test installed in the project, normally as a development dependency.
  • A test that visits the page you want to capture.
  • A GitHub repository where Actions are enabled and permission to add files under .github/workflows/.

Workflows are YAML files stored in .github/workflows. They can run on pushes, pull requests, schedules, or a manual workflow_dispatch event. The example below uses the current major versions shown in the Playwright CI pattern; check the action repositories and your own dependency policy before pinning versions.

1. Add a Playwright screenshot test

Install Playwright Test in your project if it is not present:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npm install --save-dev @playwright/test
npx playwright install

Create a test such as tests/homepage.spec.ts:

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

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

The first execution creates a reference image. Later executions compare the rendered page with that reference and fail when the difference exceeds Playwright’s comparison rules. Commit the generated snapshot alongside the test. Update it only after reviewing an intentional design change:

#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
npx playwright test --update-snapshots

If you only need an image for inspection, use page.screenshot() and write it under a directory that the workflow uploads:

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

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

2. Create the GitHub Actions workflow

Save this as .github/workflows/website-screenshots.yml. Change the branch names, Node version, test command, and output paths to match your repository.

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/*
          cache: npm

      - 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 exactly what the lockfile specifies. npx playwright install --with-deps installs the browser binaries and the Linux system packages they require. The final step runs even when tests fail (unless the job is cancelled), so you can download screenshots, traces, and the HTML report while diagnosing a failure.

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

What the artifact contains

After the run, open the workflow in GitHub, select the completed job, and download website-screenshots-and-report from the Artifacts section. The artifact is run-based storage for outputs. It is different from dependency caching: caching accelerates later jobs, while an artifact preserves files from a particular run for review or for another job.

3. Run screenshots against your deployed site

For a production or preview capture, deploy first and pass the target URL to Playwright. One simple pattern is to put the URL in an environment variable:

- name: Run visual tests
  env:
    BASE_URL: https://preview.example.com
  run: npx playwright test

Then use it in the test:

const baseURL = process.env.BASE_URL ?? 'http://127.0.0.1:3000';

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

test('deployed homepage', async ({ page }) => {
  await page.goto(baseURL);
  await expect(page).toHaveScreenshot('homepage.png', { fullPage: true });
});

In a real preview workflow, place the deployment step before the Playwright step and pass the resulting URL through an environment variable or command-line configuration. Do not capture until the deployment has completed and the URL responds.

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

4. Keep visual comparisons deterministic

A snapshot is meaningful only when the baseline and the CI run use comparable rendering conditions. Operating system, browser version, browser settings, hardware, and headless mode can all change pixels. Create and update baselines in the same environment used for checks whenever possible.

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

Reduce avoidable differences

  • Use one browser project and a fixed viewport for the baseline and CI run.
  • Wait for the page’s important content rather than taking a screenshot during loading.
  • Disable animations or wait for them to finish when they are not part of the design under test.
  • Use stable test data, dates, fonts, and image fixtures.
  • Do not update snapshots automatically on every pull request. Review the diff first.

For broad browser or operating-system coverage, create separate baselines per project rather than comparing a Linux image with a baseline made on a different platform.

5. Choose an execution environment

Ubuntu runner with installed browsers

The workflow above is the simplest option. GitHub provides the runner, and Playwright installs the matching browsers and dependencies during the job. It is convenient, but a future runner image or browser update can alter rendering.

Playwright container

Playwright also documents a containerized job. A container keeps browser and operating-system dependencies aligned across runs, which is useful when pixel stability matters more than minimal YAML. The trade-off is additional image maintenance and potentially slower startup.

Sharded jobs for larger suites

Large suites can be split across multiple jobs using Playwright’s sharding support. Each shard produces its own results; merge the reports after all shards finish. Upload each shard’s files, or use a final job that downloads artifacts and merges the HTML report. Ensure snapshot files are available to every shard.

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

6. Preserve and protect screenshot artifacts

Set retention-days to the period your team needs, subject to the repository, organization, or enterprise retention limit. Short retention reduces storage; longer retention helps investigate regressions discovered later.

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.

Treat screenshots, traces, reports, and logs as potentially sensitive. They can expose test credentials, bearer tokens, source code, customer data, or internal URLs. Use trusted artifact storage, limit repository access, redact secrets before writing them to pages, and upload only the directories reviewers need. Do not place secrets in URLs that will appear in screenshots or traces.

7. Troubleshoot common failures

“Executable doesn’t exist” or browser launch errors

Cause: the browser binary was not installed on the runner.

Fix: run npx playwright install --with-deps after npm ci. If you use a custom container, use a Playwright image or install the matching browser dependencies inside it.

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

Missing Linux libraries or sandbox errors

Cause: the runner lacks system packages required by Chromium, Firefox, or WebKit.

Fix: use the --with-deps option on the supported Ubuntu runner, or select a Playwright container with its dependencies already included.

Snapshot mismatch on every run

Cause: the baseline and CI render in different environments, or the page contains unstable content.

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

Fix: compare operating system, browser version, viewport, headless mode, fonts, animations, time, and test data. Regenerate snapshots only after confirming that the visual change is intentional.

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

The test times out

Cause: the page is slow, blocked, waiting for a service, or never reaches the state your test expects.

Fix: wait for a specific selector or known readiness condition, verify the deployed URL from the runner, and inspect the uploaded report and trace. Increase the workflow timeout only after addressing the underlying readiness problem.

The job fails but no screenshot is available

Cause: the upload step was skipped or its path does not match the files produced by the test.

Fix: retain if: ${{ !cancelled() }}, verify the actual output directory, and upload test-results/ and playwright-report/ explicitly. A cancelled job cannot finish an upload.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Artifacts disappear too soon

Cause: the configured retention period or an organization policy is shorter than expected.

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.

Fix: choose an allowed retention period that covers your review cycle and confirm the repository or organization limit. Download important evidence to an approved long-term system.

Deployment screenshots show the old site

Cause: the screenshot job started before deployment completed, or it used the wrong preview URL.

Fix: make the screenshot job depend on the deployment job, pass the exact deployment target URL, and add a readiness check before Playwright navigates.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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 provides a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF, so a CI job can capture a URL without installing Playwright browsers. Before capture it accepts cookie or consent banners like a visitor 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 are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.

See the ScreenshotNeo documentation for authentication and options. A minimal cURL call is:

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

Equivalent Python:

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)

Equivalent Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

For CI, store YOUR_API_KEY as a GitHub Actions secret rather than committing it. ScreenshotNeo also supports full-page captures with lazy images loaded, CSS-selector element captures, dark mode, device presets, custom viewports, retina scale, PDF settings, custom CSS and JavaScript, clicks, selector or network-idle waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

The Free plan includes 1,000 screenshots each month with no card. Paid plans start at $5 for 3,000 shots; every feature is on every plan, and yearly billing gives two months free. Sign up for ScreenshotNeo to start with the free allowance.

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

Practical decision guide

Need Best fit Why
Committed pixel baselines that fail pull requests Playwright toHaveScreenshot() The expectation image is versioned with the test and compared on every run.
Images or reports for human inspection Playwright screenshot plus an Actions artifact The run preserves files that reviewers can download.
Capture without browser installation ScreenshotNeo A single API request handles rendering and returns the image or PDF.
Many independent URLs ScreenshotNeo bulk capture or sharded Playwright jobs Choose hosted bulk requests or parallel CI execution according to where you need control.

Frequently Asked Questions

Can GitHub Actions take screenshots on a schedule?

Yes. Add a cron schedule under the workflow’s `on` triggers, then keep the same Playwright and artifact steps.

Should snapshots be stored in Git?

For visual regression, store reviewed baseline images with the test so changes are visible and reproducible. For disposable inspection images, upload them as artifacts instead.

Can I use a private staging site?

Yes, provided the runner can reach it. Pass authentication through GitHub secrets or test fixtures, and ensure credentials cannot appear in screenshots, logs, or traces.

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.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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