[英]How to run Cucumber JVM Test in Jenkins
我有一個與 Maven 和 Cucumber 集成的 Selenium 自動化框架。 我想使用 jenkins 運行我的黃瓜測試。
我正在執行以下步驟來運行它:
執行這些步驟后,黃瓜測試未運行,但構建成功。
你的 pom.xml 應該有如下編寫的 runner 腳本。
jenkins 中的目標和選項也應該是 - Dtest=Runnerclass test incase 你正在運行單個測試
<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>
再次構建項目,然后在你的pom.xml目錄下執行——“maven clean”、“maven test”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.