The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.


Testing with Espresso

Basic JUnit4 instrumentation tests are fine for testing non-UI logic. They even work acceptably for some basic UI testing. The more complex your UI testing gets, though, the more likely it is that you will find plain JUnit4 instrumentation tests to be limiting and tedious.

In particular, running tests across activities can be tricky with ordinary JUnit4. ActivityTestRule is designed for testing a single activity in isolation, and crafting your own rule that transcends a single activity may be difficult.

Espresso is designed to simplify otherwise-complex UI testing scenarios, such as:

In this chapter, we will explore how to set up basic Espresso tests and how to employ them as part of your overall testing implementation.

Prerequisites

This chapter assumes that you have read the chapter on JUnit4.

Adding a Shot of Espresso

The preview of this section was whisked away by a shark-infested tornado.

Writing Tests in Espresso

The preview of this section took that left turn at Albuquerque.

The Espresso Test Recorder

The preview of this section was lost due to a rupture in the space-time continuum.

Stronger Espresso

The preview of this section is sleeping in.

Opting Out of Analytics

The preview of this section took that left turn at Albuquerque.

Waiting for the World to Change

The preview of this section is presently indisposed.