|
- Widget testing - Flutter
Widget testing A catalog of recipes for adding widget testing to your Flutter app
- Testing Flutter apps
The goal of a widget test is to verify that the widget's UI looks and interacts as expected Testing a widget involves multiple classes and requires a test environment that provides the appropriate widget lifecycle context
- An introduction to unit testing - Flutter
The test package provides the core framework for writing unit tests, and the flutter_test package provides additional utilities for testing widgets This recipe demonstrates the core features provided by the test package using the following steps:
- Testing plugins - Flutter
These tests allow you to test the Dart portion of your plugin just as you would test the Dart code of a non-plugin package However, the plugin's native code won't be loaded, so any calls to platform channels need to be mocked in tests
- Flutter learning resources
Animate a widget using a physics simulation Learn how to move a widget from a dragged point back to the center using a spring simulation
- Handle scrolling - Flutter
To scroll through lists via integration tests, use the methods provided by the WidgetTester class, which is included in the flutter_test package: In this recipe, learn how to scroll through a list of items to verify a specific widget is being displayed, and the pros and cons of different approaches
- Tap, drag, and enter text - Flutter
Many widgets not only display information, but also respond to user interaction This includes buttons that can be tapped, and TextField for entering text To test these interactions, you need a way to simulate them in the test environment For this purpose, use the WidgetTester library
- Find widgets - Flutter
The find constant provided by the flutter_test package provides several ways to locate widgets in the test environment This recipe demonstrated three of these methods, and several more methods exist for different purposes
|
|
|