在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):michaelruocco/gradle-postman-runner开源软件地址(OpenSource Url):https://github.com/michaelruocco/gradle-postman-runner开源编程语言(OpenSource Language):Java 73.6%开源软件介绍(OpenSource Introduction):gradle-postman-runnerA gradle plugin to run Postman collections. The runner makes use of newman run by gradle-node-plugin. By default, all postman collection files (ending with Usageplugins {
id "com.github.michaelruocco.gradle-postman-runner"
} If not already done, you may want to configure the gradle-node-plugin. At least download has to be enabled as of version 0.13. See gradle-node-plugin documentation for more options. node {
download = true
} That's all needed to execute the postman task:
An optional configuration of postman itself is done with the // postmanrunner configuration
postman {
// specifies collection file pattern
// default: src/test/**/*.postman_collection.json
collections = fileTree(dir: 'src/test', include: '**/*.myCollection*')
// specifies the test environment to execute the collections with
// default: no environment
environment = file('src/test/some_environment.postman_environment.json')
// specifies any environment variables to execute the collections with
// will override any values from the environment file above
// default: no environment variables
envVars = [ "myVar" : "myVarValue" ]
// specifies the a global variable file to execute the collections with
// default: no globals
globals = file('./postman_globals.json')
// specifies any global variables to execute the collections with
// will override any values from the globals file above
// default: no global variables
globalsVars = [ "myVar" : "myVarValue" ]
// stops entire execution on first failing test in a collection
// default: false
stopOnError = true
// reports to stdout
// default: true
cliReport = false
// when windows gives you lemons on cli output...
// default: false
disableUnicode = false
// enables/disables ssl verification checks and allows self-signed certificates
// default: true
secure = false
// creates junit compatible XML result files in directory
// default: off
xmlReportDir = 'build/testoutput'
// adds html output with default template to given path
// default: off
htmlReportDir = 'build/tesdtoutput/html'
// define a handlebars template for html output
// default: newman's default template https://github.com/postmanlabs/newman/blob/develop/lib/reporters/html/template-default.hbs
htmlTemplate = 'custom-template.hbs'
// adds plain json output with default template to given path
// default: off
jsonReportDir = 'build/tesdtoutput/json'
}
Besides a global configuration with the 'postman' extension as seen above, it's also possible to create a custom task and override all of the global configuration values (if any given): task postmanOnDifferentEnvifonment(type: uk.co.mruoc.postman.task.PostmanTask) {
environment = file('different_environment.postman_environment.json')
stopOnError = false
} Useful Commands// cleans build directories
// prints currentVersion
// formats code
// builds code
// runs tests
// checks for gradle issues
// checks dependency versions
./gradlew clean currentVersion dependencyUpdates lintGradle spotlessApply build |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论