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,