Given that you are using Maven and you have a separate runner class for each function, you can simply use the Failsafe plugin or Surefire plugin to pass a parameter from the command line like this, and choose which runner to run.
Fault tolerant version:
-Dit.test=Account*Test,Login*Test
Surefire Version:
-Dtest=Account*Test,Login*Test
Note that you can use wildcards, pass a comma-separated list of tests, and indicate the full location and filter by packages.
-Dit.test=com.perpecsys.salesforce.*Test
For this, I would usually use the Failsafe plugin, since Cucumber tests more similar integration tests (end-to-end tests really), and this plugin is needed for this, while the Surefire plugin is designed to run device tests.
Additional information about both plugins:
http://maven.apache.org/surefire/maven-failsafe-plugin/examples/single-test.html
http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html
From Jenkins, this is exactly the same, just use the Maven Project plugin to create a new Maven project and in the "Assembly" section in the "Target and Parameters" field, specify the maven command, for example:
clean verify -Dit.test=Account*Test
https://wiki.jenkins-ci.org/display/JENKINS/Maven+Project+Plugin
Alternatively, simply add the maven assignment step for the top level Invoke to the assembly if you are not using the Maven Project Plugin and add options there.
Hope this helps.
Pedro lopez
source share