fix(接口测试): 修复场景删除复制的case,别的步骤的断言和前后置操作也被删除的缺陷
--bug=1020598 --user=王孝刚 [接口测试] #20354批量勾选一个场景里面的多个case,做批量删除,会把剩余case的后置脚本和断言清空(特殊场景) https://www.tapd.cn/55049933/s/1313090
This commit is contained in:
parent
127a973af6
commit
62b492e468
|
@ -2332,6 +2332,12 @@ export default {
|
|||
}
|
||||
return [];
|
||||
},
|
||||
getAllCheckedNodes() {
|
||||
if (this.$refs.stepTree) {
|
||||
return this.$refs.stepTree.getCheckedNodes();
|
||||
}
|
||||
return [];
|
||||
},
|
||||
checkALevelChecked() {
|
||||
let resourceIds = [];
|
||||
if (this.$refs.stepTree) {
|
||||
|
@ -2404,7 +2410,7 @@ export default {
|
|||
confirmButtonText: this.$t('commons.confirm'),
|
||||
callback: (action) => {
|
||||
if (action === 'confirm') {
|
||||
this.getAllResourceIds().forEach((item) => {
|
||||
this.getAllCheckedNodes().forEach((item) => {
|
||||
this.recursionDelete(item, this.scenarioDefinition);
|
||||
});
|
||||
this.sort();
|
||||
|
@ -2417,14 +2423,15 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
recursionDelete(resourceId, nodes) {
|
||||
recursionDelete(item, nodes) {
|
||||
for (let i in nodes) {
|
||||
if (nodes[i]) {
|
||||
if (resourceId === nodes[i].resourceId) {
|
||||
//复制的case的断言的resourceId是一样的,所以要加上parentIndex做唯一标识
|
||||
if (item.resourceId === nodes[i].resourceId && item.parentIndex === nodes[i].parentIndex) {
|
||||
nodes.splice(i, 1);
|
||||
} else {
|
||||
if (nodes[i].hashTree != undefined && nodes[i].hashTree.length > 0) {
|
||||
this.recursionDelete(resourceId, nodes[i].hashTree);
|
||||
this.recursionDelete(item, nodes[i].hashTree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue