iRavi iVooda iRavi iVooda - 3 months ago 47
Android Question

Android New Test Type

In Android test framework there are two types namely,

Local unit tests
Instrumented tests
. Is it possible to create duplicate of the Instrumented tests?

I want only some tests to be executed when I select the this duplicate. Or in other words I wanna distinguish between different tests in "Instrumented Tests". Is this possible?

Please ask for any details you need. Thanks.


There's no need to duplicate tests, you can just annotate them using some of the Android Testing Support Library provided filters or you can create you own annotation.

Then using AndroidJunitRunner you can run tests with or without a particular annotation

Filter test run to tests with given annotation:

adb shell am instrument -w -e annotation