visual regression testing
Testing that takes screenshots of components and compares them pixel by pixel with approved baseline images to catch unintended visual changes.
In more detail
DOM assertions cannot see a clipped label or a shifted icon; screenshots can. When a difference exceeds the allowed threshold the test fails and shows a diff image highlighting changed pixels. Intended changes are accepted by updating the baseline, which reviewers approve in the pull request.
Related terms
- Playwright — Microsoft's open-source tool for automating Chromium, Firefox and WebKit browsers, widely used for end-to-end and visual tests.
- baseline snapshot — The approved reference image a visual test compares new screenshots against.
- diff — A listing of the differences between two versions of something, such as two files, two commits or two screenshots.
- flaky test — A test that sometimes passes and sometimes fails on the same code, because it depends on something it does not control.
Taught in
- Visual Regression Testing: Playwright & Snapshot Differencing — Design Systems & Component Engineering
- Storybook & Component Driven Development Workflows — Design Systems & Component Engineering