build.gradle - Gradle test parameter test suite -
i'm new gradle.
my problem:
is possible switch between test suites in "gradle test" depending on parameter?
something like:
test { usetestng() { suites 'src/test/resources/testng-'+input_parameter_as_string+'-test.xml' usedefaultlisteners = true } my goal call: gradle test "input_parameter_as_string".
hope guys can me out.
gradle documentation lists ways run specific test using system property: http://www.gradle.org/docs/current/userguide/userguide_single.html#sec:java_test . run multiple correlated tests, can try test group (both testng , gradle supports): http://testng.org/doc/documentation-main.html#test-groups .
if insist use custom closure, can use project property. in build.gradle:
test { usetestng() { suites 'src/test/resources/testng-' + project.ext.input_parameter_as_string +'-test.xml' usedefaultlisteners = true } and in command line:
gradle test -pinput_parameter_as_string=testfoobar.
Comments
Post a Comment