Gradle Android test does not support filter (--tests)

爱⌒轻易说出口 提交于 2019-12-22 08:44:58

问题


Gradle Android test does not support filter (--tests).

 gradlew test --tests com.example.test.*

works.

 gradlew connectedAndroidTest --tests com.example.test.*

Error: Unknown command-line option '--tests'.


回答1:


To run specific AndroidJUnit4 tests providing instrumentation runner is necessary to gradle.

try this format:

./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.example.android.testing.blueprint.ui.espresso.EspressoTest

Here is the list of all useful gradle commands {LINK}



来源:https://stackoverflow.com/questions/48968213/gradle-android-test-does-not-support-filter-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!