1. Section Intro
Notes
In this section we will cover widget tests, integration tests, and golden image tests.
Here's what's included:
Widget tests
- Finding widgets using common finders (
byKey
,byType
,text
) - Use
WidgetTester
to programmatically interact with widgets (tap on buttons, enter text on text fields etc.) - How and when to use
pumpWidget()
,pump()
,pumpAndSettle()
- Robot testing
- How to use mocks and override providers inside a widget test
- When to use
runAsync()
- Dealing with RenderFlex overflow errors
Integration tests
- Difference compared to widget tests
- How to test the entire app using fake repositories
Golden Image Tests
- How to create a golden image test using
matchesGoldenFile
- How to pre-load fonts, icons, and image assets
- How to use size variants to test a responsive app
- How to use test tags to more easily target golden image tests from the command line
- Additional resources
0 comments