trivago / cluecumber

Clear and concise reporting for the Cucumber BDD JSON format.

Home Page:https://www.softwaretester.blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Report is not generated when running from Junit runner

sseenivasan89 opened this issue · comments

how to run from Junit runner to generate report ?

`@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"json:target/cucumber-report/cucumber.json"},
features = {"src\test\resources\Test.feature"},
glue = {"Steps" }, dryRun = false, monochrome = true)
public class TestRunner {

}`

<plugin> <groupId>com.trivago.rta</groupId> <artifactId>cluecumber-report-plugin</artifactId> <version>2.3.1</version> <executions> <execution> <id>report</id> <phase>post-integration-test</phase> <goals> <goal>reporting</goal> </goals> </execution> </executions> <configuration> <customParameters> <Custom_Parameter>Smoke Result</Custom_Parameter> </customParameters> <sourceJsonReportDirectory>${project.build.directory}/cucumber-report</sourceJsonReportDirectory> <generatedHtmlReportDirectory>${project.build.directory}/generated-report</generatedHtmlReportDirectory> </configuration> </plugin>

Since Cluecumber is a Maven plugin, you need to run your tests using Maven.

if i run mvn test from cmd the report is not getting generated, it get generated when i use - mvn cluecumber-report:reporting, when i run this the test is not running but report is generated.

And if test fails the report is not generated

The mvn test lifecycle does not trigger the integration test phase that you have specified in your pom for Cluecumber. If you run mvn verify it does.

Please also check the example project: https://github.com/trivago/cluecumber-report-plugin/tree/master/example-project

mvn verify is working and generating report if my test pass, if my test fails it does not generate reprot

This is the standard Maven behavior. Please check #49

@sseenivasan89 you can use -Dmaven.test.failure.ignore=true to get around this issue.

Yes you can. However, your build will always pass in this case.

Closed due to no further reaction.