From 8e0e42775ccada75254a734fea0a927da617aae2 Mon Sep 17 00:00:00 2001 From: "nathan.liu" Date: Wed, 15 Jun 2022 17:14:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(UI=E8=87=AA=E5=8A=A8=E5=8C=96):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DUI=E6=8A=A5=E5=91=8A=EF=BC=8C=E5=BE=AA=E7=8E=AF?= =?UTF-8?q?=E5=B5=8C=E5=A5=97=E5=BE=AA=E7=8E=AF=E6=97=B6=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=A1=BA=E5=BA=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1014053 --user=刘瑶 【UI测试】UI报告,循环里套循环的时候,报告显示顺序不是循环的顺序 https://www.tapd.cn/55049933/s/1182950 --- backend/src/main/java/io/metersphere/xpack | 2 +- .../api/automation/report/ApiReportDetail.vue | 27 ++++++++++++++++++- frontend/src/business/components/xpack | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index e9dee3df2b..f25adf6643 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit e9dee3df2b87f216afdbd647c5a3e9e257c9f0e9 +Subproject commit f25adf66433ef097f110b09af9e5f9e25933a212 diff --git a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue index 6ae48f0cf3..fb814848dd 100644 --- a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue +++ b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue @@ -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; - 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); @@ -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) { diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index a0ae979196..9a499be8ea 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit a0ae979196ee8c9d152130b415df403ae80cae08 +Subproject commit 9a499be8ea905306f4aae866ee94a05d9f150293