--- title: Visual comparison description: "Add visual regression testing with toHaveScreenshot, which compares the screen or one element against a stored screenshot on web, iOS, and Android with the same test." "og:image": "https://e2e.com/docs/images/og/visual-testing.png?v=4929216b19" "twitter:image": "https://e2e.com/docs/images/og/visual-testing.png?v=4929216b19" keywords: [screenshot, visual regression, snapshot] --- import { Video } from './snippets/video.jsx'; `toHaveScreenshot` compares what the app shows with a PNG stored next to the test file. It works on every engine that captures pixels, so one test checks a browser, an iOS simulator, and an Android emulator.