Why is Espresso's registerIdlingResources deprecated, and what replaces it?

Marvin Effing :

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:

  • why is it deprecated?
  • what replaces it?
cherif :

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

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=430929&siteId=1