Issue
In my android app I has many Espresso's tests. It's locate in:
/app/src/androidTest/kotlin/com/myproject/android/folder1/
and /app/src/androidTest/kotlin/com/myproject/android/folder2/
To run all instrumented tests I use this:
gradlew app:connectedAndroidTest
Here output:
10:44:37 V/ddms: execute: returning
> Task :common:connectedAndroidTest
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 7m 43s
97 actionable tasks: 25 executed, 8 from cache, 64 up-to-date
Nice.
But I need to start test only in folder2
. I use this:
gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.myproject.android.activity.*
but I get error:
04:45:23 V/ddms: execute: returning
> Task :app:connectedDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:connectedDebugAndroidTest'.
> Could not generate test report to '\app\build\reports\androidTests\connected'.
Solution
Use package instead of class in the test arguments gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.package=com.myproject.android.packageName
Answered By - Amrinder Singh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.