Lee, What's the full path to your GebConfig.groovy file? It should be located in the root of one of resource directories or root of one of the source directories for the "dog" source set to be picked up automatically by Geb. There are also other options (either configuring your build or configuring where config is loaded from when instantiating geb.Browser instances) which I can tell you about in more detail but I need to know first where your GebConfig.groovy is located.
Marcin On Wed, Aug 2, 2017 at 10:24 PM, Lee <[email protected]> wrote: > I've recently come on board and inherited a project that uses Geb. I > realize what may be contributing to my issue is that everything is not > organized in anything close to a standard structure. Example of what it > probably should be but is not: src/test, src/test/resources, etc > > I'm hoping someone can help with a way to work around my issue until we > can reorganize things. > > *Here's the issue:* > > We have a Gradle task that executes our Geb tests, but it looks like how > it was previously implemented did not rely on the GebConfig.groovy file for > configurations. It just sets 'geb.driver' within the task and works. > > I'd like to utilize the GebConfig.groovy file so I can leverage the > 'environments' functionality. > > When I execute a Gradle task (example below) that tries to use my desired > environment configuration (with chromedriver) I've set up in the GebConfig > file, the tests are just executed in Firefox which I understand is the > default driver. > > Is there any way I can modify the task to point directly to the GebConfig > file? > > *Here's an example of a Gradle task that I want to use that should use > geb.env, but this doesn't work:* > > task "gebTestNoConfig"(type: Test, dependsOn: dogClasses) { > classpath = sourceSets.dog.compileClasspath + sourceSets.dog.output > > > systemProperty 'geb.env', 'chromeTest' > > > // always run tests > outputs.upToDateWhen { false } > > > include '**/automated/selenium/tests/oroduct/login/LoginTest*' > exclude excludedTests > scanForTestClasses = true > > > reports { > html.destination = file("${reporting.baseDir}/de/testresults") > } > } > > > *NOTE:* > I've also modified the 'classpath' variable above as follows, but that > didn't resolve my issue: > sourceSets.cat.compileClasspath + sourceSets.cat.output + files( > "${projectDir}\\WEB-INF\\dogTest\\com\\automated\\ > config\\GebConfig.groovy") > > > *Current example of a Gradle task where setting geb.driver works:* > > task "gebTestNoConfig"(type: Test, dependsOn: dogClasses) { > classpath = sourceSets.dog.compileClasspath + sourceSets.dog.output > > > systemProperty 'geb.driver', driver > > > // always run tests > outputs.upToDateWhen { false } > > > include '**/automated/selenium/tests/oroduct/login/LoginTest*' > exclude excludedTests > scanForTestClasses = true > > > reports { > html.destination = file("${reporting.baseDir}/de/testresults") > } > } > > Thanks, > > Lee > > -- > 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 post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/geb-user/e7dcdf26-1657-4b76-bc2d-b5602baad6c5%40googlegroups.com > <https://groups.google.com/d/msgid/geb-user/e7dcdf26-1657-4b76-bc2d-b5602baad6c5%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CA%2B52dQTLDqmfmxrd%2BuCp7LZxK8iopY-aK2DZpqHf_%2B2ZGGeGCQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
