Is there a way to change the output directory for the generated reports to an custom directory - in particular for the .json-Report files?
Documentation says (http://jgiven.org/userguide/ - 4.2):
[...] JGiven tries to autodetect when it is executed by the Maven surefire plugin [I'm using it] and in that case generates the reports into target/jgiven-reports/json. [...]
I'm using jGiven with Maven (for Appium Tests).
Configuration (pom.xml - dependencies):
<dependency>
<groupId>com.tngtech.jgiven</groupId>
<artifactId>jgiven-testng</artifactId>
<version>0.15.1</version>
<scope>test</scope>
</dependency>
Configuration (pom.xml - build/plugins):
<plugin>
<groupId>com.tngtech.jgiven</groupId>
<artifactId>jgiven-maven-plugin</artifactId>
<version>0.15.1</version>
<executions>
<execution>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
Since the directory is defined by jGiven it does not help to change the build-directory. It would still use the target/jgiven-reports/json directory.
Thanks in advance!
If somebody else is curious:
I found:
String reportDirName = System.getProperty( JGIVEN_REPORT_DIR );in https://github.com/TNG/JGiven/blob/fae0f3c8db0b00e7fa233cbd8f86306379def4b2/jgiven-core/src/main/java/com/tngtech/jgiven/impl/Config.java#L31 (current master).Important part of it:
So you can either set your system properties via the maven-surefire-plugin in the pom.xml:
or just use Java's
System.setProperty("jgiven.report.dir", "/my/custom/dir")