I have created a test run during the execution time, and I would like to add test cases meanwhile they are starting the execution. The test cases have been created, if they already doesn't exist. And this test case should be added to an existing test run with other test cases.
I have tried to use the setCaseIds
over the run and after update the run, but that override the existing run. I think the error is because I'm using the setCaseIds
, but I don't know the proper way to do.
Case mycase = new Case().setTitle("TEST TITLE").setSuiteId(suite.getId()).setSectionId(section.getId());
mycase = testRail.cases().add(mycase.getSectionId(), mycase, customCaseFields).execute();
final List<Integer> caseToAdd = new ArrayList();
caseToAdd.add(mycase.getId());
run.setCaseIds(caseToAdd);
run = testRail.runs().update(run).execute();
//The first test start the execution
.
.
.
// The first test case finish
// Now I create a new testcase to add
Case mySecondCase = new Case().setTitle("TEST TITLE").setSuiteId(suite.getId()).setSectionId(section.getId());
mycase = testRail.cases().add(mySecondCase.getSectionId(), mySecondCase, customCaseFields).execute();
// I repeat the prevous steps to add a new test case
final List<Integer> newCaseToAdd = new ArrayList();
newCaseToAdd.add(mySecondCase.getId());
run.setCaseIds(newCaseToAdd);
run = testRail.runs().update(run).execute();
Anyone knows how to do that? Thank you in advance.