A Gradle plugin for running Android instrumentation tests with Spoon.
Add to your build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'de.felixschulze.gradle:gradle-spoon-plugin:2.7.3'
}
}
apply plugin: 'de.felixschulze.gradle.spoon'
Add to your build.gradle
spoon {
teamCityLog = true
debug = true
noAnimations = true
failOnFailure = false
testSizes = ['small', 'medium']
adbTimeout = 10*60
failIfNoDeviceConnected = false
excludedDevices = ['f5adb1a1', 'a6asb224']
}
teamCityLog
: Add features for TeamCitydebug
: Activate debug output for spoonnoAnimations
: Deactivate gif generationfailOnFailure
: Deactivate exit code on failuretestSizes
: Only run test methods annotated by testSize (small, medium, large)adbTimeout
: ADB timeout in secondsfailIfNoDeviceConnected
: Fail if no device is connectedexcludedDevices
: List of devices which should be excludedinstrumentationArgs
: List of arguments to pass to the Instrumentation Runner
-PspoonTestClass=fully_qualified_test_class_package_name
-PspoonTestMethod=testMethodName
// Workaround for Multidex bug in gradle-android-plugin
// Replace Multidex dependency with some dummy dependency to avoid dex problems
// @see https://code.google.com/p/android/issues/detail?id=194609
project.getConfigurations().all { config ->
if (config.name.contains("AndroidTest")) {
config.resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == "multidex") {
details.useTarget("de.felixschulze.teamcity:teamcity-status-message-helper:1.2")
}
}
}
}
gradle-spoon-plugin is available under the MIT license. See the LICENSE file for more info.