Spring boot 通过maven命令提供测试报告名称
在我的pom.xml中,我使用cucumber框架为烟雾和回归测试创建了不同的概要文件。使用下面的maven命令来运行测试。以下是烟雾测试的示例:Spring boot 通过maven命令提供测试报告名称,spring-boot,maven,cucumber,cucumber-jvm,cucumber-java,Spring Boot,Maven,Cucumber,Cucumber Jvm,Cucumber Java,在我的pom.xml中,我使用cucumber框架为烟雾和回归测试创建了不同的概要文件。使用下面的maven命令来运行测试。以下是烟雾测试的示例: mvn clean test -Psmoke-test -Dcucumber.options="--plugin html:target/cucumber/smoke-test-report.html" 测试运行正常,但即使我提供了-Dcucumber.options我正在为cucumber使用一个公共运行器类,它也不会生成报告
mvn clean test -Psmoke-test -Dcucumber.options="--plugin html:target/cucumber/smoke-test-report.html"
测试运行正常,但即使我提供了-Dcucumber.options
我正在为cucumber使用一个公共运行器类,它也不会生成报告,因此我无法将文件名作为@cucucumberoptions
注释的一部分
以下是pom.xml配置:
<profile>
<id>smoke-test</id>
<properties>
<test>AutomationTestTrigger</test>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<spring.profiles.active>automation-test</spring.profiles.active>
<cucumber.filter.tags>@smokeTest</cucumber.filter.tags>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>regression-test</id>
<properties>
<test>AutomationTestTrigger</test>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<spring.profiles.active>automation-test</spring.profiles.active>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
烟雾试验
自动测试触发器
org.apache.maven.plugins
maven surefire插件
自动化测试
@烟雾试验
回归试验
自动测试触发器
org.apache.maven.plugins
maven surefire插件
自动化测试
cumber.options已删除。使用专用属性处理一切@M.P.Korstanje谢谢。我试过了。但它正在生成空报告:mvn clean test-Psmoke test-Dcucumber.plugin=“pretty,json:target/cucumber/report.json”
您能检查一下这是否正确吗。确保您确实在配置文件中选择了测试。