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 6620cc67bd..e39e3c514b 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java @@ -729,13 +729,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 c8c882a2a4..c333952dd9 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanScenarioCaseService.java @@ -467,7 +467,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 b47c26f859..24a1890a22 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1706,7 +1706,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 e28376011b..2d7c34217c 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 @@ -44,7 +44,8 @@ @@ -76,11 +77,13 @@ import MsTable from "@/business/components/common/components/table/MsTable"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import {getApiReport, getShareApiReport} from "@/network/api"; import MsRequestResultTail from "@/business/components/api/definition/components/response/RequestResultTail"; + export default { name: "ApiCaseFailureResult", components: { MsRequestResultTail, - MsTableColumn, MsTable, StatusTableItem, MethodTableItem, TypeTableItem, PriorityTableItem}, + MsTableColumn, MsTable, StatusTableItem, MethodTableItem, TypeTableItem, PriorityTableItem + }, props: { planId: String, isTemplate: Boolean, @@ -92,7 +95,7 @@ export default { }, data() { return { - apiCases: [], + apiCases: [], result: {}, response: {}, showResponse: false @@ -155,18 +158,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;