When we started developing with Flutter at Surf, it became interesting to see what Flutter itself can automate? After all, the applications that he creates are cross-platform, which means that autotests will be like that ... However, a stable package for working with E2E and Widget tests was included in the Flutter framework not so long ago - in early December 2020. Therefore, it is interesting to discuss this topic.
Today we will talk about autotesting within the Flutter framework in the context of mobile applications.
Autotests on Flutter
Flutter makes it possible to write autotests natively in the Dart language. The framework has:
- Unit tests, their task is to test a specific module of the system. For example, make sure that the component's controller exposes the desired state. Since this is not an interface check, there is no need to emulate the application.
- Widget tests. Any Flutter application consists of Widget components: Widget tests allow you to emulate a Widget and carry out the necessary testing with it. These can be entire screens and individual elements: fields, buttons, checkboxes, and so on.
- End-to-end (hereinafter - E2E) - tests in which we fully load the application and simulate user actions in a real infrastructure with real services, APIs, and so on.
No comments:
Post a Comment