diff --git a/api-test/backend/src/main/java/io/metersphere/controller/plan/ShareTestPlanApiReportController.java b/api-test/backend/src/main/java/io/metersphere/controller/plan/ShareTestPlanApiReportController.java new file mode 100644 index 0000000000..03119c4334 --- /dev/null +++ b/api-test/backend/src/main/java/io/metersphere/controller/plan/ShareTestPlanApiReportController.java @@ -0,0 +1,27 @@ +package io.metersphere.controller.plan; + +import io.metersphere.api.dto.ApiReportResult; +import io.metersphere.service.BaseShareInfoService; +import io.metersphere.service.definition.ApiDefinitionService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +@RestController +@RequestMapping("/share/test/plan/api/case") +public class ShareTestPlanApiReportController { + + @Resource + ApiDefinitionService apiDefinitionService; + @Resource + BaseShareInfoService baseShareInfoService; + + @GetMapping("/api/definition/report/getReport/{shareId}/{testId}") + public ApiReportResult getApiReport(@PathVariable String shareId, @PathVariable String testId) { + baseShareInfoService.validateExpired(shareId); + return apiDefinitionService.getDbResult(testId); + } +} diff --git a/api-test/backend/src/main/java/io/metersphere/controller/plan/TestPlanScenarioCaseController.java b/api-test/backend/src/main/java/io/metersphere/controller/plan/TestPlanScenarioCaseController.java index e67122809e..44eb63c3c1 100644 --- a/api-test/backend/src/main/java/io/metersphere/controller/plan/TestPlanScenarioCaseController.java +++ b/api-test/backend/src/main/java/io/metersphere/controller/plan/TestPlanScenarioCaseController.java @@ -175,7 +175,7 @@ public class TestPlanScenarioCaseController { return testPlanScenarioCaseService.getApiScenarioEnv(planId); } - @GetMapping("/plan/report") + @PostMapping("/plan/report") public ApiPlanReportDTO buildApiReport(@RequestBody ApiPlanReportRequest request) { return testPlanScenarioCaseService.buildApiReport(request); } diff --git a/api-test/backend/src/main/java/io/metersphere/service/plan/TestPlanScenarioCaseService.java b/api-test/backend/src/main/java/io/metersphere/service/plan/TestPlanScenarioCaseService.java index f223dd9a03..84bed5476a 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/plan/TestPlanScenarioCaseService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/plan/TestPlanScenarioCaseService.java @@ -863,7 +863,7 @@ public class TestPlanScenarioCaseService { if (StringUtils.isNotEmpty(contentStr)) { content.put("envName", apiDefinitionService.getEnvNameByEnvConfig(result.getProjectId(), result.getEnvConfig())); } - contentStr = content.toString(); + contentStr = JSON.toJSONString(content); apiCase.setResponse(contentStr); } catch (Exception e) { LogUtil.error("解析content失败!", e); diff --git a/api-test/frontend/src/business/automation/report/ApiReportDetail.vue b/api-test/frontend/src/business/automation/report/ApiReportDetail.vue index 82fc2fcb58..04a7060d9f 100644 --- a/api-test/frontend/src/business/automation/report/ApiReportDetail.vue +++ b/api-test/frontend/src/business/automation/report/ApiReportDetail.vue @@ -121,8 +121,8 @@ import {RequestFactory} from "../../definition/model/ApiTestModel"; import {getCurrentProjectID} from "metersphere-frontend/src/utils/token"; import {getUUID, windowPrint} from "metersphere-frontend/src/utils"; import {hasLicense} from "metersphere-frontend/src/utils/permission"; -import {getScenarioReport, getScenarioReportDetail, getShareScenarioReport, reportReName} from "@/api/scenario-report"; -import {STEP} from "@/business/automation/scenario/Setting"; +import {getScenarioReport, getScenarioReportDetail, getShareScenarioReport, reportReName} from "../../../api/scenario-report"; +import {STEP} from "../../automation/scenario/Setting"; import MsCodeEdit from "metersphere-frontend/src/components/MsCodeEdit"; export default { diff --git a/api-test/frontend/src/business/automation/report/ApiReportExport.vue b/api-test/frontend/src/business/automation/report/ApiReportExport.vue index 0f8eda8b15..e5b959793a 100644 --- a/api-test/frontend/src/business/automation/report/ApiReportExport.vue +++ b/api-test/frontend/src/business/automation/report/ApiReportExport.vue @@ -87,7 +87,7 @@ import ApiReportReqestHeaderItem from "./ApiReportReqestHeaderItem"; import MsMetricChart from "./components/MetricChart"; import MsReportTitle from "metersphere-frontend/src/components/report/MsReportTitle"; import MsReportExportTemplate from "metersphere-frontend/src/components/report/MsReportExportTemplate"; -import MsAssertionResults from "@/business/automation/report/components/AssertionResults" +import MsAssertionResults from "../../../business/automation/report/components/AssertionResults" export default { name: "MsApiReportExport", diff --git a/api-test/frontend/src/business/automation/report/ApiReportViewHeader.vue b/api-test/frontend/src/business/automation/report/ApiReportViewHeader.vue index 2bff08df1f..6261e52d45 100644 --- a/api-test/frontend/src/business/automation/report/ApiReportViewHeader.vue +++ b/api-test/frontend/src/business/automation/report/ApiReportViewHeader.vue @@ -79,11 +79,11 @@ diff --git a/test-track/frontend/src/business/plan/view/comonents/api/TestPlanApiCaseList.vue b/test-track/frontend/src/business/plan/view/comonents/api/TestPlanApiCaseList.vue index 42e238a7e3..19ff319b49 100644 --- a/test-track/frontend/src/business/plan/view/comonents/api/TestPlanApiCaseList.vue +++ b/test-track/frontend/src/business/plan/view/comonents/api/TestPlanApiCaseList.vue @@ -158,10 +158,6 @@ - - - - - - - - - - - diff --git a/test-track/frontend/src/business/plan/view/comonents/load/LoadCaseReportView.vue b/test-track/frontend/src/business/plan/view/comonents/load/LoadCaseReportView.vue deleted file mode 100644 index b0998ff020..0000000000 --- a/test-track/frontend/src/business/plan/view/comonents/load/LoadCaseReportView.vue +++ /dev/null @@ -1,546 +0,0 @@ - - - - - - diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue index 36d907ea90..99e8b9dfcc 100644 --- a/test-track/frontend/src/business/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue @@ -49,21 +49,31 @@ - - + + + + + + -
{{ $t('test_track.plan.load_case.content_empty') }}