diff --git a/backend/src/main/java/io/metersphere/controller/ShareController.java b/backend/src/main/java/io/metersphere/controller/ShareController.java index 9b0f97e505..73bc980ecf 100644 --- a/backend/src/main/java/io/metersphere/controller/ShareController.java +++ b/backend/src/main/java/io/metersphere/controller/ShareController.java @@ -15,10 +15,7 @@ import io.metersphere.commons.constants.ResourceStatusEnum; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest; -import io.metersphere.dto.LogDetailDTO; -import io.metersphere.dto.ReportDTO; -import io.metersphere.dto.RequestResult; -import io.metersphere.dto.TestResourcePoolDTO; +import io.metersphere.dto.*; import io.metersphere.performance.base.*; import io.metersphere.performance.dto.LoadTestExportJmx; import io.metersphere.performance.dto.MetricData; @@ -54,6 +51,8 @@ public class ShareController { @Resource TestPlanScenarioCaseService testPlanScenarioCaseService; @Resource + TestPlanUiScenarioCaseService testPlanUiScenarioCaseService; + @Resource ApiScenarioReportService apiScenarioReportService; @Resource TestPlanLoadCaseService testPlanLoadCaseService; @@ -160,6 +159,30 @@ public class ShareController { return testPlanScenarioCaseService.getUnExecuteCases(planId); } + @GetMapping("/test/plan/uiScenario/case/list/failure/{shareId}/{planId}") + public List getUiScenarioFailureList(@PathVariable String shareId, @PathVariable String planId) { + shareInfoService.validate(shareId, planId); + return testPlanUiScenarioCaseService.getFailureCases(planId); + } + + @GetMapping("/test/plan/uiScenario/case/list/all/{shareId}/{planId}") + public List getUiScenarioAllList(@PathVariable String shareId, @PathVariable String planId) { + shareInfoService.validate(shareId, planId); + return testPlanUiScenarioCaseService.getAllCases(planId); + } + + @GetMapping("/test/plan/uiScenario/case/list/errorReport/{shareId}/{planId}") + public List getUiScenarioErrorReportList(@PathVariable String shareId, @PathVariable String planId) { + shareInfoService.validate(shareId, planId); + return testPlanUiScenarioCaseService.getErrorReportCases(planId); + } + + @GetMapping("/test/plan/uiScenario/case/list/unExecute/{shareId}/{planId}") + public List geUitUnExecuteScenarioCases(@PathVariable String shareId, @PathVariable String planId) { + shareInfoService.validate(shareId, planId); + return testPlanUiScenarioCaseService.getUnExecuteCases(planId); + } + @GetMapping("/api/definition/report/getReport/{shareId}/{testId}") public APIReportResult getApiReport(@PathVariable String shareId, @PathVariable String testId) { // shareInfoService.apiReportValidate(shareId, testId); diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue index daee410ded..0b8477b3f6 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue @@ -90,6 +90,10 @@ import { getPlanUiScenarioFailureCase, getPlanUiScenarioUnExecuteCase, getPlanUiScenarioAllCase, + getSharePlanUiScenarioAllCase, + getSharePlanUiScenarioUnExecuteCase, + getSharePlanUiScenarioErrorReportCase, + getSharePlanUiScenarioFailureCase, } from "@/network/test-plan"; import MsTable from "@/business/components/common/components/table/MsTable"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; @@ -148,7 +152,7 @@ export default { } else { this.scenarioCases = this.report.scenarioFailureCases ? this.report.scenarioFailureCases : []; } - } else if (this.isShare) { + } else if (this.isShare && !this.isUi) { if (this.isErrorReport) { this.result = getSharePlanScenarioErrorReportCase(this.shareId, this.planId, (data) => { this.scenarioCases = data; @@ -166,6 +170,24 @@ export default { this.scenarioCases = data; }); } + } else if (this.isShare && this.isUi) { + if (this.isErrorReport) { + this.result = getSharePlanUiScenarioErrorReportCase(this.shareId, this.planId, (data) => { + this.scenarioCases = data; + }); + } else if (this.isUnExecute) { + this.result = getSharePlanUiScenarioUnExecuteCase(this.shareId, this.planId, (data) => { + this.scenarioCases = data; + }); + } else if (this.isAll) { + this.result = getSharePlanUiScenarioAllCase(this.shareId, this.planId, (data) => { + this.scenarioCases = data; + }); + } else { + this.result = getSharePlanUiScenarioFailureCase(this.shareId, this.planId, (data) => { + this.scenarioCases = data; + }); + } } else if (this.isUi) { if (this.isErrorReport) { this.result = getPlanUiScenarioErrorReportCase(this.planId, (data) => { diff --git a/frontend/src/network/test-plan.js b/frontend/src/network/test-plan.js index 0d642a7c8b..86f6b102a3 100644 --- a/frontend/src/network/test-plan.js +++ b/frontend/src/network/test-plan.js @@ -94,6 +94,21 @@ export function getSharePlanScenarioUnExecuteCase(shareId, planId, callback) { return planId ? baseGet('/share/test/plan/scenario/case/list/unExecute/' + shareId + '/' + planId, callback) : {}; } +export function getSharePlanUiScenarioFailureCase(shareId, planId, callback) { + return planId ? baseGet('/share/test/plan/uiScenario/case/list/failure/' + shareId + '/' + planId, callback) : {}; +} + +export function getSharePlanUiScenarioAllCase(shareId, planId, callback) { + return planId ? baseGet('/share/test/plan/uiScenario/case/list/all/' + shareId + '/' + planId, callback) : {}; +} + +export function getSharePlanUiScenarioErrorReportCase(shareId, planId, callback) { + return planId ? baseGet('/share/test/plan/uiScenario/case/list/errorReport/' + shareId + '/' + planId, callback) : {}; +} +export function getSharePlanUiScenarioUnExecuteCase(shareId, planId, callback) { + return planId ? baseGet('/share/test/plan/uiScenario/case/list/unExecute/' + shareId + '/' + planId, callback) : {}; +} + export function getPlanApiFailureCase(planId, callback) { return planId ? baseGet('/test/plan/api/case/list/failure/' + planId, callback) : {}; }