小编Ser*_*kov的帖子

Android Test Orchestrator 和自定义应用程序类

我尝试了Android Test Orchestrator,如果更改了Application类,它看不到任何测试。很容易重现。

  1. 在 Android Studio 3 preview Beta 6 中使用向导创建简单的项目
  2. 创建自定义跑步者,如:
    class CustomTestRunner : AndroidJUnitRunner() {
      override fun newApplication(cl: ClassLoader?, className: String?,   context: Context?): Application {
       return super.newApplication(cl, TestApplicationClass::class.simpleName, context)
      }
    }
Run Code Online (Sandbox Code Playgroud)
  1. 更换新的仪器转轮
  2. 运行仪器测试后未找到测试

有任何想法吗?看起来 Orchestrator 依赖于清单中的应用程序类名。

我使用此配置来使用特殊的 Dagger 依赖项进行测试。

testing android

5
推荐指数
1
解决办法
441
查看次数

标签 统计

android ×1

testing ×1