android - Exclude Gradle @LargeTest -
i trying run unit test on separate task ui tests have within integration tests in android studio, unfortunately have use
apply plugin: 'com.android.application'
in build.gradle file cannot add custom test tasks far can tell. since ui tests tagged "@test" , extend instrumentationtestcase run whenever
gradle connectedcheck
is called not needed, instead want 1 gradle command run ui tests , 1 run unit tests. figured able leverage tagging ui tests largetests have not been able complete gradle task can this. not able use "test" task in build.gradle since using com.android.application plugin, , advice?
thanks
what ended working me adding the
@largetest
using
import android.support.test.filters.largetest;
annotation tests needed , adding following lines build.gradle
if(!project.hasproperty('android.testinstrumentationrunnerarguments.annotation')) { testinstrumentationrunnerargument 'notannotation', 'android.support.test.filters.largetest' }
this way unless specify in command line run large tests will,be ignored. run large tests use:
gradle cat -pandroid.testinstrumentationrunnerarguments.annotation=android.support.test.filters.largetest
Comments
Post a Comment