From 637c997ae1e9d8e35292867a50e43c31586c1f2c Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 25 Jul 2022 14:50:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=8A=A5=E5=91=8A=E5=88=86?= =?UTF-8?q?=E4=BA=ABui=E7=94=A8=E4=BE=8B=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E6=98=AF=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015059 --user=宋昌昌 【测试跟踪】测试计划报告,UI场景结果显示在了接口场景结果里 https://www.tapd.cn/55049933/s/1209991 --- .../controller/ShareController.java | 31 ++++++++++++++++--- .../component/ApiScenarioFailureResult.vue | 24 +++++++++++++- frontend/src/network/test-plan.js | 15 +++++++++ 3 files changed, 65 insertions(+), 5 deletions(-) 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) : {}; }