fix(测试跟踪): 修复执行步骤中含有回车的用例未原样导入的问题

Closes #1573
This commit is contained in:
shiziyuan9527 2021-03-19 17:21:41 +08:00
parent 5739bea21e
commit bc9a8ccc21
4 changed files with 6 additions and 5 deletions

View File

@ -144,12 +144,12 @@ public class TestCaseDataListener extends EasyExcelListener<TestCaseExcelData> {
String[] stepRes = new String[1];
if (data.getStepDesc() != null) {
stepDesc = data.getStepDesc().split("\n");
stepDesc = data.getStepDesc().split("\r\n");
} else {
stepDesc[0] = "";
}
if (data.getStepResult() != null) {
stepRes = data.getStepResult().split("\n");
stepRes = data.getStepResult().split("\r\n");
} else {
stepRes[0] = "";
}

View File

@ -520,8 +520,8 @@ public class TestCaseService {
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");
step.append(num + "." + jsonArray.getJSONObject(j).getString("desc") + "\r\n");
result.append(num + "." + jsonArray.getJSONObject(j).getString("result") + "\r\n");
}
data.setStepDesc(step.toString());

View File

@ -8,6 +8,7 @@
@setTreeNodes="setTreeNodes"
@exportTestCase="exportTestCase"
@saveAsEdit="editTestCase"
@refreshAll="refreshAll"
:type="'edit'"
ref="nodeTree"
/>

View File

@ -101,7 +101,7 @@ export default {
this.$emit("refreshTable");
},
refreshAll() {
this.selectRows.clear();
// this.selectRows.clear();
this.$emit('refreshAll');
},
handleCommand(e) {