问题
I cannot use port 8080 for my testing. When I set the port to another open port (8090) Geb-Spock tests work fine, but only while running locally on IntelliJ. However, if I try and run a Jenkins build, I come out empty handed. I am pretty certain the problem has something to do with my GebConfig.groovy.
Note: I am using xvfb to aid the browser, and I am fairly certain it is configured correctly as it is producing results when configured to 8080.
Running on port 8090...
Running on port 8080...
Attempted Solutions:
Specify which port to use in Jenkins run configuration (which seems to get the server running just fine)
- grails -Dgrails.server.port.http=8090 test-app functional: -echoOut --refresh-dependencies
- There is also an option in the Jenkins grails build to set the port, which works just as well
- peform a grails clean before running
Various configurations within GebConfig.groovy, including changing the baseUrl
- The first example from Book of Geb
import org.openqa.selenium.firefox.FirefoxDriver driver = { new FirefoxDriver() }
- The geb-grails example - https://github.com/geb/geb-example-grails/blob/master/test/functional/GebConfig.groovy
No GebConfig at all
Other info:
- Grails Version: 2.3.6
- Java Version: 1.7.0_79 (open jdk)
- OS: Fedora 20 (local), Ubuntu server 12 lts (Jenkins)
- IntelliJ: 14.0
BuildConfig.groovy
dependencies{
test "org.gebish:geb-spock:0.10.0"
test "org.seleniumhq.selenium:selenium-support:2.45.0"
test "org.seleniumhq.selenium:selenium-firefox-driver:2.45.0"
}
plugins{
test ":geb:0.10.0"
}
来源:https://stackoverflow.com/questions/30221272/configuring-geb-and-spock-on-jenkins-grails