fix(接口测试): 修复大场景实时生成报告数据不显示问题

--bug=1019898 --user=赵勇 【接口测试】禁用本地执行,使用k8s资源池执行接口后,场景中调试/生成报告场景失败 https://www.tapd.cn/55049933/s/1304454
This commit is contained in:
fit2-zhao 2022-11-24 14:17:55 +08:00 committed by fit2-zhao
parent a3e15b8524
commit ee6a1fd245
1 changed files with 21 additions and 17 deletions

View File

@ -347,24 +347,28 @@ export default {
getScenarioReport(this.reportId).then((response) => {
this.report = response.data || {};
if (response.data) {
this.content = JSON.parse(response.data.content);
if (!this.content) {
this.content = { scenarios: [] };
}
if (this.content.projectEnvMap) {
this.projectEnvMap = this.content.projectEnvMap;
}
this.content.error = this.content ? this.content.error : '';
if (response.data.status === 'RUNNING') {
setTimeout(this.getReport, 2000);
} else {
this.content = JSON.parse(response.data.content);
if (!this.content) {
this.content = { scenarios: [] };
}
if (this.content.projectEnvMap) {
this.projectEnvMap = this.content.projectEnvMap;
}
this.content.error = this.content ? this.content.error : '';
this.content.success =
this.content.total - this.content.error - this.content.errorCode - this.content.unExecute;
this.totalTime = this.content.totalTime;
this.fullTreeNodes = this.content.steps;
this.recursiveSorting(this.fullTreeNodes);
this.reload();
}
if ('Running' !== this.report.status) {
this.$emit('finish');
this.content.success =
this.content.total - this.content.error - this.content.errorCode - this.content.unExecute;
this.totalTime = this.content.totalTime;
this.fullTreeNodes = this.content.steps;
this.recursiveSorting(this.fullTreeNodes);
this.reload();
}
if ('Running' !== this.report.status) {
this.$emit('finish');
}
}
});
},