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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to