Setup UI Tests with Espresso for Automatic Localized Screenshots

Merged Torsten Grote requested to merge 596-espresso into master

This MR sets up the infrastructure for Espresso UI tests including the ability to inject objects into the tests as well as waiting for views to get displayed and activities to get resumed. The latter is necessary due to our sign-in infrastructure. Then launching an activity to get tested, the PasswordActivity gets started first and finishes when the password was entered correctly. However, Espresso doesn't wait for this unexpected activity to finish and the other one to resume again.

The MR also adds a first test to take automatic screenshots to illustrate the dark theme in the manual (#1253 (closed)). These two screenshots were taken by it.

manual_dark_theme_settings manual_dark_theme_nav_drawer

(The dark theme is still the old one, because !861 (merged) wasn't merged when I took these screenshots.)

I recommend to take screenshots with fastlane since it automates the whole process of taking the shots and pulling them from the device. For example, before the screenshotting starts, I use it to activate the device's demo mode to make the status bar look nice and always the same. But it can also be used for automatically uploading (localized) screenshots and (localized) app metadata (#1102 (closed)) to Google Play. You can even upload the signed APK releases as well and integrate a script that also updates the F-Droid repository, automating most of the release process.

Install Fastlane with gem install fastlane -NV, go into the briar-android folder and call fastlane screenshots to automatically take the shots from a device (or emulator) connected via adb.

Closes #596 (closed)

Edited by Torsten Grote

Merge request reports