我尝试了一下,如果应用程序类被更改了,它将不会看到任何测试。很容易复制。
class CustomTestRunner : AndroidJUnitRunner() {
override fun newApplication(cl: ClassLoader?, className: String?, context: Context?): Application {
return super.newApplication(cl, TestApplicationClass::class.simpleName, context)
}
}有什么想法吗?看起来,Orchestrator依赖于清单中的应用程序类名。
我使用此配置来使用特殊的Dagger依赖项进行测试。
发布于 2018-04-23 09:58:50
我也有过类似的问题,一个定制的测试跑步者。确保您的TestApplicationClass不会在运行时崩溃。如果自定义运行程序崩溃,则orchestrator将无法获得有关测试的信息,并将返回消息:
No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don't inherit from TestCase or lack @Test annotations).
这就是我在我的定制跑步者身上发生的事。
祝好运!
https://stackoverflow.com/questions/46344898
复制相似问题