我在testng套件中有10个测试用例,我需要从jenkinks执行单个或单个测试用例,请问有人可以帮助我如何从jenkins执行单个测试用例吗,我尝试了maven surfire命令mvn -Dtest = TestCircle test将测试命令包含到golas中并已执行但无法正常工作,请参考数据并更正我如何在詹金斯中设定目标以执行单个测试用例。 “ mvn clean compile install -DPICK_CONFIGURATION_FROM =” JENKINS“ -DEXECUTION_MODE =” Remote“- Dtest = TestCircle#EAConsoleLandingPageTest测试 -DPLATFORM =” WEB“ -DOPERATING_SYSTEM =” WINDOWS“ -DBROWSER =” chrome“- DCOMPUTERNAME =“ Test” -DTEST_ENVIRONMENT =“ RUNFC” -DPLAN_ID =“” -DTEST_TYPE =“烟雾” -DGRID_URL =“ http:// localhost:4444 / wd / hub”“
下面是示例测试套件: 类>
<class
name="com.ea.automation.tests.EAConsoleLandingPageTest">
<methods>
<include name="clickOnGetStartedBtn" />
<include name="selectProjectFromLandingPage" />
<include name="clickOnEAConsoleIcon" />
<include name="verifyRequestProjectAccess" />
<include name="verifyProjectAccess" />
<include name="verifyHomePageRedierecting" />
</methods>
</class>
<class
name="com.ea.automation.tests.EAConsoleSelfServiceTest">
<methods>
<include name="clickOnCreateNewproject" />
<include name="verifyProjectUserAcess" />
<include name="switchProjects" />
<include name="clickOnProjectSettings" />
</methods>
</class>
<class
name="com.ea.automation.tests.EAConsoleNotificationAppTest">
<methods>
<include name="selectProject" />
<include name="clickOnNotification" />
<include name="checkAllWdgetNotifications" />
</methods>
</class>
<class
name="com.ea.automation.tests.EAConsoleSupportAppTest">
<methods>
<include name="clickOnSupportApp" />
<include name="checkCreateTicket" />
<include name="clickOnCloseErrorMessageModel" />
<include name="clickOnSupportFromApp" />
<include name="clickOnSupportEmail" />
</methods>
</class>
<class
name="com.ea.automation.tests.EAConsoleSDKDownloadsAppTest">
<methods>
<include name="selectProject" />
<include name="clickOnSDKDownloads" />
</methods>
</class>
答案 0 :(得分:0)
我建议的方法不是可取的。因为运行Jenkins的唯一目的是运行一组测试用例,而不是单个测试用例。但是您可以通过以下方式实现您的想法。
我已经在一个用于根据Jenkins构建参数选择不同套件文件的项目中实现了这种方法。这种方法有效。因此,在运行时,根据您通过的Jenkins Build参数,相应的测试将由Jenkins运行。