- Default Bitrise build step “Android Unit Test”
2. Unit tests results are output into “App & Artifacts” tab.
By default, Bitrise zips the test results for unit tests. To generate Unit Tests HTML results report.
- We need to write a bash script to move the HTML report to the Bitrise output directory.
- Add step “Do anything with Script”, and copy paste below Linux command. Linux command “mv” moves the HTML file to $BITRISE_DEPLOY_DIR location.
#move results to bitrise deploy dir and rename file
$mv /bitrise/src/AppName/./build/reports/tests/testGoogleFlavorAppNameFreeFatReleaseUnitTest/index.html $BITRISE_DEPLOY_DIR/Unit-tests-results.html
3. Now Unit tests HTML report is moved to Bitrise tab “Apps and Artifacts”.
UI test (Espresso tests) are run in Firebase Test Lab (FTL), if you are familiar with FTL is a similar configuration. We need to generate Debug and Test APKs to run UI test on FTL framework.
- Open Bitrise workflow.
2. Build Android debug build APK and Android Test APK. To generate Test APK we need to add the build step “Gradle Runner”.
3. Add build step “[BETA] Virtual Device Testing for Android”
4. Select Instrumentation Test tab, and configure FTL
5. Run. We get UI tests results in the “Test reports ->See more tab”
Is configured by default.
Bitrise generates HTML results report:
Thanks for reading! Let me know if you have any questions.