How to run Android JUnit tests from multiple projects in eclipse?

I am wondering how to run several projects containing Android JUnit Robotium test from eclipse right away ... Hope someone can help.

Thanks a lot!

+1
source share
2 answers

I found myself in a similar situation. I used the command line to run my test. You can use the following commands

For one test

adb shell am instrument -e your class -w your package/android.test.InstrumentationTestRunner 

For all your tests

 adb shell am instrument -w your package/android.test.InstrumentationTestRunner 

Hope this helps.

+1
source

You can run JUnit tests on multiple projects using the public Classpath Suite class.

Create an Eclipse project that contains a dependency on all the projects you want to test. Write a set:

 @RunWith(ClasspathSuite.class) public class MySuite 

Take a look at this article: Roger Rabbit - JUnit Tests Runner through several projects , includes a step-by-step example and code example.

+1
source

Source: https://habr.com/ru/post/948213/


All Articles