I am struggling to create a gradle task to execute the test task with specified system.properties that I use for my Selenium Tests
task firefox() << {
System.setProperty('driver', 'firefox')
tasks.clean.execute()
tasks.test.execute()
}
That does not work obviously. I highly appreciate any help, to finalize my built script!
Task.execute()
should never be called from a build script (bad things can happen if you do). It's up to Gradle to call this method. The way to set system properties for the test
task is:
test {
systemProperty "driver", "firefox"
}
System.setProperty()
won't have any effect because tests always execute in a separate JVM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With