Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View Flutter widget tests in simulator

Tags:

flutter

Is there a way to see the UI tests in the simulator?

I am writing some tests for a widget which has animation and want to verify my tests are triggering the animation correctly.

like image 847
S.D. Avatar asked Aug 26 '18 05:08

S.D.


People also ask

How do I know if my widgets are visible Flutter?

Check if the widget is currently visible using bool isVisible() .

How do you test a stateful widget in Flutter?

For that, we will use a widget tester to tap the submit button and Mockito's verify method. The snippet is the same for both create and update tests. final saveButton = find. byKey(const Key('submit-button')); expect(saveButton, findsOneWidget); await tester.


1 Answers

Found the answer from the Docs page:

To help debug widget tests, you can use the debugDumpApp() function to visualize the UI state of your test or simply flutter run test/widget_test.dart to see your test run in your preferred runtime environment such as a simulator or a device. During a flutter run session on a widget test, you can also interactively tap parts of the screen for the Flutter tool to print the suggested Finder.

like image 130
S.D. Avatar answered Sep 19 '22 00:09

S.D.