fix(测试计划): 场景执行触发方式修改,针对场景结果历史数据兼容

This commit is contained in:
fit2-zhao 2021-07-22 11:29:43 +08:00 committed by fit2-zhao
parent c95e4742ce
commit 7a4302b291
2 changed files with 10 additions and 6 deletions

View File

@ -207,10 +207,6 @@ public class ApiScenarioReportService {
startTime = scenarioResult.getRequestResults().get(0).getStartTime();
}
ApiScenarioReport report = editReport(scenarioResult, startTime);
if (!StringUtils.equals(ReportTriggerMode.API.name(), report.getTriggerMode())) {
report.setTriggerMode(ReportTriggerMode.MANUAL.name());
apiScenarioReportMapper.updateByPrimaryKeySelective(report);
}
// 报告详情内容
ApiScenarioReportDetail detail = new ApiScenarioReportDetail();

View File

@ -157,8 +157,12 @@ export default {
}
},
created() {
//
if (!this.request.requestResult) {
this.request.requestResult = {responseResult: {}};
this.request.requestResult = [{responseResult: {}}];
} else if (this.request.requestResult && Object.prototype.toString.call(this.request.requestResult) !== '[object Array]') {
let obj = JSON.parse(JSON.stringify(this.request.requestResult));
this.request.requestResult = [obj];
}
// IDID
if (!this.request.projectId) {
@ -328,7 +332,11 @@ export default {
if (response.data.method && response.data.method != null) {
this.request.method = response.data.method;
}
this.request.requestResult = requestResult;
if (requestResult && Object.prototype.toString.call(requestResult) !== '[object Array]') {
this.request.requestResult = [requestResult];
} else {
this.request.requestResult = requestResult;
}
this.request.id = response.data.id;
this.request.disabled = true;
this.request.root = true;