View Flutter widget tests in simulator

Viewed 3423

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.

2 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.

run from command line

 flutter run -t test/your_test.dart

-t is for target file

if it tells you it couldnt find the apk you may have to tell it which flavor to use like this

flutter run --flavor uat -t test/your_test.dart
Related