Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing grails没有';找不到geb功能测试_Unit Testing_Grails_Functional Testing_Geb - Fatal编程技术网

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测试应用程序
似乎没有人运行任何测试。我还将该项目升级到Grails2.3.6,并获得了相同的结果。我运行的测试有误吗?还有其他人有这个问题吗

更新

除了Windows7之外,我还能够在Mac电脑上重现这个问题。当我在Mac电脑上运行时

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上复制它。我将用我奇怪的发现更新这个问题。