问题描述
我是 Serenity 和 BDD 的新手.我有一个基于 Serenity-Cucumber 和 Page Based 模型的小型演示项目.下面是项目的结构:
I'm new to Serenity and BDD. I've a small demo project based on Serenity-Cucumber and Page Based model. Below is the structure of the project:
登录和注销功能有大约 8 个场景.
The Login and Logout features have around 8 scenarios.
我希望能够并行运行功能文件.实现这一目标的最简单、最有效的方法是什么?
目前为止
为每个功能创建单独的 Runner 类,然后使用故障安全或安全插件 - 这是我不想要的,因为我不希望每个功能文件都有一个新的运行器.
使用了cucumber-vm-parallel-plugin".我将下面的代码复制粘贴到我的 pom 文件中.没啥事儿.
Used the "cucumber-vm-parallel-plugin". I copy pasted below code in my pom file. Nothing happened.
<plugin>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>generateRunners</id>
<phase>validate</phase>
<goals>
<goal>generateRunners</goal>
</goals>
<configuration>
<glue>com.automationrhapsody.cucumber.parallel.tests</glue>
<featuresDirectory>src/test/resources/com</featuresDirectory>
<cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir>
<format>json,html</format>
<tags>"~@ignored"</tags>
</configuration>
</execution>
</executions>
查看 Serenity 文档并使用以下参数运行我的程序,但无法实现并行执行.
Looked into Serenity documentation and ran my program using following parameters, but could not achieve parallel execution.
mvn verify -Dthucydides.batch.count=2 -Dthucydides.batch.number=2
mvn verify -Dthucydides.batch.count=2 -Dthucydides.batch.number=2
我被困在这里了.任何帮助(简单有效)将不胜感激.另外,请建议如何正确完成上述选项 2 和 3
I'm stuck over here. Any help (easy and effective) will be appreciated.Also, please suggest how options 2 and 3 above can be done correctly
谢谢.
推荐答案
你还需要添加下面的插件.
You also need to add below plugin.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<forkCount>5</forkCount>
<reuseForks>true</reuseForks>
<includes>
<include>**/*IT.class</include>
</includes>
</configuration>
</plugin>
这篇关于并行运行 Serenity -Cucumber 测试用例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!