简体   繁体   English

如何配置Jenkins运行1个硒测试用例

[英]How to configure Jenkins to run 1 selenium test case

I am running Jenkins on Windows 7 as service. 我正在Windows 7上将Jenkins作为服务运行。

I have approximately 100 selenium test cases in package, but I want to run only 1 test case. 程序包中大约有100个硒测试用例,但是我只想运行1个测试用例。

Is it possible to configure Jenkins to run not all, but 1 test? 是否可以将Jenkins配置为不运行全部测试,而是运行1个测试?

Depending on how your Jenkins build is configured, somewhere you are specifying the maven goals. 根据您的Jenkins构建的配置方式,在某个位置指定Maven目标。 These can be configured to specify the test you want to execute, as described here : 这些可以被配置为指定要执行,如描述的测试在这里

mvn -Dtest=TestCircle#mytest test mvn -Dtest = TestCircle#mytest测试

Note that this require surefire 2.7.3 or later, and Junit 4.X or TestNG: 请注意,这需要surefire 2.7.3或更高版本,以及Junit 4.X或TestNG:

As of Surefire 2.7.3, you can also run only a subset of the tests in a test class. 从Surefire 2.7.3开始,您也只能在测试类中运行部分测试。

NOTE: This feature is supported only for Junit 4.x and TestNG. 注意:仅Junit 4.x和TestNG支持此功能。

For older versions of the Surefire plugin/JUnit, it seems it is only possible to control this on class level, ie you cannot specify a specific test in a class: 对于Surefire插件/ JUnit的旧版本,似乎只能在类级别进行控制,即,您不能在类中指定特定的测试:

mvn -Dtest=TestCircle test mvn -Dtest = TestCircle测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM