diff --git a/frontend/src/api/modules/test-plan/report.ts b/frontend/src/api/modules/test-plan/report.ts index a57ea67942..df13c52416 100644 --- a/frontend/src/api/modules/test-plan/report.ts +++ b/frontend/src/api/modules/test-plan/report.ts @@ -39,4 +39,9 @@ export function updateReportDetail(data: UpdateReportDetailParams) { return MSR.post({ url: reportUrl.UpdateReportDetailUrl, data }); } +// 测试计划-报告-详情 +export function getReportDetail(id: string) { + return MSR.get({ url: `${reportUrl.PlanReportDetailUrl}/${id}` }); +} + export default {}; diff --git a/frontend/src/api/requrls/test-plan/report.ts b/frontend/src/api/requrls/test-plan/report.ts index 8ae8126098..5ed230342a 100644 --- a/frontend/src/api/requrls/test-plan/report.ts +++ b/frontend/src/api/requrls/test-plan/report.ts @@ -6,6 +6,8 @@ export const PlanReportRenameUrl = '/test-plan/report/rename'; export const PlanDeleteUrl = '/test-plan/report/delete'; // 批量删除报告 export const PlanBatchDeleteUrl = '/test-plan/report/batch-delete'; +// 测试计划-报告-详情 +export const PlanReportDetailUrl = '/test-plan/report/get'; // 测试计划-报告-详情-缺陷分页查询 export const ReportBugListUrl = '/test-plan/report/detail/bug/page'; // 测试计划-报告-详情-功能用例分页查询 diff --git a/frontend/src/assets/svg/bugTotal.svg b/frontend/src/assets/svg/bugTotal.svg new file mode 100644 index 0000000000..435ba36517 --- /dev/null +++ b/frontend/src/assets/svg/bugTotal.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/src/assets/svg/passRate.svg b/frontend/src/assets/svg/passRate.svg new file mode 100644 index 0000000000..c26947a319 --- /dev/null +++ b/frontend/src/assets/svg/passRate.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/src/assets/svg/threshold.svg b/frontend/src/assets/svg/threshold.svg new file mode 100644 index 0000000000..31da7f7204 --- /dev/null +++ b/frontend/src/assets/svg/threshold.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/src/components/business/ms-case-associate/executeResult.vue b/frontend/src/components/business/ms-case-associate/executeResult.vue index 59608492a6..923c648fd3 100644 --- a/frontend/src/components/business/ms-case-associate/executeResult.vue +++ b/frontend/src/components/business/ms-case-associate/executeResult.vue @@ -40,7 +40,7 @@ label: 'BLOCKED', icon: StatusType.BLOCKED, statusText: t('caseManagement.featureCase.chokeUp'), - color: 'rgb(var(--warning-6))', + color: 'rgb(var(--primary-3))', }, ERROR: { label: 'ERROR', diff --git a/frontend/src/config/testPlan.ts b/frontend/src/config/testPlan.ts index 337d606623..b8b6b9ef07 100644 --- a/frontend/src/config/testPlan.ts +++ b/frontend/src/config/testPlan.ts @@ -1,6 +1,6 @@ import type { PassRateCountDetail, planStatusType, TestPlanDetail } from '@/models/testPlan/testPlan'; +import type { PlanReportDetail, StatusListType } from '@/models/testPlan/testPlanReport'; import { LastExecuteResults } from '@/enums/caseEnum'; - // TODO: 对照后端字段 // 测试计划详情 export const testPlanDefaultDetail: TestPlanDetail = { @@ -46,5 +46,77 @@ export const defaultExecuteForm = { planCommentFileIds: [], notifier: [] as string[], }; +// 报告详情 +export const defaultReportDetail: PlanReportDetail = { + id: '', + name: '', + startTime: 0, + executeTime: 0, // 报告执行开始时间 + endTime: 0, + summary: '', + passThreshold: 0, // 通过阈值 + passRate: 0, // 通过率 + executeRate: 0, // 执行完成率 + bugCount: 0, + caseTotal: 0, + executeCount: { + success: 0, + error: 0, + fakeError: 0, + block: 0, + pending: 0, + }, + functionalCount: { + success: 0, + error: 0, + fakeError: 0, + block: 0, + pending: 0, + }, +}; + +export const statusConfig: StatusListType[] = [ + { + label: 'common.success', + value: 'success', + color: '#00C261', + class: 'bg-[rgb(var(--success-6))]', + rateKey: 'requestPassRate', + key: 'SUCCESS', + }, + // TODO 这个版本不展示误报 + // { + // label: 'common.fakeError', + // value: 'fakeError', + // color: '#FFC14E', + // class: 'bg-[rgb(var(--warning-6))]', + // rateKey: 'requestFakeErrorRate', + // key: 'FAKE_ERROR', + // }, + { + label: 'common.fail', + value: 'error', + color: '#ED0303', + class: 'bg-[rgb(var(--danger-6))]', + rateKey: 'requestErrorRate', + key: 'ERROR', + }, + { + label: 'common.unExecute', + value: 'pending', + color: '#D4D4D8', + class: 'bg-[var(--color-text-input-border)]', + rateKey: 'requestPendingRate', + key: 'PENDING', + }, + { + label: 'common.block', + value: 'block', + color: '#B379C8', + class: 'bg-[rgb(var(--primary-3))]', + rateKey: 'requestPendingRate', + key: 'BLOCK', + }, +]; export default {}; diff --git a/frontend/src/models/testPlan/testPlanReport.ts b/frontend/src/models/testPlan/testPlanReport.ts new file mode 100644 index 0000000000..d9be327840 --- /dev/null +++ b/frontend/src/models/testPlan/testPlanReport.ts @@ -0,0 +1,34 @@ +export interface countDetail { + success: number; + error: number; + fakeError: number; + block: number; + pending: number; +} +export interface PlanReportDetail { + id: string; + name: string; + startTime: number; + executeTime: number; // 报告执行开始时间 + endTime: number; + summary: string; + passThreshold: number; // 通过阈值 + passRate: number; // 通过率 + executeRate: number; // 执行完成率 + bugCount: number; + caseTotal: number; + executeCount: countDetail; + functionalCount: countDetail; + // TOTO 这个版本不展示场景和接口 + // apiCaseCount: countDetail; // 接口场景用例分析-用例数 + // apiScenarioCount: countDetail; // 接口场景用例分析-用例数 +} + +export interface StatusListType { + label: string; + value: keyof countDetail; + color: string; + class: string; + rateKey: string; + key: string; +} diff --git a/frontend/src/views/api-test/report/component/case/IndepReportChart.vue b/frontend/src/views/api-test/report/component/case/IndepReportChart.vue deleted file mode 100644 index 0f1eb67608..0000000000 --- a/frontend/src/views/api-test/report/component/case/IndepReportChart.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - - - diff --git a/frontend/src/views/api-test/report/component/case/setReportChart.vue b/frontend/src/views/api-test/report/component/case/setReportChart.vue index a628559df3..5d150d7975 100644 --- a/frontend/src/views/api-test/report/component/case/setReportChart.vue +++ b/frontend/src/views/api-test/report/component/case/setReportChart.vue @@ -1,7 +1,7 @@