diff --git a/frontend/src/api/modules/test-plan/testPlan.ts b/frontend/src/api/modules/test-plan/testPlan.ts index 4f6e20783d..4d39ee1a97 100644 --- a/frontend/src/api/modules/test-plan/testPlan.ts +++ b/frontend/src/api/modules/test-plan/testPlan.ts @@ -15,6 +15,7 @@ import { deletePlanUrl, DeleteTestPlanModuleUrl, DisassociateCaseUrl, + EditCaseLastExecResultUrl, followPlanUrl, GetAssociatedBugUrl, GetFeatureCaseModuleCountUrl, @@ -32,6 +33,7 @@ import { SortFeatureCaseUrl, TestPlanAssociateBugUrl, TestPlanCancelBugUrl, + TestPlanCaseDetailUrl, updateTestPlanModuleUrl, UpdateTestPlanUrl, } from '@/api/requrls/test-plan/testPlan'; @@ -46,6 +48,7 @@ import type { BatchFeatureCaseParams, BatchUpdateCaseExecutorParams, DisassociateCaseParams, + EditLastExecResultParams, FollowPlanParams, PassRateCountDetail, PlanDetailBugItem, @@ -171,6 +174,10 @@ export function getFeatureCaseModule(planId: string) { export function disassociateCase(data: DisassociateCaseParams) { return MSR.post({ url: DisassociateCaseUrl, data }); } +// 计划详情-功能用例列表-编辑执行结果 +export function editLastExecResult(data: EditLastExecResultParams) { + return MSR.post({ url: EditCaseLastExecResultUrl, data }); +} // 计划详情-功能用例列表-拖拽排序 export const sortFeatureCase = (data: SortFeatureCaseParams) => { return MSR.post({ url: SortFeatureCaseUrl, data }); @@ -191,6 +198,10 @@ export function batchUpdateCaseExecutor(data: BatchUpdateCaseExecutorParams) { export function runFeatureCase(data: RunFeatureCaseParams) { return MSR.post({ url: RunFeatureCaseUrl, data }); } +// 计划详情-功能用例-详情 +export function getCaseDetail(id: string) { + return MSR.get({ url: `${TestPlanCaseDetailUrl}/${id}` }); +} // 测试计划-用例详情-缺陷列表 export function associatedBugPage(data: TableQueryParams) { return MSR.post({ url: GetAssociatedBugUrl, data }); diff --git a/frontend/src/api/requrls/test-plan/testPlan.ts b/frontend/src/api/requrls/test-plan/testPlan.ts index f68b436698..32868d8f6f 100644 --- a/frontend/src/api/requrls/test-plan/testPlan.ts +++ b/frontend/src/api/requrls/test-plan/testPlan.ts @@ -50,6 +50,8 @@ export const GetFeatureCaseModuleCountUrl = '/test-plan/functional/case/module/c export const GetFeatureCaseModuleUrl = '/test-plan/functional/case/tree'; // 计划详情-功能用例列表-拖拽排序 export const SortFeatureCaseUrl = '/test-plan/functional/case/sort'; +// 计划详情-功能用例列表-编辑执行结果 +export const EditCaseLastExecResultUrl = '/test-plan/functional/case/edit'; // 计划详情-功能用例-取消关联用例 export const DisassociateCaseUrl = '/test-plan/functional/case/disassociate'; // 计划详情-功能用例-批量取消关联用例 @@ -58,6 +60,8 @@ export const BatchDisassociateCaseUrl = '/test-plan/functional/case/batch/disass export const RunFeatureCaseUrl = '/test-plan/functional/case/run'; // 测试计划-用例详情-缺陷列表 export const GetAssociatedBugUrl = '/test-plan/functional/case/has/associate/bug/page'; +// 测试计划-用例详情 +export const TestPlanCaseDetailUrl = '/test-plan/functional/case/detail'; // 测试计划-用例详情-关联缺陷 export const TestPlanAssociateBugUrl = '/test-plan/functional/case/associate/bug'; // 测试计划-用例详情-取消关联缺陷 diff --git a/frontend/src/config/testPlan.ts b/frontend/src/config/testPlan.ts index 145b76744c..337d606623 100644 --- a/frontend/src/config/testPlan.ts +++ b/frontend/src/config/testPlan.ts @@ -41,7 +41,7 @@ export const defaultDetailCount: PassRateCountDetail = { }; export const defaultExecuteForm = { - lastExecResult: 'PASSED' as LastExecuteResults, + lastExecResult: LastExecuteResults.SUCCESS, content: '', planCommentFileIds: [], notifier: [] as string[], diff --git a/frontend/src/models/testPlan/testPlan.ts b/frontend/src/models/testPlan/testPlan.ts index a664645e6e..cf84cd32bf 100644 --- a/frontend/src/models/testPlan/testPlan.ts +++ b/frontend/src/models/testPlan/testPlan.ts @@ -158,6 +158,10 @@ export interface DisassociateCaseParams { id: string; } +export interface EditLastExecResultParams extends DisassociateCaseParams { + lastExecResult: string; +} + export interface BatchFeatureCaseParams extends BatchActionQueryParams { testPlanId: string; moduleIds?: string[]; diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue index 4b6df31663..e17690f18b 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue @@ -587,9 +587,10 @@ if (steps) { stepData.value = JSON.parse(steps).map((item: any) => { return { + id: item.id, step: item.desc, expected: item.result, - actualResult: item.actualResult ?? '', + actualResult: item.actualResult, executeResult: item.executeResult, }; }); diff --git a/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue b/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue index 378453f80c..16e2ef5078 100644 --- a/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue +++ b/frontend/src/views/test-plan/testPlan/detail/featureCase/components/caseTable.vue @@ -42,6 +42,7 @@ v-model:model-value="record.lastExecResult" :placeholder="t('common.pleaseSelect')" class="param-input w-full" + @change="() => handleEditLastExecResult(record)" >