From the course: Android Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Create an Espresso user interface test

Create an Espresso user interface test - Android Tutorial

From the course: Android Development Tips

Create an Espresso user interface test

- [Instructor] Android Studio is integrated with Espresso, an open source testing tool, that allow you to create user interface tests. You can record these tests from within Android Studio, and then play them back, to make sure you haven't broken anything in the user interface when you make changes. When you use Espresso, I strongly recommend using a physical device, not a virtual device running on the emulator. There are certain tests that will fail on the emulator, that work fine on the physical device. And to demonstrate this, I'm using a virtual device emulating the Pixel, and a physical device, a Nexus 5X, that I'm projecting to the screen. I'm actually going to record the test with the virtual device, and then play it back on both. In Android Studio, I'll go to the menu and choose Run, Record Espresso Test. And I'll choose my virtual device, which I can identify by the API 25. I'll move the Espresso recording dialog over to the left, and then I'll bring the virtual device onto…

Contents