fix(测试计划): 脑图执行用例-调整步骤数据

This commit is contained in:
teukkk 2024-08-01 15:10:42 +08:00 committed by 刘瑞斌
parent 0deac9e9f4
commit 5bc0ca72ea
1 changed files with 21 additions and 2 deletions

View File

@ -628,6 +628,11 @@
function cancelStepExecute() { function cancelStepExecute() {
executeForm.value = { ...defaultExecuteForm }; executeForm.value = { ...defaultExecuteForm };
} }
/**
* 步骤/用例执行后 更新脑图数据
* @param status 用例执行状态
* @param content 用例实际结果内容
*/
function submitStepExecuteDone(status: string, content: string) { function submitStepExecuteDone(status: string, content: string) {
// //
caseNodeAboveSelectStep.value.setData('resource', [executionResultMap[status].statusText, caseTag]).render(); caseNodeAboveSelectStep.value.setData('resource', [executionResultMap[status].statusText, caseTag]).render();
@ -645,6 +650,9 @@
}); });
caseNodeAboveSelectStep.value.layout(); caseNodeAboveSelectStep.value.layout();
} }
/**
* 步骤/用例执行
*/
async function submitStepExecute() { async function submitStepExecute() {
try { try {
submitStepExecuteLoading.value = true; submitStepExecuteLoading.value = true;
@ -655,7 +663,18 @@
id: caseNodeAboveSelectStep.value.data.id, id: caseNodeAboveSelectStep.value.data.id,
...executeForm.value, ...executeForm.value,
notifier: executeForm.value?.commentIds?.join(';'), notifier: executeForm.value?.commentIds?.join(';'),
stepsExecResult: JSON.stringify(stepData.value), stepsExecResult: JSON.stringify(
stepData.value.map((item, index) => {
return {
id: item.id,
num: index,
desc: item.step,
result: item.expected,
actualResult: item.actualResult,
executeResult: item.executeResult,
};
})
),
}; };
await runFeatureCase(params); await runFeatureCase(params);
stepExecuteModelVisible.value = false; stepExecuteModelVisible.value = false;
@ -748,7 +767,7 @@
// // // //
if ([actualResultTag, stepTag, stepExpectTag].some((item) => node.data?.resource?.includes(item))) { if ([actualResultTag, stepTag, stepExpectTag].some((item) => node.data?.resource?.includes(item))) {
caseNodeAboveSelectStep.value = getCaseNodeWithResource(node, stepTag); caseNodeAboveSelectStep.value = getCaseNodeWithResource(node, stepTag);
if (caseNodeAboveSelectStep.value.data.id) { if (caseNodeAboveSelectStep.value?.data?.id) {
getStepData(caseNodeAboveSelectStep.value.data.id); getStepData(caseNodeAboveSelectStep.value.data.id);
stepExecuteModelVisible.value = true; stepExecuteModelVisible.value = true;
} }