I am trying to run android instrumentation Junit test using command line.I am using following command and it is launching the test right.
adb shell am instrument -w com.android.foo/android.test.InstrumentationTestRunner
My android project package has following java source files (in alphabetical order)
com.android.foo
ActivityTest
ContactsTest
LaunchTest
SendTest
When I run the test using the above mentioned command, the test starts executing ActivityTest first and so on. This is not what I want, I want it to execute LaunchTest first followed by ContactTest, SendTest and ActivityTest. I tried using
adb shell am instrument -w -e class com.android.foo.LaunchTest,com.android.foo.ContactTest com.android.foo/android.test.InstrumentationTestRunner
but it gives me an error may be because I am not using TestCase class in my code but instead my LaunchTest and others extends ActivityInstrumentationTestCase2.
any help is appreciated.
I finally got it to work using the following command :
adb shell am instrument -e class com.android.foo.LaunchTest -w com.android.foo/android.test.InstrumentationTestRunner
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With