diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsScenarioParser.java b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsScenarioParser.java index bd7be133f0..5c3a1e164e 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsScenarioParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsScenarioParser.java @@ -61,7 +61,7 @@ public class MsScenarioParser extends MsAbstractParser { } private ScenarioImport parseMsFormat(String testStr, ApiTestImportRequest importRequest) { - ScenarioImport scenarioImport = JSON.parseObject(testStr, ScenarioImport.class,Feature.DisableSpecialKeyDetect); + ScenarioImport scenarioImport = JSON.parseObject(testStr, ScenarioImport.class, Feature.DisableSpecialKeyDetect); List data = scenarioImport.getData(); Set moduleIdSet = scenarioImport.getData().stream() @@ -80,7 +80,7 @@ public class MsScenarioParser extends MsAbstractParser { data.forEach(item -> { String scenarioDefinitionStr = item.getScenarioDefinition(); if (StringUtils.isNotBlank(scenarioDefinitionStr)) { - JSONObject scenarioDefinition = JSONObject.parseObject(scenarioDefinitionStr); + JSONObject scenarioDefinition = JSONObject.parseObject(scenarioDefinitionStr, Feature.DisableSpecialKeyDetect); if (scenarioDefinition != null) { JSONObject environmentMap = scenarioDefinition.getJSONObject("environmentMap"); if (environmentMap != null) { diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/parse/MsDefinitionParser.java b/backend/src/main/java/io/metersphere/api/dto/definition/parse/MsDefinitionParser.java index 28c136f386..25269fae5d 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/parse/MsDefinitionParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/parse/MsDefinitionParser.java @@ -121,7 +121,7 @@ public class MsDefinitionParser extends MsAbstractParser { apiDefinition.setProjectId(this.projectId); String request = apiDefinition.getRequest(); - JSONObject requestObj = JSONObject.parseObject(request); + JSONObject requestObj = JSONObject.parseObject(request, Feature.DisableSpecialKeyDetect); if(requestObj.get("projectId")!=null){ requestObj.put("projectId", apiDefinition.getProjectId()); } @@ -148,7 +148,7 @@ public class MsDefinitionParser extends MsAbstractParser { } cases.forEach(item -> { String request = item.getRequest(); - JSONObject requestObj = JSONObject.parseObject(request); + JSONObject requestObj = JSONObject.parseObject(request, Feature.DisableSpecialKeyDetect); requestObj.put("useEnvironment", ""); item.setRequest(JSONObject.toJSONString(requestObj)); item.setApiDefinitionId(apiDefinition.getId()); 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 01a5e60913..ed47cf6e51 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 @@ -233,7 +233,7 @@ public class ApiScenarioEnvService { environmentType = EnvironmentType.JSON.toString(); } String definition = apiScenarioWithBLOBs.getScenarioDefinition(); - MsScenario scenario = JSONObject.parseObject(definition, MsScenario.class); + MsScenario scenario = JSONObject.parseObject(definition, MsScenario.class, Feature.DisableSpecialKeyDetect); GenerateHashTreeUtil.parse(definition, scenario); if (StringUtils.equals(environmentType, EnvironmentType.JSON.toString())) { scenario.setEnvironmentMap(JSON.parseObject(environmentJson, Map.class)); @@ -251,7 +251,7 @@ public class ApiScenarioEnvService { boolean isEnv = true; if (apiScenarioWithBLOBs != null) { String definition = apiScenarioWithBLOBs.getScenarioDefinition(); - MsScenario scenario = JSONObject.parseObject(definition, MsScenario.class); + MsScenario scenario = JSONObject.parseObject(definition, MsScenario.class, Feature.DisableSpecialKeyDetect); Map envMap = scenario.getEnvironmentMap(); if (testPlanApiScenarios != null) { String envType = testPlanApiScenarios.getEnvironmentType(); diff --git a/backend/src/main/java/io/metersphere/api/exec/utils/GenerateHashTreeUtil.java b/backend/src/main/java/io/metersphere/api/exec/utils/GenerateHashTreeUtil.java index d881bd0820..f6d2acdd54 100644 --- a/backend/src/main/java/io/metersphere/api/exec/utils/GenerateHashTreeUtil.java +++ b/backend/src/main/java/io/metersphere/api/exec/utils/GenerateHashTreeUtil.java @@ -126,7 +126,7 @@ public class GenerateHashTreeUtil { MsThreadGroup group = new MsThreadGroup(); group.setLabel(item.getName()); group.setName(runRequest.getReportId()); - MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class); + MsScenario scenario = JSONObject.parseObject(item.getScenarioDefinition(), MsScenario.class, Feature.DisableSpecialKeyDetect); group.setOnSampleError(scenario.getOnSampleError()); if (planEnvMap != null && planEnvMap.size() > 0) { scenario.setEnvironmentMap(planEnvMap); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 27913c0cd6..c038586623 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -699,6 +699,35 @@ public class ApiAutomationService { return scenarioWithBLOBs; } + private static JSONObject jsonMerge(JSONObject source, JSONObject target) { + // 覆盖目标JSON为空,直接返回覆盖源 + if (target == null) { + return source; + } + for (String key : source.keySet()) { + Object value = source.get(key); + if (!target.containsKey(key)) { + target.put(key, value); + } else { + if (value instanceof JSONObject) { + JSONObject valueJson = (JSONObject) value; + JSONObject targetValue = jsonMerge(valueJson, target.getJSONObject(key)); + target.put(key, targetValue); + } else if (value instanceof JSONArray) { + JSONArray valueArray = (JSONArray) value; + for (int i = 0; i < valueArray.size(); i++) { + JSONObject obj = (JSONObject) valueArray.get(i); + JSONObject targetValue = jsonMerge(obj, (JSONObject) target.getJSONArray(key).get(i)); + target.getJSONArray(key).set(i, targetValue); + } + } else { + target.put(key, value); + } + } + } + return target; + } + public String setDomain(ApiScenarioEnvRequest request) { Boolean enable = request.getEnvironmentEnable(); String scenarioDefinition = request.getDefinition(); @@ -714,11 +743,17 @@ public class ApiAutomationService { } } else { String scenarioId = request.getId(); - ApiScenarioWithBLOBs apiScenarioWithBLOBs = apiScenarioMapper.selectByPrimaryKey(scenarioId); - if (apiScenarioWithBLOBs != null) { - String environmentType = apiScenarioWithBLOBs.getEnvironmentType(); - String environmentGroupId = apiScenarioWithBLOBs.getEnvironmentGroupId(); - String environmentJson = apiScenarioWithBLOBs.getEnvironmentJson(); + ApiScenarioDTO scenario = getNewApiScenario(scenarioId); + if (scenario != null) { + String referenced = element.getString("referenced"); + if (StringUtils.equalsIgnoreCase("REF", referenced)) { + JSONObject source = JSON.parseObject(scenario.getScenarioDefinition(), Feature.DisableSpecialKeyDetect); + element = jsonMerge(source, element); + } + element.put("referenced", referenced); + String environmentType = scenario.getEnvironmentType(); + String environmentGroupId = scenario.getEnvironmentGroupId(); + String environmentJson = scenario.getEnvironmentJson(); if (StringUtils.equals(environmentType, EnvironmentType.GROUP.name())) { environmentMap = environmentGroupProjectService.getEnvMap(environmentGroupId); } else if (StringUtils.equals(environmentType, EnvironmentType.JSON.name())) { @@ -727,7 +762,6 @@ public class ApiAutomationService { } } - ParameterConfig config = new ParameterConfig(); apiScenarioEnvService.setEnvConfig(environmentMap, config); if (config.getConfig() != null && !config.getConfig().isEmpty()) { @@ -1376,7 +1410,7 @@ public class ApiAutomationService { if (scenario == null || StringUtils.isEmpty(scenario.getScenarioDefinition())) { return; } - JSONObject element = JSON.parseObject(scenario.getScenarioDefinition(),Feature.DisableSpecialKeyDetect); + JSONObject element = JSON.parseObject(scenario.getScenarioDefinition(), Feature.DisableSpecialKeyDetect); JSONArray hashTree = element.getJSONArray("hashTree"); ApiScenarioImportUtil.formatHashTree(hashTree); setHashTree(hashTree); @@ -1400,7 +1434,7 @@ public class ApiAutomationService { if (CollectionUtils.isEmpty(object.getJSONArray("hashTree"))) { ApiTestCaseInfo model = extApiTestCaseMapper.selectApiCaseInfoByPrimaryKey(object.getString("id")); if (model != null) { - JSONObject element = JSON.parseObject(model.getRequest(),Feature.DisableSpecialKeyDetect); + JSONObject element = JSON.parseObject(model.getRequest(), Feature.DisableSpecialKeyDetect); object.put("hashTree", element.getJSONArray("hashTree")); } } @@ -1544,7 +1578,7 @@ public class ApiAutomationService { *

* 匹配场景中用到的路径 * - * @param scenarioIdList 场景集合(id / scenario大字段 必须有数据) + * @param scenarioIdList 场景集合(id / scenario大字段 必须有数据) * @param allEffectiveApiList 接口集合(id / path 必须有数据) * @return */ @@ -1556,8 +1590,8 @@ public class ApiAutomationService { int containsCount = 0; for (ApiDefinition model : allEffectiveApiList) { - if(refIdList.contains(model.getId())){ - containsCount ++; + if (refIdList.contains(model.getId())) { + containsCount++; } } @@ -1991,7 +2025,7 @@ public class ApiAutomationService { public static void main(String args[]) { String s = "{\"id\":\"a0b24269-96af-4e38-9527-abb8de9e298a\",\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"tags\":\"[]\",\"userId\":\"zhaoyong\",\"apiScenarioModuleId\":\"91b7822c-265f-4304-8256-92b7f862dbc5\",\"modulePath\":\"/MeterSphere-test\",\"name\":\"创建测试\",\"level\":\"P0\",\"status\":\"Underway\",\"principal\":\"zhaoyong\",\"stepTotal\":2,\"schedule\":null,\"createTime\":1649660714601,\"updateTime\":1649663715536,\"passRate\":\"0%\",\"lastResult\":\"Fail\",\"reportId\":\"aae35c28\",\"num\":100115,\"originalState\":null,\"customNum\":\"100115\",\"createUser\":null,\"version\":10,\"deleteTime\":null,\"deleteUserId\":null,\"executeTimes\":null,\"order\":null,\"environmentType\":\"JSON\",\"environmentGroupId\":null,\"versionId\":\"5b78930e-6880-11ec-a810-0242ac1e0a05\",\"refId\":\"a0b24269-96af-4e38-9527-abb8de9e298a\",\"latest\":null,\"scenarioDefinition\":{\"id\":\"a0b24269-96af-4e38-9527-abb8de9e298a\",\"enableCookieShare\":false,\"name\":\"创建测试\",\"type\":\"scenario\",\"clazzName\":\"io.metersphere.api.dto.definition.request.MsScenario\",\"variables\":[],\"headers\":[],\"referenced\":\"Created\",\"environmentMap\":{\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\":\"bdb7c2cb-76ba-4761-bdc1-dc136c492124\"},\"hashTree\":[{\"resourceId\":\"11335d47-ed41-2934-ecf8-150232d8d71d\",\"num\":\"\",\"refType\":\"CASE\",\"type\":\"HTTPSamplerProxy\",\"body\":{\"valid\":true,\"jsonSchema\":{\"hidden\":true,\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"The Root Schema\",\"type\":\"object\",\"properties\":{\"password\":{\"hidden\":true,\"mock\":{\"mock\":\"Calong@2015\"},\"title\":\"The password Schema\",\"type\":\"string\",\"$id\":\"#/properties/password\"},\"username\":{\"hidden\":true,\"mock\":{\"mock\":\"admin\"},\"title\":\"The username Schema\",\"type\":\"string\",\"$id\":\"#/properties/username\"}},\"$id\":\"http://example.com/root.json\"},\"xml\":false,\"binary\":[],\"json\":true,\"kvs\":[],\"raw\":\"{\\n \\\"username\\\": \\\"admin\\\",\\n \\\"password\\\": \\\"Calong@2015\\\"\\n}\",\"kV\":false,\"oldKV\":false,\"type\":\"JSON\"},\"path\":\"/signin\",\"protocol\":\"HTTP\",\"enable\":true,\"followRedirects\":true,\"useEnvironment\":\"ec29256c-9523-48ff-b257-755f5daccb60\",\"connectTimeout\":\"60000\",\"hashTree\":[{\"resourceId\":\"4454ea7f-5c0e-4e1b-b66a-7fb925fc5b4c\",\"mockEnvironment\":false,\"active\":true,\"index\":1,\"type\":\"Extract\",\"regex\":[{\"valid\":true,\"expression\":\"Set-Cookie: (.*?); Path=/; HttpOnly;\",\"variable\":\"Cookie\",\"useHeaders\":\"true\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${Cookie}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(.*?)\\\"\",\"variable\":\"id\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(.+?)\\\"\",\"variable\":\"id2\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id2}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(\\\\d+)\\\"\",\"variable\":\"id3\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id3}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(.\\\\d+)\\\"\",\"variable\":\"id4\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id4}\"}],\"xpath\":[],\"enable\":true,\"json\":[{\"valid\":true,\"expression\":\"$.data.csrfToken\",\"variable\":\"csrfToken\",\"multipleMatching\":false,\"type\":\"JSONPath\",\"value\":\"\"}],\"hashTree\":[],\"id\":\"bec13d6d-3dc0-3f20-ff73-d4fb0b8dcc99\",\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.extract.MsExtract\",\"parentIndex\":\"1_1\",\"checkBox\":false,\"isLeaf\":true},{\"jsr223\":[],\"resourceId\":\"5f22b989-279b-4417-b896-c3cbcdfd7448\",\"mockEnvironment\":false,\"document\":{\"data\":{\"xml\":[],\"json\":[],\"xmlFollowAPI\":\"false\",\"jsonFollowAPI\":\"false\"},\"enable\":true,\"type\":\"JSON\"},\"xpath2\":[],\"active\":false,\"index\":2,\"jsonPath\":[],\"type\":\"Assertions\",\"duration\":{\"valid\":false,\"enable\":true,\"type\":\"Duration\",\"value\":0},\"regex\":[],\"enable\":true,\"hashTree\":[],\"id\":\"e233298c-845b-5a48-8968-06266ebe775e\",\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.assertions.MsAssertions\",\"parentIndex\":\"1_2\",\"checkBox\":false,\"isLeaf\":true}],\"id\":\"4975f880-cb88-539d-38c6-01f134011946\",\"responseTimeout\":\"60000\",\"headers\":[{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"Content-Type\",\"urlEncode\":false,\"value\":\"application/json\",\"required\":true}],\"rest\":[],\"mockEnvironment\":false,\"method\":\"POST\",\"active\":false,\"index\":1,\"url\":\"\",\"customizeReq\":false,\"referenced\":\"Copy\",\"domain\":\"https://www.jd.com\",\"name\":\"登录ms\",\"isRefEnvironment\":true,\"arguments\":[{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.sampler.MsHTTPSamplerProxy\",\"doMultipartPost\":false,\"parentIndex\":1,\"requestResult\":[{\"responseResult\":{}}],\"checkBox\":false,\"isBatchProcess\":false,\"isLeaf\":true},{\"resourceId\":\"459089ec-eb03-c66b-1e81-9d6b5905a54f\",\"num\":\"\",\"refType\":\"CASE\",\"type\":\"HTTPSamplerProxy\",\"body\":{\"valid\":true,\"jsonSchema\":{\"$id\":\"http://example.com/root.json\",\"title\":\"The Root Schema\",\"hidden\":true,\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"@type\":{\"$id\":\"#/properties/@type\",\"title\":\"The @type Schema\",\"hidden\":true,\"mock\":{\"mock\":\"aaa\"},\"type\":\"string\"}}},\"xml\":false,\"binary\":[],\"json\":true,\"kvs\":[{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"request\",\"type\":\"text\",\"contentType\":\"application/json;boundary=----WebKitFormBoundarybikQMdDG93ZCVD4V\",\"urlEncode\":false,\"value\":\"{\\\"name\\\":\\\"测试1\\\",\\\"module\\\":\\\"f9ee3850-e0a4-4529-99f8-24c6cb9a5e57\\\",\\\"nodePath\\\":\\\"/未规划用例\\\",\\\"maintainer\\\":\\\"zyy\\\",\\\"priority\\\":\\\"P0\\\",\\\"type\\\":\\\"functional\\\",\\\"method\\\":\\\"\\\",\\\"prerequisite\\\":\\\"\\\",\\\"testId\\\":\\\"[]\\\",\\\"otherTestName\\\":\\\"\\\",\\\"steps\\\":\\\"[{\\\\\\\"num\\\\\\\":1,\\\\\\\"desc\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"result\\\\\\\":\\\\\\\"\\\\\\\"}]\\\",\\\"stepDesc\\\":\\\"\\\",\\\"stepResult\\\":\\\"\\\",\\\"selected\\\":[],\\\"remark\\\":\\\"\\\",\\\"tags\\\":\\\"[]\\\",\\\"demandId\\\":\\\"\\\",\\\"demandName\\\":\\\"\\\",\\\"status\\\":\\\"Prepare\\\",\\\"reviewStatus\\\":\\\"Prepare\\\",\\\"stepDescription\\\":\\\"\\\",\\\"expectedResult\\\":\\\"\\\",\\\"stepModel\\\":null,\\\"customNum\\\":\\\"\\\",\\\"followPeople\\\":\\\"\\\",\\\"follows\\\":[],\\\"customFields\\\":\\\"[{\\\\\\\"id\\\\\\\":\\\\\\\"ea902d54-ab30-11ec-bfae-0242ac1e0a02\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"责任人\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"zyy\\\\\\\",\\\\\\\"type\\\\\\\":\\\\\\\"member\\\\\\\",\\\\\\\"customData\\\\\\\":null},{\\\\\\\"id\\\\\\\":\\\\\\\"ea91b4b1-ab30-11ec-bfae-0242ac1e0a02\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"用例等级\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"P0\\\\\\\",\\\\\\\"type\\\\\\\":\\\\\\\"select\\\\\\\",\\\\\\\"customData\\\\\\\":null},{\\\\\\\"id\\\\\\\":\\\\\\\"ea991a6c-ab30-11ec-bfae-0242ac1e0a02\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"用例状态\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"Prepare\\\\\\\",\\\\\\\"type\\\\\\\":\\\\\\\"select\\\\\\\",\\\\\\\"customData\\\\\\\":null}]\\\",\\\"nodeId\\\":\\\"f9ee3850-e0a4-4529-99f8-24c6cb9a5e57\\\",\\\"projectId\\\":\\\"a79ac4e6-c3b7-4d82-8f11-b1c9be05c396\\\",\\\"casePublic\\\":false,\\\"updatedFileList\\\":[]}\",\"required\":false},{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"raw\":\"{\\n \\\"@type\\\": \\\"aaa\\\"\\n}\",\"kV\":false,\"oldKV\":false,\"type\":\"JSON\"},\"path\":\"/test/case/add\",\"protocol\":\"HTTP\",\"enable\":true,\"followRedirects\":true,\"useEnvironment\":\"ec29256c-9523-48ff-b257-755f5daccb60\",\"connectTimeout\":\"60000\",\"hashTree\":[{\"jsr223\":[],\"resourceId\":\"f318347e-2a8f-4bbe-9753-506156d44656\",\"mockEnvironment\":false,\"document\":{\"data\":{\"xml\":[],\"json\":[],\"xmlFollowAPI\":\"false\",\"jsonFollowAPI\":\"false\"},\"enable\":true,\"type\":\"JSON\"},\"xpath2\":[],\"active\":false,\"index\":1,\"jsonPath\":[],\"type\":\"Assertions\",\"duration\":{\"valid\":false,\"enable\":true,\"type\":\"Duration\",\"value\":0},\"regex\":[],\"enable\":true,\"hashTree\":[],\"id\":\"aaa65613-b39c-dc42-852d-17e47366c6cb\",\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.assertions.MsAssertions\",\"parentIndex\":\"2_1\",\"checkBox\":false,\"isLeaf\":true}],\"id\":\"ab259fed-5328-71f7-8079-e05783a82499\",\"responseTimeout\":\"60000\",\"headers\":[{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"Content-Type\",\"urlEncode\":false,\"value\":\"application/json\",\"required\":true},{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"CSRF-TOKEN\",\"urlEncode\":false,\"value\":\"${csrfToken}\",\"required\":true},{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"Cookie\",\"urlEncode\":false,\"value\":\"${Cookie}\",\"required\":true},{\"valid\":false,\"file\":false,\"enable\":true,\"urlEncode\":false,\"required\":true}],\"rest\":[{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"mockEnvironment\":false,\"method\":\"POST\",\"active\":true,\"index\":2,\"url\":\"\",\"customizeReq\":false,\"referenced\":\"Copy\",\"domain\":\"https://www.jd.com\",\"name\":\"创建功能用例\",\"isRefEnvironment\":true,\"arguments\":[{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.sampler.MsHTTPSamplerProxy\",\"doMultipartPost\":false,\"parentIndex\":2,\"requestResult\":[{\"responseResult\":{}}],\"checkBox\":false,\"isBatchProcess\":false,\"isLeaf\":true,\"preSize\":0,\"postSize\":0,\"ruleSize\":0}],\"onSampleError\":true,\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\"},\"description\":null,\"useUrl\":null,\"environmentJson\":\"{\\\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\\\":\\\"bdb7c2cb-76ba-4761-bdc1-dc136c492124\\\"}\",\"projectName\":\"默认项目\",\"userName\":\"zz\",\"creatorName\":\"zz\",\"principalName\":\"zz\",\"tagNames\":null,\"deleteUser\":null,\"versionName\":\"v1.0.0\",\"versionEnable\":null,\"projectIds\":null,\"caseId\":null,\"environment\":null,\"env\":\"{\\\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\\\":\\\"bdb7c2cb-76ba-4761-bdc1-dc136c492124\\\"}\",\"environmentMap\":{\"默认项目\":\"JD\"},\"creator\":\"zhaoyong\",\"showBatchTip\":true,\"variables\":[],\"headers\":[],\"scenarioDefinitionOrg\":{\"apiScenarioModuleId\":\"91b7822c-265f-4304-8256-92b7f862dbc5\",\"name\":\"创建测试\",\"status\":\"Underway\",\"principal\":\"zhaoyong\",\"level\":\"P0\",\"tags\":[],\"description\":null,\"scenarioDefinition\":[{\"resourceId\":\"11335d47-ed41-2934-ecf8-150232d8d71d\",\"num\":\"\",\"refType\":\"CASE\",\"type\":\"HTTPSamplerProxy\",\"body\":{\"valid\":true,\"jsonSchema\":{\"hidden\":true,\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"The Root Schema\",\"type\":\"object\",\"properties\":{\"password\":{\"hidden\":true,\"mock\":{\"mock\":\"Calong@2015\"},\"title\":\"The password Schema\",\"type\":\"string\",\"$id\":\"#/properties/password\"},\"username\":{\"hidden\":true,\"mock\":{\"mock\":\"admin\"},\"title\":\"The username Schema\",\"type\":\"string\",\"$id\":\"#/properties/username\"}},\"$id\":\"http://example.com/root.json\"},\"xml\":false,\"binary\":[],\"json\":true,\"kvs\":[],\"raw\":\"{\\n \\\"username\\\": \\\"admin\\\",\\n \\\"password\\\": \\\"Calong@2015\\\"\\n}\",\"kV\":false,\"oldKV\":false,\"type\":\"JSON\"},\"path\":\"/signin\",\"protocol\":\"HTTP\",\"enable\":true,\"followRedirects\":true,\"useEnvironment\":\"ec29256c-9523-48ff-b257-755f5daccb60\",\"connectTimeout\":\"60000\",\"hashTree\":[{\"resourceId\":\"4454ea7f-5c0e-4e1b-b66a-7fb925fc5b4c\",\"mockEnvironment\":false,\"active\":true,\"index\":1,\"type\":\"Extract\",\"regex\":[{\"valid\":true,\"expression\":\"Set-Cookie: (.*?); Path=/; HttpOnly;\",\"variable\":\"Cookie\",\"useHeaders\":\"true\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${Cookie}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(.*?)\\\"\",\"variable\":\"id\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(.+?)\\\"\",\"variable\":\"id2\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id2}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(\\\\d+)\\\"\",\"variable\":\"id3\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id3}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(.\\\\d+)\\\"\",\"variable\":\"id4\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id4}\"}],\"xpath\":[],\"enable\":true,\"json\":[{\"valid\":true,\"expression\":\"$.data.csrfToken\",\"variable\":\"csrfToken\",\"multipleMatching\":false,\"type\":\"JSONPath\",\"value\":\"\"}],\"hashTree\":[],\"id\":\"bec13d6d-3dc0-3f20-ff73-d4fb0b8dcc99\",\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.extract.MsExtract\",\"parentIndex\":\"1_1\"},{\"jsr223\":[],\"resourceId\":\"5f22b989-279b-4417-b896-c3cbcdfd7448\",\"mockEnvironment\":false,\"document\":{\"data\":{\"xml\":[],\"json\":[],\"xmlFollowAPI\":\"false\",\"jsonFollowAPI\":\"false\"},\"enable\":true,\"type\":\"JSON\"},\"xpath2\":[],\"active\":false,\"index\":2,\"jsonPath\":[],\"type\":\"Assertions\",\"duration\":{\"valid\":false,\"enable\":true,\"type\":\"Duration\",\"value\":0},\"regex\":[],\"enable\":true,\"hashTree\":[],\"id\":\"e233298c-845b-5a48-8968-06266ebe775e\",\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.assertions.MsAssertions\",\"parentIndex\":\"1_2\"}],\"id\":\"4975f880-cb88-539d-38c6-01f134011946\",\"responseTimeout\":\"60000\",\"headers\":[{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"Content-Type\",\"urlEncode\":false,\"value\":\"application/json\",\"required\":true}],\"rest\":[],\"mockEnvironment\":false,\"method\":\"POST\",\"active\":false,\"index\":1,\"url\":\"\",\"customizeReq\":false,\"referenced\":\"Copy\",\"domain\":\"https://www.jd.com\",\"name\":\"登录ms\",\"isRefEnvironment\":true,\"arguments\":[{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.sampler.MsHTTPSamplerProxy\",\"doMultipartPost\":false,\"parentIndex\":1},{\"resourceId\":\"459089ec-eb03-c66b-1e81-9d6b5905a54f\",\"num\":\"\",\"refType\":\"CASE\",\"type\":\"HTTPSamplerProxy\",\"body\":{\"valid\":true,\"jsonSchema\":{\"hidden\":true,\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"The Root Schema\",\"type\":\"object\",\"properties\":{\"\\\\@type\":{\"hidden\":true,\"mock\":{\"mock\":\"aaa\"},\"title\":\"The \\\\@type Schema\",\"type\":\"string\",\"$id\":\"#/properties/\\\\@type\"}},\"$id\":\"http://example.com/root.json\"},\"xml\":false,\"binary\":[],\"json\":true,\"kvs\":[{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"request\",\"type\":\"text\",\"contentType\":\"application/json;boundary=----WebKitFormBoundarybikQMdDG93ZCVD4V\",\"urlEncode\":false,\"value\":\"{\\\"name\\\":\\\"测试1\\\",\\\"module\\\":\\\"f9ee3850-e0a4-4529-99f8-24c6cb9a5e57\\\",\\\"nodePath\\\":\\\"/未规划用例\\\",\\\"maintainer\\\":\\\"zyy\\\",\\\"priority\\\":\\\"P0\\\",\\\"type\\\":\\\"functional\\\",\\\"method\\\":\\\"\\\",\\\"prerequisite\\\":\\\"\\\",\\\"testId\\\":\\\"[]\\\",\\\"otherTestName\\\":\\\"\\\",\\\"steps\\\":\\\"[{\\\\\\\"num\\\\\\\":1,\\\\\\\"desc\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"result\\\\\\\":\\\\\\\"\\\\\\\"}]\\\",\\\"stepDesc\\\":\\\"\\\",\\\"stepResult\\\":\\\"\\\",\\\"selected\\\":[],\\\"remark\\\":\\\"\\\",\\\"tags\\\":\\\"[]\\\",\\\"demandId\\\":\\\"\\\",\\\"demandName\\\":\\\"\\\",\\\"status\\\":\\\"Prepare\\\",\\\"reviewStatus\\\":\\\"Prepare\\\",\\\"stepDescription\\\":\\\"\\\",\\\"expectedResult\\\":\\\"\\\",\\\"stepModel\\\":null,\\\"customNum\\\":\\\"\\\",\\\"followPeople\\\":\\\"\\\",\\\"follows\\\":[],\\\"customFields\\\":\\\"[{\\\\\\\"id\\\\\\\":\\\\\\\"ea902d54-ab30-11ec-bfae-0242ac1e0a02\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"责任人\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"zyy\\\\\\\",\\\\\\\"type\\\\\\\":\\\\\\\"member\\\\\\\",\\\\\\\"customData\\\\\\\":null},{\\\\\\\"id\\\\\\\":\\\\\\\"ea91b4b1-ab30-11ec-bfae-0242ac1e0a02\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"用例等级\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"P0\\\\\\\",\\\\\\\"type\\\\\\\":\\\\\\\"select\\\\\\\",\\\\\\\"customData\\\\\\\":null},{\\\\\\\"id\\\\\\\":\\\\\\\"ea991a6c-ab30-11ec-bfae-0242ac1e0a02\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"用例状态\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"Prepare\\\\\\\",\\\\\\\"type\\\\\\\":\\\\\\\"select\\\\\\\",\\\\\\\"customData\\\\\\\":null}]\\\",\\\"nodeId\\\":\\\"f9ee3850-e0a4-4529-99f8-24c6cb9a5e57\\\",\\\"projectId\\\":\\\"a79ac4e6-c3b7-4d82-8f11-b1c9be05c396\\\",\\\"casePublic\\\":false,\\\"updatedFileList\\\":[]}\",\"required\":false},{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"raw\":\"{\\n \\\"\\\\\\\\@type\\\": \\\"aaa\\\"\\n}\",\"kV\":false,\"oldKV\":false,\"type\":\"JSON\"},\"path\":\"/test/case/add\",\"protocol\":\"HTTP\",\"enable\":true,\"followRedirects\":true,\"useEnvironment\":\"ec29256c-9523-48ff-b257-755f5daccb60\",\"connectTimeout\":\"60000\",\"hashTree\":[{\"jsr223\":[],\"resourceId\":\"f318347e-2a8f-4bbe-9753-506156d44656\",\"mockEnvironment\":false,\"document\":{\"data\":{\"xml\":[],\"json\":[],\"xmlFollowAPI\":\"false\",\"jsonFollowAPI\":\"false\"},\"enable\":true,\"type\":\"JSON\"},\"xpath2\":[],\"active\":false,\"index\":1,\"jsonPath\":[],\"type\":\"Assertions\",\"duration\":{\"valid\":false,\"enable\":true,\"type\":\"Duration\",\"value\":0},\"regex\":[],\"enable\":true,\"hashTree\":[],\"id\":\"aaa65613-b39c-dc42-852d-17e47366c6cb\",\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.assertions.MsAssertions\",\"parentIndex\":\"2_1\"}],\"id\":\"ab259fed-5328-71f7-8079-e05783a82499\",\"responseTimeout\":\"60000\",\"headers\":[{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"Content-Type\",\"urlEncode\":false,\"value\":\"application/json\",\"required\":true},{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"CSRF-TOKEN\",\"urlEncode\":false,\"value\":\"${csrfToken}\",\"required\":true},{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"Cookie\",\"urlEncode\":false,\"value\":\"${Cookie}\",\"required\":true},{\"valid\":false,\"file\":false,\"enable\":true,\"urlEncode\":false,\"required\":true}],\"rest\":[{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"mockEnvironment\":false,\"method\":\"POST\",\"active\":true,\"index\":2,\"url\":\"\",\"customizeReq\":false,\"referenced\":\"Copy\",\"domain\":\"https://www.jd.com\",\"name\":\"创建功能用例\",\"isRefEnvironment\":true,\"arguments\":[{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.sampler.MsHTTPSamplerProxy\",\"doMultipartPost\":false,\"parentIndex\":2}]},\"follows\":[],\"hashTree\":[{\"resourceId\":\"11335d47-ed41-2934-ecf8-150232d8d71d\",\"num\":\"\",\"refType\":\"CASE\",\"type\":\"HTTPSamplerProxy\",\"body\":{\"valid\":true,\"jsonSchema\":{\"hidden\":true,\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"The Root Schema\",\"type\":\"object\",\"properties\":{\"password\":{\"hidden\":true,\"mock\":{\"mock\":\"Calong@2015\"},\"title\":\"The password Schema\",\"type\":\"string\",\"$id\":\"#/properties/password\"},\"username\":{\"hidden\":true,\"mock\":{\"mock\":\"admin\"},\"title\":\"The username Schema\",\"type\":\"string\",\"$id\":\"#/properties/username\"}},\"$id\":\"http://example.com/root.json\"},\"xml\":false,\"binary\":[],\"json\":true,\"kvs\":[],\"raw\":\"{\\n \\\"username\\\": \\\"admin\\\",\\n \\\"password\\\": \\\"Calong@2015\\\"\\n}\",\"kV\":false,\"oldKV\":false,\"type\":\"JSON\"},\"path\":\"/signin\",\"protocol\":\"HTTP\",\"enable\":true,\"followRedirects\":true,\"useEnvironment\":\"ec29256c-9523-48ff-b257-755f5daccb60\",\"connectTimeout\":\"60000\",\"hashTree\":[{\"resourceId\":\"4454ea7f-5c0e-4e1b-b66a-7fb925fc5b4c\",\"mockEnvironment\":false,\"active\":true,\"index\":1,\"type\":\"Extract\",\"regex\":[{\"valid\":true,\"expression\":\"Set-Cookie: (.*?); Path=/; HttpOnly;\",\"variable\":\"Cookie\",\"useHeaders\":\"true\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${Cookie}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(.*?)\\\"\",\"variable\":\"id\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(.+?)\\\"\",\"variable\":\"id2\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id2}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(\\\\d+)\\\"\",\"variable\":\"id3\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id3}\"},{\"valid\":true,\"expression\":\"\\\"id\\\":\\\"(.\\\\d+)\\\"\",\"variable\":\"id4\",\"useHeaders\":\"false\",\"multipleMatching\":false,\"type\":\"Regex\",\"value\":\"${id4}\"}],\"xpath\":[],\"enable\":true,\"json\":[{\"valid\":true,\"expression\":\"$.data.csrfToken\",\"variable\":\"csrfToken\",\"multipleMatching\":false,\"type\":\"JSONPath\",\"value\":\"\"}],\"hashTree\":[],\"id\":\"bec13d6d-3dc0-3f20-ff73-d4fb0b8dcc99\",\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.extract.MsExtract\",\"parentIndex\":\"1_1\",\"checkBox\":false,\"isLeaf\":true},{\"jsr223\":[],\"resourceId\":\"5f22b989-279b-4417-b896-c3cbcdfd7448\",\"mockEnvironment\":false,\"document\":{\"data\":{\"xml\":[],\"json\":[],\"xmlFollowAPI\":\"false\",\"jsonFollowAPI\":\"false\"},\"enable\":true,\"type\":\"JSON\"},\"xpath2\":[],\"active\":false,\"index\":2,\"jsonPath\":[],\"type\":\"Assertions\",\"duration\":{\"valid\":false,\"enable\":true,\"type\":\"Duration\",\"value\":0},\"regex\":[],\"enable\":true,\"hashTree\":[],\"id\":\"e233298c-845b-5a48-8968-06266ebe775e\",\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.assertions.MsAssertions\",\"parentIndex\":\"1_2\",\"checkBox\":false,\"isLeaf\":true}],\"id\":\"4975f880-cb88-539d-38c6-01f134011946\",\"responseTimeout\":\"60000\",\"headers\":[{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"Content-Type\",\"urlEncode\":false,\"value\":\"application/json\",\"required\":true}],\"rest\":[],\"mockEnvironment\":false,\"method\":\"POST\",\"active\":false,\"index\":1,\"url\":\"\",\"customizeReq\":false,\"referenced\":\"Copy\",\"domain\":\"https://www.jd.com\",\"name\":\"登录ms\",\"isRefEnvironment\":true,\"arguments\":[{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.sampler.MsHTTPSamplerProxy\",\"doMultipartPost\":false,\"parentIndex\":1,\"requestResult\":[{\"responseResult\":{}}],\"checkBox\":false,\"isBatchProcess\":false,\"isLeaf\":true},{\"resourceId\":\"459089ec-eb03-c66b-1e81-9d6b5905a54f\",\"num\":\"\",\"refType\":\"CASE\",\"type\":\"HTTPSamplerProxy\",\"body\":{\"valid\":true,\"jsonSchema\":{\"$id\":\"http://example.com/root.json\",\"title\":\"The Root Schema\",\"hidden\":true,\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"@type\":{\"$id\":\"#/properties/@type\",\"title\":\"The @type Schema\",\"hidden\":true,\"mock\":{\"mock\":\"aaa\"},\"type\":\"string\"}}},\"xml\":false,\"binary\":[],\"json\":true,\"kvs\":[{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"request\",\"type\":\"text\",\"contentType\":\"application/json;boundary=----WebKitFormBoundarybikQMdDG93ZCVD4V\",\"urlEncode\":false,\"value\":\"{\\\"name\\\":\\\"测试1\\\",\\\"module\\\":\\\"f9ee3850-e0a4-4529-99f8-24c6cb9a5e57\\\",\\\"nodePath\\\":\\\"/未规划用例\\\",\\\"maintainer\\\":\\\"zyy\\\",\\\"priority\\\":\\\"P0\\\",\\\"type\\\":\\\"functional\\\",\\\"method\\\":\\\"\\\",\\\"prerequisite\\\":\\\"\\\",\\\"testId\\\":\\\"[]\\\",\\\"otherTestName\\\":\\\"\\\",\\\"steps\\\":\\\"[{\\\\\\\"num\\\\\\\":1,\\\\\\\"desc\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"result\\\\\\\":\\\\\\\"\\\\\\\"}]\\\",\\\"stepDesc\\\":\\\"\\\",\\\"stepResult\\\":\\\"\\\",\\\"selected\\\":[],\\\"remark\\\":\\\"\\\",\\\"tags\\\":\\\"[]\\\",\\\"demandId\\\":\\\"\\\",\\\"demandName\\\":\\\"\\\",\\\"status\\\":\\\"Prepare\\\",\\\"reviewStatus\\\":\\\"Prepare\\\",\\\"stepDescription\\\":\\\"\\\",\\\"expectedResult\\\":\\\"\\\",\\\"stepModel\\\":null,\\\"customNum\\\":\\\"\\\",\\\"followPeople\\\":\\\"\\\",\\\"follows\\\":[],\\\"customFields\\\":\\\"[{\\\\\\\"id\\\\\\\":\\\\\\\"ea902d54-ab30-11ec-bfae-0242ac1e0a02\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"责任人\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"zyy\\\\\\\",\\\\\\\"type\\\\\\\":\\\\\\\"member\\\\\\\",\\\\\\\"customData\\\\\\\":null},{\\\\\\\"id\\\\\\\":\\\\\\\"ea91b4b1-ab30-11ec-bfae-0242ac1e0a02\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"用例等级\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"P0\\\\\\\",\\\\\\\"type\\\\\\\":\\\\\\\"select\\\\\\\",\\\\\\\"customData\\\\\\\":null},{\\\\\\\"id\\\\\\\":\\\\\\\"ea991a6c-ab30-11ec-bfae-0242ac1e0a02\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"用例状态\\\\\\\",\\\\\\\"value\\\\\\\":\\\\\\\"Prepare\\\\\\\",\\\\\\\"type\\\\\\\":\\\\\\\"select\\\\\\\",\\\\\\\"customData\\\\\\\":null}]\\\",\\\"nodeId\\\":\\\"f9ee3850-e0a4-4529-99f8-24c6cb9a5e57\\\",\\\"projectId\\\":\\\"a79ac4e6-c3b7-4d82-8f11-b1c9be05c396\\\",\\\"casePublic\\\":false,\\\"updatedFileList\\\":[]}\",\"required\":false},{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"raw\":\"{\\n \\\"@type\\\": \\\"aaa\\\"\\n}\",\"kV\":false,\"oldKV\":false,\"type\":\"JSON\"},\"path\":\"/test/case/add\",\"protocol\":\"HTTP\",\"enable\":true,\"followRedirects\":true,\"useEnvironment\":\"ec29256c-9523-48ff-b257-755f5daccb60\",\"connectTimeout\":\"60000\",\"hashTree\":[{\"jsr223\":[],\"resourceId\":\"f318347e-2a8f-4bbe-9753-506156d44656\",\"mockEnvironment\":false,\"document\":{\"data\":{\"xml\":[],\"json\":[],\"xmlFollowAPI\":\"false\",\"jsonFollowAPI\":\"false\"},\"enable\":true,\"type\":\"JSON\"},\"xpath2\":[],\"active\":false,\"index\":1,\"jsonPath\":[],\"type\":\"Assertions\",\"duration\":{\"valid\":false,\"enable\":true,\"type\":\"Duration\",\"value\":0},\"regex\":[],\"enable\":true,\"hashTree\":[],\"id\":\"aaa65613-b39c-dc42-852d-17e47366c6cb\",\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.assertions.MsAssertions\",\"parentIndex\":\"2_1\",\"checkBox\":false,\"isLeaf\":true}],\"id\":\"ab259fed-5328-71f7-8079-e05783a82499\",\"responseTimeout\":\"60000\",\"headers\":[{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"Content-Type\",\"urlEncode\":false,\"value\":\"application/json\",\"required\":true},{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"CSRF-TOKEN\",\"urlEncode\":false,\"value\":\"${csrfToken}\",\"required\":true},{\"valid\":true,\"file\":false,\"enable\":true,\"name\":\"Cookie\",\"urlEncode\":false,\"value\":\"${Cookie}\",\"required\":true},{\"valid\":false,\"file\":false,\"enable\":true,\"urlEncode\":false,\"required\":true}],\"rest\":[{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"mockEnvironment\":false,\"method\":\"POST\",\"active\":true,\"index\":2,\"url\":\"\",\"customizeReq\":false,\"referenced\":\"Copy\",\"domain\":\"https://www.jd.com\",\"name\":\"创建功能用例\",\"isRefEnvironment\":true,\"arguments\":[{\"valid\":false,\"file\":false,\"enable\":true,\"type\":\"text\",\"contentType\":\"text/plain\",\"urlEncode\":false,\"required\":false}],\"projectId\":\"a55ec10b-53ec-11ec-8069-0242ac1e0a04\",\"clazzName\":\"io.metersphere.api.dto.definition.request.sampler.MsHTTPSamplerProxy\",\"doMultipartPost\":false,\"parentIndex\":2,\"requestResult\":[{\"responseResult\":{}}],\"checkBox\":false,\"isBatchProcess\":false,\"isLeaf\":true,\"preSize\":0,\"postSize\":0,\"ruleSize\":0}]}"; - JSONObject element = JSON.parseObject(s, Feature.DisableSpecialKeyDetect); + JSONObject element = JSON.parseObject(s, Feature.DisableSpecialKeyDetect); System.out.println(element); } } diff --git a/backend/src/main/java/io/metersphere/api/service/MsHashTreeService.java b/backend/src/main/java/io/metersphere/api/service/MsHashTreeService.java index f2f3427ccc..7b384e3d08 100644 --- a/backend/src/main/java/io/metersphere/api/service/MsHashTreeService.java +++ b/backend/src/main/java/io/metersphere/api/service/MsHashTreeService.java @@ -62,6 +62,7 @@ public class MsHashTreeService { public static final String AUTH_MANAGER = "authManager"; public static final String PROJECT_ID = "projectId"; public static final String ACTIVE = "active"; + public static final String ENV_MAP = "environmentMap"; public void setHashTree(JSONArray hashTree) { // 将引用转成复制 @@ -86,14 +87,14 @@ public class MsHashTreeService { } else { ApiScenarioWithBLOBs bloBs = apiScenarioMapper.selectByPrimaryKey(object.getString(ID)); if (bloBs != null) { - object = JSON.parseObject(bloBs.getScenarioDefinition(),Feature.DisableSpecialKeyDetect); + object = JSON.parseObject(bloBs.getScenarioDefinition(), Feature.DisableSpecialKeyDetect); hashTree.set(i, object); } } } else if (SCENARIO.equals(object.getString(TYPE))) { ApiScenarioWithBLOBs bloBs = apiScenarioMapper.selectByPrimaryKey(object.getString(ID)); if (bloBs != null) { - object = JSON.parseObject(bloBs.getScenarioDefinition(),Feature.DisableSpecialKeyDetect); + object = JSON.parseObject(bloBs.getScenarioDefinition(), Feature.DisableSpecialKeyDetect); hashTree.set(i, object); } } @@ -183,7 +184,7 @@ public class MsHashTreeService { ApiTestCaseInfo apiTestCase = apiTestCaseService.get(element.getString(ID)); if (apiTestCase != null) { if (StringUtils.equalsIgnoreCase(element.getString(REFERENCED), REF)) { - JSONObject refElement = JSON.parseObject(apiTestCase.getRequest(),Feature.DisableSpecialKeyDetect); + JSONObject refElement = JSON.parseObject(apiTestCase.getRequest(), Feature.DisableSpecialKeyDetect); ElementUtil.dataFormatting(refElement); JSONArray array = refElement.getJSONArray(HASH_TREE); ElementUtil.copyBean(element, refElement); @@ -255,8 +256,11 @@ public class MsHashTreeService { boolean variableEnable = element.containsKey(VARIABLE_ENABLE) ? element.getBoolean(VARIABLE_ENABLE) : true; + if (environmentEnable && StringUtils.isNotEmpty(scenarioWithBLOBs.getEnvironmentJson())) { + element.put(ENV_MAP, JSON.parseObject(scenarioWithBLOBs.getEnvironmentJson(), Map.class)); + } if (StringUtils.equalsIgnoreCase(element.getString(REFERENCED), REF)) { - element = JSON.parseObject(scenarioWithBLOBs.getScenarioDefinition(),Feature.DisableSpecialKeyDetect); + element = JSON.parseObject(scenarioWithBLOBs.getScenarioDefinition(), Feature.DisableSpecialKeyDetect); element.put(REFERENCED, REF); element.put(NAME, scenarioWithBLOBs.getName()); } diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index cd2e911425..7d964d4ec7 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -1550,7 +1550,7 @@ export default { if (!this.currentScenario.headers) { this.currentScenario.headers = []; } - if (this.currentScenario.id) { + if (this.currentScenario && this.currentScenario.id) { this.result = this.$get("/api/automation/getApiScenario/" + this.currentScenario.id, response => { if (response.data) { this.path = "/api/automation/update"; @@ -1818,19 +1818,15 @@ export default { return []; }, checkALevelChecked() { + let resourceIds = []; if (this.$refs.stepTree) { - let resourceIds = []; this.$refs.stepTree.root.childNodes.forEach(item => { if (item.checked) { resourceIds.push(item.data.resourceId); } }) - if (resourceIds.length > 20) { - this.$warning(this.$t('api_test.automation.open_check_message')); - return false; - } } - return true; + return resourceIds; }, recursionExpansion(resourceIds, array) { if (array) { @@ -1850,11 +1846,15 @@ export default { }, openExpansion() { this.expandedStatus = true; - if (this.checkALevelChecked()) { - let resourceIds = this.getAllResourceIds(); - this.changeNodeStatus(resourceIds, this.scenarioDefinition); - this.recursionExpansion(resourceIds, this.$refs.stepTree.root.childNodes); + let resourceIds = []; + let openResourceIds = this.checkALevelChecked(); + if (openResourceIds.length > 20) { + resourceIds = openResourceIds.slice(0, 20); + } else { + resourceIds = this.getAllResourceIds(); } + this.changeNodeStatus(resourceIds, this.scenarioDefinition); + this.recursionExpansion(resourceIds, this.$refs.stepTree.root.childNodes); }, closeExpansion() { this.expandedStatus = false; diff --git a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue index 51e7087444..3836ef3398 100644 --- a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue @@ -52,6 +52,7 @@ :environmentType="environmentType" :environmentGroupId="environmentGroupId" :envMap="envMap" + :is-scenario="true" @enable="enable" @copy="copyRow" @remove="remove" diff --git a/frontend/src/business/components/api/automation/scenario/common/JDBCProcessorContent.vue b/frontend/src/business/components/api/automation/scenario/common/JDBCProcessorContent.vue index 0ef5a766f8..64fe38930a 100644 --- a/frontend/src/business/components/api/automation/scenario/common/JDBCProcessorContent.vue +++ b/frontend/src/business/components/api/automation/scenario/common/JDBCProcessorContent.vue @@ -82,7 +82,7 @@ import {createComponent} from "@/business/components/api/definition/components/j import {Assertions, Extract} from "@/business/components/api/definition/model/ApiTestModel"; import {parseEnvironment} from "@/business/components/api/definition/model/EnvironmentModel"; import ApiEnvironmentConfig from "@/business/components/api/test/components/ApiEnvironmentConfig"; -import {getCurrentProjectID} from "@/common/js/utils"; +import {getCurrentProjectID, objToStrMap} from "@/common/js/utils"; import {getUUID} from "@/common/js/utils"; import MsJsr233Processor from "@/business/components/api/automation/scenario/component/Jsr233Processor"; @@ -102,6 +102,10 @@ export default { type: Boolean, default: true, }, + isScenario: { + type: Boolean, + default: false, + }, isReadOnly: { type: Boolean, default: false @@ -133,7 +137,13 @@ export default { this.getEnvironments(); }, deep: true - } + }, + '$store.state.useEnvironment': function () { + if (!this.isScenario) { + this.request.environmentId = this.$store.state.useEnvironment; + this.getEnvironments(); + } + }, }, methods: { remove(row) { @@ -167,13 +177,42 @@ export default { runTest() { }, - getEnvironments() { - this.environments = []; + itselfEnvironment() { let id = this.request.projectId ? this.request.projectId : this.projectId; + this.result = this.$get('/api/environment/list/' + id, response => { + this.environments = response.data; + this.environments.forEach(environment => { + parseEnvironment(environment); + }) + this.initDataSource(); + }); + }, + getEnvironments() { let envId = ""; + let id = this.request.projectId ? this.request.projectId : this.projectId; if (this.$store.state.scenarioEnvMap && this.$store.state.scenarioEnvMap instanceof Map - && this.$store.state.scenarioEnvMap.has(this.projectId)) { - envId = this.$store.state.scenarioEnvMap.get(this.projectId); + && this.$store.state.scenarioEnvMap.has(id)) { + envId = this.$store.state.scenarioEnvMap.get(id); + } + if (this.request.referenced === 'Created' && this.isScenario && !this.request.isRefEnvironment) { + this.itselfEnvironment(); + return; + } else if (!this.isScenario && !this.request.customizeReq) { + this.itselfEnvironment(); + return; + } + this.environments = []; + // 场景开启自身环境 + if (this.request.environmentEnable && this.request.refEevMap) { + let obj = Object.prototype.toString.call(this.request.refEevMap).match(/\[object (\w+)\]/)[1].toLowerCase(); + if (obj !== 'object' && obj !== "map") { + this.request.refEevMap = objToStrMap(JSON.parse(this.request.refEevMap)); + } else if (obj === 'object' && obj !== "map") { + this.request.refEevMap = objToStrMap(this.request.refEevMap); + } + if (this.request.refEevMap instanceof Map && this.request.refEevMap.has(id)) { + envId = this.request.refEevMap.get(id); + } } let targetDataSourceName = ""; let currentEnvironment = {}; @@ -215,7 +254,7 @@ export default { } } let flag = false; - if (currentEnvironment.config && currentEnvironment.config.databaseConfigs) { + if (currentEnvironment && currentEnvironment.config && currentEnvironment.config.databaseConfigs) { currentEnvironment.config.databaseConfigs.forEach(item => { if (item.id === this.request.dataSourceId) { flag = true; diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue index 3d09a19c71..2586e1500c 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue @@ -125,6 +125,7 @@ export default { if (this.scenario.id && this.scenario.referenced === 'REF' && !this.scenario.loaded && this.scenario.hashTree) { this.setDisabled(this.scenario.hashTree, this.scenario.projectId); } + this.setOwnEnvironment(this.scenario.hashTree); }, components: {ApiBaseComponent, MsSqlBasisParameters, MsTcpBasisParameters, MsDubboBasisParameters, MsApiRequestForm}, data() { @@ -138,7 +139,6 @@ export default { computed: { isDeletedOrRef() { return this.scenario.referenced !== undefined && this.scenario.referenced === 'Deleted' || this.scenario.referenced === 'REF'; - }, }, methods: { @@ -237,6 +237,21 @@ export default { } } }, + setOwnEnvironment(scenarioDefinition) { + for (let i in scenarioDefinition) { + let typeArray = ["JDBCPostProcessor", "JDBCSampler", "JDBCPreProcessor"] + if (typeArray.indexOf(scenarioDefinition[i].type) !== -1) { + scenarioDefinition[i].refEevMap = new Map(); + scenarioDefinition[i].environmentEnable = this.scenario.environmentEnable; + if (this.scenario.environmentEnable && this.scenario.environmentMap) { + scenarioDefinition[i].refEevMap = this.scenario.environmentMap; + } + } + if (scenarioDefinition[i].hashTree !== undefined && scenarioDefinition[i].hashTree.length > 0) { + this.setOwnEnvironment(scenarioDefinition[i].hashTree); + } + } + }, calcProjectId(projectId, parentId) { if (!projectId) { return parentId ? parentId : getCurrentProjectID(); @@ -258,36 +273,36 @@ export default { clickResource(resource) { let workspaceId = getCurrentWorkspaceId(); let isTurnSpace = true - if(resource.projectId!==getCurrentProjectID()){ + if (resource.projectId !== getCurrentProjectID()) { isTurnSpace = false; this.$get("/project/get/" + resource.projectId, response => { if (response.data) { - workspaceId = response.data.workspaceId; + workspaceId = response.data.workspaceId; isTurnSpace = true; - this.checkPermission(resource,workspaceId,isTurnSpace); + this.checkPermission(resource, workspaceId, isTurnSpace); } }); - }else { - this.checkPermission(resource,workspaceId,isTurnSpace); + } else { + this.checkPermission(resource, workspaceId, isTurnSpace); } }, - gotoTurn(resource,workspaceId,isTurnSpace){ + gotoTurn(resource, workspaceId, isTurnSpace) { let automationData = this.$router.resolve({ name: 'ApiAutomation', params: {redirectID: getUUID(), dataType: "scenario", dataSelectRange: 'edit:' + resource.id, projectId: resource.projectId, workspaceId: workspaceId} }); - if(isTurnSpace){ + if (isTurnSpace) { window.open(automationData.href, '_blank'); } }, - checkPermission(resource,workspaceId,isTurnSpace){ + checkPermission(resource, workspaceId, isTurnSpace) { this.$get('/project/getOwnerProjectIds', res => { const project = res.data.find(p => p === resource.projectId); - if(!project){ + if (!project) { this.$warning(this.$t('commons.no_permission')); - }else{ - this.gotoTurn(resource,workspaceId,isTurnSpace) + } else { + this.gotoTurn(resource, workspaceId, isTurnSpace) } }) } diff --git a/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue b/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue index ab137d5a2d..19a7fd400d 100644 --- a/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue +++ b/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue @@ -9,7 +9,7 @@ {{ this.$t('ui.disable') }} {{ this.$t('ui.enable') }} {{ this.$t('api_test.automation.delete_step') }} - {{ this.$t('test_track.module.rename') }} + {{ this.$t('test_track.module.rename') }} {{ this.$t("api_test.automation.view_scene_variables") }} @@ -56,6 +56,12 @@ export default { name: "StepExtendBtns", components: {STEP, MsVariableList, MsAddBasisApi}, props: { + isScenario: { + type: Boolean, + default() { + return false; + } + }, data: Object, environmentType: String, environmentGroupId: String, @@ -147,9 +153,25 @@ export default { if (res.data) { let data = JSON.parse(res.data); this.data.hashTree = data.hashTree; + this.setOwnEnvironment(this.data.hashTree); } }) }, + setOwnEnvironment(scenarioDefinition) { + for (let i in scenarioDefinition) { + let typeArray = ["JDBCPostProcessor", "JDBCSampler", "JDBCPreProcessor"] + if (typeArray.indexOf(scenarioDefinition[i].type) !== -1) { + scenarioDefinition[i].environmentEnable = this.data.environmentEnable; + scenarioDefinition[i].refEevMap = new Map(); + if (this.data.environmentEnable && this.data.environmentMap) { + scenarioDefinition[i].refEevMap = this.data.environmentMap; + } + } + if (scenarioDefinition[i].hashTree !== undefined && scenarioDefinition[i].hashTree.length > 0) { + this.setOwnEnvironment(scenarioDefinition[i].hashTree); + } + } + }, saveAsApi() { this.currentProtocol = this.data.protocol; this.data.customizeReq = false; diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseHeader.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseHeader.vue index 2e131587f4..31f22592b6 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseHeader.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseHeader.vue @@ -20,7 +20,7 @@ :project-id="projectId" :is-read-only="isReadOnly" :useEnvironment='useEnvironment' - @setEnvironment="setEnvironment" ref="environmentSelect"/> + @setEnvironment="setEnvironment" ref="environmentSelect" v-if="api.protocol==='HTTP'"/> diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index ef5ac79df8..2684fdaf42 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -144,7 +144,6 @@ v-if="isXpack&&api.method==='ESB'" ref="esbDefinition"/> diff --git a/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue b/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue index 6234db274f..4920b35f05 100644 --- a/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue +++ b/frontend/src/business/components/api/definition/components/request/database/BasisParameters.vue @@ -98,7 +98,7 @@

{{ request.ruleSize }}
- @@ -123,7 +123,7 @@ import MsCodeEdit from "../../../../../common/components/MsCodeEdit"; import MsApiScenarioVariables from "../../ApiScenarioVariables"; import {parseEnvironment} from "../../../model/EnvironmentModel"; import ApiEnvironmentConfig from "@/business/components/api/test/components/ApiEnvironmentConfig"; -import {getCurrentProjectID} from "@/common/js/utils"; +import {getCurrentProjectID, objToStrMap} from "@/common/js/utils"; import {getUUID} from "@/common/js/utils"; import MsJsr233Processor from "../../../../automation/scenario/component/Jsr233Processor"; import MsJmxStep from "../../step/JmxStep"; @@ -148,6 +148,10 @@ export default { type: Boolean, default: true, }, + isCase: { + type: Boolean, + default: false, + }, isScenario: { type: Boolean, default: false, @@ -177,12 +181,24 @@ export default { }, deep: true }, + '$store.state.useEnvironment': function () { + if (!this.isScenario) { + this.request.environmentId = this.$store.state.useEnvironment; + this.getEnvironments(); + } + }, '$store.state.scenarioEnvMap': { handler(v) { this.getEnvironments(); }, deep: true - } + }, + 'request.refEevMap': { + handler(v) { + this.getEnvironments(); + }, + deep: true + }, }, created() { this.getEnvironments(); @@ -265,9 +281,10 @@ export default { }, getEnvironments() { let envId = ""; + let id = this.request.projectId ? this.request.projectId : this.projectId; if (this.$store.state.scenarioEnvMap && this.$store.state.scenarioEnvMap instanceof Map - && this.$store.state.scenarioEnvMap.has(this.projectId)) { - envId = this.$store.state.scenarioEnvMap.get(this.projectId); + && this.$store.state.scenarioEnvMap.has(id)) { + envId = this.$store.state.scenarioEnvMap.get(id); } if (this.request.referenced === 'Created' && this.isScenario && !this.request.isRefEnvironment) { this.itselfEnvironment(); @@ -277,8 +294,18 @@ export default { return; } this.environments = []; - let id = this.request.projectId ? this.request.projectId : this.projectId; - + // 场景开启自身环境 + if (this.request.environmentEnable && this.request.refEevMap) { + let obj = Object.prototype.toString.call(this.request.refEevMap).match(/\[object (\w+)\]/)[1].toLowerCase(); + if (obj !== 'object' && obj !== "map") { + this.request.refEevMap = objToStrMap(JSON.parse(this.request.refEevMap)); + } else if (obj === 'object' && obj !== "map") { + this.request.refEevMap = objToStrMap(this.request.refEevMap); + } + if (this.request.refEevMap instanceof Map && this.request.refEevMap.has(id)) { + envId = this.request.refEevMap.get(id); + } + } let targetDataSourceName = ""; let currentEnvironment = {}; this.result = this.$get('/api/environment/list/' + id, response => { @@ -297,7 +324,9 @@ export default { } if (envId && environment.id === envId) { currentEnvironment = environment; - this.environments = [currentEnvironment]; + if (!this.isCase) { + this.environments = [currentEnvironment]; + } } }); this.initDataSource(envId, currentEnvironment, targetDataSourceName); @@ -319,7 +348,7 @@ export default { } } let flag = false; - if (currentEnvironment.config && currentEnvironment.config.databaseConfigs) { + if (currentEnvironment && currentEnvironment.config && currentEnvironment.config.databaseConfigs) { currentEnvironment.config.databaseConfigs.forEach(item => { if (item.id === this.request.dataSourceId) { flag = true; diff --git a/frontend/src/business/components/api/definition/components/step/JmxStep.vue b/frontend/src/business/components/api/definition/components/step/JmxStep.vue index c223196e03..fa04189f6c 100644 --- a/frontend/src/business/components/api/definition/components/step/JmxStep.vue +++ b/frontend/src/business/components/api/definition/components/step/JmxStep.vue @@ -137,6 +137,10 @@ export default { tabType: String, response: {}, apiId: String, + isScenario: { + type: Boolean, + default: false, + }, showScript: { type: Boolean, default: true,