3

In Jenkins my job is of type "Build a maven2/3 project" and project name is "SeleniumProject" and project source is "SVN" contains around 40 test cases. When I build this, it runs all test cases and 3 of them fail. How can I execute an individual test in this project? These test cases are coming under module "automation". Where do I need to configure build to run only one test case?

Excellll
  • 12,627
  • 11
  • 51
  • 78
Subbarao Gaddam
  • 131
  • 1
  • 1
  • 2

1 Answers1

3

Use -Dtest=<test class name> or -Dtest=<test class name>#<test method name> as specified at http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

ps: use StackOverflow for programming questions - they'll get answered sooner

FlasH from Ru
  • 203
  • 2
  • 8
  • It is not working in jenkins, In project level all test cases are running, in module level no test cases are running – Subbarao Gaddam Jan 29 '14 at 02:43
  • Just created a test jenkins job for a multimodule project. Added `-DfailNoTests=false -Dtest=` to its 'Goals and options' in a 'Build' section (i.e. my 'Goals and options' param looks like `-DfailNoTests=false -Dtest= install`). As a result the whole project was built, only the specified test class was executed. – FlasH from Ru Jan 29 '14 at 07:08