【发布时间】:2020-10-08 09:17:32
【问题描述】:
我们将 Serenity Cucumber 与 Maven 集成,用于使用 Junit 运行的 REST API 自动化项目。每当尝试在控制台上执行命令 mvn serenity:aggregate 时,结果显示“构建成功”,但加载了 0 个要求,并且 index.html 有 0 个结果并在 target/site/serenity 下生成。而如果使用命令 mvn clean verify 运行,则得到相同的结果文件夹。
插件的pom.xml文件:
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>2.0.40</version>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>2.0.40</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>4.5.0</version>
<dependencies>
<dependency>
<groupId>com.googlecode.totallylazy</groupId>
<artifactId>totallylazy</artifactId>
<version>1.20</version>
<scope>system</scope>
<systemPath>${basedir}/externalMavenLibrary/totallylazy-1.20.jar</systemPath>
</dependency>
</dependencies>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>cucumber-jvm-example</projectName>
<outputDirectory>${basedir}/target/site/cucumber-pretty</outputDirectory>
<jsonFiles>
<param>**/*.json</param>
</jsonFiles>
<classificationFiles>
<param>**/*.properties</param>
</classificationFiles>
<cucumberOutput>${basedir}/target/cucumber.json</cucumberOutput>
<enableFlashCharts>true</enableFlashCharts>
<checkBuildResult>true</checkBuildResult>
<skippedFails>true</skippedFails>
</configuration>
</execution>
</executions>
</plugin>
pom.xml 文件中的其他版本:
serenity-cucumber: 1.9.35
serenity-rest-assured: 2.0.45
serenity-core: 2.0.45
serenity-junit: 2.2.1
serenity-maven-plugin: 2.0.40
Serenity.properties 文件:
serenity.project.name=Test
serenity.console.colors=true
serenity.reports.show.step.details=true
由于运行 mvn serenity:aggregate 后无法获取报告,因此缺少图表和其他不错的功能。 请指导。
【问题讨论】:
标签: rest-assured serenity-bdd cucumber-serenity