fix(测试计划): 报告用例明细列表展示问题

This commit is contained in:
song-cc-rock 2024-08-30 17:02:06 +08:00 committed by Craftsman
parent ae1b6ddb02
commit 27cb8d9475
7 changed files with 25 additions and 3 deletions

View File

@ -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;
/**
* 报告分析

View File

@ -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);

View File

@ -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),

View File

@ -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; // 接口场景用例分析-用例数

View File

@ -106,6 +106,9 @@ const subPlanList: PlanReportDetail = {
endTime: 0,
summary: '',
caseTotal: 1,
functionalTotal: 0,
apiCaseTotal: 0,
apiScenarioTotal: 0,
passThreshold: 100,
passRate: 100,
executeRate: 0,

View File

@ -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<ReportMetricsItemModel[]>(() => {
if (props.isGroup) {

View File

@ -26,6 +26,9 @@
executeRate: 100, //
bugCount: 10,
caseTotal: 0,
functionalTotal: 0,
apiCaseTotal: 0,
apiScenarioTotal: 0,
executeCount: {
success: 0,
error: 0,