Flutter Golden Testing with the Alchemist Package

Max Zimmermann đź’ˇ
6 min readMay 5, 2023

Introduction

Golden testing is a popular method used in software development to ensure to catch visual regression by comparing the rendered output against a “golden” version. For Flutter, which creates apps for different platforms and sizes which are tedious to test, golden testing can reduce the amount of manual testing needed. To streamline the golden testing process in Flutter, VeryGoodVentures has developed the alchemist package. This article will argue why to use this package and show a small code example of how it works. If you want to learn more about golden testing in general check out my other article: What are golden tests and when to use them (app automated testing 101).

Why alchemist?

The two most established packages for golden testing for Flutter are golden_toolkit from eBay and alchemist from VeryGoodVentures. In total, both are great packages but there are two advantages why you should use the alchemist package.

1. Less boilerplate code

With the Alchemist package, developers can write golden tests with significantly less code. From my experience, it takes half the amount of code which results in faster development and better readability.

2. Platform-independent snapshots

--

--

Max Zimmermann đź’ˇ

Flutter developer. I am excited about learning new things and sharing them with others. https://linktr.ee/maxmitz