From 6313afe4271ffa40a74973c5ff170ecc064af3ec Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Fri, 1 Nov 2024 15:42:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=8A=A5=E5=91=8A=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E6=80=BB=E7=BB=93=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/models/testPlan/testPlanReport.ts | 1 + .../detail/component/system-card/summary.vue | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/src/models/testPlan/testPlanReport.ts b/frontend/src/models/testPlan/testPlanReport.ts index 2b019c8371..4f6d2071d2 100644 --- a/frontend/src/models/testPlan/testPlanReport.ts +++ b/frontend/src/models/testPlan/testPlanReport.ts @@ -36,6 +36,7 @@ export interface PlanReportDetail { testPlanName: string; resultStatus?: string; // 报告结果 defaultLayout: boolean; // 报告布局 + children?: PlanReportDetail[]; // 计划组子计划数据 } export type detailCountKey = 'functionalCount' | 'apiCaseCount' | 'apiScenarioCount'; diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/summary.vue b/frontend/src/views/test-plan/report/detail/component/system-card/summary.vue index 43b2d363da..abaff23a42 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/summary.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/summary.vue @@ -106,18 +106,23 @@ // 通过率 const allSuccessCount = (allSuccessCase / allCaseTotal) * 100; const allSuccessRate = `${Number.isNaN(allSuccessCount) ? 0 : allSuccessCount.toFixed(2)}`; - + // TODO 待联调 if (props.isPlanGroup) { - return `

${props.detail.testPlanName}包含 ${props.detail.planCount}个子计划。 - 其中 ${props.detail.passCountOfPlan} 个子计划通过, ${props.detail.failCountOfPlan} 个子计划不通过。

`; + let summaryDesc = `

${props.detail.testPlanName} 包含 ${props.detail.planCount} 个子计划。 其中 ${props.detail.passCountOfPlan} 个子计划通过, ${props.detail.failCountOfPlan} 个子计划不通过; + 包含功能测试、接口用例、场景用例, 共 ${allCaseTotal} 条用例,已执行 ${allHasExecutedCase} 条,通过用例 ${allSuccessCase} 条,通过率为 ${allSuccessRate} %;共关联缺陷 ${props.detail.bugCount} 个

`; + (props.detail?.children || []).forEach((item) => { + const content = `

▪ ${item.testPlanName}子计划,包含功能测试、接口用例、场景用例, 共 ${item.caseTotal} 条用例,已执行 ${item.executeCount} 条,通过用例 ${item.passCountOfPlan} 条,通过率为 ${item.passThreshold} %,未达到通过阈值(通过阈值为${item.passThreshold}%)

`; + summaryDesc += content; + }); + return summaryDesc; } - const functionalCasText = `▪ 本次测试包含${functionalCaseDetail.caseTotal}条功能测试用例,执行了${functionalCaseDetail.hasExecutedCase}条,未执行${functionalCaseDetail.pending}条,执行率为${functionalCaseDetail.apiExecutedRate},通过用例${functionalCaseDetail.success}条,通过率为${functionalCaseDetail.successRate}。共发现缺陷${props.detail.functionalBugCount}个。
`; + const functionalCasText = `▪ 本次测试包含${functionalCaseDetail.caseTotal}条功能测试用例,执行了${functionalCaseDetail.hasExecutedCase}条,未执行${functionalCaseDetail.pending}条,执行率为${functionalCaseDetail.apiExecutedRate},通过用例${functionalCaseDetail.success}条,通过率为${functionalCaseDetail.successRate}。共关联缺陷${props.detail.functionalBugCount}个。
`; const functionCaseDesc = functionalCaseDetail.caseTotal ? `${functionalCasText}` : ``; - const apiCaseText = `▪ 本次测试包含${apiCaseDetail.caseTotal}条接口测试用例,执行了${apiCaseDetail.hasExecutedCase}条,未执行${apiCaseDetail.pending}条,执行率为${apiCaseDetail.apiExecutedRate},通过用例${apiCaseDetail.success}条,通过率为${apiCaseDetail.successRate}。共发现缺陷 ${props.detail.apiBugCount} 个。
`; + const apiCaseText = `▪ 本次测试包含${apiCaseDetail.caseTotal}条接口测试用例,执行了${apiCaseDetail.hasExecutedCase}条,未执行${apiCaseDetail.pending}条,执行率为${apiCaseDetail.apiExecutedRate},通过用例${apiCaseDetail.success}条,通过率为${apiCaseDetail.successRate}。共关联缺陷 ${props.detail.apiBugCount} 个。
`; const apiCaseDesc = apiCaseDetail.caseTotal ? `${apiCaseText}` : ``; - const scenarioCaseText = `▪ 本次测试包含${apiScenarioDetail.caseTotal}条场景测试用例,执行了${apiScenarioDetail.hasExecutedCase}条,未执行${apiScenarioDetail.pending}条,执行率为${apiScenarioDetail.apiExecutedRate},通过用例${apiScenarioDetail.success}条,通过率为${apiScenarioDetail.successRate}。共发现缺陷${props.detail.scenarioBugCount}个`; + const scenarioCaseText = `▪ 本次测试包含${apiScenarioDetail.caseTotal}条场景测试用例,执行了${apiScenarioDetail.hasExecutedCase}条,未执行${apiScenarioDetail.pending}条,执行率为${apiScenarioDetail.apiExecutedRate},通过用例${apiScenarioDetail.success}条,通过率为${apiScenarioDetail.successRate}。共关联缺陷 ${props.detail.scenarioBugCount}个`; const scenarioCaseDesc = apiScenarioDetail.caseTotal ? `${scenarioCaseText}` : ``; const isPass = Number(allSuccessRate) >= Number(props.detail.passThreshold);