From 55028ced8381754c2d6b52af561831ea6de979f5 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 31 Oct 2022 11:40:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E6=AD=A5=E9=AA=A4=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1017459 --user=赵勇 【接口测试】github#18262,接口自动化:引用了如图场景,然后自定义一个脚本,放到引用的场景里面去,发现只执行了引用的这个场景,自己自定义的脚本没有执行 https://www.tapd.cn/55049933/s/1283209 --- .../automation/scenario/EditApiScenario.vue | 13 +- .../component/ApiScenarioComponent.vue | 2 + .../scenario/component/LoopController.vue | 123 +++++++++++++++--- 3 files changed, 115 insertions(+), 23 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index c9d0d3ae1f..f10cab28b7 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -184,11 +184,13 @@ + @node-drag-end="nodeDragEnd" @node-click="nodeClick" draggable ref="stepTree" + :key="reloadTree"> @@ -1552,6 +1554,12 @@ export default { environmentConfigClose() { this.getEnvironments(); }, + allowDrag(node) { + if (node.data && node.data.disabled && node.parent.data && node.parent.data.disabled) { + return false; + } + return true; + }, allowDrop(draggingNode, dropNode, dropType) { if (draggingNode.data.type === 'Assertions' || dropNode.data.type === 'Assertions') { return false; @@ -1566,12 +1574,13 @@ export default { } return false; } else if (dropType === "inner" && dropNode.data.referenced !== 'REF' && dropNode.data.referenced !== 'Deleted' + && !dropNode.data.disabled && (this.stepFilter.get(dropNode.data.type) && this.stepFilter.get(dropNode.data.type).indexOf(draggingNode.data.type) != -1)) { return true; } return false; }, - allowDrag(draggingNode, dropNode, dropType) { + nodeDragEnd(draggingNode, dropNode, dropType) { if (dropNode && draggingNode && dropType) { this.sort(); this.forceRerender(); diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue index 5eabd31147..eb08188ab7 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue @@ -133,6 +133,7 @@ export default { this.isShowNum = this.scenario.num ? true : false; if (this.scenario.id && this.scenario.referenced === 'REF' && !this.scenario.loaded && this.scenario.hashTree) { this.scenario.root = this.node.parent.parent ? false : true; + this.scenario.disabled = true; this.recursive(this.scenario.hashTree, this.scenario.projectId, true); } }, @@ -233,6 +234,7 @@ export default { } } if (this.scenario && this.scenario.hashTree && this.node.expanded) { + this.scenario.disabled = true; this.recursive(this.scenario.hashTree, this.scenario.projectId, false); } this.reload(); diff --git a/frontend/src/business/components/api/automation/scenario/component/LoopController.vue b/frontend/src/business/components/api/automation/scenario/component/LoopController.vue index 36a80b38b1..1c7682ced2 100644 --- a/frontend/src/business/components/api/automation/scenario/component/LoopController.vue +++ b/frontend/src/business/components/api/automation/scenario/component/LoopController.vue @@ -1,23 +1,58 @@