From 5b42f01b80697f6ccca98906780d995c59fdfe3f Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Wed, 26 May 2021 17:06:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=8B=E5=8A=A1=E6=8E=A7=E5=88=B6=E5=99=A8=E5=90=8E=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E7=BB=9F=E8=AE=A1=E6=9C=89=E9=97=AE=E9=A2=98=E3=80=81?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E5=AF=BC=E5=85=A5har=E4=B8=8D=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复添加事务控制器后场景统计有问题、场景导入har不成功的问题 --- .../src/main/java/io/metersphere/api/jmeter/TestResult.java | 5 +++++ .../io/metersphere/api/parse/HarScenarioAbstractParser.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java b/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java index 085337e0af..62c5328908 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java @@ -90,6 +90,10 @@ public class TestResult { if (StringUtils.isNotEmpty(subItem.getName()) && subItem.getName().indexOf(SEPARATOR) != -1) { String array[] = subItem.getName().split(SEPARATOR); subItem.setName(array[0]); + if (StringUtils.isNotEmpty(subItem.getScenario())) { + List id_names = JSON.parseObject(subItem.getScenario(), List.class); + this.setStatus(id_names, subItem.getError() > 0); + } } }); } @@ -104,5 +108,6 @@ public class TestResult { } } this.setScenarioTotal(this.margeScenariMap.size()); + } } diff --git a/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java b/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java index 17bec09638..a34c804f6c 100644 --- a/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java +++ b/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java @@ -65,6 +65,8 @@ public abstract class HarScenarioAbstractParser extends ApiImportAbstractPars HarPostData content = requestBody.postData; if (!StringUtils.equalsIgnoreCase("GET", requestBody.method) && requestBody.postData == null) { return; + }else if(requestBody.postData == null){ + return; } String contentType = content.mimeType; if (StringUtils.isEmpty(contentType)) {