So I defined many UiAutomatorTestCase classes, each has 1 or 2 test cases at the most. Then I use Shell script on Jenkins to string these test cases into a series of tests, for example:
adb shell uiautomator runtest myTest.jar -c com.myTest.TestClass1
adb shell uiautomator runtest myTest.jar -c com.myTest.TestClass2
adb shell uiautomator runtest myTest.jar -c com.myTest.TestClass3
adb shell uiautomator runtest myTest.jar -c com.myTest.TestClass4
...
so on so forth.
one of the two (1/2) problems I have is that with Jenkins builds, it doesn't matter if any of these test fails, Jenkins always shows up as green, I need Jenkins stop and shows red for the build.
the other (2/2) problem is that if the app crashes in one of the tests, say, TestClass2, the script will try to pick up and continue executing. What would be the best method to make the script stop?
Any suggestions? Thanks