Android UI Tests on a CI

Why do we need this?

https://fastersafely.com/images/pipeline_1.png

Back Story

3 years ago when I was developing UI Tests for Android apps, it was challenging to integrate UI tests on CI and include it on pipeline (developed using Espresso). So, we covered only Unit Tests & Integration Tests.

Here are the challenges we encountered:

  1. The pipeline we used included CircleCI, it was painful to make it work with because x86 emulators are not supported, and running ARM emulators is way too slow to be useful.
  2. Setting up and managing an in-house device farm is expensive and requires long-term investment and on-going infrastructure support - not a viable option for most teams especially if you are a small one.
  3. Cloud-based device farms such as Firebase Test Lab are a much more cost-effective solution for large teams as they take care of managing the infrastructure while offering simple APIs for integrating with existing CI pipelines. However, if you are willing to spend 💰💰 then go for it. But if you need a reasonable price with a large number of tests, you might need to consider something else.

Pre-requisites

We need to have these checkboxes on our environment to run in a CI:

What tools check these boxes?

1. Bitrise

to visualing the workflow like ⤵️

https://raw.githubusercontent.com/ziadtawfeek/web/master/assets/bitrise-workflow.png

If all went well with the workflow, you will get a bitrise report on the build details ⤵️

https://raw.githubusercontent.com/ziadtawfeek/web/master/assets/bitrise-summary.png

Conclusion:

2. GitHub Actions

Setting it to work, you will get a report visual like this ⤵️

Conclusion: