From 27cb8d9475e4030621292d7b48158d4c150f2df7 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Fri, 30 Aug 2024 17:02:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E7=94=A8=E4=BE=8B=E6=98=8E=E7=BB=86=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/dto/response/TestPlanReportDetailResponse.java | 6 ++++++ .../io/metersphere/plan/service/TestPlanReportService.java | 4 ++++ frontend/src/config/testPlan.ts | 3 +++ frontend/src/models/testPlan/testPlanReport.ts | 3 +++ .../views/test-plan/report/detail/component/reportConfig.ts | 3 +++ .../views/test-plan/report/detail/component/viewReport.vue | 6 +++--- frontend/src/views/test-plan/report/detail/configReport.vue | 3 +++ 7 files changed, 25 insertions(+), 3 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanReportDetailResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanReportDetailResponse.java index 7bf08f15ae..61d01b582d 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanReportDetailResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanReportDetailResponse.java @@ -28,6 +28,12 @@ public class TestPlanReportDetailResponse { private String summary; @Schema(description = "用例总数") private Integer caseTotal; + @Schema(description = "功能用例总数") + private Integer functionalTotal; + @Schema(description = "接口用例总数") + private Integer apiCaseTotal; + @Schema(description = "接口场景用例总数") + private Integer apiScenarioTotal; /** * 报告分析 diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java index d4c2642321..f80a32140b 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java @@ -621,8 +621,12 @@ public class TestPlanReportService { TestPlanReportSummary reportSummary = testPlanReportSummaries.getFirst(); TestPlanReportDetailResponse planReportDetail = new TestPlanReportDetailResponse(); BeanUtils.copyBean(planReportDetail, planReport); + // 用例总数需单独返回, 不然前端表格不展示, 影响执行中的数据 int caseTotal = (int) (reportSummary.getFunctionalCaseCount() + reportSummary.getApiCaseCount() + reportSummary.getApiScenarioCount()); planReportDetail.setCaseTotal(caseTotal); + planReportDetail.setFunctionalTotal(reportSummary.getFunctionalCaseCount().intValue()); + planReportDetail.setApiCaseTotal(reportSummary.getApiCaseCount().intValue()); + planReportDetail.setApiScenarioTotal(reportSummary.getApiScenarioCount().intValue()); planReportDetail.setBugCount(reportSummary.getBugCount().intValue()); // 暂时只有功能用例能关联缺陷 Long functionalBugCount = extTestPlanReportFunctionalCaseMapper.countBug(reportId); diff --git a/frontend/src/config/testPlan.ts b/frontend/src/config/testPlan.ts index e21ea1a558..de49fe565f 100644 --- a/frontend/src/config/testPlan.ts +++ b/frontend/src/config/testPlan.ts @@ -81,6 +81,9 @@ export const defaultReportDetail: PlanReportDetail = { executeRate: 0, // 执行完成率 bugCount: 0, caseTotal: 0, + functionalTotal: 0, + apiCaseTotal: 0, + apiScenarioTotal: 0, executeCount: cloneDeep(defaultCount), functionalCount: cloneDeep(defaultCount), apiCaseCount: cloneDeep(defaultCount), diff --git a/frontend/src/models/testPlan/testPlanReport.ts b/frontend/src/models/testPlan/testPlanReport.ts index 2b65691f74..9248bb6b9e 100644 --- a/frontend/src/models/testPlan/testPlanReport.ts +++ b/frontend/src/models/testPlan/testPlanReport.ts @@ -20,6 +20,9 @@ export interface PlanReportDetail { executeRate: number; // 执行完成率 bugCount: number; caseTotal: number; + functionalTotal: number; + apiCaseTotal: number; + apiScenarioTotal: number; executeCount: countDetail; functionalCount: countDetail; apiCaseCount: countDetail; // 接口场景用例分析-用例数 diff --git a/frontend/src/views/test-plan/report/detail/component/reportConfig.ts b/frontend/src/views/test-plan/report/detail/component/reportConfig.ts index ca148202b8..5405eb2972 100644 --- a/frontend/src/views/test-plan/report/detail/component/reportConfig.ts +++ b/frontend/src/views/test-plan/report/detail/component/reportConfig.ts @@ -106,6 +106,9 @@ const subPlanList: PlanReportDetail = { endTime: 0, summary: '', caseTotal: 1, + functionalTotal: 0, + apiCaseTotal: 0, + apiScenarioTotal: 0, passThreshold: 100, passRate: 100, executeRate: 0, diff --git a/frontend/src/views/test-plan/report/detail/component/viewReport.vue b/frontend/src/views/test-plan/report/detail/component/viewReport.vue index 03192ebac5..7c644e6029 100644 --- a/frontend/src/views/test-plan/report/detail/component/viewReport.vue +++ b/frontend/src/views/test-plan/report/detail/component/viewReport.vue @@ -422,9 +422,9 @@ const apiScenarioDetail = getSummaryDetail(detail.value.apiScenarioCount || defaultCount); return apiScenarioDetail.successRate; }); - const functionalCaseTotal = computed(() => getSummaryDetail(detail.value.functionalCount).caseTotal); - const apiCaseTotal = computed(() => getSummaryDetail(detail.value.apiCaseCount).caseTotal); - const scenarioCaseTotal = computed(() => getSummaryDetail(detail.value.apiScenarioCount).caseTotal); + const functionalCaseTotal = computed(() => detail.value.functionalTotal); + const apiCaseTotal = computed(() => detail.value.apiCaseTotal); + const scenarioCaseTotal = computed(() => detail.value.apiScenarioTotal); const reportAnalysisList = computed(() => { if (props.isGroup) { diff --git a/frontend/src/views/test-plan/report/detail/configReport.vue b/frontend/src/views/test-plan/report/detail/configReport.vue index 53f2659332..e6da90b799 100644 --- a/frontend/src/views/test-plan/report/detail/configReport.vue +++ b/frontend/src/views/test-plan/report/detail/configReport.vue @@ -26,6 +26,9 @@ executeRate: 100, // 执行完成率 bugCount: 10, caseTotal: 0, + functionalTotal: 0, + apiCaseTotal: 0, + apiScenarioTotal: 0, executeCount: { success: 0, error: 0,