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 16:56:21 +08:00 committed by 刘瑞斌
parent 590c96178e
commit 901fb098b1
3 changed files with 28 additions and 4 deletions

@ -1 +1 @@
Subproject commit e9dee3df2b87f216afdbd647c5a3e9e257c9f0e9
Subproject commit 4ac3f8294a9b432398dce7c3e84be2fcacb07d7c

View File

@ -149,6 +149,7 @@
showRerunButton: false,
stepFilter: new STEP,
exportReportIsOk: false,
tempResult: [],
}
},
activated() {
@ -452,7 +453,14 @@
if (data.content) {
let report = JSON.parse(data.content);
this.content = report;
this.fullTreeNodes = report.steps;
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);
@ -473,7 +481,23 @@
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 b946a7eef6e682b10ae8b49445e398c28aa50cb2