Search code examples
intellij-ideagradlegroovyfunctional-testinggeb

Geb/Spock Error- No reports dir has been configured, you need to set in the config file or via the build adapter


I have trouble running my functional test from IntelliJ IDE. When I run the functional test, I got the following error message:

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)

Based on my research, all I need to do is to add the following code in GebConfig.groovy: reportsDir = new File("target/runtime_reports_dir")

I added the line to GebConfig.groovy and rebuild the project, but still running into the same issue. Is there any other fix to this error?


Solution

  • Adding reportsDir = 'target/geb-reports' to your GebConfig shoud fix this, can you show me your GebConfig file?

    There is also another fix for it, your test class extends GebReportingSpec, you can chage it to GebSpec and it should also work.