【问题标题】:Serenity BDD report does not show stories with Examples (Embedded tables)Serenity BDD 报告不显示带有示例的故事(嵌入式表格)
【发布时间】:2016-07-14 08:14:20
【问题描述】:

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

【问题讨论】:

  • 你在 maven 中使用干净的测试吗?如果是这样,请尝试干净验证。

标签: java maven bdd serenity-bdd cucumber-serenity


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多