Testing in Android Part 5: Idling Resources

Idling Resources from Espresso, CountingIdlingResource, and ComposeOkHttp3IdlingResource

Siva Ganesh Kantamani
5 min readOct 3, 2023
Photo by UX Indonesia on Unsplash

Introduction

In this article, we’re going to learn about how to write integration tests that involve background tasks like API calls to update the UI using the Espresso Idling Resources feature. As I said Idling Resources is part Espresso not Compose, so we need to make a few customizations to make it work together.

We’ll start the article with the basic question, What’s Idling Resources, from there we’ll create custom Idling Resources to support Compose test cases and our use-case.

This is the final part of the series, I would highly recommend you to read the previous parts of this series before going further if you already haven’t:

What is Idling Resources?

--

--