【发布时间】:2017-09-21 13:13:09
【问题描述】:
我尝试了 Android Test Orchestrator,如果 Application 类已更改,它看不到任何测试。很容易复制。
- 在 Android Studio 3 预览版 Beta 6 中使用向导创建简单项目
- 创建自定义运行器,例如:
class CustomTestRunner : AndroidJUnitRunner() {
override fun newApplication(cl: ClassLoader?, className: String?, context: Context?): Application {
return super.newApplication(cl, TestApplicationClass::class.simpleName, context)
}
}
- 用新的更换仪表滑轨
- 运行插桩测试后未找到测试
有什么想法吗?看起来 Orchestrator 依赖于清单中的应用程序类名称。
我使用这个配置来使用特殊的 Dagger 依赖项进行测试。
【问题讨论】:
-
尝试覆盖 AJUR 的 onOrchestratorConnected() 方法,并放 Logs 查看是否为每个测试连接了 orchestrator