From 901fb098b182bc088d6a52ca03a98e115860ba44 Mon Sep 17 00:00:00 2001 From: "nathan.liu" Date: Wed, 15 Jun 2022 16:56:21 +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?=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 | 28 +++++++++++++++++-- frontend/src/business/components/xpack | 2 +- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index e9dee3df2b..4ac3f8294a 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit e9dee3df2b87f216afdbd647c5a3e9e257c9f0e9 +Subproject commit 4ac3f8294a9b432398dce7c3e84be2fcacb07d7c diff --git a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue index eaf2527f3f..f631fa2564 100644 --- a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue +++ b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue @@ -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) { diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index a0ae979196..b946a7eef6 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit a0ae979196ee8c9d152130b415df403ae80cae08 +Subproject commit b946a7eef6e682b10ae8b49445e398c28aa50cb2