-
Learn how to perform UI testing of your Android applications with Espresso.
Testing is essential to delivering high-quality software. Espresso is the tool of choice for many Android developers, who need to test the logic and UI of their applications. Join instructor Chiu-Ki Chan to learn the essentials of Android Espresso for UI testing. Learn how to write tests by hand, and then leverage the Espresso Test Recorder to record actions that generate the code for you. Find out how to use the Layout Inspector to pinpoint the views you want to test, and also test scrolling views such as list and recycler views.
Overview
Syllabus
-
Introduction
- Welcome
- What you should know
- Exercise files
- Automated testing
- Types of Android tests
- How Espresso works
- Advantages of Espresso
- Synchronization: Message queue
- Synchronization: Async tasks
- App: Hello World
- Adding Espresso to your project
- Turn off animations
- ActivityTestRule
- The Espresso formula
- ViewMatcher
- ViewAction
- ViewAssertion
- String value vs. string id
- Why not findViewById?
- Fluent API
- Hamcrest matcher
- Write tests automatically
- Record actions
- Add assertions
- Generated code
- App: Toolbar Title
- Layout Inspector
- Combining matchers
- Pitfall to overspecification
- Custom matcher: matchesSafely
- Custom matcher: describeTo
- Using withToolbarTitle
- onView vs. onData
- App: List view
- withValue matcher
- onData
- Failing test
- App: Recycler view
- Cannot use onData
- MainActivityTest
- RecyclerViewActions
- Other recycler view actions
- Wrap up
- Next steps