1

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?

Gülsen Keskin
  • 657
  • 7
  • 23

1 Answers1

0

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

Gülsen Keskin
  • 657
  • 7
  • 23