Hi Lee, The configuration you described looks correct to me and it should work as far as I can tell. The geb.env system property seems to be set because configuration for chrome environment is used so I don't see a reason why another property, set in the same way on the same gradle test task would not be picked up in your geb config script.
When you say that: > This always fails though as it seems to not be able to get the property when it's declared in the Gradle task. how exactly does this failure manifest? Cheers, Marcin On Fri, Apr 24, 2020 at 12:55 AM Lee <[email protected]> wrote: > I've created a Gradle file where I define a task to execute Geb tests > pretty much as follows: > > task gebTest(type: Test { > include 'somePathToTests' > systemProperty 'geb.env', 'chrome' > ) > > I have the 'chrome' environment configured in my GebConfig.groovy file and > that works fine. > > What I'd like to do is define a new system property in the Gradle task and > be able to use that from within the GebConfig file. > > Example of modified Gradle task with new 'remoteUrl' system property > declaration: > > task gebTest(type: Test { > include 'somePathToTests' > systemProperty 'geb.env', 'chrome' > systemProperty 'remoteUrl', "http://localhost:4444/wd/hub" > ) > > > > How I'm trying to use it in the GebConfig file: > > standAloneURL = System.getProperty('remoteUrl') > > environments { > chrome { > driver = { > chromeOptions.addArguments("--window-size=1920,1080") > chromeOptions.addArguments("--headless") > chromeOptions.addArguments("--disable-gpu") > new RemoteWebDriver(new URL(standAloneURL), chromeOptions) > } > } > } > > This always fails though as it seems to not be able to get the property > when it's declared in the Gradle task. > > But, if I update the GebConfig file by hard coding the 'standAloneURL' to > be what I want, it works fine. > > Example: > standAloneURL = "http://localhost:4444/wd/hub" > > > This is confusing me as setting the system property 'geb.env' in my Gradle > task works just fine. > > Are there any suggestions as to what I may be doing wrong? > > -- > You received this message because you are subscribed to the Google Groups > "Geb User Mailing List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/geb-user/49e631e5-d019-4a9b-81b6-1a677e106a82%40googlegroups.com > <https://groups.google.com/d/msgid/geb-user/49e631e5-d019-4a9b-81b6-1a677e106a82%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CA%2B52dQR0vWr1%3DmEKkFbnMaPOb1-N5_O65Kiq%2BY_swA9JH8JEMQ%40mail.gmail.com.
