为什么不赞成使用Espresso的registerIdlingResources,用什么代替它? [英] Why is Espresso's registerIdlingResources deprecated, and what replaces it?

查看:91
本文介绍了为什么不赞成使用Espresso的registerIdlingResources,用什么代替它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Espresso for Android进行UI测试,并遵循Google的

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:

  • 为什么不推荐使用它?
  • 用什么代替它?

推荐答案

我正在使用Espresso进行单元测试

I'm working on unit tests with Espresso

我希望你是说UI测试;)

I hope you mean UI tests ;)

为什么不推荐使用它?

why is it deprecated?

某些应用程序在Gradle或依赖项注入框架(例如Dagger)中使用构建风格来生成注册空闲资源的测试构建配置.其他人只是通过他们的活动暴露闲置的资源.所有这些方法的问题在于它们增加了开发工作流程的复杂性,其中一些甚至破坏了封装.

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?

现在,您需要使用 IdlingRegistry API

来源: Android测试支持库1.0

这篇关于为什么不赞成使用Espresso的registerIdlingResources,用什么代替它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆