In the interest of all newcomers (such as myself) who stumble upon this question; I would like to explicitly point out that the systemProperty test task in gradle just passes the system properties to the test jvm. Therefore, if you just use
test{ systemProperty 'Chrome', 'Browser' }
You cannot access the property in junit tests through "System.getProperty (" Browser ")." Instead, it should be associated with the gradle test -DBrowser = Chrome command
The above case is just an illustration, and it probably makes sense to use -
test{ systemProperty 'Chrome', System.getProperty('Browser') }
together with
gradle test -DBrowser=Chrome
Savvy source share