grails-profiles / base

2 stars 12 forks source link

Problem With GEB Dependencies #17

Closed osscontributor closed 6 years ago

osscontributor commented 6 years ago

See the project at https://github.com/jeffbrown/gebdependencies.

$ ./gradlew clean check
Starting a Gradle Daemon, 1 busy and 1 incompatible Daemons could not be reused, use --status for details
Parallel execution is an incubating feature.
:clean
:compileJava NO-SOURCE
:compileGroovy
:buildProperties
:processResources
:classes
:configureChromeDriverBinary
:configureGeckoDriverBinary
:compileTestJava NO-SOURCE
:compileTestGroovy NO-SOURCE
:processTestResources NO-SOURCE
:testClasses UP-TO-DATE
:test NO-SOURCE
:compileIntegrationTestJava NO-SOURCE
:compileIntegrationTestGroovy FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileIntegrationTestGroovy'.
> Unable to load class geb.Page due to missing dependency org/openqa/selenium/By

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 13.251 secs

The combination of dependencies in a newly created 3.3.2 web profile app appear to be problematic.

See comments at https://github.com/jeffbrown/gebdependencies/blob/4f17453dd8d413522d343318f0cea8b08018c479/build.gradle#L63-L73...

    // These are here by default with 3.3.2 and do not work...
    testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:3.6.0"
    testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:3.6.0"
    testRuntime "org.seleniumhq.selenium:selenium-remote-driver:3.6.0"
    testRuntime "org.seleniumhq.selenium:selenium-api:3.6.0"

    // These are not here by default and they do work.  Comment out
    // the dependencies above and use these, the GEB spec will pass.
//    testCompile "org.seleniumhq.selenium:selenium-java:2.53.1"
//    testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
//    testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"

This appears to be related to recent changes made at https://github.com/grails-profiles/base/commit/bc1db3bdaee34d922a8593fdb9d454c466b08275#diff-85591e57e3c09fdfb19080a3c7368f83.

osscontributor commented 6 years ago

Replacing testRuntime "org.seleniumhq.selenium:selenium-api:3.6.0" with testCompile "org.seleniumhq.selenium:selenium-api:3.6.0" gets around the specific problem mentioned above but then gets to other dependency problems.

I think we should have a set of dependencies and GebConfig.groovy created by default that will work with the HtmlUnitDriver without any special config changes.

osscontributor commented 6 years ago

I should clarify.. bringing back HtmlUnitDriver isn't really what I am advocating, but some headless solution.

osscontributor commented 6 years ago

If I change testRuntime "org.seleniumhq.selenium:selenium-api:3.6.0" to testCompile "org.seleniumhq.selenium:selenium-api:3.6.0" and run with the following, it does appear to work...

./gradlew -Dgeb.env=chromeHeadless iT
sdelamo commented 6 years ago

Replacing

    testRuntime "org.seleniumhq.selenium:selenium-remote-driver:3.6.0"
    testRuntime "org.seleniumhq.selenium:selenium-api:3.6.0"

with:

    testCompile "org.seleniumhq.selenium:selenium-remote-driver:3.6.0"
    testCompile "org.seleniumhq.selenium:selenium-api:3.6.0"

solve the issue.

I am able to execute the tests with:

./gradlew check

It executes the tests in the firefox environment.