Suggest an editImprove this articleRefine the answer for “Why can visual tests be flaky?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Visual tests** can be flaky because they are too sensitive to any changes, even ones insignificant to the user: they compare pixels, which makes them fragile. **Key point:** a test can fail because of a font, anti-aliasing, an animation or a difference in browser or OS, even though the interface is essentially "the same."Shown above the full answer for quick recall.Answer (EN)ImageVisual tests can be flaky because they are **too sensitive to any changes, even ones that are insignificant to the user**. They compare pixels, and this makes them fragile. The main reasons for instability: --- ### **1. Changes that don't affect the substance but change pixels** Even a small thing, and the screenshot is already different: - a different font after a browser update - a different rendering subsystem on Windows/Mac/Linux - anti-aliasing and text smoothing - a minimal 1-pixel shift The test will fail, even though the interface is essentially "the same." --- ### **2. Unstable data and dynamic content** If something on the UI changes with every render, the test will keep catching "changes": - random IDs - the current date/time - random images - animations - loading states --- ### **3. Animations and asynchronous states** The interface can be screenshotted **in the middle of an animation**, so the resulting frame is unpredictable. As a result, tests sometimes pass and sometimes fail. --- ### **4. Dependency on the environment** Differences can come from: - browser version - OS version - screen scale - DPI - theme (light/dark) --- ### **5. Unstable styles** If CSS depends on computed values or third-party libraries, the visual result can drift. --- ### **Summary** Visual tests are unstable because they **rely on an exact pixel match**, and pixels easily change for reasons unrelated to real bugs. That is why such tests require discipline, a stabilized environment and configured filters to provide value instead of false alarms.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.