refactor(接口测试): 优化插件被删除后执行的提示信息

--bug=1027473 --user=王孝刚 【接口测试】场景详情-插件被删除-单步骤调试-有时调试成功/有时提示调用资源池失败
https://www.tapd.cn/55049933/s/1388396
This commit is contained in:
wxg0103 2023-06-29 19:44:08 +08:00 committed by fit2-zhao
parent 475fda0d79
commit 7c29efffa0
6 changed files with 16 additions and 33 deletions

View File

@ -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) => {

View File

@ -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 = [];

View File

@ -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);

View File

@ -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 {

View File

@ -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: '场景包含插件步骤,对应场景已经删除不能执行!',
},
};

View File

@ -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: '場景包含挿件步驟,對應場景已經刪除不能運行! '
},
};