Geb/Spock 错误 - 没有配置报告目录,您需要在配置文件中或通过构建适配器进行设置
Geb/Spock Error- No reports dir has been configured, you need to set in the config file or via the build adapter
我在使用 IntelliJ IDE 进行功能测试时遇到了问题 运行。当我 运行 功能测试时,我收到以下错误消息:
java.lang.IllegalStateException: No reports dir has been configured, you need to set in the config file or via the build adapter.
at geb.Browser.getReportGroupDir(Browser.groovy:899)
at geb.Browser.cleanReportGroupDir(Browser.groovy:932)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:56)
at geb.spock.GebReportingSpec.setupSpec(GebReportingSpec.groovy:37)
根据我的研究,我需要做的就是在GebConfig.groovy中添加以下代码:
reportsDir = new File("target/runtime_reports_dir")
我将行添加到 GebConfig.groovy 并重建项目,但仍然 运行 遇到同样的问题。是否有任何其他修复此错误的方法?
将 reportsDir = 'target/geb-reports' 添加到你的 GebConfig 应该可以解决这个问题,你能告诉我你的 GebConfig 文件吗?
还有另一个修复方法,您的测试 class 扩展了 GebReportingSpec,您可以将其更改为 GebSpec,它应该也可以工作。
我遇到了同样的问题,同时在 GebConfig 中正确配置了 reportsDir
添加资源文件夹(我的 GebConfig 所在的位置)"Test Sources Root" 对我有用
将文件夹标记为"Test Sources Root":
- 右键单击文件夹
- 将目录标记为
- 测试源根目录
测试愉快!
我在使用 IntelliJ IDE 进行功能测试时遇到了问题 运行。当我 运行 功能测试时,我收到以下错误消息:
java.lang.IllegalStateException: No reports dir has been configured, you need to set in the config file or via the build adapter.
at geb.Browser.getReportGroupDir(Browser.groovy:899)
at geb.Browser.cleanReportGroupDir(Browser.groovy:932)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:56)
at geb.spock.GebReportingSpec.setupSpec(GebReportingSpec.groovy:37)
根据我的研究,我需要做的就是在GebConfig.groovy中添加以下代码:
reportsDir = new File("target/runtime_reports_dir")
我将行添加到 GebConfig.groovy 并重建项目,但仍然 运行 遇到同样的问题。是否有任何其他修复此错误的方法?
将 reportsDir = 'target/geb-reports' 添加到你的 GebConfig 应该可以解决这个问题,你能告诉我你的 GebConfig 文件吗?
还有另一个修复方法,您的测试 class 扩展了 GebReportingSpec,您可以将其更改为 GebSpec,它应该也可以工作。
我遇到了同样的问题,同时在 GebConfig 中正确配置了 reportsDir
添加资源文件夹(我的 GebConfig 所在的位置)"Test Sources Root" 对我有用
将文件夹标记为"Test Sources Root":
- 右键单击文件夹
- 将目录标记为
- 测试源根目录
测试愉快!