Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we generate json report for integration tests in Flutter?

I am writing integration tests with Flutter's new integartion-test package. The tests are executing fine using flutter drive command but it does not give me any json report. flutter test --machine is not working for integration tests.

I want to generate a json report for the executed tests. Is there any other command or any workaround for this?

like image 302
Umang Divyanshu Avatar asked Sep 21 '25 11:09

Umang Divyanshu


2 Answers

If you run your tests locally, you can try with this command:

flutter test -machine integration_test > report.json

Otherwise, on Firebase Test Lab you get a JUnit xml output file for each execution.

like image 88
Leonardo Avatar answered Sep 23 '25 05:09

Leonardo


Whilst looking for a solution, I found something:

Report looks like this: Picture of report

I just use:

flutter test --machine > machine.log || echo 'Tests failed' <PATH/TO_TEST_CLASS>

flutter pub global run dart_dot_reporter machine.log

Reference:

  • https://dev.to/apastuhov/make-dart-flutter-test-report-readable-2h0b
like image 26
Arkadiusz Kwiatkowski Avatar answered Sep 23 '25 05:09

Arkadiusz Kwiatkowski