grails - Grails Webtest:找不到Webtest jar

标签 grails web-testing

我无法在Grails 2.3.11上运行webtests。运行grails test-app我得到这个:

Error Fatal error running tests: couldn't find webtest jar.
Expression: webtestJarFile. Values: webtestJarFile = null (Use --stacktrace to see the full trace)

BuildConfig.groovy的“插件”部分中,我有:
test(":webtest:3.0.1") {
    excludes 'htmlunit'
}

我也尝试了没有excludes,但这没有帮助。 grails clean也没有帮助。这曾经奏效,但我不知道哪个Grails升级完全破坏了它。

最佳答案

曾经我是canoo webtest的忠实拥护者,但是Grails的插件现在已经过时了,我也没有使其在Grails 2.x上运行。

我建议,如果您的项目中已经有大量的Webtest测试,请将您的项目分为Grails和Webtest部分,将您的Webtest项目降级到您知道它们可以工作的Grails版本(1.3.8是最后一个版本我确信它们可以正常工作),并独立于您的项目运行它们。启动测试时,可以通过指定baseUrl轻松实现。

现在,Grails项目中最好的Webtest替代品是Spock和Geb,但您会错过出色的Webtest报告。幸运的是,有一个很棒的项目https://github.com/renatoathaydes/spock-reports现在提供了可通过模板修改的spock报告。 Film-Strip插件(https://grails.org/plugin/film-strip)(我是作者)将带您返回屏幕截图。我正在开发一个插件,它将spock报告与geb屏幕截图结合在一起,以带回webtest报告的精神。

Beeing不是您问题的真实答案,希望它能提供解决方案。

关于grails - Grails Webtest:找不到Webtest jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29183187/

相关文章:

javascript - Grails View 编解码器不工作 (2.4)

testing - 无法从 OSX 上的 Testcafe IDE 连接到站点

android - Android SDK Manager 中的 Google Web Driver 是什么?

testing - Testcafe 等到一个元素有一个特定的文本

grails - 缺少依赖项org/codehaus/groovy/grails/commons/ApplicationAttributes

grails - 如何将g:textfiled值从GSP传递到grails中作为参数的一部分

html - 使用 TestCafe 从 HTML5 日期输入中删除值?

testing - Jmeter : How to test a website to render a page regardless of the content

grails - Grails按用户ID查看和过滤事件

grails - 有没有一种方法可以为非开发环境禁用gsp缓存