# The wild side of visual tests

- Speaker: [Eran Shapira](/wiki/speakers/eran-shapira.md)
- Event: [Reversim Summit 2019](/wiki/years/2019.md)
- Video: https://www.youtube.com/watch?v=zjmo3u7-Gig
- Transcript: [/transcripts/2019/36-zjmo3u7-Gig.md](/transcripts/2019/36-zjmo3u7-Gig.md)
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: [DevOps](/wiki/topics/devops.md), [Frontend](/wiki/topics/frontend.md), [Testing](/wiki/topics/testing.md), [UX Design](/wiki/topics/ux-design.md)

> Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

## Summary

The speaker discusses the challenges of visual regressions in modern web development and how friction between developers and designers can be reduced through automated visual testing. By treating UI components as isolated units within a style guide catalog and leveraging headless browsers, developers can catch unintended visual changes early. The talk demonstrates how integrating these visual tests into a CI/CD pipeline using Docker ensures consistent rendering across different operating systems. Ultimately, this approach saves time, eliminates subjective arguments about pixels, and automates the verification process with designers.

## Key points

- [1:26](https://www.youtube.com/watch?v=zjmo3u7-Gig&t=86s) Visual regressions often break user interfaces after code changes, leading to frequent friction and arguments between developers and designers.
- [5:01](https://www.youtube.com/watch?v=zjmo3u7-Gig&t=301s) Full-page visual tests are often unreliable due to unpredictable dynamic data, lazy loading, and rendering differences across browsers and operating systems.
- [7:27](https://www.youtube.com/watch?v=zjmo3u7-Gig&t=447s) Shifting visual testing from entire pages to individual components inside a UI catalog turns them into reliable visual unit tests.
- [13:26](https://www.youtube.com/watch?v=zjmo3u7-Gig&t=806s) Combining a headless browser runner with snapshot testing tools allows automated capturing and comparison of component images.
- [21:03](https://www.youtube.com/watch?v=zjmo3u7-Gig&t=1263s) Running visual tests inside containers eliminates font-rendering discrepancies between different developer operating systems.
- [25:35](https://www.youtube.com/watch?v=zjmo3u7-Gig&t=1535s) Integrating visual checks into the build pipeline automatically alerts developers and designers via chat tools when a component's appearance changes.

## Takeaways

- Adopt component-driven development and maintain a centralized UI catalog to avoid duplicating UI work across teams.
- Implement automated visual tests for individual components rather than entire pages to achieve higher test reliability.
- Use containerization for your test runners to guarantee consistent font rendering and avoid cross-environment visual false positives.
- Streamline design reviews by letting automated visual diffs serve as the source of truth during pull requests.

## Questions this talk answers

- How can I prevent visual tests from failing due to minor font and rendering differences across developer machines?
- What is the best way to integrate visual regression testing into an existing React component library and CI pipeline?
- How do you handle dynamic content and asynchronous loading when capturing screenshots for visual tests?

## Technologies

React, Angular, Vue, Storybook, Puppeteer, Jest, Docker, Jenkins

## Tags

automation, ci/cd, design systems, frontend, testing, ui components, visual testing
