I'm trying to write an integration test with flutter. In some cases I need to repeat the same process. such as adding a new line I want to make these new line insertion codes as a separate method and call them wherever I want in the test. but I couldn't find how to do
How can I make some test lines a method in the integration test and call it like a method in the test case I want?
this is the solution i was looking for:
class HomeRobot {
const HomeRobot(this.tester);
final WidgetTester tester;
Future<void> findTitle() async {}
Future<void> scrollThePage({bool scrollUp = false}) async {}
Future<void> clickFirstButton() async {}
Future<void> clickSecondButton() async {}
}
https://medium.com/flutter-community/integration-testing-in-flutter-b25c62ec287c
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.