黄瓜 html 报告未在硒黄瓜中以有效格式生成

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

我正在尝试在 maven cucumber html 报告 中生成 html 格式的报告。我能够生成 cucumber json 和 cucumber pretty html 报告,但问题是生成的报告不是 html 格式并且没有任何数据。有人可以帮我解决这个问题吗?

Maven pom 依赖和插件

<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>

测试运行器Class

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

生成的报告文件格式

我在这里找到了答案 https://www.youtube.com/watch?v=PtEp5r6ilKE

并像这里一样更新 pom 插件而不是依赖 https://github.com/damianszczepanik/maven-cucumber-reporting

希望对其他人有所帮助。