fix(UI 自动化): 导入新增的ide文件,执行查看报告步骤没有国际化

--bug=1013819 --user=张大海 【UI测试】导入side文件,直接执行,步骤名称显示错误 https://www.tapd.cn/55049933/s/1175220
This commit is contained in:
zhangdahai112 2022-06-07 16:57:57 +08:00 committed by zhangdahai112
parent 4636c693ce
commit d761cde14f
1 changed files with 26 additions and 1 deletions

View File

@ -184,6 +184,9 @@ export default {
hashTree.forEach(item => {
if (item.enable) {
item.parentIndex = fullPath ? fullPath + "_" + item.index : item.index;
if (item.command === item.name) {
item.name = this.$t("ui." + item.name);
}
let name = item.name ? item.name : this.getType(item.type);
let id = item.type === 'JSR223Processor' || !item.id ? item.resourceId : item.id
let obj = {
@ -311,7 +314,8 @@ export default {
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.resetLabel(this.content.steps);
this.fullTreeNodes = this.content.steps
this.recursiveSorting(this.fullTreeNodes);
this.reload();
}
@ -402,6 +406,27 @@ export default {
}
}
},
/**
*
* @param hashTree
*/
resetLabel(hashTree) {
if (!hashTree || !hashTree.length) {
return;
}
for (let i = 0; i < hashTree.length; i++) {
if (hashTree[i].type && hashTree[i].type === 'MsUiCommand') {
let label = this.$t("ui." + hashTree[i].label) ? this.$t("ui." + hashTree[i].label) : hashTree[i].label;
if (label.indexOf("ui") == -1) {
hashTree[i].label = label;
}
} else if (hashTree[i].type && hashTree[i].type === 'UiScenario') {
if (hashTree[i].children) {
this.resetLabel(hashTree[i].children);
}
}
}
}
},
computed: {
projectId() {