Getting ready

Since instrumentation tests require real devices or emulators to run on, ensure that you have one of either of these. We'll be using Android Studio 3.0 for our coding purposes. You can download the source code from https://gitlab.com/aanandshekharroy/Anko-examples and switch to the 5-instrumentation-tests branch. We will also be using Espresso for writing instrumentation tests as it is the easiest software to use. Espresso is automatically included in your project when you create a new project.

Espresso is targeted at developers who believe that automated testing is an integral part of the development lifecycle. While it can be used for black-box testing, Espresso's full power is unlocked by those who are familiar with the code base under test.