Skip to content

Instantly share code, notes, and snippets.

@up1
Created July 19, 2026 05:00
Show Gist options
  • Select an option

  • Save up1/536a4d79b0bae45740a4bb52b4f0e185 to your computer and use it in GitHub Desktop.

Select an option

Save up1/536a4d79b0bae45740a4bb52b4f0e185 to your computer and use it in GitHub Desktop.
Playwright :: Visual testing
import { test, expect } from '@playwright/test';
test('example test', async ({ page }) => {
await page.goto('https://playwright.dev');
await expect(page).toHaveScreenshot();
});
import { test, expect } from '@playwright/test';
test('example test', async ({ page }) => {
await page.goto('https://playwright.dev');
await expect(page).toHaveScreenshot({ maxDiffPixels: 100 });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment