This function is the entry point of any widget test in Flutter:
void testWidgets(String description, WidgetTesterCallback callback, { bool skip: false, Timeout timeout })
We will be checking it in action using a few steps. First, let's check its signature:
- description: This helps to document the test; that is, it describes what widget features are being tested.
- callback : This is WidgetTesterCallback. This callback receives a WidgetTester instance so that we can interact with the widget and make our validations. This is the body of the test, where we write our test logic.
- skip: We can skip the test when running multiple tests by setting this flag.
- timeout: This is the maximum time the test callback can run.