Dunes Buggy
Dunes Buggy

Reputation: 1819

Android New Test Type

In Android test framework there are two types namely, Local unit tests and 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.

Upvotes: 0

Views: 39

Answers (1)

Diego Torres Milano
Diego Torres Milano

Reputation: 69198

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 com.android.foo.MyAnnotation com.android.foo/android.support.test.runner.AndroidJUnitRunner

Upvotes: 1

Related Questions