I would like to pass JVM parameters to my Gradle test task. I use the parameters in a Cucumber feature file: ${app.url}
. In the build.gradle
file, I put those lines:
test {
testLogging.showStandardStreams = true
systemProperties System.getProperties()
}
When I execute gradle test -Dapp.url=http://.....
, I don't see the parameter was passed to the application. I also tried the below, but the result is the same:
test {
testLogging.showStandardStreams = true
systemProperty "app.url", System.getProperty("app.url")
}
When I use Maven and pass the same parameters as Jvm arguments, it works fine. Now I would like to switch to the Gradle, but I am stuck with passing parameters.