fix(接口测试): 修复场景步骤调试禁用状态还能执行问题

--bug=1010372 --user=赵勇 【github#10695】接口自动化-场景里面,把接口关闭再调试,会一直loading https://www.tapd.cn/55049933/s/1105546
This commit is contained in:
fit2-zhao 2022-02-18 10:20:50 +08:00 committed by fit2-zhao
parent 2e44835dcb
commit c58ba88665
7 changed files with 18 additions and 1 deletions

View File

@ -1190,6 +1190,7 @@ export default {
const index = hashTree.findIndex(d => d.resourceId !== undefined && row.resourceId !== undefined && d.resourceId === row.resourceId) const index = hashTree.findIndex(d => d.resourceId !== undefined && row.resourceId !== undefined && d.resourceId === row.resourceId)
hashTree.splice(index, 1); hashTree.splice(index, 1);
this.sort(); this.sort();
this.showHide();
} }
} }
}); });
@ -1351,6 +1352,7 @@ export default {
allowDrag(draggingNode, dropNode, dropType) { allowDrag(draggingNode, dropNode, dropType) {
if (dropNode && draggingNode && dropType) { if (dropNode && draggingNode && dropType) {
this.sort(); this.sort();
this.showHide();
} }
}, },
nodeExpand(data, node) { nodeExpand(data, node) {

View File

@ -58,7 +58,7 @@
</template> </template>
<template v-slot:button v-if="!ifFromVariableAdvance"> <template v-slot:button v-if="!ifFromVariableAdvance">
<el-tooltip :content="$t('api_test.run')" placement="top" v-if="!loading"> <el-tooltip :content="$t('api_test.run')" placement="top" v-if="!loading">
<el-button @click="run" icon="el-icon-video-play" style="padding: 5px" class="ms-btn" size="mini" circle/> <el-button :disabled="!request.enable" @click="run" icon="el-icon-video-play" style="padding: 5px" class="ms-btn" size="mini" circle/>
</el-tooltip> </el-tooltip>
<el-tooltip :content="$t('report.stop_btn')" placement="top" :enterable="false" v-else> <el-tooltip :content="$t('report.stop_btn')" placement="top" :enterable="false" v-else>
<el-button @click.once="stop" size="mini" style="color:white;padding: 0 0.1px;width: 24px;height: 24px;" <el-button @click.once="stop" size="mini" style="color:white;padding: 0 0.1px;width: 24px;height: 24px;"
@ -634,6 +634,10 @@ export default {
} }
} }
} }
if(!this.request.enable){
this.$warning(this.$t('api_test.automation.debug_message'));
return false;
}
this.request.debug = true; this.request.debug = true;
this.request.active = true; this.request.active = true;
this.loading = true; this.loading = true;

View File

@ -149,6 +149,10 @@ export default {
}, },
methods: { methods: {
run() { run() {
if(!this.scenario.enable){
this.$warning(this.$t('api_test.automation.debug_message'));
return;
}
this.scenario.run = true; this.scenario.run = true;
let runScenario = JSON.parse(JSON.stringify(this.scenario)); let runScenario = JSON.parse(JSON.stringify(this.scenario));
runScenario.hashTree = [this.scenario]; runScenario.hashTree = [this.scenario];

View File

@ -254,6 +254,10 @@ export default {
this.$warning("当前循环下没有请求,不能执行"); this.$warning("当前循环下没有请求,不能执行");
return; return;
} }
if(!this.controller.enable){
this.$warning(this.$t('api_test.automation.debug_message'));
return;
}
this.loading = true; this.loading = true;
this.debugData = { this.debugData = {
id: this.currentScenario.id, id: this.currentScenario.id,

View File

@ -1382,6 +1382,7 @@ export default {
loop_input_val: "Variable prefix", loop_input_val: "Variable prefix",
loop_message: "There is more than one request in the current cycle and cannot be closed", loop_message: "There is more than one request in the current cycle and cannot be closed",
env_message: "Please select the operating environment for the project to which this step belongs in the environment configuration", env_message: "Please select the operating environment for the project to which this step belongs in the environment configuration",
debug_message: "The current step is disabled and cannot be debugged",
request_total: "request", request_total: "request",
request_success: "success", request_success: "success",
request_error: "error", request_error: "error",

View File

@ -1387,6 +1387,7 @@ export default {
loop_input_val: "变量前缀", loop_input_val: "变量前缀",
loop_message: "当前循环下超过一个请求,不能关闭状态", loop_message: "当前循环下超过一个请求,不能关闭状态",
env_message: "请在环境配置中为该步骤所属项目选择运行环境", env_message: "请在环境配置中为该步骤所属项目选择运行环境",
debug_message: "当前步骤是禁用状态不能调试",
request_total: "请求", request_total: "请求",
request_success: "成功", request_success: "成功",
request_error: "失败", request_error: "失败",

View File

@ -1387,6 +1387,7 @@ export default {
loop_input_val: "變量前綴", loop_input_val: "變量前綴",
loop_message: "當前循環下超過一個請求,不能關閉狀態", loop_message: "當前循環下超過一個請求,不能關閉狀態",
env_message: "請在環境配置中為該步驟所屬項目選擇運行環境", env_message: "請在環境配置中為該步驟所屬項目選擇運行環境",
debug_message: "當前步驟是禁用狀態不能調試",
request_total: "請求", request_total: "請求",
request_success: "成功", request_success: "成功",
request_error: "失敗", request_error: "失敗",