Testing in Android Part 5: Idling Resources
Idling Resources from Espresso, CountingIdlingResource, and ComposeOkHttp3IdlingResource
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:
- Testing in Android Part 1: Unit Tests
- Testing in Android Part 2: Integration Tests
- Testing in Android Part 3: End-to-End Tests
- Testing in Android Part 4: Mock API Calls Or Not?
- Testing in Android Part 5: Idling Resources? — You’re here