fix(接口测试): 修复单步调试结果不回显问题

【【接口测试】场景复制api-单步骤调试失败】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001026240

Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
fit2-zhao 2023-05-18 13:41:06 +08:00 committed by fit2-zhao
parent 59c12df020
commit d7ec497444
2 changed files with 22 additions and 13 deletions

View File

@ -1253,8 +1253,15 @@ export default {
} else {
this.reqError += 1;
}
this.runningEvaluation(e.data);
let hasRequest = this.runScenario && this.runScenario.hasRequest;
if (hasRequest && data && this.runScenario.hashTree) {
this.runScenario.hashTree[0].requestResult = [];
this.runScenario.hashTree[0].testing = false;
this.runScenario.hashTree[0].requestResult.push(data);
}
}
this.runningEvaluation(e.data);
this.message = getUUID();
if (e.data && e.data.indexOf('MS_TEST_END') !== -1) {
this.runScenario = undefined;
@ -1738,7 +1745,10 @@ export default {
return;
}
this.clearResult(this.scenarioDefinition);
this.clearNodeStatus(this.$refs.stepTree.root.childNodes);
let hasRequest = runScenario && runScenario.hasRequest;
if (!hasRequest) {
this.clearNodeStatus(this.$refs.stepTree.root.childNodes);
}
this.saved = runScenario && runScenario.stepScenario ? false : true;
/*触发执行操作*/
this.$refs.currentScenario.validate(async (valid) => {
@ -1880,8 +1890,8 @@ export default {
}
}
this.isPreventReClick = true;
if (this.currentScenario.scenarioDefinitionOrg){
delete this.currentScenario['scenarioDefinitionOrg'];
if (this.currentScenario.scenarioDefinitionOrg) {
delete this.currentScenario['scenarioDefinitionOrg'];
}
this.currentScenario.name = this.currentScenario.name.trim();
await saveScenario(this.path, this.currentScenario, this.scenarioDefinition, this, (response) => {
@ -2018,7 +2028,7 @@ export default {
}
this.dataProcessing(obj.hashTree);
this.scenarioDefinition = obj.hashTree;
this.$nextTick(()=>{
this.$nextTick(() => {
let data = this.scenarioDefinition;
if (data.hashTree) {
this.sort(data.hashTree);
@ -2027,7 +2037,7 @@ export default {
this.margeDomain(this.scenarioDefinition, domainMap);
this.cancelBatchProcessing();
}
})
});
}
}
if (this.currentScenario.copy) {

View File

@ -81,7 +81,7 @@
</span>
</template>
<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="!request.testing">
<el-button
:disabled="!request.enable"
@click="run"
@ -264,10 +264,10 @@ export default {
this.request.projectId = getCurrentProjectID();
}
this.request.customizeReq = this.isCustomizeReq;
if (this.request.customizeReq) {
if (this.request.customizeReq) {
if (this.node.parent && this.node.parent.data && this.node.parent.data.length > 1) {
this.request.projectId = getCurrentProjectID();
}else {
} else {
this.request.projectId =
this.node.parent.data instanceof Array ? this.node.parent.data[0].projectId : this.node.parent.data.projectId;
}
@ -511,6 +511,8 @@ export default {
this.reportId = getUUID();
debugData.hashTree = [this.request];
debugData.stepScenario = true;
debugData.hasRequest = true;
this.request.testing = true;
this.$emit('runScenario', debugData);
}
});
@ -527,10 +529,7 @@ export default {
}
},
stop() {
execStop(this.reportId).then(() => {
this.loading = false;
this.$success(this.$t('report.test_stop_success'));
});
this.$emit('stopScenario');
},
errorRefresh() {
this.loading = false;