Mac hosting guide

WebKit Layout Pixel-Diff Regression Testing

Give each page a separate light and dark Playwright WebKit baseline, approve changes deliberately, and keep every run on one pinned machine type, because the OS, browser build and GPU all change the pixels.

Figment editorial teamPublished Updated Facts checked November 10, 2026

Figment Mac plans

US East. Pay before use. Hourly and daily too.

Intel Mac VM4 shared vCPUs, 4GB RAM, 80GB SSD$25per monthApple Silicon Mac VM4 shared vCPUs, 4GB RAM, 65GB SSD$39per monthDedicated M4 Pro12-core CPU, 24GB RAM, 512GB SSD$199per month

Minimum first purchase: $25 of account credit, used for your rental.

Give each page a separate light and dark baseline, run the two modes as separate Playwright tests so a light-mode failure does not hide the dark snapshot, and use a fixed browser build, viewport and font set so a layout change is easy to see. Take baselines and comparisons on one pinned machine type, because the exact OS, browser build and GPU change how pixels render. See Playwright's visual comparison guide.

How do I capture both color modes?

Pin Playwright in your package lock file and run npx playwright install webkit on the runner. Add a ready marker to each fixture after the data and images it needs are available. Use stable fixture data, and wait for fonts before taking the screenshot.

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

const paths = [
  { name: 'home', path: '/' },
  { name: 'pricing', path: '/pricing' },
];

test.use({ browserName: 'webkit', viewport: { width: 1440, height: 900 } });
test.describe.configure({ mode: 'parallel' });

for (const { name, path } of paths) {
  for (const colorScheme of ['light', 'dark'] as const) {
    test(`${name} in ${colorScheme} mode`, async ({ page }) => {
      await page.emulateMedia({ colorScheme, reducedMotion: 'reduce' });
      await page.goto(path);
      await expect(page.getByTestId('visual-ready')).toBeVisible();
      await page.evaluate(async () => { await document.fonts.ready; });

      await expect(page).toHaveScreenshot(`${name}-${colorScheme}.png`, {
        animations: 'disabled',
        caret: 'hide',
        fullPage: true,
        threshold: 0.15,
        maxDiffPixels: 100,
      });
    });
  }
}

Set baseURL in the Playwright configuration and start the fixture server before running the test. Leave Playwright's maximum failure count disabled if the job should collect both results after the first failure. Start with stable pages, and adjust the tolerance only after reviewing repeated captures of the same commit. References: Playwright's screenshot assertion and WebKit's dark mode documentation.

How do I approve snapshot changes deliberately?

Run the baseline update on the same browser build and OS that CI uses, review each light and dark image, and commit the approved files. On ordinary CI runs use --update-snapshots=none, so a missing reference fails instead of creating a replacement. Upload test-results/ and the HTML report when tests fail. If only one mode fails, compare its CSS variables and inherited styles first. See Playwright's snapshot options.

# Run only when you intend to update references.
npx playwright test tests/visual.spec.ts --update-snapshots

# Run this in CI after the approved references are committed.
npx playwright test tests/visual.spec.ts --update-snapshots=none

How do I inspect an image pair with ImageMagick?

Use ImageMagick when you want a highlighted PNG and a count of changed pixels. Absolute Error (AE) counts pixels that differ, and SSIM reports structural similarity. Run each metric separately so you can tell the expected "images differ" status from a tool failure. The Playwright assertion above decides whether the CI job passes.

#!/usr/bin/env bash
set -euo pipefail
: "${1:?Pass the baseline PNG}"
: "${2:?Pass the current PNG}"
: "${3:?Pass a new path for the difference PNG}"

status=0
magick compare -metric AE "$1" "$2" "$3" || status=$?
if [[ "$status" != 0 && "$status" != 1 ]]; then
  printf 'ImageMagick AE comparison failed (%s)\n' "$status" >&2
  exit "$status"
fi

status=0
magick compare -metric SSIM "$1" "$2" null: || status=$?
if [[ "$status" != 0 && "$status" != 1 ]]; then
  printf 'ImageMagick SSIM comparison failed (%s)\n' "$status" >&2
  exit "$status"
fi

Keep the two images the same size. Treat the AE count and SSIM score as diagnostic data, and review the highlighted image before approving a baseline update. See ImageMagick's compare reference.

Which tests need a hosted Mac?

WebKit media emulation catches CSS theme and layout changes on a runner you already have. Use a Mac for repeatable macOS rendering or for a second pass in installed Safari. If your product relies on system appearance, reproduce the failure with the host in each appearance mode and capture the result from system Safari. Playwright's bundled WebKit and the installed Safari application are separate browser builds (Playwright's WebKit notes; see also testing installed Safari on two macOS versions).

Pin one machine type for baselines and for every later run. Rendering depends on the exact OS, Safari or WebKit build and GPU, so a baseline taken on one plan can fail on another without any layout change in your code. Changing plan means regenerating and reviewing the baselines.

Which baseline Mac fits a WebKit pixel-diff workflow?

Figment planUse it for
Intel Mac VM ($25 a month, $2 a day)A Sequoia baseline for a lightweight screenshot workflow. Test the exact browser build before depending on it.
Apple Silicon Mac VM ($39 a month, $6 a day)An Apple silicon baseline for system Safari checks. The VM has 4 shared vCPUs.
Dedicated M4 Pro 48 GB ($349 a month, or $299 on a 12-month term)A whole Mac with no other tenant, when you do not want a shared host behind your baselines.

Check the macOS version shown before purchase, and record the browser version, OS, fixture size and capture frequency with your baselines. Compare plans at /mac-hosting.

Which Figment Mac fits this work?

Intel Mac VM from $25 a month, Apple Silicon Mac VM from $39, or a Dedicated M4 Pro for $199. Hourly and daily plans too. You pay before use, starting with at least $25 of account credit.

Choose a Mac plan