用例步骤换行

This commit is contained in:
wenyann 2020-07-14 11:10:36 +08:00
parent 686baea129
commit bac151be1e
1 changed files with 10 additions and 8 deletions

View File

@ -341,16 +341,18 @@ public class TestCaseService {
if (TestCaseList.get(i).getMethod().equals("manual")) {
String steps = TestCaseList.get(i).getSteps();
JSONArray jsonArray = JSON.parseArray(steps);
for (int j = 0; j <jsonArray.size(); j++) {
int num=j+1;
step.append(num + ":" + jsonArray.getJSONObject(j).getString("desc"));
step.append("\n");
data.setStepDesc(step.toString());
result.append(num + ":" + jsonArray.getJSONObject(j).getString("result"));
result.append("\n");
data.setStepResult(result.toString());
for (int j = 0; j < jsonArray.size(); j++) {
int num = j + 1;
step.append(num + ":" + jsonArray.getJSONObject(j).getString("desc") + "\n");
result.append(num + ":" + jsonArray.getJSONObject(j).getString("result") + "\n");
}
data.setStepDesc(step.toString());
data.setStepResult(result.toString());
step.setLength(0);
result.setLength(0);
data.setRemark(TestCaseList.get(i).getRemark());
} else if(TestCaseList.get(i).getMethod().equals("auto")&&TestCaseList.get(i).getType().equals("api")){
data.setStepDesc("");
data.setStepResult("");