我正在使用此库com.codepine.api.testrail.TestRail(java),并且正在尝试更新测试用例的步骤列表。
public Case updateStepsIfNeeded(int caseId,List candidateStepsToUpdate) throws Exception {
List realSteps = getTestCaseSteps(caseId);
boolean isUpdateNeeded = !(realSteps.size() == candidateStepsToUpdate.size()
&& realSteps.stream().allMatch(step -> step.equals(candidateStepsToUpdate.get(realSteps.indexOf(step)))));
if(isUpdateNeeded) {
Map<String, Object> realCustomFields = getCustomFields(caseId);
//adding a new step to object
realCustomFields.put("steps_separated", candidateStepsToUpdate);
//How can i update the test case with the additional step
//return getCase(caseId).setCustomFields(realCustomFields);
}
return null;
}
if(isUpdateNeeded) {
Map<String, Object> realCustomFields = getCustomFields(caseId);
//adding a new step to object
realCustomFields.put("steps_separated", candidateStepsToUpdate);
//How can i update the test case with the additional step
//return getCase(caseId).setCustomFields(realCustomFields);
}
return null;
}
您知道如何更新步骤列表并执行吗?
谢谢!