10 min. • Aug 9, 2023
We dive into the topic of UI testing in Flutter. Read more about automated UI tests' benefits and available solutions and why UI testing plays a crucial role, especially in large-scale applications.
6 min • Aug 6, 2025
This article explores effective strategies for testing email-dependent flows in automated end-to-end tests. It covers practical methods from workarounds to tools along with their implementation, pros and cons, and best practices for seamless integration into development pipelines.
6 min • Oct 13, 2025
Testing SMS often seems like a simple task - until you try to automate it. Each message depends on external networks, carriers, and devices, making even small tests unpredictable. This article explains how to choose the right approach for stable and reliable results.
Golden tests in Flutter allow you to verify UI consistency by comparing rendered widgets against reference images. They are a powerful tool for catching visual regressions – but only if configured correctly. Without proper setup, golden tests quickly become flaky and unreliable, especially in CI/CD environments.
Golden tests render a widget and compare its visual output with a stored "golden" image. If even a single pixel differs, the test fails.
They are commonly used for:
Golden tests are not logic tests – they validate appearance, not behavior.
Golden tests are platform-sensitive. The same widget can render slightly differently on macOS, Windows, and Linux due to:
This becomes a major issue when golden files are generated locally (often macOS) and validated in CI (usually Linux). Without proper tooling, this leads to flaky tests and false negatives.
While golden tests can be written using flutter_test, doing so directly is verbose and fragile. Alchemist is the modern, actively maintained standard for golden testing in Flutter. It builds on top of flutter_test and solves the most common golden test problems.
Alchemist provides:
Instead of writing many separate tests, you define golden scenarios that describe how a widget should look under different conditions. This makes golden tests easier to read, maintain, and review in pull requests.
Golden tests must be fully deterministic.
Before capturing a golden image:
DateTime.now() and random values.Any dynamic input will cause random test failures and invalidate the test's purpose.
When a UI change is intentional, golden files must be regenerated manually.
Use:
flutter test --update-goldensAlways review visual diffs before committing updated goldens. Blindly updating goldens can hide real regressions.
Following consistent practices helps ensure that golden tests remain reliable and produce stable visual comparisons.
flutter_test.Several common mistakes can make golden tests unstable or difficult to maintain. These are:
Golden tests are most effective when used sparingly and intentionally. Combined with Alchemist, they become a reliable guardrail against accidental UI regressions in Flutter projects.