fix(接口测试): 修复复制的场景无法添加断言的缺陷

--bug=1013423 --user=王孝刚
【接口测试】场景中A存在引用/复制场景B-在场景中A中添加场景断言后-在引用/复制场景B中添加场景断言-添加失败
https://www.tapd.cn/55049933/s/1164041
This commit is contained in:
wxg0103 2022-05-25 17:25:30 +08:00 committed by f2c-ci-robot[bot]
parent 5040e2aa5e
commit 0ac2c9c595
1 changed files with 38 additions and 21 deletions

View File

@ -229,6 +229,7 @@
@setDomain="setDomain"
@openScenario="openScenario"
@editScenarioAdvance="editScenarioAdvance"
ref="componentConfig"
v-if="stepFilter.get('ALlSamplerStep').indexOf(data.type) ===-1
|| (!node.parent || !node.parent.data || stepFilter.get('AllSamplerProxy').indexOf(node.parent.data.type) === -1)"
/>
@ -1143,35 +1144,51 @@ export default {
}
}
},
scenarioAssertion(type, plugin, isAssertions, data) {
let isChildren = true;
if (!data) {
data = this.scenarioDefinition;
isChildren = false;
}
data.forEach(item => {
if (item.type === type) {
item.active = true;
item.scenarioAss = true;
isAssertions = true;
}
if (!isChildren) {
this.reloadTree = getUUID();
}
})
if (!isAssertions) {
setComponent(type, this, plugin);
for (let i in data) {
if (data[i].type === "Assertions") {
data[i].active = true;
data[i].scenarioAss = true;
let assertions = data[i];
data.splice(i, 1);
data.unshift(assertions);
this.sort();
}
}
}
},
addComponent(type, plugin) {
let isAssertions = false;
if (type === 'Assertions') {
this.scenarioDefinition.forEach(item => {
if (item.type === type) {
item.active = true;
item.scenarioAss = true;
isAssertions = true;
this.reloadTree = getUUID();
}
})
if (!isAssertions) {
setComponent(type, this, plugin);
for (let i in this.scenarioDefinition) {
if (this.scenarioDefinition[i].type === "Assertions") {
this.scenarioDefinition[i].active = true;
this.scenarioDefinition[i].scenarioAss = true;
let assertions = this.scenarioDefinition[i];
this.scenarioDefinition.splice(i, 1);
this.scenarioDefinition.unshift(assertions);
this.sort();
}
}
if (this.selectedTreeNode !== undefined && this.selectedTreeNode.type === 'scenario' && this.selectedTreeNode.referenced === 'Copy') {
this.selectedTreeNode.active = true;
this.scenarioAssertion(type, plugin, isAssertions, this.selectedTreeNode.hashTree);
this.selectedNode.expanded = true;
this.cancelBatchProcessing();
} else {
this.scenarioAssertion(type, plugin, isAssertions);
}
} else {
setComponent(type, this, plugin);
}
},
nodeClick(data, node) {
if ((data.referenced != 'REF' && data.referenced != 'Deleted' && !data.disabled && this.stepFilter) || data.refType === 'CASE') {
this.operatingElements = this.stepFilter.get(data.type);