android - 使用 ANDROIDX_TEST_ORCHESTRATOR 时未找到测试
问题描述
当我ANDROIDX_TEST_ORCHESTRATOR
有testOptions
testOptions {
unitTests.includeAndroidResources = true
animationsDisabled = true
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
我运行仪器测试
./gradlew connectedStudioDebugAndroidTest --stacktrace
我收到未找到测试的错误
com.android.builder.testing.ConnectedDevice > No tests found.[emu1(AVD) - 9] FAILED
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).
当我ANDROIDX_TEST_ORCHESTRATOR
在testOptions
testOptions {
unitTests.includeAndroidResources = true
animationsDisabled = true
// execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
测试运行。
那么我怎样才能让测试运行ANDROIDX_TEST_ORCHESTRATOR
呢?
编辑
我取得了一些进展:androidTests 在我的真实设备(API 28)上运行,但不是任何模拟器(API 28)。我在 OSX 顺便说一句。
解决方案
这似乎是ANDROIDX_TEST_ORCHESTRATOR
版本1.2.0
和旧版本中的错误。
我通过将版本添加到文件1.3.0-rc01
中来让它工作。dependencies
build.gradle
androidTestUtil 'androidx.test:orchestrator:1.3.0-rc01'
推荐阅读
- reactjs - ReactNative FlatList 检测滚动到 List 上的最后一项
- java - 创建一个方法来反转数组 String[] 然后检查它是否是回文
- javascript - 如果开始日期在今天之后的一周内,则将值设为 true,而在结束日期之后设为 false
- java - 方法链来构建一个对象,该对象通过 Lombok Builder 在两个对象上具有另一个对象
- python - 如何在python中的列表中拆分文档
- google-chrome-devtools - 如何在 Chrome 开发者工具中使用 Dock to Bottom 而不影响当前页面的视口高度?我不想取消停靠单独的窗口
- jwt - WSO2 - 从 JWT 中删除 AD 角色
- python - 如何处理高频时间序列数据?
- java - 使用 itext 和 java 在 pdf 中打印大量行的问题
- elasticsearch - 将弹性搜索范围查询与过滤器相结合,以排除其他字段上的空值