diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java index abf287fd0e..b5e0af62ad 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java @@ -741,13 +741,13 @@ public class TestPlanApiCaseService { String reportId = testPlanApiCaseReportMap.get(testPlanApiCaseId); dto.setReportId(reportId); if(StringUtils.isEmpty(reportId)){ - dto.setStatus(defaultStatus); + dto.setExecResult(defaultStatus); }else { String status = reportResult.get(reportId); if(status == null){ status = defaultStatus; } - dto.setStatus(status); + dto.setExecResult(status); } } return buildCases(apiTestCases); diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java index 2d4e010ab2..13583b72cc 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java @@ -511,7 +511,7 @@ public class TestPlanScenarioCaseService { if(status == null ){ status = defaultStatus; } - dto.setStatus(status); + dto.setLastResult(status); } } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index 77eaca347d..5bbab9d40f 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1728,7 +1728,6 @@ public class TestPlanService { if (MapUtils.isEmpty(executeInfo.getApiCaseExecInfo()) && MapUtils.isEmpty(executeInfo.getApiScenarioCaseExecInfo())) { return; } - ApiDefinitionExecResultMapper apiDefinitionExecResultMapper = CommonBeanFactory.getBean(ApiDefinitionExecResultMapper.class); if (checkReportConfig(config, "api")) { List apiAllCases = null; List scenarioAllCases = null; diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue index 4de1081582..c541cb3729 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue @@ -94,7 +94,7 @@ export default { }, data() { return { - apiCases: [], + apiCases: [], result: {}, response: {}, showResponse: false @@ -157,18 +157,22 @@ export default { } }); } else { - if(row.reportId){ + if (row.reportId) { let url = "/api/definition/report/get/" + row.reportId; this.$get(url, response => { if (response.data) { let data = response.data; if (data && data.content) { this.showResponse = true; - this.response = JSON.parse(data.content); + try { + this.response = JSON.parse(data.content); + } catch (e) { + this.response = {}; + } } } }); - }else { + } else { getApiReport(row.id, (data) => { if (data && data.content) { this.showResponse = true;