Unit testing grails没有';找不到geb功能测试
我正在使用位于的示例项目 出于某种原因,当我运行Unit testing grails没有';找不到geb功能测试,unit-testing,grails,functional-testing,geb,Unit Testing,Grails,Functional Testing,Geb,我正在使用位于的示例项目 出于某种原因,当我运行grails测试应用程序functional:时,它不会拾取任何测试。上面说 |Loading Grails 2.3.1 |Configuring classpath . |Environment set to test ........................................................ |Tests PASSED - view reports in C:\Users\user\src\geb-exam
grails测试应用程序functional:
时,它不会拾取任何测试。上面说
|Loading Grails 2.3.1
|Configuring classpath
.
|Environment set to test
........................................................
|Tests PASSED - view reports in C:\Users\user\src\geb-example-grails\target\test-reports
没有打开任何浏览器(我习惯于使用webdriver),当我查看target\test reports\html\all.html
时,我得到
单元测试结果-所有测试
没有执行任何测试。
我已经试着和你一起执行了
grails测试应用程序功能:
grails测试应用程序-功能性
grails测试应用程序
grails test-app -Dwebdriver.chrome.driver=/Applications/Google\ Chrome.app/Contents/MacOS/chromedriver
然后不运行任何测试,并报告所有测试都通过。(与windows计算机相同)
然而,当我通过
grails test-app
测试已经运行,Google Chrome已经启动,但是没有进行导航(我怀疑我在Mac上的路径中有一个过时的chromedriver。)
更新2
在和…一起跑步之后
grails test-app -Dgeb.env=firefox
找到并执行测试。在使用最新的selenium(2.40.0,我熟悉的一个webdriver问题)更新BuildConfig.groovy
之前,不会进行任何更新
考虑到这一点,我决定检查chromedriver是否安装正确。而我把chromedriver.exe
放在了与谷歌chrome相同的位置。我没有将该位置添加到我的路径中。这样做之后。。。尤里卡!测试运行和执行时100%通过!谢谢你的建议!除非浏览器的webdriver设置正确(我觉得奇怪,但还行),否则测试不会运行。我无法重现该错误。使用2.3.1执行测试。你有镀铬机吗?如果不是的话,我希望看到大量的错误
您可以尝试grails测试应用程序functional:-Dgeb.env=firefox
,它将尝试使用FirefoxDriver。如果您已经安装了Firefox,则无需任何额外配置即可运行
如果这没有给你任何帮助,请尝试grails测试应用程序functional:PersonCRUDSpec
,它将显式地尝试运行该测试。我已经安装了chrome驱动程序。我甚至尝试用-Dwebdriver.chrome.driver=
指定位置。我将尝试通过gem.env指定。。。我也能在我的Mac上复制它。我将用我奇怪的发现更新这个问题。