From 7df2186a958afcc1547ba5cabfe498ebd70bab8b Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 18 May 2022 19:08:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=85=A5jmx=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E8=AF=B7=E6=B1=82=E7=8E=AF=E5=A2=83=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1013259 --user=赵勇 接口测试-接口自动化导入jmx文件,导入生成的自定义请求中已包含域名,在场景调试时无需选择环境 https://www.tapd.cn/55049933/s/1160003 --- .../api/exec/scenario/ApiScenarioEnvService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java b/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java index b8b10f1d0f..ae18483898 100644 --- a/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java +++ b/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java @@ -133,11 +133,15 @@ public class ApiScenarioEnvService { if (StringUtils.equals(testElement.getType(), "HTTPSamplerProxy")) { // 校验是否是全路径 MsHTTPSamplerProxy httpSamplerProxy = (MsHTTPSamplerProxy) testElement; - if (!StringUtils.equalsIgnoreCase(httpSamplerProxy.getReferenced(), "Created") || (httpSamplerProxy.getIsRefEnvironment() != null && + if (httpSamplerProxy.isCustomizeReq()) { + env.getProjectIds().add(httpSamplerProxy.getProjectId()); + env.setFullUrl(httpSamplerProxy.getIsRefEnvironment() == null ? true : httpSamplerProxy.getIsRefEnvironment()); + } else if (!StringUtils.equalsIgnoreCase(httpSamplerProxy.getReferenced(), "Created") || (httpSamplerProxy.getIsRefEnvironment() != null && httpSamplerProxy.getIsRefEnvironment())) { env.getProjectIds().add(httpSamplerProxy.getProjectId()); - env.setFullUrl(httpSamplerProxy.getIsRefEnvironment() == null ? true : false); + env.setFullUrl(false); } + } else if (StringUtils.equals(testElement.getType(), "JDBCSampler") || StringUtils.equals(testElement.getType(), "TCPSampler")) { env.getProjectIds().add(testElement.getProjectId()); env.setFullUrl(false);