From 44fc67f70ccac2abf4e0563a2286084c3f14c5d7 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 4 Jul 2022 11:42:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E6=8A=A5=E5=91=8A=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=97=B6=E8=AF=AF=E6=8A=A5=E4=BF=A1=E6=81=AF=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1014516 --user=王孝刚 【接口测试】场景报告-查看详情-导出报告,中间的步骤统计没有误报 https://www.tapd.cn/55049933/s/1193718 --- .../api/service/ApiScenarioReportStructureService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java index 8ff660716c..d02831a0a6 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java @@ -258,17 +258,20 @@ public class ApiScenarioReportStructureService { dto.setValue(requestResultExpandDTO); dto.setErrorCode(reportResults.get(0).getErrorCode()); } + dto.setTotalStatus(reportResult.getStatus()); } else { if (reportResult.getContent() != null) { StepTreeDTO step = new StepTreeDTO(dto.getLabel(), UUID.randomUUID().toString(), dto.getType(), reportResults.get(i).getId(), (i + 1)); step.setValue(JSON.parseObject(new String(reportResults.get(i).getContent(), StandardCharsets.UTF_8), RequestResult.class)); step.setErrorCode(reportResults.get(i).getErrorCode()); + step.setTotalStatus(reportResults.get(i).getStatus()); dtoList.add(step); } else { StepTreeDTO step = new StepTreeDTO(dto.getLabel(), UUID.randomUUID().toString(), dto.getType(), reportResults.get(i).getId(), (i + 1)); RequestResultExpandDTO requestResultExpandDTO = new RequestResultExpandDTO(reportResult); step.setValue(requestResultExpandDTO); step.setErrorCode(reportResults.get(i).getErrorCode()); + step.setTotalStatus(reportResults.get(i).getStatus()); dtoList.add(step); } } @@ -286,6 +289,7 @@ public class ApiScenarioReportStructureService { dto.setErrorCode(reportResults.get(0).getErrorCode()); dto.setTotalStatus(requestResultExpandDTO.getStatus()); } + dto.setTotalStatus(reportResult.getStatus()); } } if (StringUtils.isNotEmpty(dto.getType()) && requests.contains(dto.getType()) && dto.getValue() == null || isUiUnExecuteCommand(dto)) { @@ -303,7 +307,7 @@ public class ApiScenarioReportStructureService { } else { if (dto.getValue() instanceof RequestResultExpandDTO && StringUtils.isNotEmpty(((RequestResultExpandDTO) dto.getValue()).getStatus())) { dto.setTotalStatus(((RequestResultExpandDTO) dto.getValue()).getStatus()); - } else if (dto.getValue() != null) { + } else if (dto.getValue() != null && StringUtils.isEmpty(dto.getTotalStatus())) { if (dto.getValue().getError() > 0 || BooleanUtils.isNotTrue(dto.getValue().isSuccess())) { dto.setTotalStatus("fail"); } else {