fix(测试跟踪): 用例导出报错

This commit is contained in:
chenjianxing 2020-11-06 09:39:22 +08:00
parent 63e234b74b
commit fcf879d06f
2 changed files with 13 additions and 6 deletions

View File

@ -457,12 +457,19 @@ public class TestCaseService {
if (t.getMethod().equals("manual")) {
String steps = t.getSteps();
String setp = "";
if (steps.contains("null") && !steps.contains("\"null\"")) {
setp = steps.replace("null", "\"\"");
} else {
setp = steps;
setp = steps;
JSONArray jsonArray = null;
//解决旧版本保存用例导出报错
try {
jsonArray = JSON.parseArray(setp);
} catch (Exception e) {
if (steps.contains("null") && !steps.contains("\"null\"")) {
setp = steps.replace("null", "\"\"");
jsonArray = JSON.parseArray(setp);
}
}
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");

@ -1 +1 @@
Subproject commit b9091a47b197faef77c72b134b7cf604fe3209f0
Subproject commit eb237fb6bfeba8d99e4db52450ae92f3cdd4ea33