我有一个与Maven和Cucumber集成的Selenium Automation Framework . 我想用詹金斯进行黄瓜测试 .
我正在按照步骤运行它:
创建新作业>选择Maven项目
提供POM.xml的路径
添加后期构建操作Cucumber-JVM报告
保存
立即建造
执行这些步骤后黄瓜测试没有运行,但Build是成功的 .
您的pom.xml应该具有如下脚本编程器 .
jenkins中的目标和选项应该是 - Dtest=Runnerclass 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是你的跑步者 . 那么你可以在jenkins中运行你的测试 .
您需要在pom.xml中的以下库
<pluginManagement></pluginManagement>
org.apache.maven.plugins
maven-compiler-plugins
maven-surefire-plugin
再次构建项目,然后在pom.xml的目录中执行 - “maven clean”,“maven test”
2 回答
您的pom.xml应该具有如下脚本编程器 .
jenkins中的目标和选项应该是 - Dtest=Runnerclass test ,如果你正在进行单一测试
上面插件中的id是你的跑步者 . 那么你可以在jenkins中运行你的测试 .
您需要在pom.xml中的以下库
1
org.apache.maven.plugins
maven-compiler-plugins
2
org.apache.maven.plugins
maven-surefire-plugin
再次构建项目,然后在pom.xml的目录中执行 - “maven clean”,“maven test”