I am having trouble figuring out how I get test attributes to be generated when running tests in a gradle project.
https://testng.org/doc/documentation-main.html#loggingI have been reviewing the documentation above, and I can see the generateTestResultAttributes boolean can be set via command line, and in Maven but I can't seem to find the documentation anywhere that shows how to set it in the build.gradle test task.
Below is my test task, and where I am trying to add the boolean to allow me to set test attributes that will show up in the testng-results.xml using the IAttributes setAttribute method.
test {
useTestNG() {
//run classes in parallel, thread count limited by processor.
options {
parallel = 'classes'
threadCount = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
useDefaultListeners = true
//sets the default group to run as smoke-api.*, .* is wildcard.
includeGroups System.getProperty('groups', 'smoke-api.*')
excludeGroups System.getProperty('excludeGroups', 'exclude')
}
//we want display the following test events
testLogging {
events "PASSED", "FAILED", "SKIPPED"
}
reports.html.enabled = false
}