icon

Flutter Test

Performs any test in a Flutter project.

If you have tests in your repository, and selected yes when prompted during app creation, the primary Workflow will include the Flutter Test Step by default. If you add tests to your app later, add the Flutter Test Step to your Workflow manually. The Step runs the flutter test command with the specified flags. To check the available flags, open a command line interface on your own machine and run flutter test --help.

Configuring the Step

  1. Provide your project's root directory in the Project Location field.
  2. The Step's test result directory is the root directory for all test results created by the Bitrise CLI. This input gets filled out automatically.
  3. You can append additional flags to the default flutter test command in the Additional parameters field.
  4. Select 'yes' in the Generate code coverage files input to get detailed analysis of your code.

Test output in the build log

On Flutter 3.10 and newer the Step prints the normal, human-readable flutter test output to the build log, and you can control its verbosity with a --reporter flag (for example --reporter expanded) in the Additional parameters field. On older Flutter versions the log falls back to the raw machine JSON stream. The machine-readable JSON needed for the JUnit test report and the BITRISE_FLUTTER_TESTRESULT_PATH output is collected separately, so it does not affect what you see in the log. Do not pass --file-reporter in Additional parameters — the Step manages it internally.

Troubleshooting

Make sure the Project Location input of the Flutter Test Step is correct. The default value is the Environment Variable (Env Var) created for your Flutter project’s location.

Useful links

Related Steps

Similar steps

This Step is used to search for test results and export them for the Deploy to Bitrise.io Step which can export the results to the Test Reports.

Runs Instrumented tests on an existing APK

This step runs your Android project's unit tests.

Run App Center launch test for android