如何在Jenkins中运行Cucumber JVM Test [英] How to run Cucumber JVM Test in Jenkins
本文介绍了如何在Jenkins中运行Cucumber JVM Test的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个与Maven和Cucumber集成的Selenium自动化框架.我想使用詹金斯进行黄瓜测试.
I have an Selenium Automation Framework integrated with Maven and Cucumber. I want to run my cucumber test using jenkins.
我正在按照以下步骤运行它:
I am following steps to run it:
- 创建新作业>选择Maven项目
- 提供POM.xml的路径
- 添加构建后操作Cucumber-JVM报告
- 保存
- 立即构建
执行这些步骤后,黄瓜测试未运行,但是构建成功.
The cucumber tests are not running after executing these steps, however Build is successful.
推荐答案
您的pom.xml应具有如下所示的运行脚本.
Your pom.xml should have runner scripted like below.
jenkins中的目标和选项也应该是- Dtest = Runnerclass测试,以防您正在运行单个测试
Also Goal and options in jenkins should be -Dtest=Runnerclass test incase you are running single test
<profiles>
<profile>
<id>integration-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<parallel>none</parallel>
<threadCount>1</threadCount>
<disableXmlReport>true</disableXmlReport>
</configuration>
<executions>
<execution>
<id>Runnerclass</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
上面插件中的
id是您的跑步者. 那么您可以使用詹金斯进行测试.
id in the above plugin is your runner. then you can run your tests in jenkins.
这篇关于如何在Jenkins中运行Cucumber JVM Test的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文