Search code examples
mavenselenium-webdrivercucumber

Cucumber rhtml eport is not generating in valid format in selenium cucumber


I'm trying to generate my reports in html format in maven cucumber html report. I'm able to generate cucumber json and cucumber pretty html report, but the issue is the generated report is not in an html format and it doesn't have any data. Can somebody please help me to solve this issue.

Maven pom dependency and plugin

<dependency>
    <groupId>com.aventstack</groupId>
    <artifactId>extentreports</artifactId>
    <version>4.1.5</version>
</dependency>

<!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting -->
<dependency>
    <groupId>net.masterthought</groupId>
    <artifactId>cucumber-reporting</artifactId>
    <version>5.3.0</version>
</dependency>

 <plugin>
                    <groupId>net.masterthought</groupId>
                    <artifactId>maven-cucumber-reporting</artifactId>
                    <version>5.1.1</version>
                    <executions>
                        <execution>
                            <id>execution</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                            <configuration>
                                <projectName>CucumberReport</projectName>
                                <outputDirectory>${project.build.directory}/site/cucumber-reports</outputDirectory>
                                <!-- <cucumberOutput>${project.build.directory}/cucumber.json</cucumberOutput> -->
                                    <cucumberOutput>${project.build.directory}/cucumber.json</cucumberOutput>
                                <!-- <parallelTesting>false</parallelTesting> -->
                                <buildNumber>1</buildNumber>
                                <checkBuildResult>false</checkBuildResult>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

TestRunner Class

@CucumberOptions(features="testFeature",glue= {"stepDefinitions"}
,plugin={"html:target/site/cucumber-pretty","json:target/cucumber.json"},monochrome=true)
public class TestRunnerTestNG extends AbstractTestNGCucumberTests{

generated report file format

generated report format


Solution

  • i have found my answer here https://www.youtube.com/watch?v=PtEp5r6ilKE

    and update pom plugin like here not dependency https://github.com/damianszczepanik/maven-cucumber-reporting

    hope it help to others.