mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
fix(测试跟踪): 测试用例导出报错
This commit is contained in:
parent
4dfc963c40
commit
319b54ca7e
@ -458,19 +458,11 @@ public class TestCaseService {
|
||||
String steps = t.getSteps();
|
||||
String setp = "";
|
||||
if (steps.contains("null")) {
|
||||
setp = steps.replace("null", "");
|
||||
setp = steps.replace("null", "\"\"");
|
||||
} else {
|
||||
setp = steps;
|
||||
}
|
||||
JSONArray jsonArray = null;
|
||||
try {
|
||||
jsonArray = JSON.parseArray(setp);
|
||||
} catch (Exception e) {
|
||||
// 解决旧版本保存用例导出报错
|
||||
setp.replace("\"desc\":,", "\"desc\":\"\",");
|
||||
setp.replace("\"result\":}", "\"result\":\"\"}");
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
}
|
||||
JSONArray jsonArray = JSON.parseArray(setp);
|
||||
for (int j = 0; j < jsonArray.size(); j++) {
|
||||
int num = j + 1;
|
||||
step.append(num + "." + jsonArray.getJSONObject(j).getString("desc") + "\n");
|
||||
|
Loading…
Reference in New Issue
Block a user