在Jenkins上配置Geb和Spock(Grails)

时间:2015-05-13 17:12:03

标签: grails jenkins spock geb

我无法使用端口8080进行测试。当我将端口设置为另一个打开端口(8090)时,Geb-Spock测试工作正常,但仅在IntelliJ上本地运行时。但是,如果我尝试运行Jenkins构建,我就空手而归。我很确定这个问题与我的GebConfig.groovy有关。

注意:我正在使用xvfb来帮助浏览器,我相当确定它配置正确,因为它在配置为8080时产生结果。

在8090端口上运行...... enter image description here

在端口8080上运行...... enter image description here

尝试的解决方案:

  1. 指定在Jenkins运行配置中使用哪个端口(这似乎让服务器运行正常)

    • grails -Dgrails.server.port.http = 8090 test-app functional:-echoOut --refresh-dependencies
    • 在Jenkins grails构建中还有一个选项来设置端口,它也可以正常工作
    • 在运行之前将grails清理干净
  2. GebConfig.groovy中的各种配置,包括更改baseUrl

    • Book of Geb的第一个例子

    import org.openqa.selenium.firefox.FirefoxDriver driver = {new FirefoxDriver()}

  3. 根本没有GebConfig

  4. 其他信息:

    • Grails版本:2.3.6
    • Java版本:1.7.0_79(打开jdk)
    • OS:Fedora 20(本地),Ubuntu服务器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"
    }
    

0 个答案:

没有答案