在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):stanfy/spoon-gradle-plugin开源软件地址(OpenSource Url):https://github.com/stanfy/spoon-gradle-plugin开源编程语言(OpenSource Language):Groovy 79.5%开源软件介绍(OpenSource Introduction):Spoon Gradle PluginGradle plugin for Spoon. Allows you to run spoon with almost no effort under new Android build system. Plugin generates Usagebuildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.stanfy.spoon:spoon-gradle-plugin:1.2.2'
}
}
apply plugin: 'spoon'
// This section is optional
spoon {
// for debug output
debug = true
// To run a single test class
className = 'fully.qualified.TestCase'
// To run a single method in TestCase
methodName = 'testMyApp'
// To execute the tests device by device */
sequential = true
// To grant permissions to Android M >= devices */
grantAllPermissions = true
} After applying the plugin you'll find You may run all the test variations with
Generated reports are available at For making screenshots add dependencies {
androidTestCompile 'com.squareup.spoon:spoon-client:1.6.4'
} By default the plugin runs tests on all the connected devices. In order to run them on some concrete devices instead, you may specify their serial numbers: spoon {
devices = ['333236E9AE5800EC']
skipDevices = ['serial-you-want-to-skip']
} It is also allowed to specify specify size of tests that should be run. You may run all the tests
annotated as gradle spoonSmall Run You may also setup your project to take parameters for class/method to be run from command line. E.g.: gradle spoon -PspoonClassName=fully.qualified.TestCase And project configuration: spoon {
if (project.hasProperty('spoonClassName')) {
className = project.spoonClassName
}
} Test ShardingYou can configure test sharding using the spoon {
numShards = 4
shardIndex = 0
} If you are specifying sharding for multiple devices, you may use spoon's built in auto-sharding by specifying: spoon {
shard = true
} This will automatically shard across all specified serials, and merge the results. Custom instrumentation argumentsUse the spoon {
instrumentationArgs = ["foo=bar", "name=value"]
} Code CoverageYou can configure spoon to calculate code coverage by using spoon {
codeCoverage = true
} This option requires your app to have the Known issuesIf you have troubles with running Android Lint after this plugin is applied, try the following workaround buildscript {
// ...
dependencies {
classpath('com.stanfy.spoon:spoon-gradle-plugin:1.2.2') {
exclude module: 'guava'
}
classpath 'com.google.guava:guava:17.0'
}
} You can find details in the related issue. TestingAfter making editions, run
This will install the plugin to local maven repo and run spoon task in the example project. License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论