fix(UI自动化): 修复UI报告,循环嵌套循环时报告显示顺序错误

--bug=1014053 --user=刘瑶 【UI测试】UI报告,循环里套循环的时候,报告显示顺序不是循环的顺序 https://www.tapd.cn/55049933/s/1182950
This commit is contained in:
nathan.liu 2022-06-15 17:14:46 +08:00 committed by 刘瑞斌
parent dac8d7c0ec
commit 8e0e42775c
3 changed files with 28 additions and 3 deletions

@ -1 +1 @@
Subproject commit e9dee3df2b87f216afdbd647c5a3e9e257c9f0e9
Subproject commit f25adf66433ef097f110b09af9e5f9e25933a212

View File

@ -121,6 +121,7 @@ export default {
fullTreeNodes: [],
stepFilter: new STEP,
exportReportIsOk: false,
tempResult: [],
}
},
activated() {
@ -408,7 +409,14 @@ export default {
if (data.content) {
let report = JSON.parse(data.content);
this.content = report;
if(data.reportType === "UI_INDEPENDENT"){
this.tempResult = report.steps;
//
this.checkOrder(this.tempResult);
this.fullTreeNodes = this.tempResult;
}else{
this.fullTreeNodes = report.steps;
}
this.content.console = report.console;
this.content.error = report.error;
let successCount = (report.total - report.error - report.errorCode - report.unExecute);
@ -425,6 +433,23 @@ export default {
this.$warning(this.$t('commons.report_delete'));
}
},
checkOrder(origin){
if(!origin){
return;
}
if(origin.children && Array.isArray(origin.children)){
origin.children.sort((m,n)=>{
let mTime = m.value ? m.value.startTime ? m.value.startTime : 0 : 0;
let nTime = m.value ? n.value.startTime ? n.value.startTime : 0 : 0;
return mTime <= nTime;
})
origin.children.forEach(v => {
if(v.children){
this.checkOrder(v.children)
}
})
}
},
buildReport() {
if (this.report) {
if (this.isNotRunning) {

@ -1 +1 @@
Subproject commit a0ae979196ee8c9d152130b415df403ae80cae08
Subproject commit 9a499be8ea905306f4aae866ee94a05d9f150293