fix(测试跟踪): 修复功能用例没有预期步骤时导出excel后相关字段变为null的问题

--bug=1012886
--user=宋天阳
【测试跟踪】github#13201
xmind上传没有预期结果的步骤,导出excel版本用例,该步骤显示成null
https://www.tapd.cn/55049933/s/1156560
This commit is contained in:
song-tianyang 2022-05-12 11:44:50 +08:00 committed by TIanyang
parent a04b7a12a6
commit 7ed233e4ca
1 changed files with 10 additions and 3 deletions

View File

@ -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");
}
}