You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, flutter test only uses a single "test" font called Ahem. This font is designed to show black spaces for every character and icon. This obviously makes goldens much less valuable if you are trying to verify that your app looks correct.
I do, just configure tests to use google fonts folder to load custom fonts like we do with eBAy's Golden tool kit ie by using the Golden toolkit:
Future<void> testExecutable(FutureOr<void> Function() testMain) async { return GoldenToolkit.runWithConfiguration( () async { await loadAppFonts(); await testMain(); }, config: GoldenToolkitConfiguration( // Currently, goldens are not generated/validated in CI for this repo. We have settled on the goldens for this package // being captured/validated by developers running on MacOSX. We may revisit this in the future if there is a reason to invest // in more sophistication skipGoldenAssertion: () => !Platform.isMacOS, ), ); }
That way we get more power without having to change anything in playbook
https://pub.dev/packages/golden_toolkit#loading-fonts
Here is how
golden_toolkit
loading roboto font:https://github.com/eBay/flutter_glove_box/blob/master/packages/golden_toolkit/lib/src/font_loader.dart
The text was updated successfully, but these errors were encountered: