gpt4 book ai didi

java - Serenity BDD 报告不显示带有示例的故事(嵌入式表格)

转载 作者:行者123 更新时间:2023-12-02 09:06:20 31 4
gpt4 key购买 nike

我对 Serenity 报告中显示的所有故事有疑问。

当我使用 maven (mvn clean verify) 运行它们时,我可以在输出中看到它们,并且它们会运行所有示例,但是当我打开在target\site\serenity 文件夹,它们不会出现在那里。

不知何故,报告插件错过了它们,有问题的故事是带有示例:的故事。

我有一个类,它是 TestSuit 并运行所有故事,并且 Steps 组织在其他类中:

public class BddTestSuite extends SerenityStories {

private static final Logger LOGGER = LoggerFactory.getLogger(BddTestSuite.class);

@BeforeStories
public void setUp(){
LOGGER.info(
"\n===========================================================================" +
"\n>>>>>>>>>>> STARTING THE INTEGRATION TEST-SUITE " +
"\n===========================================================================");
}
}

我的故事:

Narrative:
Short description

Scenario: Scenario title
Given a given with param1 <param1>
And a given with param2 <param2>
When a when with param3 <param3>
Then a then with param1 <param1>, param2 <param2> and param3 <param3>
Examples:
|param1|param2|param3|
|val11|val12|val13|
|val21|val22|val23|

我的pom.xml:

        <build>
.
.
.
<plugins>
.
.
.
<!--Running integration tests-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${failsafe.plugin.version}</version>
<configuration>
<includes>
<include>**/integration/**/*.java</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<!--Building Serenity report for BDD stories (integration tests)-->
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.version}</version>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

最佳答案

我已经通过将 serenity-maven-plugin 更新到 1.1.42 版本来修复它

关于java - Serenity BDD 报告不显示带有示例的故事(嵌入式表格),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38368889/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com