Espresso is an intelligent framework that automatically takes care of common synchronization use cases for us thus requiring test authors to put minimal synchronization code in place.
When we invoke onView(), espresso waits and checks for the below conditions before proceeding with assertions
Is the message queue empty?
Are there any instances of AsyncTask executing any tasks?
Are all developer-defined Idling resources idle?
While this is great for most of the use cases
Espresso still isn’t aware of any other async (asynchronous) operations such as some operation running on a background thread
In such cases, we need to let espresso handle know about these, by registering them as an Idling resource
Blog: https://automationhacks.io/2022-05-14...
Android developers: https://developer.android.com/trainin...
App: https://github.com/automationhacks/te...
Test: https://github.com/automationhacks/te...