fix(测试计划): 执行脑图-用例的实际结果只更新不新增
This commit is contained in:
parent
d44c59b80f
commit
97e38804a8
|
@ -543,21 +543,13 @@
|
||||||
|
|
||||||
// 执行
|
// 执行
|
||||||
const executeVisible = ref(false);
|
const executeVisible = ref(false);
|
||||||
// 新增或更新用例的实际结果节点
|
// 更新用例的实际结果节点
|
||||||
function updateCaseActualResultNode(node: MinderJsonNode, content: string) {
|
function updateCaseActualResultNode(node: MinderJsonNode, content: string) {
|
||||||
let actualResultNode;
|
const actualResultNode = node.children?.find((item: MinderJsonNode) =>
|
||||||
actualResultNode = node.children?.find((item: MinderJsonNode) => item.data?.id === `actualResult-${node.data?.id}`);
|
item.data?.resource?.includes(actualResultTag)
|
||||||
|
);
|
||||||
if (actualResultNode) {
|
if (actualResultNode) {
|
||||||
actualResultNode
|
actualResultNode.setData('text', content ?? '').render();
|
||||||
.setData('resource', [actualResultTag])
|
|
||||||
.setData('text', content ?? '')
|
|
||||||
.render();
|
|
||||||
} else {
|
|
||||||
actualResultNode = createNode(
|
|
||||||
{ resource: [actualResultTag], text: content ?? '', id: `actualResult-${node.data?.id}` },
|
|
||||||
node
|
|
||||||
);
|
|
||||||
handleRenderNode(node, [actualResultNode]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 点击模块/用例执行
|
// 点击模块/用例执行
|
||||||
|
@ -567,7 +559,7 @@
|
||||||
if (resource?.includes(caseTag)) {
|
if (resource?.includes(caseTag)) {
|
||||||
// 用例添加标签
|
// 用例添加标签
|
||||||
window.minder.execCommand('resource', [executionResultMap[status].statusText, caseTag]);
|
window.minder.execCommand('resource', [executionResultMap[status].statusText, caseTag]);
|
||||||
// 新增或更新用例的实际结果节点
|
// 更新用例的实际结果节点
|
||||||
updateCaseActualResultNode(selectNode.value, content);
|
updateCaseActualResultNode(selectNode.value, content);
|
||||||
// 更新执行历史
|
// 更新执行历史
|
||||||
if (extraVisible.value && activeExtraKey.value === 'history') {
|
if (extraVisible.value && activeExtraKey.value === 'history') {
|
||||||
|
@ -638,7 +630,7 @@
|
||||||
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();
|
||||||
// 新增或更新用例的实际结果节点
|
// 更新用例的实际结果节点
|
||||||
updateCaseActualResultNode(caseNodeAboveSelectStep.value, content);
|
updateCaseActualResultNode(caseNodeAboveSelectStep.value, content);
|
||||||
// 更新步骤数据:标签和实际结果
|
// 更新步骤数据:标签和实际结果
|
||||||
caseNodeAboveSelectStep.value.children.forEach((child: MinderJsonNode) => {
|
caseNodeAboveSelectStep.value.children.forEach((child: MinderJsonNode) => {
|
||||||
|
|
Loading…
Reference in New Issue