Back to Guides

Visual regression on preview URLs in CI (the Playwright-friendly path)

Published: November 2026•7 min read

Looking for how to integrate RegressionBot with Playwright? Keep Playwright for your functional tests, and point RegressionBot at the deployed preview URL. It captures the whole live page in the cloud, compares it with production, and tells you in plain English what changed.

The @regressionbot/playwright package is deprecated (details below), so this URL workflow is the path for new projects.

Keep Playwright for behavior; use live URLs for how the page looks

Playwright answers “does the checkout work?” A visual check answers “does the deployed page look the way we meant it to?” Those are different questions, and the second one is best asked of the real, deployed page, where your code, your CMS, your CSS and third-party scripts all land together. RegressionBot captures that live page in a real browser, so there is nothing to install in your test suite. No Storybook is required either.

Captures are Chromium viewports at the sizes you configure (for example Desktop Chrome and iPhone 13). This is not a real-device or Safari/WebKit lab.

Live-vs-live: testOrigin (preview) vs baseOrigin (production)

Pass your preview URL as testOrigin and production as baseOrigin. Both are captured in the same run, page by page from a URL or sitemap, so production is the baseline and no images are stored in git. If you are not comparing two live origins, see managed baselines below.

If the preview sits behind a password or a staging gate, do not put the credential in the job payload. Store it once on a project (update_project with testAuth) and pass that project's name on the run. See Verify UI changes before the PR and Preview vs Production Workflow.

Cloud workers cannot reach localhost. Use a tunnel or a preview deploy; see Internal Environments.

Pass PR intent so verdicts can recommend pass / review / fail

Each changed page gets a plain-English description of what moved. The measured record is the structured changes list on each page.

If you also pass the PR or commit intent (runContext), the run can return a verdict recommendation: pass, review or fail for the run, or not_judged when no intent was given. Each page is labeled intentional, bug, noise or needs_review. A verdict is a recommendation. Approving and rejecting remain the only actions that move a baseline. A person or your own policy still owns the merge decision. See Intent and the Verdict.

Example: GitHub Action on preview deployment

name: Visual Check
on:
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write # Required to post/update comments on your PR
    steps:
      - uses: actions/checkout@v4

      # Replace this with your preview provider's output or dynamic setup.
      - name: Set preview URL
        run: echo "PREVIEW_URL=https://preview.myapp.com" >> "$GITHUB_ENV"

      - name: Run Visual Check
        id: vrs
        uses: RegressionBot/regressionbot-action@v0
        with:
          api-key: ${{ secrets.REGRESSIONBOT_API_KEY }}
          test-origin: ${{ env.PREVIEW_URL }}
          base-origin: 'https://myapp.com'
          sitemap-url: '${{ env.PREVIEW_URL }}/sitemap.xml'
          scan: '**'
          project: 'my-web-app'
          devices: 'Desktop Chrome, iPhone 12'
          github-token: ${{ secrets.GITHUB_TOKEN }}

The Action reads the pull request's title, description (the first 2,000 characters) and head commit from the event itself, so the run is judged against what the PR says it does. There is no run-context input to add. On a push it uses the commit message and SHA. Set change-description to say it yourself (explicit inputs win), or send-pr-context: 'false' to send nothing.

The full workflow, including forked-repository permissions and approving from a PR comment, is in Preview vs Production Workflow.

Example: SDK call after deploy

If you want to write your own reporting, call the Node.js SDK after your deploy step. The SDK reads the same fields as the Action:

import { RegressionBot } from '@regressionbot/sdk';

const client = new RegressionBot(process.env.REGRESSIONBOT_API_KEY);
const job = await client
  .test(process.env.PREVIEW_URL)
  .against('https://myapp.com')
  .forProject('my-web-app')
  .on(['Desktop Chrome', 'iPhone 12'])
  .sitemap(process.env.PREVIEW_URL + '/sitemap.xml')
  .scan('/pages/**')
  .withContext({
    prTitle: process.env.PR_TITLE,
    prDescription: process.env.PR_BODY
  })
  .run();

await job.waitForCompletion(5000, undefined, { waitForSummaries: true });
const summary = await job.getSummary();

For a faster check on copy and structure changes, a quick check is available. The GitHub Action does not take fidelity yet, so that path calls the REST API directly, as shown in the workflow docs.

Example: ask your coding agent over MCP

Connect your agent to the MCP server at https://mcp.regressionbot.com/ and give it the same fields. Cursor, Claude Code and Codex connect by signing in or with an API key. See MCP Server for each client.

run_regression_job {
  "testOrigin": "https://preview-123.myapp.com",
  "baseOrigin": "https://myapp.com",
  "sitemapUrl": "https://myapp.com/sitemap.xml",
  "devices": ["Desktop Chrome", "iPhone 13"],
  "runContext": {
    "prTitle": "Rename the Pro plan to Professional",
    "prDescription": "Only the plan name changes on the pricing page."
  }
}

Then call get_job_status with waitSeconds: 25 until readyForSummary is true, and get_job_summary for each page's changes and the run's intentAssessment.decision. The agent guides for Claude Code and Cursor go step by step.

Masking ads, cookies, and other noisy regions

Hide dynamic or sensitive regions before capture with a data-vr-mask attribute in your markup, or pass CSS selectors such as #chat-widget or .cookie-banner as masks. See Data Masking.

Managed baselines when you are not comparing two live origins

Leave out baseOrigin and a run compares against managed baselines stored for the project. The first managed run has nothing to compare against, so it captures baselines and every result comes back as a new baseline. Run again for a real comparison.

About the deprecated @regressionbot/playwright package

Existing installs keep working; the package receives no further updates. For new projects, point RegressionBot at your URLs, as above. The old reference remains on the deprecated Playwright page for projects already using it.

Cypress? Use the same URL workflow (no Cypress plugin)

We don't ship a Cypress integration. Keep Cypress (or Playwright) for functional tests; point RegressionBot at the deployed preview URL.

Related

Ready to ship with confidence?

Start catching visual changes before they reach production. Start your 7-day free trial today. No credit card required.