Skip to content

Instantly share code, notes, and snippets.

@krmahadevan
Created October 13, 2021 08:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krmahadevan/ff7dc7e49c60836a635b8fe8a43c7cb8 to your computer and use it in GitHub Desktop.
Save krmahadevan/ff7dc7e49c60836a635b8fe8a43c7cb8 to your computer and use it in GitHub Desktop.
A Sample Gradle build file that configures TestNG to be run as a custom task
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn more about Gradle by exploring our samples at https://docs.gradle.org/7.2/samples
*/
plugins {
id 'java'
id 'idea'
}
group 'com.rationaleemotions'
version '1.0.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
// https://mvnrepository.com/artifact/org.testng/testng
testImplementation 'org.testng:testng:7.4.0'
}
task testngTest(type: JavaExec, dependsOn: [classes]) {
group 'Verification'
description 'Run'
mainClass = 'org.testng.TestNG'
args('src/test/resources/suite.xml', '-reporter',
'org.testng.reporters.XMLReporter:generateTestResultAttributes=true,generateGroupsAttribute=true'
)
classpath = sourceSets.test.runtimeClasspath
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment