---
title: "📸 Visual Comparison Widget"
description: "Playwright has a built-in ability to perform a Visual Comparison."
canonical: "https://currents.dev/changelog/cameraflash-visual-comparison-widget"
updated: "2024-08-28"
---

# 📸 Visual Comparison Widget

2024-08-28, New (tracks: platform)

Playwright has a built-in ability to perform a Visual Comparison.

---


Playwright has a built-in ability to perform a [Visual Comparison](https://playwright.dev/docs/test-snapshots).

```
test('example test', async ({ page }) => { 
  await page.goto('https://playwright.dev'); 
  await expect(page).toHaveScreenshot({ maxDiffPixels: 100 });}
);
```

Playwright will fail a test if the current snapshot differs from a reference image.

We’ve released a first-class support for displaying the visual comparison screenshots, including browsing the diff, actual, expected, side by side and slider widget.

![](/img/changelog/cameraflash-visual-comparison-widget-1.gif)

The support is automatic and doesn’t require any action other than just using `toHaveScreenshot`[directive](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-2).

