From 7c29efffa02eb2452bca97f29dbf4f065e7f8837 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 29 Jun 2023 19:44:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E6=8F=92=E4=BB=B6=E8=A2=AB=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=90=8E=E6=89=A7=E8=A1=8C=E7=9A=84=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1027473 --user=王孝刚 【接口测试】场景详情-插件被删除-单步骤调试-有时调试成功/有时提示调用资源池失败 https://www.tapd.cn/55049933/s/1388396 --- .../automation/scenario/EditApiScenario.vue | 6 ++-- .../scenario/component/PluginComponent.vue | 4 +++ .../assertion/ScenarioAssertions.vue | 30 ------------------- api-test/frontend/src/i18n/lang/en-US.js | 3 ++ api-test/frontend/src/i18n/lang/zh-CN.js | 3 ++ api-test/frontend/src/i18n/lang/zh-TW.js | 3 ++ 6 files changed, 16 insertions(+), 33 deletions(-) diff --git a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue index dd26fa1209..17ba6b3f02 100644 --- a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue +++ b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue @@ -1293,7 +1293,7 @@ export default { this.mergeScenario(this.scenarioDefinition); this.validatePluginData(this.scenarioDefinition); if (this.pluginDelStep) { - this.$error('场景包含插件步骤,对应场景已经删除不能执行!'); + this.$error(this.$t('automation.scenario_plugin_run_warning')); return; } /*触发执行操作*/ @@ -1755,7 +1755,7 @@ export default { this.validatePluginData(this.scenarioDefinition); if (this.pluginDelStep) { this.debugLoading = false; - this.$error('场景包含插件步骤,对应场景已经删除不能调试!'); + this.$error(this.$t('automation.scenario_plugin_run_warning')); this.clearResult(this.scenarioDefinition); this.clearNodeStatus(this.$refs.stepTree.root.childNodes); @@ -1899,7 +1899,7 @@ export default { } this.validatePluginData(this.scenarioDefinition); if (this.pluginDelStep) { - this.$error('场景包含插件步骤,对应场景已经删除不能编辑!'); + this.$error(this.$t('automation.scenario_plugin_save_warning')); return; } return new Promise((resolve) => { diff --git a/api-test/frontend/src/business/automation/scenario/component/PluginComponent.vue b/api-test/frontend/src/business/automation/scenario/component/PluginComponent.vue index 564c7cb0cd..8c406458e6 100644 --- a/api-test/frontend/src/business/automation/scenario/component/PluginComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/component/PluginComponent.vue @@ -368,6 +368,10 @@ export default { } }, run() { + if(this.request.plugin_del){ + this.$error(this.$t('automation.scenario_plugin_save_warning')); + return; + } this.request.debug = true; this.loading = true; this.runData = []; diff --git a/api-test/frontend/src/business/definition/components/assertion/ScenarioAssertions.vue b/api-test/frontend/src/business/definition/components/assertion/ScenarioAssertions.vue index d5b75517b0..f1e5d2ee92 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ScenarioAssertions.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ScenarioAssertions.vue @@ -176,37 +176,7 @@ export default { reloadData: '', }; }, - watch: { - assertions: { - handler(v) { - this.computeStep(); - }, - deep: true, - }, - }, methods: { - computeStep() { - let ruleSize = 0; - ruleSize = - this.assertions.jsonPath.length + - this.assertions.jsr223.length + - this.assertions.regex.length + - this.assertions.xpath2.length; - if ( - this.assertions && - this.assertions.document.data && - (this.assertions.document.data.json.length > 0 || this.assertions.document.data.xml.length > 0) - ) { - ruleSize++; - } - if (this.assertions.duration && this.assertions.duration.value > 0) { - ruleSize++; - } - ruleSize += this.assertions.text ? this.assertions.text.length : 0; - this.request.ruleSize = ruleSize; - this.$emit('reload'); - }, - after() { this.type = ''; this.reloadData = getUUID().substring(0, 8); diff --git a/api-test/frontend/src/i18n/lang/en-US.js b/api-test/frontend/src/i18n/lang/en-US.js index 6a0d7e842b..6c25ed9ba0 100644 --- a/api-test/frontend/src/i18n/lang/en-US.js +++ b/api-test/frontend/src/i18n/lang/en-US.js @@ -135,6 +135,9 @@ const message = { 'The current may cause page loading exceptions, whether to continue?', case_message: 'Please select a case', scenario_message: 'Please select a scene', + scenario_plugin_debug_warning: 'The scenario contains plugin steps, and the corresponding scenario has been deleted and cannot be debugged! ', + scenario_plugin_save_warning: 'The scene contains plugin steps, and the corresponding scene has been deleted and cannot be edited! ', + scenario_plugin_run_warning: 'The scenario contains plugin steps, and the corresponding scenario has been deleted and cannot be executed!', }, }; export default { diff --git a/api-test/frontend/src/i18n/lang/zh-CN.js b/api-test/frontend/src/i18n/lang/zh-CN.js index b695c13c32..9f94bcef98 100644 --- a/api-test/frontend/src/i18n/lang/zh-CN.js +++ b/api-test/frontend/src/i18n/lang/zh-CN.js @@ -130,6 +130,9 @@ const message = { scenario_step_ref_message: '当前操作可能导致页面加载异常,是否继续', case_message: '请选择案例', scenario_message: '请选择场景', + scenario_plugin_debug_warning: '场景包含插件步骤,对应场景已经删除不能调试!', + scenario_plugin_save_warning: '场景包含插件步骤,对应场景已经删除不能编辑!', + scenario_plugin_run_warning: '场景包含插件步骤,对应场景已经删除不能执行!', }, }; diff --git a/api-test/frontend/src/i18n/lang/zh-TW.js b/api-test/frontend/src/i18n/lang/zh-TW.js index 3ace8c717d..d5b0c6b881 100644 --- a/api-test/frontend/src/i18n/lang/zh-TW.js +++ b/api-test/frontend/src/i18n/lang/zh-TW.js @@ -130,6 +130,9 @@ const message = { scenario_step_ref_message: '當前操作可能導致頁面加載異常,是否繼續', case_message: '請選擇案例', scenario_message: '請選擇場景', + scenario_plugin_debug_warning:'場景包含挿件步驟,對應場景已經刪除不能調試! ', + scenario_plugin_save_warning: '場景包含挿件步驟,對應場景已經刪除不能編輯! ', + scenario_plugin_run_warning: '場景包含挿件步驟,對應場景已經刪除不能運行! ' }, };