logo
Sep 22, 2025 · In the introduction to unit testing recipe, you learned how to test Dart classes using the test package. To test widget classes, you need a few additional tools pro
Jan 21, 2026 · Testing a widget involves multiple classes and requires a test environment that provides the appropriate widget lifecycle context. For example, the Widget being tes
Oct 28, 2025 · A catalog of recipes for adding widget testing to your Flutter app.
Oct 30, 2025 · In the test environment, Flutter doesn't automatically rebuild widgets when the state changes. To ensure that the widget tree is rebuilt after simulating a user int
Oct 30, 2025 · How to handle scrolling in a widget test. Now, you can write a test. In this example, scroll through the list of items and verify that a particular item exists in t
Sep 22, 2025 · To locate widgets in a test environment, use the Finder classes. While it's possible to write your own Finder classes, it's generally more convenient to locate widg
Mar 7, 2026 · The integration_test package lets you: Use the flutter drive command to run tests on a physical device or emulator. Run on Firebase Test Lab, to automate testing on
Oct 30, 2025 · The test package provides the core framework for writing unit tests, and the flutter_test package provides additional utilities for testing widgets. This recipe dem
Nov 24, 2025 · This test makes sure that the orientation is landscape and that only 3 columns of data appear in the app: In test/widget_test.dart, inside of the Orientation group,
Oct 30, 2025 · Testing the data layer Similar to the UI layer, the components of the data layer have well-defined inputs and outputs, making both sides fake-able. To write unit te