测试轨-如何更新给定测试用例的步骤? (java-test-rail-api)

时间:2018-11-29 08:00:31

标签: java api testrail

我正在使用此库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; } 您知道如何更新步骤列表并执行吗? 谢谢!

0 个答案:

没有答案
相关问题