diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 62e5bbdba3..e0c466aa2c 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -1485,7 +1485,6 @@ public class TestCaseService { data.setPrerequisite(t.getPrerequisite()); data.setTags(t.getTags()); if (StringUtils.equals(t.getMethod(), "manual") || StringUtils.isBlank(t.getMethod())) { - if (StringUtils.equals(data.getStepModel(), TestCaseConstants.StepModel.TEXT.name())) { data.setStepDesc(t.getStepDescription()); data.setStepResult(t.getExpectedResult()); @@ -1508,8 +1507,16 @@ public class TestCaseService { if (CollectionUtils.isNotEmpty(jsonArray)) { 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"); + String stepItem = jsonArray.getJSONObject(j).getString("desc"); + if(StringUtils.isEmpty(stepItem)){ + stepItem = ""; + } + step.append(num + "." + stepItem + "\n"); + String resultItem = jsonArray.getJSONObject(j).getString("result"); + if(StringUtils.isEmpty(resultItem)){ + resultItem = ""; + } + result.append(num + "." + resultItem + "\n"); } }