【发布时间】:2019-03-20 00:36:15
【问题描述】:
我在执行期间创建了一个测试运行,我想在它们开始执行的同时添加测试用例。测试用例已经创建,如果它们已经不存在的话。并且应该将此测试用例与其他测试用例一起添加到现有的测试运行中。
我尝试在运行和更新运行后使用setCaseIds,但这会覆盖现有运行。我认为错误是因为我使用的是setCaseIds,但我不知道正确的做法。
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();
有人知道怎么做吗?提前谢谢你。
【问题讨论】:
标签: java api selenium automation testrail