How to change default Gradle suite and test headings in TestNG report


(Lidia Marchioni) #1

This has got to be covered somewhere, but I just can’t find it…

I’m running Selenium/TestNG tests with Gradle. Here is a simplified version of the build.gradle file:

apply plugin: 'java'
apply plugin: 'idea'
  repositories {
    mavenCentral()
}
  dependencies {
    compile "org.seleniumhq.selenium:selenium-java:2.21.0"
    compile "org.testng:testng:6.3.1"
}
  tasks.withType(Test) { systemProperty 'BROWSER', System.getProperty('BROWSER', 'firefox') }
  task demo(type: Test) {
    useTestNG() {
        includeGroups 'demo'
    }
}

When I execute tests, the TestNG report shows “Gradle suite” and “Gradle test” as headings of the results. How do I change that?

Thanks Lidia


(Peter Niederwieser) #2
test {
  useTestNG {
    suiteName = ...
    testName = ...
  }
}

(Lidia Marchioni) #3

Works like a charm.

Thank you Lidia