Reputation: 430
We have created a maven Java application to run SoapUI tests using maven plugin 5.3. This project we run in Jenkins for Regression. To re-run the failed tests of SoapUI project after fixing we have to run the Jenkins job again for that project. Jenkins job gets the fixed (updated proejct xml after fix from SVN repository) tests and rerun all the passed and failed tests again.
Is there a way to re-run only the failed test in Jenkins?
Jenkins job:
Plugin:
Upvotes: 0
Views: 115
Reputation: 430
I am able to do it by passing only test suites to run in a loop and run it using wrunner:
} else if (!testSuiteDisable && testSuitetoRerun != null) {
for (int i = 0; i < testSuitetoRerun.size(); i++) {
testSuiteName = project.getTestSuiteByName(testSuitetoRerun.get(i).trim().toString()).getName();
for (TestCase testCase : project.getTestSuiteByName(testSuitetoRerun.get(i).trim().toString()).getTestCaseList()) {
testCaseName = testCase.getName();
startTime = System.currentTimeMillis();
boolean testCaseDisable = project.getTestSuiteByName(testSuiteName).getTestCaseByName(testCaseName).isDisabled();
if (!testCaseDisable) {
System.out.println("Running Test Case : " + testCaseName);
wsRunner = project.getTestSuiteByName(testSuiteName).getTestCaseByName(testCaseName).run(new PropertiesMap(), false);
Upvotes: 0