This project showcases how to integrate Allure Reports into Flutter integration tests β making it simple to generate structured, visually rich test reports that help developers, QA and stakeholders understand test outcomes at a glance.
Read our blog Elevating Flutter Test Reports with Allure
integration_test/
β Flutter integration test files.scripts/
β Shell script for running tests and generating report.allure-results/
β Raw Allure test result files.allure-report/
β Generated Allure HTML reports.
Make sure you have the following installed:
- Flutter SDK
- Google Cloud SDK β For uploading/downloading test results from GCS.
- Allure Commandline β For generating HTML reports.
Tip: You can use this approach with both Flutter's built-in integration_test package and the Patrol framework.
To take full advantage of Allure's structured reporting:
- Use the
TestResults
class in your integration tests. - Wrap each meaningful step in
report.addStep()
to ensure it's logged and visible in the final report. - At the end of your test, if no exceptions were thrown, call
report.passTest()
to mark the test as passed in the final report. - In the
tearDown()
block, export the test results to your storage solution.
β‘οΈ Example usage: see integration_test/app_test.dart
.
Use the provided script to run integration tests and generate an Allure report locally:
cd scripts
./run_tests_locally_allure.sh
The run_tests_locally_allure.sh
script automates the entire flow:
- Cleans up local
allure-results/
. - Deletes previous results from your GCS bucket.
- Runs Flutter integration tests (
integration_test/app_test.dart
by default). - Downloads the latest test results from GCS.
- Generates the Allure HTML report.
- Opens the report automatically in your browser.
- Ensure access to the Google Cloud Storage bucket defined in the script.
- The Allure CLI must be in your systemβs PATH.
- To use GCS:
- Save your service account key in
assets/keys/
. - Configure the
GoogleCloudPaths
class with your bucket details.
- Save your service account key in
- You can replace GCS with any other storage service or a local solution.
Weβve set up a system to automatically generate and host Allure reports using GitHub Pages. This makes the latest and historical test results easily accessible β without any manual work.
A GitHub Actions workflow handles the entire process:
- Retrieves tests results and generates the Allure HTML report (
--single-file
). - Archives past reports in a
/historical-reports/
folder. - Automatically creates or updates a
index.html
with links to all past reports. - Pushes everything to the
allure-report
branch. - GitHub Pages serves this branch, making the reports publicly accessible.
π You can browse or reuse the full setup in our GitHub workflow.
π οΈ Feel free to adapt it to your project and infrastructure!
/project-root
|ββ /allure-report π Latest Allure report
|ββ /allure-results π Latest JSON results files
|ββ /historical-reports
β |ββ report_2025_01_01/index.html
β |ββ report_2025_01_02/index.html
β |ββ ...
|ββ index.html π Generated historical report
|ββ generate_index.dart π Dart script for building the index