Chapter    5

Espresso

Android apps fail for a number of reasons other than simple logic errors. At its most basic, the app may not install correctly, or there may be a problem when you move from landscape to portrait and back again. Because of fragmentation, the layout might not work on any number of devices that you haven’t had the time to test it on, or it could hang if the network is down.

It’s just not possible to test for these conditions using unit testing. We’re going to have to use another testing tool to test our GUIs (graphical user interfaces) or activities. And, unfortunately, it also means we’re back to using devices and emulators to do our testing.

There are lots of options out there, such as UIAutomator, Calabash, Robotium, and ...

Get Agile Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.