I'm working on UI tests with Espresso for Android, and following the Google's code sample it is used, even though it's deprecated. So my questions are:
Since the example has not been updated, if you are using Espresso 3.0< instead of registerIdlingResources
Espresso.registerIdlingResources(mIdlingResource);
you should use IdlingRegistry:
IdlingRegistry.getInstance().register(mIdlingResource);
I'm working on unit tests with Espresso
I hope you mean UI tests ;)
why is it deprecated?
Some apps use build flavors in Gradle or a dependency injection framework, like Dagger, to generate test build configurations that register idling resources. Others simply expose the idling resource through their activities. The problem with all these approaches is that they add complexity to your development workflow, and some of them even break encapsulation.
what replaces it?
Now you need to use IdlingRegistry API
Source: Android Testing Support Library 1.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With