Espresso: A Comprehensive Guide to UI Testing in Android with Jetpack Compose 

Dive deep into the world of Espresso testing for Android with Jetpack Compose. This course will equip you with the knowledge to write robust and efficient UI tests. We'll kick things off with Gradle setup, ensuring your environment is primed for success. Building upon your existing knowledge, we'll establish a solid foundation with the fundamentals of Espresso and provide a cheat sheet for quick reference. Next, you'll conquer waitUntil, a powerful tool replacing Idling Resources for synchronising tests with UI actions. Mocking intents allows for focused testing without relying on external dependencies, and we'll show you how to master this technique. Working with lists and LazyColumn and their data is a common scenario – here, you'll gain the skills to handle them with ease. We'll also explore advanced topics like Espresso recipes, Espresso Web for testing web views, and accessibility checks – all enriched with practical examples from real-world projects. 

Codelab Objectives

In this codelab, you’ll explore:

  • Getting Started with Espresso
  • Setting Up Espresso Dependencies and Configuration
  • Writing out first test
  • Improving Test Reliability with waitUntil
  • Working with Lists and LazyColumn using Espresso
  • Mocking intents with Espresso
  • Espresso Web: Testing Integration with WebView
  • Testing Compose UI for Accessibility
  • Custom Assertions and Matchers
  • Common Test Patterns

Codelab Content

Meet the instructor

James Cullimore

Content Author & Course Instructor

More courses by the instructor