How can I start testng suite with arguments via gradle to generate TestResultAttributes

已查看 188 次
跳至第一个未读帖子

Lotte

未读,
2021年7月20日 15:17:312021/7/20
收件人 testng-users
I have a gradle Project lwith this test task:

test{
useTestNG() {
useDefaultListeners = true
suites 'src/test/suite.xml'
}
}

and I would like to  start bei test via comandline argument:
-reporter org.testng.reporters.XMLReporter:generateTestResultAttributes=true,generateGroupsAttribute=true

So that i can generate the attributes ino the xml-report "testng-results.xml", too.

⇜Krishnan Mahadevan⇝

未读,
2021年7月21日 07:21:472021/7/21
收件人 testng-users
I couldnt find any way in the built-in TestNG Gradle DSL that can support this.

But you can try something like this

dependencies {
// https://mvnrepository.com/artifact/org.testng/testng
testImplementation 'org.testng:testng:7.4.0'
}


task testngTest(type: JavaExec, dependsOn: [classes]) {
mainClass = 'org.testng.TestNG'
args('src/test/resources/suite.xml', '-reporter',
'org.testng.reporters.XMLReporter:generateTestResultAttributes=true,generateGroupsAttribute=true'
)
classpath = sourceSets.test.runtimeClasspath
}


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/27ab5be5-2894-498f-9555-214673e9a74en%40googlegroups.com.
回复全部
回复作者
转发
0 个新帖子