A Flutter Best Practice Google Is Hiding, Better Skia Goldens Testing
he default Skia Goldens testing leaves a lot to be desired in that the only fonts that are loaded is a very skimpy font to show blocks, no way to show all the device forms, and a cumbersome way to inject the root widget above the widget under test.
There is a better practice way to implement Skia Goldens testing, so we get all those problems addressed and cool tool for acceptance testing.
What I am Using
The Dynamic Platform Widgets plugin I am using is:
flutter_platform_widgets | Flutter Package
This project is an attempt to see if it is possible to create widgets that are platform aware. Currently in order to…
It dynamically delivers the right widgets to the right platform instead of wiring all that stuff by-hand.
To supply custom fonts for Goldens testing, I go beyond just using the Google Fonts Flutter package:
google_fonts | Flutter Package
The google_fonts package for Flutter allows you to easily use any of the 977 fonts (and their variants) from…
I download the fonts I want to use and stick them in the google-fonts subfolder in my Flutter App project folder and declare that assets folder in my pubspec.
The to complete the SKIA Goldens better testing toolkit I use eBay’s Golden Toolkit:
golden_toolkit | Flutter Package
This project contains APIs and utilities that build upon Flutter's Golden test functionality to provide powerful UI…
Implementing Better Skia Goldens Testing
It’s called Skia Goldens Testing, as it uses the Skia render part of the Flutter Embed Sky engine to render a few frames of the widget.
With using eBay’s Golden Toolkit we get way more cool stuff to use in Goldens acceptance testing.