I'm trying to run the tests with this line... but this launches all tests:
./gradlew -DconnectedAndroidTest.single=LandingActivityTests connectedAndroidTest
How can I launch a single test?
I'm trying to run the tests with this line... but this launches all tests:
./gradlew -DconnectedAndroidTest.single=LandingActivityTests connectedAndroidTest
How can I launch a single test?
you can run the single android test in two steps:
./gradlew installDebugAndroidTest
adb shell am instrument -w -e class com.example.MyInstrumentationTest#testFoo com.example.test/android.support.test.runner.AndroidJUnitRunner
https://developer.android.com/tools/testing/testing_otheride.html
Since Android Gradle plugin version 1.3.0 you can use
Visit Testing
Sadly,
gradle connectedAndroidTest
task is not supporting all the arguments.There is feature request for gradle team.
If you are using Android Studio, you can create Run Configuration that launches specific test via
adb shell am instrument
if you want to run just one test inside the class do something like
can_register
is a method in a classRegisterEmailTest
NOTE: the package needs to reference where the class is otherwise it will not work.