使用 ANDROIDX_TEST_ORCHESTRATOR 时未找到测试
No tests found when using ANDROIDX_TEST_ORCHESTRATOR
当我在 testOptions
中有 ANDROIDX_TEST_ORCHESTRATOR
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).
当我在 testOptions
中注释掉 ANDROIDX_TEST_ORCHESTRATOR
时
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
及更早版本中的错误。
我通过在 build.gradle
文件的 dependencies
中将版本升级到 1.3.0-rc01
来让它工作。
androidTestUtil 'androidx.test:orchestrator:1.3.0-rc01'
当我在 testOptions
ANDROIDX_TEST_ORCHESTRATOR
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).
当我在 testOptions
ANDROIDX_TEST_ORCHESTRATOR
时
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
及更早版本中的错误。
我通过在 build.gradle
文件的 dependencies
中将版本升级到 1.3.0-rc01
来让它工作。
androidTestUtil 'androidx.test:orchestrator:1.3.0-rc01'