fix(测试计划): 场景执行触发方式修改,针对场景结果历史数据兼容
This commit is contained in:
parent
c95e4742ce
commit
7a4302b291
|
@ -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();
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
// 跨项目关联,如果没有ID,则赋值本项目ID
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue