Run test suite with gradle

I have a question about running TestSuite

from gradle.

So, under androidTest/java

I have two packages, the first one contains the control tests ( ActivityInstrumentationTestCase2

) and the other one TestSuite

which contains these control tests. If I run the test suite in Android Studio it works fine. How can I run it from gradle? I mean, I would like to run it at Jenkins. What should a gradle task be? I've tried with connectedAndroidTest

, and it runs the benchmark test in a non-specific order instead of the test suite.

+3


source to share


1 answer


You can add filters to select your tests. If you only selected your test package, you can use the normal test case provided by gradle.



test {
    filter {
        includeTestsMatching "*MyTestSuite"
    }
}

      

0


source







All Articles