Configuring Geb and Spock on Jenkins (Grails)

陌路散爱 提交于 2019-12-11 20:19:33

问题


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:

  1. 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
  2. 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
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!