feat(测试计划): 测试计划报告一键总结功能补充

This commit is contained in:
xinxin.wu 2024-06-15 18:24:04 +08:00 committed by Craftsman
parent 1f64a7e300
commit 9716dd5712
5 changed files with 20 additions and 6 deletions

View File

@ -15,10 +15,12 @@
</template>
<template #lastReportStatus="{ record }">
<ExecutionStatus
v-if="record.lastReportStatus !== 'PENDING'"
:module-type="ReportEnum.API_REPORT"
:status="record.lastReportStatus"
:class="[!record.lastReportId ? '' : 'cursor-pointer']"
/>
<span v-else>-</span>
</template>
<template #[FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL]="{ filterContent }">
<CaseLevel :case-level="filterContent.value" />
@ -80,6 +82,7 @@
keyword: string;
getPageApiType: keyof typeof CasePageApiTypeEnum; // Api
extraTableParams?: TableQueryParams; //
protocols: string[];
}>();
const emit = defineEmits<{
@ -215,6 +218,7 @@
condition: {
keyword: props.keyword,
},
protocols: props.protocols,
...props.extraTableParams,
};
}

View File

@ -83,6 +83,11 @@ export const defaultReportDetail: PlanReportDetail = {
apiCaseCount: cloneDeep(defaultCount),
apiScenarioCount: cloneDeep(defaultCount),
planCount: 0,
passCountOfPlan: 0, // 计划通过数量
failCountOfPlan: 0, // 计划未通过数量
functionalBugCount: 0, // 用例明细bug总数
apiBugCount: 0, // 接口用例明细bug总数
scenarioBugCount: 0, // 场景用例明细bug总数
};
export const statusConfig: StatusListType[] = [

View File

@ -22,6 +22,11 @@ export interface PlanReportDetail {
apiCaseCount: countDetail; // 接口场景用例分析-用例数
apiScenarioCount: countDetail; // 接口场景用例分析-用例数
planCount: number;
passCountOfPlan: number; // 计划通过数量
failCountOfPlan: number; // 计划未通过数量
functionalBugCount: number; // 用例明细bug总数
apiBugCount: number; // 接口用例明细bug总数
scenarioBugCount: number; // 场景用例明细bug总数
}
export type AnalysisType = 'FUNCTIONAL' | 'API' | 'SCENARIO';

View File

@ -95,13 +95,13 @@
// TODO
if (props.isPlanGroup) {
return `<p style=""><span color="" fontsize=""> <strong>${props.detail.name}</strong>包含 ${props.detail.planCount}个子计划。
其中 X 个子计划通过 X 个子计划不通过</span></p>`;
其中 ${props.detail.passCountOfPlan} 个子计划通过 ${props.detail.failCountOfPlan} 个子计划不通过</span></p>`;
}
//
return `<p style=""><span color="" fontsize=""> <strong>${props.detail.name}</strong> 包含功能测试、接口用例、场景用例, 共 ${allCaseTotal}条用例,已执行 ${allHasExecutedCase} 条,通过用例 ${allSuccessCase} 条,通过率为 ${allSuccessRate},达到/未达到通过阈值(通过阈值为${props.detail.passThreshold}%<strong>${props.detail.name}</strong> 计划满足/不满足发布要求。<br>
1本次测试包含${functionalCaseDetail.caseTotal}条功能测试用例执行了${functionalCaseDetail.hasExecutedCase}未执行${functionalCaseDetail.pending}执行率为${functionalCaseDetail.apiExecutedRate}通过用例${functionalCaseDetail.success}通过率为${functionalCaseDetail.successRate}共发现缺陷0<br>
2本次测试包含${apiCaseDetail.caseTotal}条接口测试用例执行了${apiCaseDetail.hasExecutedCase}未执行${apiCaseDetail.pending}执行率为${apiCaseDetail.apiExecutedRate}通过用例${apiCaseDetail.success}通过率为${apiCaseDetail.successRate}共发现缺陷 ${props.detail.bugCount} <br>
3本次测试包含${apiScenarioDetail.caseTotal}条场景测试用例执行了${apiScenarioDetail.hasExecutedCase}未执行${apiScenarioDetail.pending}执行率为${apiScenarioDetail.apiExecutedRate}%通过用例${apiScenarioDetail.success}通过率为${apiScenarioDetail.successRate}共发现缺陷0</span></p>
1本次测试包含${functionalCaseDetail.caseTotal}条功能测试用例执行了${functionalCaseDetail.hasExecutedCase}未执行${functionalCaseDetail.pending}执行率为${functionalCaseDetail.apiExecutedRate}通过用例${functionalCaseDetail.success}通过率为${functionalCaseDetail.successRate}共发现缺陷${props.detail.functionalBugCount}<br>
2本次测试包含${apiCaseDetail.caseTotal}条接口测试用例执行了${apiCaseDetail.hasExecutedCase}未执行${apiCaseDetail.pending}执行率为${apiCaseDetail.apiExecutedRate}通过用例${apiCaseDetail.success}通过率为${apiCaseDetail.successRate}共发现缺陷 ${props.detail.apiBugCount} <br>
3本次测试包含${apiScenarioDetail.caseTotal}条场景测试用例执行了${apiScenarioDetail.hasExecutedCase}未执行${apiScenarioDetail.pending}执行率为${apiScenarioDetail.apiExecutedRate}%通过用例${apiScenarioDetail.success}通过率为${apiScenarioDetail.successRate}共发现缺陷${props.detail.scenarioBugCount}</span></p>
`;
});

View File

@ -718,7 +718,7 @@
const defaultCountDetailMap = ref<Record<string, PassRateCountDetail>>({});
function getFunctionalCount(id: string) {
return defaultCountDetailMap.value[id]?.functionalCaseCount ?? 0;
return defaultCountDetailMap.value[id]?.caseTotal ?? 0;
}
function getSchedule(id: string) {
return !!defaultCountDetailMap.value[id]?.scheduleConfig;
@ -729,7 +729,7 @@
function getMoreActions(record: TestPlanItem) {
const { status: planStatus } = record;
const useCount = defaultCountDetailMap.value[record.id]?.functionalCaseCount ?? 0;
const useCount = defaultCountDetailMap.value[record.id]?.caseTotal ?? 0;
//
const copyAction =