当我有 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'