From 3d80530bebd81e03e3c086ada1c6321f0928593f Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 29 Dec 2022 15:10:49 +0800 Subject: [PATCH 01/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E8=A7=A3=E5=86=B3=E5=85=A8=E6=96=B0=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=A1=B9=E7=9B=AE=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021358 --user=赵勇 【接口测试】在安装过ms的环境重新安装ms,会出现2个未规划模块 https://www.tapd.cn/55049933/s/1320747 --- .../listener/ApiAppStartListener.java | 18 +++-- .../service/definition/ApiModuleService.java | 29 ++++--- .../scenario/ApiScenarioModuleService.java | 77 ++++++++++--------- 3 files changed, 71 insertions(+), 53 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/listener/ApiAppStartListener.java b/api-test/backend/src/main/java/io/metersphere/listener/ApiAppStartListener.java index 2d9123a011..7a1c1874d2 100644 --- a/api-test/backend/src/main/java/io/metersphere/listener/ApiAppStartListener.java +++ b/api-test/backend/src/main/java/io/metersphere/listener/ApiAppStartListener.java @@ -3,15 +3,13 @@ package io.metersphere.listener; import com.mchange.lang.IntegerUtils; import io.metersphere.api.exec.queue.ExecThreadPoolExecutor; import io.metersphere.api.jmeter.JMeterService; -import io.metersphere.service.ApiExecutionQueueService; -import io.metersphere.service.MockConfigService; -import io.metersphere.service.PluginService; import io.metersphere.commons.constants.ScheduleGroup; import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.LogUtil; import io.metersphere.dto.BaseSystemConfigDTO; -import io.metersphere.service.BaseScheduleService; -import io.metersphere.service.SystemParameterService; +import io.metersphere.service.*; +import io.metersphere.service.definition.ApiModuleService; +import io.metersphere.service.scenario.ApiScenarioModuleService; import org.apache.commons.lang3.StringUtils; import org.python.core.Options; import org.python.util.PythonInterpreter; @@ -36,6 +34,10 @@ public class ApiAppStartListener implements ApplicationRunner { private PluginService pluginService; @Resource private ApiExecutionQueueService apiExecutionQueueService; + @Resource + private ApiModuleService apiModuleService; + @Resource + private ApiScenarioModuleService apiScenarioModuleService; @Value("${jmeter.home}") private String jmeterHome; @@ -59,6 +61,12 @@ public class ApiAppStartListener implements ApplicationRunner { LogUtil.info("处理重启导致未执行完成的报告"); apiExecutionQueueService.exceptionHandling(); + LogUtil.info("初始化默认项目接口模块"); + apiModuleService.initDefaultNode(); + + LogUtil.info("初始化默认项目场景模块"); + apiScenarioModuleService.initDefaultModule(); + BaseSystemConfigDTO dto = systemParameterService.getBaseInfo(); LogUtil.info("设置并发队列核心数", dto.getConcurrency()); if (StringUtils.isNotEmpty(dto.getConcurrency())) { diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiModuleService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiModuleService.java index 268f31dcef..cecf69b2cf 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiModuleService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiModuleService.java @@ -6,11 +6,13 @@ import io.metersphere.api.parse.api.ApiDefinitionImport; import io.metersphere.base.domain.*; import io.metersphere.base.mapper.ApiDefinitionMapper; import io.metersphere.base.mapper.ApiModuleMapper; +import io.metersphere.base.mapper.ProjectMapper; import io.metersphere.base.mapper.ext.ExtApiDefinitionMapper; import io.metersphere.base.mapper.ext.ExtApiModuleMapper; import io.metersphere.base.mapper.ext.ExtApiTestCaseMapper; import io.metersphere.commons.constants.ProjectModuleDefaultNodeEnum; import io.metersphere.commons.constants.PropertyConstant; +import io.metersphere.commons.constants.RequestTypeConstants; import io.metersphere.commons.constants.TestCaseConstants; import io.metersphere.commons.enums.ApiTestDataStatus; import io.metersphere.commons.exception.MSException; @@ -31,7 +33,6 @@ import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.jetbrains.annotations.NotNull; import org.mybatis.spring.SqlSessionUtils; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -54,6 +55,8 @@ public class ApiModuleService extends NodeTreeService { private ApiDefinitionService apiDefinitionService; @Resource private ExtApiTestCaseMapper extApiTestCaseMapper; + @Resource + private ProjectMapper projectMapper; @Resource SqlSessionFactory sqlSessionFactory; @@ -141,8 +144,6 @@ public class ApiModuleService extends NodeTreeService { } public List getNodeTreeByProjectId(String projectId, String protocol, String versionId) { - // 判断当前项目下是否有默认模块,没有添加默认模块 - this.getDefaultNode(projectId, protocol); ApiDefinitionRequest request = new ApiDefinitionRequest(); List apiModules = getApiModulesByProjectAndPro(projectId, protocol); request.setProjectId(projectId); @@ -189,8 +190,6 @@ public class ApiModuleService extends NodeTreeService { } public List getNodeTreeByCondition(String projectId, String protocol, String versionId, ApiDefinitionRequest request) { - // 判断当前项目下是否有默认模块,没有添加默认模块 - this.getDefaultNode(projectId, protocol); List apiModules = getApiModulesByProjectAndPro(projectId, protocol); request.setProjectId(projectId); request.setProtocol(protocol); @@ -570,19 +569,29 @@ public class ApiModuleService extends NodeTreeService { return apiModuleMapper.countByExample(example); } + public void initDefaultNode() { + ProjectExample projectExample = new ProjectExample(); + projectExample.createCriteria().andNameEqualTo("默认项目"); + List projects = projectMapper.selectByExample(projectExample); + if (CollectionUtils.isNotEmpty(projects)) { + String[] protocols = {RequestTypeConstants.HTTP, RequestTypeConstants.DUBBO, RequestTypeConstants.SQL, RequestTypeConstants.TCP}; + for (String protocol : protocols) { + saveDefault(projects.get(0).getId(), protocol); + } + } + } + public ApiModule getDefaultNode(String projectId, String protocol) { ApiModuleExample example = new ApiModuleExample(); example.createCriteria().andProjectIdEqualTo(projectId).andProtocolEqualTo(protocol).andNameEqualTo(ProjectModuleDefaultNodeEnum.API_MODULE_DEFAULT_NODE.getNodeName()).andParentIdIsNull(); List list = apiModuleMapper.selectByExample(example); - if (CollectionUtils.isEmpty(list)) { - return saveDefault(projectId, protocol); - } else { + if (CollectionUtils.isNotEmpty(list)) { return list.get(0); } + return null; } - @Async - public synchronized ApiModule saveDefault(String projectId, String protocol) { + public ApiModule saveDefault(String projectId, String protocol) { ApiModuleExample example = new ApiModuleExample(); example.createCriteria().andProjectIdEqualTo(projectId).andProtocolEqualTo(protocol).andNameEqualTo(ProjectModuleDefaultNodeEnum.API_MODULE_DEFAULT_NODE.getNodeName()).andParentIdIsNull(); List list = apiModuleMapper.selectByExample(example); diff --git a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioModuleService.java b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioModuleService.java index e14f733843..fe04b69c89 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioModuleService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioModuleService.java @@ -3,12 +3,10 @@ package io.metersphere.service.scenario; import io.metersphere.api.dto.ApiTestImportRequest; import io.metersphere.api.dto.automation.*; -import io.metersphere.base.domain.ApiScenario; -import io.metersphere.base.domain.ApiScenarioModule; -import io.metersphere.base.domain.ApiScenarioModuleExample; -import io.metersphere.base.domain.ApiScenarioWithBLOBs; +import io.metersphere.base.domain.*; import io.metersphere.base.mapper.ApiScenarioMapper; import io.metersphere.base.mapper.ApiScenarioModuleMapper; +import io.metersphere.base.mapper.ProjectMapper; import io.metersphere.base.mapper.ext.ExtApiScenarioMapper; import io.metersphere.base.mapper.ext.ExtApiScenarioModuleMapper; import io.metersphere.commons.constants.ProjectModuleDefaultNodeEnum; @@ -30,10 +28,9 @@ import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionUtils; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; +import org.apache.commons.collections.CollectionUtils; import javax.annotation.Resource; import java.util.*; @@ -55,14 +52,14 @@ public class ApiScenarioModuleService extends NodeTreeService getNodeTreeByProjectId(String projectId) { - // 判断当前项目下是否有默认模块,没有添加默认模块 - this.getDefaultNode(projectId); List nodes = extApiScenarioModuleMapper.getNodeTreeByProjectId(projectId); ApiScenarioRequest request = new ApiScenarioRequest(); request.setProjectId(projectId); @@ -103,8 +100,6 @@ public class ApiScenarioModuleService extends NodeTreeService getNodeTreeByProjectId(String projectId, ApiScenarioRequest request) { - // 判断当前项目下是否有默认模块,没有添加默认模块 - this.getDefaultNode(projectId); List nodes = extApiScenarioModuleMapper.getNodeTreeByProjectId(projectId); request.setProjectId(projectId); List list = new ArrayList<>(); @@ -174,7 +169,7 @@ public class ApiScenarioModuleService extends NodeTreeService moduleDTOList, Map> scenarioMap) { - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(moduleDTOList) && MapUtils.isNotEmpty(scenarioMap)) { + if (CollectionUtils.isNotEmpty(moduleDTOList) && MapUtils.isNotEmpty(scenarioMap)) { moduleDTOList.forEach(node -> { List moduleIds = new ArrayList<>(); moduleIds = this.nodeList(moduleDTOList, node.getId(), moduleIds); @@ -191,7 +186,7 @@ public class ApiScenarioModuleService extends NodeTreeService selectTreeStructModuleById(Collection ids) { - if (org.apache.commons.collections.CollectionUtils.isEmpty(ids)) { + if (CollectionUtils.isEmpty(ids)) { return new ArrayList<>(0); } else { List parentIdList = new ArrayList<>(); @@ -246,7 +241,7 @@ public class ApiScenarioModuleService extends NodeTreeService list = getPos(projectId, level, parentId, "pos desc"); - if (!CollectionUtils.isEmpty(list) && list.get(0) != null && list.get(0).getPos() != null) { + if (CollectionUtils.isNotEmpty(list) && list.get(0) != null && list.get(0).getPos() != null) { return list.get(0).getPos() + DEFAULT_POS; } else { return DEFAULT_POS; @@ -463,7 +458,7 @@ public class ApiScenarioModuleService extends NodeTreeService nodes = apiScenarioModuleMapper.selectByExample(example); - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(nodes)) { + if (CollectionUtils.isNotEmpty(nodes)) { List names = nodes.stream().map(ApiScenarioModule::getName).collect(Collectors.toList()); OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(ids), nodes.get(0).getProjectId(), String.join(",", names), nodes.get(0).getCreateUser(), new LinkedList<>()); return JSON.toJSONString(details); @@ -489,7 +484,7 @@ public class ApiScenarioModuleService extends NodeTreeService list = apiScenarioModuleMapper.selectByExample(example); - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(list)) { + if (CollectionUtils.isNotEmpty(list)) { module = list.get(0); } } @@ -509,34 +504,40 @@ public class ApiScenarioModuleService extends NodeTreeService list = apiScenarioModuleMapper.selectByExample(example); - if (CollectionUtils.isEmpty(list)) { - return saveDefault(projectId); - } else { + if (!CollectionUtils.isEmpty(list)) { return list.get(0); } + return null; } - @Async - public synchronized ApiScenarioModule saveDefault(String projectId) { - ApiScenarioModuleExample example = new ApiScenarioModuleExample(); - example.createCriteria().andProjectIdEqualTo(projectId).andNameEqualTo(ProjectModuleDefaultNodeEnum.API_SCENARIO_DEFAULT_NODE.getNodeName()).andParentIdIsNull(); - List list = apiScenarioModuleMapper.selectByExample(example); - if (CollectionUtils.isEmpty(list)) { - ApiScenarioModule module = new ApiScenarioModule(); - module.setId(UUID.randomUUID().toString()); - module.setName(ProjectModuleDefaultNodeEnum.API_SCENARIO_DEFAULT_NODE.getNodeName()); - module.setPos(1.0); - module.setLevel(1); - module.setCreateTime(System.currentTimeMillis()); - module.setUpdateTime(System.currentTimeMillis()); - module.setProjectId(projectId); - module.setCreateUser(SessionUtils.getUserId()); - apiScenarioModuleMapper.insert(module); - return module; - } else { - return list.get(0); + public void initDefaultModule() { + ProjectExample projectExample = new ProjectExample(); + projectExample.createCriteria().andNameEqualTo("默认项目"); + List projects = projectMapper.selectByExample(projectExample); + if (!CollectionUtils.isEmpty(projects)) { + ApiScenarioModuleExample example = new ApiScenarioModuleExample(); + example.createCriteria() + .andProjectIdEqualTo(projects.get(0).getId()) + .andNameEqualTo(ProjectModuleDefaultNodeEnum.API_SCENARIO_DEFAULT_NODE.getNodeName()) + .andParentIdIsNull(); + List list = apiScenarioModuleMapper.selectByExample(example); + if (CollectionUtils.isEmpty(list)) { + ApiScenarioModule module = new ApiScenarioModule(); + module.setId(UUID.randomUUID().toString()); + module.setName(ProjectModuleDefaultNodeEnum.API_SCENARIO_DEFAULT_NODE.getNodeName()); + module.setPos(1.0); + module.setLevel(1); + module.setCreateTime(System.currentTimeMillis()); + module.setUpdateTime(System.currentTimeMillis()); + module.setProjectId(projects.get(0).getId()); + module.setCreateUser(SessionUtils.getUserId()); + apiScenarioModuleMapper.insert(module); + } } } From e54f206eeef54bd031b6bee45cf749455ea09a07 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 29 Dec 2022 18:31:32 +0800 Subject: [PATCH 02/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E5=85=BC=E5=AE=B9=E5=AF=BC=E5=85=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=8E=AF=E5=A2=83=E8=B5=84=E6=BA=90=E6=B1=A0?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=89=A7=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021399 --user=赵勇 【接口测试】有一个场景,使用LOCAL资源池执行一直pending https://www.tapd.cn/55049933/s/1321056 --- .../io/metersphere/commons/utils/GenerateHashTreeUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/commons/utils/GenerateHashTreeUtil.java b/api-test/backend/src/main/java/io/metersphere/commons/utils/GenerateHashTreeUtil.java index d318641ec8..7ddb0af5c1 100644 --- a/api-test/backend/src/main/java/io/metersphere/commons/utils/GenerateHashTreeUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/commons/utils/GenerateHashTreeUtil.java @@ -94,10 +94,11 @@ public class GenerateHashTreeUtil { String environmentType = apiScenarioWithBLOBs.getEnvironmentType(); String environmentJson = apiScenarioWithBLOBs.getEnvironmentJson(); String environmentGroupId = apiScenarioWithBLOBs.getEnvironmentGroupId(); + if (StringUtils.isBlank(environmentType)) { environmentType = EnvironmentType.JSON.toString(); } - if (StringUtils.equals(environmentType, EnvironmentType.JSON.toString())) { + if (StringUtils.equals(environmentType, EnvironmentType.JSON.toString()) && StringUtils.isNotBlank(environmentJson)) { scenario.setEnvironmentMap(JSON.parseObject(environmentJson, Map.class)); } else if (StringUtils.equals(environmentType, EnvironmentType.GROUP.toString())) { Map map = CommonBeanFactory.getBean(BaseEnvGroupProjectService.class).getEnvMap(environmentGroupId); @@ -133,7 +134,7 @@ public class GenerateHashTreeUtil { String definition = element.toString(); MsScenario scenario = JSON.parseObject(definition, MsScenario.class); group.setOnSampleError(scenario.getOnSampleError()); - if (planEnvMap != null && planEnvMap.size() > 0) { + if (MapUtils.isNotEmpty(planEnvMap)) { scenario.setEnvironmentMap(planEnvMap); } else { setScenarioEnv(scenario, item); From 5e9100bb19360fcf1669fd362d6c9c002b710948 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 29 Dec 2022 17:31:00 +0800 Subject: [PATCH 03/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8Drest=E5=8F=82=E6=95=B0=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E5=90=8E=E6=97=A0=E6=B3=95=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E5=88=B0=E5=8F=98=E9=87=8F=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=1021380 --user=王孝刚 【接口测试】rest参数中使用变量后开启编码,变量引用不到 https://www.tapd.cn/55049933/s/1320954 --- .../api/dto/definition/request/sampler/MsHTTPSamplerProxy.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index 0532fc931b..abf7b5f303 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -555,8 +555,7 @@ public class MsHTTPSamplerProxy extends MsTestElement { String value = keyValue.getValue() != null && keyValue.getValue().startsWith("@") ? ScriptEngineUtils.buildFunctionCallString(keyValue.getValue()) : keyValue.getValue(); value = keyValue.isUrlEncode() ? StringUtils.join(StringUtils.join("${__urlencode(", value), ")}") : value; - String key = keyValue.isUrlEncode() ? StringUtils.join(StringUtils.join("${__urlencode(", keyValue.getName()), ")}") : keyValue.getName(); - keyValueMap.put(key, value); + keyValueMap.put(keyValue.getName(), value); } catch (Exception e) { LogUtil.error(e); } From 9188d7368a960d110b6d6bb34fcae106088e6c8a Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Thu, 29 Dec 2022 13:41:35 +0800 Subject: [PATCH 04/28] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C=E5=8F=B0=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8F=8A=E6=97=B6=E5=93=8D=E5=BA=94=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021338--user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021338 --bug=1021332--user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021332 --- .../base/mapper/ext/ExtIssuesMapper.xml | 21 +- .../src/business/component/IssueTableList.vue | 230 ++++++++---------- .../business/component/MsReviewTableItem.vue | 28 +++ 3 files changed, 142 insertions(+), 137 deletions(-) create mode 100644 workstation/frontend/src/business/component/MsReviewTableItem.vue diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml index c3b4e701af..3c5f7ec572 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml @@ -86,18 +86,15 @@ diff --git a/workstation/frontend/src/business/component/IssueTableList.vue b/workstation/frontend/src/business/component/IssueTableList.vue index 3a102b6a89..335b88ed42 100644 --- a/workstation/frontend/src/business/component/IssueTableList.vue +++ b/workstation/frontend/src/business/component/IssueTableList.vue @@ -17,131 +17,77 @@ @refresh="getIssues" ref="table" > - - - + + + { + this.page.result.loading = getIssues(this.page).then((response) => { let data = response.data; this.page.total = data.itemCount; this.page.data = data.listObject; parseCustomFilesForList(this.page.data); + this.initCustomFieldValue(); }); } }, + initCustomFieldValue() { + if (this.fields.length <= 0) { + return; + } + this.page.data.forEach(item => { + let displayValueMap = {}; + let fieldIdSet = new Set(this.fields.map(i => i.id)); + this.issueTemplate.customFields.forEach(field => { + let displayValue; + if (!fieldIdSet.has(field.name)) { + return; + } + if (field.name === '状态') { + displayValue = this.getCustomFieldValue(item, field, this.issueStatusMap[item.status]); + } else { + displayValue = this.getCustomFieldValue(item, field); + } + displayValueMap[field.name] = displayValue; + }); + item.displayValueMap = displayValueMap; + }); + this.loading = false; + }, + handleEdit(resource) { - let issueData = this.$router.resolve({path:'/track/issue',query:{id:resource.id}}); + let issueData = this.$router.resolve({path: '/track/issue', query: {id: resource.id}}); window.open(issueData.href, '_blank'); }, }, diff --git a/workstation/frontend/src/business/component/MsReviewTableItem.vue b/workstation/frontend/src/business/component/MsReviewTableItem.vue new file mode 100644 index 0000000000..d22f900404 --- /dev/null +++ b/workstation/frontend/src/business/component/MsReviewTableItem.vue @@ -0,0 +1,28 @@ + + + + + From d9f86bbd146314ded1cf3df83b8c84fcbb6544df Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 29 Dec 2022 17:19:07 +0800 Subject: [PATCH 05/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E6=88=90=E5=91=98=E4=B8=8B=E6=8B=89=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD=E5=BD=93=E5=89=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=97=B6=E6=A0=A1=E9=AA=8C=E7=94=A8=E6=88=B7=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 过滤掉非当前项目下的成员,可能是超级管理员用户组中的成员,导致成员下拉待选列表数据有问题 --- .../src/business/automation/ApiAutomation.vue | 13 ++++++++++++- .../src/business/definition/ApiDefinition.vue | 13 ++++++++++++- .../sdk-parent/frontend/src/utils/custom_field.js | 12 ++++++++++-- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/api-test/frontend/src/business/automation/ApiAutomation.vue b/api-test/frontend/src/business/automation/ApiAutomation.vue index 0e5344ad09..81fd357556 100644 --- a/api-test/frontend/src/business/automation/ApiAutomation.vue +++ b/api-test/frontend/src/business/automation/ApiAutomation.vue @@ -327,7 +327,7 @@ export default { this.activeName = name; let currentScenario = { status: 'Underway', - principal: getCurrentUser().id, + principal: this._getCurrentUserId(), apiScenarioModuleId: 'default-module', id: getUUID(), modulePath: '/' + this.$t('commons.module_title'), @@ -371,6 +371,17 @@ export default { this.addListener(); } }, + _getCurrentUserId() { + const {id, userGroups} = getCurrentUser(); + if (userGroups) { + // 是否是当前项目下的成员 + let index = userGroups.findIndex(ug => ug.sourceId === getCurrentProjectID()); + if (index !== -1) { + return id; + } + } + return ''; + }, addListener() { let index = this.tabs.findIndex((item) => item.name === this.activeName); // 找到当前选中tab的index if (index != -1) { diff --git a/api-test/frontend/src/business/definition/ApiDefinition.vue b/api-test/frontend/src/business/definition/ApiDefinition.vue index 0f4b43f8bb..fd77fd70d2 100644 --- a/api-test/frontend/src/business/definition/ApiDefinition.vue +++ b/api-test/frontend/src/business/definition/ApiDefinition.vue @@ -659,7 +659,7 @@ export default { name: '', status: 'Underway', method: 'GET', - userId: getCurrentUser().id, + userId: this._getCurrentUserId(), url: '', protocol: this.currentProtocol, environmentId: '', @@ -681,6 +681,17 @@ export default { } this.handleTabsEdit(this.$t('api_test.definition.request.title'), e, api); }, + _getCurrentUserId() { + const {id, userGroups} = getCurrentUser(); + if (userGroups) { + // 是否是当前项目下的成员 + let index = userGroups.findIndex(ug => ug.sourceId === getCurrentProjectID()); + if (index !== -1) { + return id; + } + } + return ''; + }, handleTabClose() { let tabs = this.apiTabs[0]; let message = ''; diff --git a/framework/sdk-parent/frontend/src/utils/custom_field.js b/framework/sdk-parent/frontend/src/utils/custom_field.js index 68f1a04daf..ff7cb718c0 100644 --- a/framework/sdk-parent/frontend/src/utils/custom_field.js +++ b/framework/sdk-parent/frontend/src/utils/custom_field.js @@ -1,5 +1,5 @@ import i18n from "../i18n"; -import { getCurrentUserId } from "../utils/token"; +import {getCurrentProjectID, getCurrentUser} from "../utils/token"; import { SYSTEM_FIELD_NAME_MAP } from "../utils/table-constants"; function setDefaultValue(item, value) { @@ -39,7 +39,15 @@ export function parseCustomField(data, template, rules, oldFields) { val && val === "CURRENT_USER" ) { - val = getCurrentUserId(); + val = ''; + const {id, userGroups} = getCurrentUser(); + if (userGroups) { + // CURRENT_USER是否是当前项目下的成员 + let index = userGroups.findIndex(ug => ug.sourceId === getCurrentProjectID()); + if (index !== -1) { + val = id; + } + } } setDefaultValue(item, val); } From 404bbd916b50c2e46836be07833c15284ebe0d50 Mon Sep 17 00:00:00 2001 From: zhangdahai112 Date: Thu, 29 Dec 2022 19:53:24 +0800 Subject: [PATCH 06/28] =?UTF-8?q?fix(UI=E8=87=AA=E5=8A=A8=E5=8C=96):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E4=BF=9D=E5=AD=98=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E9=85=8D=E7=BD=AE=E6=B2=A1=E6=9C=89=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021100 --user=张大海 【测试跟踪】测试计划 - 执行整个测试计划 - 选择新环境 - 保存,没有保存环境 https://www.tapd.cn/55049933/s/1321002 --- .../java/io/metersphere/plan/service/TestPlanService.java | 4 ++++ .../service/remote/ui/PlanTestPlanUiScenarioCaseService.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java index efa6e1410d..cf10f0f3f8 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java @@ -1669,6 +1669,10 @@ public class TestPlanService { planTestPlanApiCaseService.setApiCaseEnv(planId, runModeConfig); planTestPlanScenarioCaseService.setScenarioEnv(planId, runModeConfig); } + + if (DiscoveryUtil.hasService(MicroServiceName.UI_TEST)) { + planTestPlanUiScenarioCaseService.setScenarioEnv(planId, runModeConfig); + } } public void editReportConfig(TestPlanDTO testPlanDTO) { diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/remote/ui/PlanTestPlanUiScenarioCaseService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/remote/ui/PlanTestPlanUiScenarioCaseService.java index a4cf43759e..56eae36145 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/remote/ui/PlanTestPlanUiScenarioCaseService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/remote/ui/PlanTestPlanUiScenarioCaseService.java @@ -161,4 +161,8 @@ public class PlanTestPlanUiScenarioCaseService extends UiTestService { public List getUiScenarioProjectIds(String planId) { return microService.getForData(serviceName, BASE_URL + "/get/project/ids/" + planId, List.class); } + + public RunModeConfigDTO setScenarioEnv(String planId, RunModeConfigDTO runModeConfig) { + return microService.postForData(serviceName, BASE_URL + "/set/env/" + planId, runModeConfig, RunModeConfigDTO.class); + } } From d865c8142c489a1dce098831fa56770ec4297db4 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 30 Dec 2022 13:49:42 +0800 Subject: [PATCH 07/28] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA)?= =?UTF-8?q?:=20=E6=B2=A1=E6=9C=89=E5=A1=AB=E5=86=99=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=B9=B3=E5=8F=B0=E8=B4=A6=E5=8F=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E5=88=9B=E5=BB=BATAPD=E7=BC=BA=E9=99=B7=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021427 --user=陈建星 【测试跟踪】缺陷管理-提交缺陷到azure失败 https://www.tapd.cn/55049933/s/1321476 --- .../java/io/metersphere/service/wapper/UserService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test-track/backend/src/main/java/io/metersphere/service/wapper/UserService.java b/test-track/backend/src/main/java/io/metersphere/service/wapper/UserService.java index 191e495031..8ea394a862 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/wapper/UserService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/wapper/UserService.java @@ -19,7 +19,11 @@ public class UserService { UserMapper userMapper; public UserDTO.PlatformInfo getCurrentPlatformInfo(String workspaceId) { - return JSON.parseObject(getCurrentPlatformInfoStr(workspaceId), UserDTO.PlatformInfo.class); + String currentPlatformInfoStr = getCurrentPlatformInfoStr(workspaceId); + if (StringUtils.isNotBlank(currentPlatformInfoStr)) { + JSON.parseObject(currentPlatformInfoStr, UserDTO.PlatformInfo.class); + } + return null; } public String getCurrentPlatformInfoStr(String workspaceId) { From 624992cb1bef2035305b8478071c07d26a65713f Mon Sep 17 00:00:00 2001 From: zhangdahai112 Date: Fri, 30 Dec 2022 11:42:13 +0800 Subject: [PATCH 08/28] =?UTF-8?q?fix(UI=E8=87=AA=E5=8A=A8=E5=8C=96):=20?= =?UTF-8?q?=E6=8C=AA=E8=B5=B0=E7=8E=AF=E5=A2=83=E7=AE=A1=E7=90=86=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=99=A8=E4=B8=8E=E6=80=A7=E8=83=BD=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021082 --user=张大海 【UI测试】环境配置-HTTP配置-UI配置,在默认的空域名页面修改UI配置后点击域名,UI配置没有刷新 https://www.tapd.cn/55049933/s/1321448 --- .../environment/EnvironmentHttpConfig.vue | 39 ------------------- .../components/EnvironmentHttpConfig.vue | 39 ------------------- 2 files changed, 78 deletions(-) diff --git a/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue b/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue index 04dd1f9348..76dd55e43d 100644 --- a/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue +++ b/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue @@ -57,45 +57,6 @@ - - - - - - {{ $t("ui.browser") }} - - - - - - - - - {{ $t("ui.performance_mode") }} - - - - - - - - - - - - -
{{ $t('commons.add') }} diff --git a/project-management/frontend/src/business/menu/environment/components/EnvironmentHttpConfig.vue b/project-management/frontend/src/business/menu/environment/components/EnvironmentHttpConfig.vue index 5184cd1597..ef462e631f 100644 --- a/project-management/frontend/src/business/menu/environment/components/EnvironmentHttpConfig.vue +++ b/project-management/frontend/src/business/menu/environment/components/EnvironmentHttpConfig.vue @@ -57,45 +57,6 @@ - - - - - - {{ $t("ui.browser") }} - - - - - - - - - {{ $t("ui.performance_mode") }} - - - - - - - - - - - - -
{{ $t('commons.add') }} From ce89d69acc17168dc159e751e96ad02316b9d5c0 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 30 Dec 2022 13:56:07 +0800 Subject: [PATCH 09/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3TEST=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=82=B9=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=B2=A1=E6=9C=89=E5=BC=B9=E5=90=8C=E6=AD=A5=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021369--user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021369 --- .../definition/components/ApiKeyValue.vue | 14 +- .../definition/components/ApiVariable.vue | 28 +- .../complete/EditCompleteHTTPApi.vue | 352 ++++++++------- .../request/http/ApiHttpRequestForm.vue | 2 + .../components/runtest/RunTestHTTPPage.vue | 406 +++++++++++++++++- .../components/sync/ApiSyncCaseConfig.vue | 144 +++++++ 6 files changed, 768 insertions(+), 178 deletions(-) create mode 100644 api-test/frontend/src/business/definition/components/sync/ApiSyncCaseConfig.vue diff --git a/api-test/frontend/src/business/definition/components/ApiKeyValue.vue b/api-test/frontend/src/business/definition/components/ApiKeyValue.vue index f56e0c92bf..559e35e0f5 100644 --- a/api-test/frontend/src/business/definition/components/ApiKeyValue.vue +++ b/api-test/frontend/src/business/definition/components/ApiKeyValue.vue @@ -240,7 +240,19 @@ export default { } }); if (isNeedCreate) { - this.items.push(new KeyValue({ enable: true })); + this.items.push(new KeyValue({ + enable: true, + contentType: null, + description: null, + file: false, + files: null, + max: null, + min: null, + required: true, + type: null, + urlEncode: false, + value: null + })); } this.$emit('change', this.items); // TODO 检查key重复 diff --git a/api-test/frontend/src/business/definition/components/ApiVariable.vue b/api-test/frontend/src/business/definition/components/ApiVariable.vue index b987721e2f..2ada628752 100644 --- a/api-test/frontend/src/business/definition/components/ApiVariable.vue +++ b/api-test/frontend/src/business/definition/components/ApiVariable.vue @@ -424,13 +424,20 @@ export default { if (isNeedCreate) { this.parameters.push( new KeyValue({ - type: 'text', + contentType: 'text/plain', + description: null, enable: true, + file: false, + files: null, + isEdit: false, + max: null, + min: null, + required: false, + type: 'text', urlEncode: this.urlEncode, uuid: this.uuid(), - required: false, - isEdit: false, - contentType: 'text/plain', + valid: false, + value: null }) ); } @@ -520,13 +527,20 @@ export default { if (this.parameters.length === 0 || this.parameters[this.parameters.length - 1].name) { this.parameters.push( new KeyValue({ - type: 'text', + contentType: 'text/plain', + description: null, enable: true, + file: false, + files: null, + isEdit: false, + max: null, + min: null, required: false, + type: 'text', urlEncode: this.urlEncode, uuid: this.uuid(), - isEdit: false, - contentType: 'text/plain', + valid: false, + value: null }) ); } diff --git a/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue b/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue index 6b1ab9acd0..7c44439efd 100644 --- a/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue +++ b/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue @@ -149,91 +149,15 @@ - - - -
- {{ - $t('api_test.definition.one_click_sync') + 'case' - }} - -
-
- {{ $t('workstation.batch_sync_api_tips') }}

- - {{ $t('workstation.sync') + $t('commons.setting') }} - -

-
- -
-
- -
- - {{ $t('api_test.definition.change_notification') }} - - - - - -
- {{ $t('api_test.definition.recipient_tips') }}
-

- {{ $t('project_application.workstation.go_to_api_message') }} -

- - {{ $t('api_test.definition.recipient') + ':' }} - - - {{ 'CASE' + $t('api_test.creator') }} - - {{ $t('commons.scenario') + $t('api_test.creator') }} - - - -
- - {{ $t('project_application.workstation.no_show_setting') }} - - - - - - - {{ $t('commons.cancel') }} - {{ $t('commons.confirm') }} - -
+ +
@@ -269,11 +193,10 @@ import {createComponent} from '.././jmeter/components'; import {TYPE_TO_C} from '@/business/automation/scenario/Setting'; import MsDialogFooter from 'metersphere-frontend/src/components/MsDialogFooter'; import {getProjectMemberOption} from '@/api/project'; -import {deepClone} from 'metersphere-frontend/src/utils/tableUtils'; import {getDefaultVersion, setLatestVersionById} from 'metersphere-frontend/src/api/version'; -import SyncSetting from '@/business/definition/util/SyncSetting'; import {useApiStore} from '@/store'; +import ApiSyncCaseConfig from "@/business/definition/components/sync/ApiSyncCaseConfig"; const {Body} = require('@/business/definition/model/ApiTestModel'); const Sampler = require('@/business/definition/components/jmeter/components/sampler/sampler'); @@ -294,7 +217,7 @@ export default { MsSelectTree, MsChangeHistory, HttpApiVersionDiff, - SyncSetting, + ApiSyncCaseConfig }, data() { let validateURL = (rule, value, callback) => { @@ -377,7 +300,6 @@ export default { createNewVersionVisible: false, batchSyncApiVisible: false, isXpack: false, - showApiSyncConfig: true, apiSyncRuleRelation: { caseCreator: true, scenarioCreator: true, @@ -555,7 +477,6 @@ export default { this.$refs['httpForm'].validate((valid) => { if (valid) { this.setParameter(); - if (!this.httpForm.versionId) { if (this.$refs.versionHistory && this.$refs.versionHistory.currentVersion) { this.httpForm.versionId = this.$refs.versionHistory.currentVersion.id; @@ -564,76 +485,214 @@ export default { if (hasLicense() && (this.httpForm.caseTotal > 0 || this.citedScenarioCount > 0) && !this.httpForm.isCopy) { if (this.httpForm.method !== this.beforeHttpForm.method && !this.noShowSyncRuleRelation) { this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); } if (this.httpForm.path !== this.beforeHttpForm.path && !this.noShowSyncRuleRelation) { this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); } - if (this.httpForm.request.headers && this.beforeRequest.headers) { - for (let i = 0; i < this.httpForm.request.headers.length; i++) { - if (this.httpForm.request.headers[i].isEdit !== undefined) { - this.beforeRequest.headers[i].isEdit = this.httpForm.request.headers[i].isEdit + if (this.request.headers && this.beforeRequest.headers) { + if (this.request.headers.length === this.beforeRequest.headers.length) { + let requestHeaders = []; + let beforeHeaders = []; + for (let i = 0; i < this.request.headers.length; i++) { + this.beforeRequest.headers[i].valid = this.request.headers[i].valid + if (this.request.headers[i].isEdit !== undefined) { + this.beforeRequest.headers[i].isEdit = this.request.headers[i].isEdit + } + if (this.request.headers[i].uuid) { + this.beforeRequest.headers[i].uuid = this.request.headers[i].uuid + } + if (this.request.headers[i].time) { + this.beforeRequest.headers[i].time = this.request.headers[i].time + } + if (this.request.headers[i].name === undefined) { + this.beforeRequest.headers[i].name = undefined + } + let newRequest = this.request.headers[i]; + const ordered = {}; + Object.keys(newRequest).sort().forEach(function (key) { + ordered[key] = newRequest[key]; + }); + requestHeaders.push(ordered); + let beforeRequest = this.beforeRequest.headers[i]; + const beforeOrdered = {}; + Object.keys(beforeRequest).sort().forEach(function (key) { + beforeOrdered[key] = beforeRequest[key]; + }); + beforeHeaders.push(beforeOrdered) + } + + let submitRequestHeaders = JSON.stringify(requestHeaders); + let beforeRequestHeaders = JSON.stringify(beforeHeaders); + if (submitRequestHeaders !== beforeRequestHeaders && !this.noShowSyncRuleRelation) { + this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); + } + } else { + let submitRequestHeaders = JSON.stringify(this.request.headers); + let beforeRequestHeaders = JSON.stringify(this.beforeRequest.headers); + if (submitRequestHeaders !== beforeRequestHeaders && !this.noShowSyncRuleRelation) { + this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); } } - let submitRequestHeaders = JSON.stringify(this.httpForm.request.headers); - let beforeRequestHeaders = JSON.stringify(this.beforeRequest.headers); - if (submitRequestHeaders !== beforeRequestHeaders && !this.noShowSyncRuleRelation) { - this.batchSyncApiVisible = true; - } } - if (this.httpForm.request.arguments && this.beforeRequest.arguments) { - for (let i = 0; i < this.httpForm.request.arguments.length; i++) { - if (this.httpForm.request.arguments[i].isEdit !== undefined) { - this.beforeRequest.arguments[i].isEdit = this.httpForm.request.arguments[i].isEdit + if (this.request.arguments && this.beforeRequest.arguments) { + if (this.request.arguments.length === this.beforeRequest.arguments.length) { + let requestArguments = []; + let beforeArguments = []; + for (let i = 0; i < this.request.arguments.length; i++) { + if (this.request.arguments[i].isEdit !== undefined) { + this.beforeRequest.arguments[i].isEdit = this.request.arguments[i].isEdit + } + if (this.request.arguments[i].uuid) { + this.beforeRequest.arguments[i].uuid = this.request.arguments[i].uuid + } + if (this.request.arguments[i].time) { + this.beforeRequest.arguments[i].time = this.request.arguments[i].time + } + if (this.request.arguments[i].name === undefined) { + this.beforeRequest.arguments[i].name = undefined + } + this.beforeRequest.arguments[i].valid = this.request.arguments[i].valid + let newRequest = this.request.arguments[i]; + const ordered = {}; + Object.keys(newRequest).sort().forEach(function (key) { + ordered[key] = newRequest[key]; + }); + requestArguments.push(ordered); + let beforeRequest = this.beforeRequest.arguments[i]; + const beforeOrdered = {}; + Object.keys(beforeRequest).sort().forEach(function (key) { + beforeOrdered[key] = beforeRequest[key]; + }); + beforeArguments.push(beforeOrdered) + } + let submitRequestQuery = JSON.stringify(requestArguments); + let beforeRequestQuery = JSON.stringify(beforeArguments); + if (submitRequestQuery !== beforeRequestQuery && !this.noShowSyncRuleRelation) { + this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); + } + } else { + let submitRequestQuery = JSON.stringify(this.request.arguments); + let beforeRequestQuery = JSON.stringify(this.beforeRequest.arguments); + if (submitRequestQuery !== beforeRequestQuery && !this.noShowSyncRuleRelation) { + this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); } } - let submitRequestQuery = JSON.stringify(this.httpForm.request.arguments); - let beforeRequestQuery = JSON.stringify(this.beforeRequest.arguments); - if (submitRequestQuery !== beforeRequestQuery && !this.noShowSyncRuleRelation) { - this.batchSyncApiVisible = true; - } } - if (this.httpForm.request.rest && this.beforeRequest.rest) { - for (let i = 0; i < this.httpForm.request.rest.length; i++) { - if (this.httpForm.request.rest[i].isEdit !== undefined) { - this.beforeRequest.rest[i].isEdit = this.httpForm.request.rest[i].isEdit + if (this.request.rest && this.beforeRequest.rest) { + if (this.request.rest.length === this.beforeRequest.rest.length) { + let requestRest = []; + let beforeRest = []; + for (let i = 0; i < this.request.rest.length; i++) { + if (this.request.rest[i].isEdit !== undefined) { + this.beforeRequest.rest[i].isEdit = this.request.rest[i].isEdit + } + if (this.request.rest[i].uuid) { + this.beforeRequest.rest[i].uuid = this.request.rest[i].uuid + } + if (this.request.rest[i].time) { + this.beforeRequest.rest[i].time = this.request.rest[i].time + } + if (this.request.rest[i].name === undefined) { + this.beforeRequest.rest[i].name = undefined + } + this.beforeRequest.rest[i].valid = this.request.rest[i].valid + + let newRequest = this.request.rest[i]; + const ordered = {}; + Object.keys(newRequest).sort().forEach(function (key) { + ordered[key] = newRequest[key]; + }); + requestRest.push(ordered); + let beforeRequest = this.beforeRequest.rest[i]; + const beforeOrdered = {}; + Object.keys(beforeRequest).sort().forEach(function (key) { + beforeOrdered[key] = beforeRequest[key]; + }); + beforeRest.push(beforeOrdered) + } + let submitRequestRest = JSON.stringify(requestRest); + let beforeRequestRest = JSON.stringify(beforeRest); + if (submitRequestRest !== beforeRequestRest && !this.noShowSyncRuleRelation) { + this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); + } + } else { + let submitRequestRest = JSON.stringify(this.request.rest); + let beforeRequestRest = JSON.stringify(this.beforeRequest.rest); + if (submitRequestRest !== beforeRequestRest && !this.noShowSyncRuleRelation) { + this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); } } - let submitRequestRest = JSON.stringify(this.httpForm.request.rest); - let beforeRequestRest = JSON.stringify(this.beforeRequest.rest); - if (submitRequestRest !== beforeRequestRest && !this.noShowSyncRuleRelation) { - this.batchSyncApiVisible = true; - } } - if (this.httpForm.request.body && this.beforeRequest.body) { - let submitRequestBody = JSON.stringify(this.httpForm.request.body); + if (this.request.body && this.beforeRequest.body) { + if (this.request.body.valid) { + this.beforeRequest.body.valid = this.request.body.valid + } + if (this.request.body.kvs.length === this.beforeRequest.body.kvs.length) { + let requestKvs = []; + let beforeKvs = []; + for (let i = 0; i < this.request.body.kvs.length; i++) { + if (this.request.body.kvs[i].isEdit !== undefined) { + this.beforeRequest.body.kvs[i].isEdit = this.request.body.kvs[i].isEdit + } + if (this.request.body.kvs[i].files !== null && this.request.body.kvs[i].files.length === 0) { + this.beforeRequest.body.kvs[i].files = this.request.body.kvs[i].files + } + if (this.request.body.kvs[i].uuid) { + this.beforeRequest.body.kvs[i].uuid = this.request.body.kvs[i].uuid + } + if (this.request.body.kvs[i].time) { + this.beforeRequest.body.kvs[i].time = this.request.body.kvs[i].time + } + if (this.request.body.kvs[i].name === undefined) { + this.beforeRequest.body.kvs[i].name = undefined + } + this.beforeRequest.body.kvs[i].valid = this.request.body.kvs[i].valid + + let newRequest = this.request.body.kvs[i]; + const ordered = {}; + Object.keys(newRequest).sort().forEach(function (key) { + ordered[key] = newRequest[key]; + }); + requestKvs.push(ordered); + let beforeRequest = this.request.body.kvs[i]; + const beforeOrdered = {}; + Object.keys(beforeRequest).sort().forEach(function (key) { + beforeOrdered[key] = beforeRequest[key]; + }); + beforeKvs.push(beforeOrdered) + } + this.request.body.kvs = requestKvs; + this.beforeRequest.body.kvs = beforeKvs + } + let submitRequestBody = JSON.stringify(this.request.body); let beforeRequestBody = JSON.stringify(this.beforeRequest.body); - for (let i = 0; i < this.httpForm.request.body.kvs.length; i++) { - if (this.httpForm.request.body.kvs[i].isEdit !== undefined) { - this.beforeRequest.body.kvs[i].isEdit = this.httpForm.request.body.kvs[i].isEdit - } - if (this.httpForm.request.body.kvs[i].files !== null && this.httpForm.request.body.kvs[i].files.length === 0) { - this.beforeRequest.body.kvs[i].files = this.httpForm.request.body.kvs[i].files - } - if (this.httpForm.request.body.kvs[i].uuid) { - this.beforeRequest.body.kvs[i].uuid = this.httpForm.request.body.kvs[i].uuid - } - } if (submitRequestBody !== beforeRequestBody && !this.noShowSyncRuleRelation) { this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); } } - if (this.httpForm.request.authManager && this.beforeRequest.authManager) { - let submitRequestAuthManager = JSON.stringify(this.httpForm.request.authManager); + if (this.request.authManager && this.beforeRequest.authManager) { + let submitRequestAuthManager = JSON.stringify(this.request.authManager); let beforeRequestAuthManager = JSON.stringify(this.beforeRequest.authManager); if (submitRequestAuthManager !== beforeRequestAuthManager && !this.noShowSyncRuleRelation) { this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); } } - if (this.httpForm.request.hashTree && this.beforeRequest.hashTree) { - let submitRequestHashTree = JSON.stringify(this.httpForm.request.hashTree); + if (this.request.hashTree && this.beforeRequest.hashTree) { + let submitRequestHashTree = JSON.stringify(this.request.hashTree); let beforeRequestHashTree = JSON.stringify(this.beforeRequest.hashTree); if (submitRequestHashTree !== beforeRequestHashTree && !this.noShowSyncRuleRelation) { this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); } } if ( @@ -645,10 +704,12 @@ export default { !this.noShowSyncRuleRelation ) { this.batchSyncApiVisible = true; + this.$refs.syncCaseConfig.show(); } if (this.batchSyncApiVisible !== true) { this.$emit('saveApi', this.httpForm); } + } else { this.$emit('saveApi', this.httpForm); } @@ -660,16 +721,10 @@ export default { } }); }, - batchSync() { + batchSync(fromData) { if (hasLicense() && (this.httpForm.caseTotal > 0 || this.citedScenarioCount > 0) && !this.httpForm.isCopy) { - if (this.$refs.synSetting && this.$refs.synSetting.fromData) { - let fromData = this.$refs.synSetting.fromData; - fromData.method = true; - fromData.path = true; - fromData.protocol = true; - this.httpForm.triggerUpdate = JSON.stringify(fromData); - this.apiSyncRuleRelation.apiSyncCaseRequest = JSON.stringify(fromData); - } + this.httpForm.triggerUpdate = JSON.stringify(fromData); + this.apiSyncRuleRelation.apiSyncCaseRequest = JSON.stringify(fromData); if (this.apiSyncRuleRelation.sendNotice && this.apiSyncRuleRelation.sendNotice === true) { this.httpForm.sendSpecialMessage = this.apiSyncRuleRelation.sendNotice; } else { @@ -694,7 +749,7 @@ export default { saveApiSyncRuleRelation(apiSyncRuleRelation) { updateRuleRelation(apiSyncRuleRelation.resourceId, apiSyncRuleRelation).then(() => { this.$emit('saveApi', this.httpForm); - this.batchSyncApiVisible = false; + this.$refs.syncCaseConfig.close(); }); }, createModules() { @@ -1019,12 +1074,6 @@ export default { this.checkout(row); }); }, - gotoApiMessage() { - let apiResolve = this.$router.resolve({ - path: '/project/messagesettings', - }); - window.open(apiResolve.href, '_blank'); - }, getSyncRule() { relationGet(this.httpForm.id, 'API').then((response) => { if (response.data) { @@ -1051,9 +1100,6 @@ export default { } }); }, - updateSyncData(value) { - this.apiSyncRuleRelation.apiSyncConfig = value; - }, handleCommand(command) { if (command === 'openSyncRule') { this.noShowSyncRuleRelation = false; diff --git a/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue b/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue index 71fecc2e6a..01f6859d84 100644 --- a/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue +++ b/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue @@ -513,6 +513,7 @@ export default { if (item) { let line = item.split(/:|:/); let values = item.split(line[0] + ':'); + let required = false; keyValues.push( new KeyValue({ @@ -525,6 +526,7 @@ export default { encode: true, enable: true, contentType: 'text/plain', + }) ); } diff --git a/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue b/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue index 716ffad7b9..cc082c2a6b 100644 --- a/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue +++ b/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue @@ -74,14 +74,22 @@ :response="responseData" v-if="loadRequest" :request="api.request" - ref="apiRequestForm" /> + ref="apiRequestForm"/>

{{ $t('api_test.definition.request.res_param') }}

- +
- + + + ref="caseList"/> + + From 474ea08815bb383b8e733e073fd3350c0dc45d12 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 30 Dec 2022 14:47:26 +0800 Subject: [PATCH 10/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=97=B6=E5=93=8D=E5=BA=94=E4=BD=93=E7=8A=B6=E6=80=81=E7=A0=81?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E4=BF=A1=E6=81=AF=E5=AF=BC=E5=87=BA=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020795--user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001020795 --- .../io/metersphere/api/parse/api/Swagger3Parser.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java index 797dcbfe18..4c8499928d 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java @@ -979,7 +979,7 @@ public class Swagger3Parser extends SwaggerAbstractParser { return new JSONObject(); } JSONObject responseBody = new JSONObject(); - JSONObject statusCodeInfo = new JSONObject(); + // build 请求头 JSONObject headers = new JSONObject(); JSONArray headValueList = response.optJSONArray("headers"); @@ -995,13 +995,14 @@ public class Swagger3Parser extends SwaggerAbstractParser { } } } - statusCodeInfo.put("headers", headers); - statusCodeInfo.put("content", buildContent(response)); - statusCodeInfo.put("description", StringUtils.EMPTY); // 返回code JSONArray statusCode = response.optJSONArray("statusCode"); for (int i = 0; i < statusCode.length(); i++) { + JSONObject statusCodeInfo = new JSONObject(); + statusCodeInfo.put("headers", headers); + statusCodeInfo.put("content", buildContent(response)); + statusCodeInfo.put("description", StringUtils.EMPTY); JSONObject jsonObject = statusCode.getJSONObject(i); jsonObject.get("name"); statusCodeInfo.put("description", jsonObject.get("value")); From b15910316edaf62ba68114ff2400b52ba349cda0 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 30 Dec 2022 14:57:39 +0800 Subject: [PATCH 11/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E7=94=B1=E4=BA=8E=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=BC=E5=85=A5=E5=AF=B9example=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=97=AE=E9=A2=98=E8=80=8C=E4=BA=A7=E7=94=9F=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021408--user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021408 --- .../main/java/io/metersphere/api/parse/api/Swagger3Parser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java index 4c8499928d..78d9c6fd29 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java @@ -330,7 +330,7 @@ public class Swagger3Parser extends SwaggerAbstractParser { Set refSet = new HashSet<>(); Map infoMap = new HashMap(); Schema schema = getSchema(mediaType.getSchema()); - if (content.get(contentType).getExample() != null && schema.getExample() == null) { + if (content.get(contentType) != null && content.get(contentType).getExample() != null && schema.getExample() == null) { schema.setExample(content.get(contentType).getExample()); } Object bodyData = null; From 648cc80439c7eb87574727575a69f7edfbcd1dc3 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 30 Dec 2022 15:15:46 +0800 Subject: [PATCH 12/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=85=A5=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BF=9D=E7=95=99swagger=E4=B8=8A=E6=AC=A1=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=AE=B0=E5=BD=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021412--user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021412 --- .../definition/components/import/ApiImport.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/api-test/frontend/src/business/definition/components/import/ApiImport.vue b/api-test/frontend/src/business/definition/components/import/ApiImport.vue index c51c50e918..5695896188 100644 --- a/api-test/frontend/src/business/definition/components/import/ApiImport.vue +++ b/api-test/frontend/src/business/definition/components/import/ApiImport.vue @@ -10,7 +10,7 @@ :destroy-on-close="true">
{{ $t('api_test.api_import.data_format') }}
- + {{ item.name }} @@ -106,7 +106,7 @@ :show-desc="true" :isShowEnable="isShowEnable" :suggestions="headerSuggestions" - :items="headers" /> + :items="headers"/>
{{ $t('api_test.definition.request.query_param') }}{{ $t('api_test.api_import.optional') }}: @@ -466,9 +466,9 @@ export default { clearAuthInfo() { this.headers = []; this.queryArguments = []; - this.headers.push(new KeyValue({ enable: true })); - this.queryArguments.push(new KeyValue({ enable: true })); - this.authConfig = { hashTree: [], authManager: {} }; + this.headers.push(new KeyValue({enable: true})); + this.queryArguments.push(new KeyValue({enable: true})); + this.authConfig = {hashTree: [], authManager: {}}; this.$refs.importAuth.initData(); }, changeAuthEnable() { @@ -476,6 +476,12 @@ export default { this.clearAuthInfo(); } }, + clearUrParameter(value) { + if (value !== 'Swagger2') { + this.clearAuthInfo(); + this.authEnable = false; + } + }, buildParam() { let param = {}; Object.assign(param, this.formData); From 6ab04cef70d095ec30f0e8c977c1c46f88fd3ea3 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 30 Dec 2022 14:54:13 +0800 Subject: [PATCH 13/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E7=8E=AF=E5=A2=83=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E6=95=B0=E6=8D=AE=E6=B2=A1=E6=9C=89=E5=88=B7=E6=96=B0?= =?UTF-8?q?=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=1021366 --user=王孝刚 【接口测试】在接口TEST/CASE等页面更新环境后,接口定义右上角的环境下拉框没更新 https://www.tapd.cn/55049933/s/1321539 --- .../definition/components/case/MsEnvironmentSelect.vue | 4 ++++ .../src/business/environment/components/EnvironmentSelect.vue | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/api-test/frontend/src/business/definition/components/case/MsEnvironmentSelect.vue b/api-test/frontend/src/business/definition/components/case/MsEnvironmentSelect.vue index b313ca61ed..8d900225f7 100644 --- a/api-test/frontend/src/business/definition/components/case/MsEnvironmentSelect.vue +++ b/api-test/frontend/src/business/definition/components/case/MsEnvironmentSelect.vue @@ -8,6 +8,7 @@ :placeholder="$t('api_test.definition.request.run_env')" clearable filterable + @click.native="refreshEnv" @clear="clear"> { From ac1afa8cf2f2cf286e7061ff78235ccf9138962a Mon Sep 17 00:00:00 2001 From: CaptainB Date: Fri, 30 Dec 2022 17:26:55 +0800 Subject: [PATCH 14/28] build: xstream version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1076fc2f2f..a4726f15f2 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ 1.70 2.11.0 1.10.0 - 1.4.19 + 1.4.20 3.1.0 2.1.5 1.7.14 From b3adadc6f46c8d95ef56632e2d8a0ef5c92a9229 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 30 Dec 2022 17:32:29 +0800 Subject: [PATCH 15/28] build: swagger version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a4726f15f2..ac097a4466 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ 1.10.0 1.4.20 3.1.0 - 2.1.5 + 2.1.8 1.7.14 1.15.3 0.19.0 From 8d92d8f91b71c3714eff4777e7dd27c6d40c9997 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 3 Jan 2023 09:47:05 +0800 Subject: [PATCH 16/28] =?UTF-8?q?style(=E6=8E=A5=E5=8F=A3=E6=B5=8B?= =?UTF-8?q?=E8=AF=95):=20=E5=BE=AA=E7=8E=AF=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=A0=B7=E5=BC=8F=E6=98=BE=E7=A4=BA=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021456 --user=赵勇 【接口测试】单独执行场景里的循环控制器,循环控制器error颜色错误,步骤没有执行结果 https://www.tapd.cn/55049933/s/1321770 --- .../business/automation/scenario/component/LoopController.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-test/frontend/src/business/automation/scenario/component/LoopController.vue b/api-test/frontend/src/business/automation/scenario/component/LoopController.vue index 498f699aea..2915c2a5c0 100644 --- a/api-test/frontend/src/business/automation/scenario/component/LoopController.vue +++ b/api-test/frontend/src/business/automation/scenario/component/LoopController.vue @@ -178,7 +178,7 @@ {{ getCode() }} From b0ce81da51c1aa410a99d2a4f945c488c47d53fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=91=9E=E6=96=8C?= Date: Tue, 3 Jan 2023 12:27:31 +0800 Subject: [PATCH 17/28] chore: readme date --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2795673444..79157b4a45 100755 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ MeterSphere 的最新 LTS 版本为 v1.20 LTS。MeterSphere 下一个 LTS 版本 ### License & Copyright -Copyright (c) 2014-2022 飞致云 FIT2CLOUD, All rights reserved. +Copyright (c) 2014-2023 飞致云 FIT2CLOUD, All rights reserved. Licensed under The GNU General Public License version 3 (GPLv3) (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at From fd1a73f51f3c7e957d39ac790c83f73f212fed7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=91=9E=E6=96=8C?= Date: Tue, 3 Jan 2023 12:31:17 +0800 Subject: [PATCH 18/28] chore: readme date --- README-EN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-EN.md b/README-EN.md index 2f1549b411..1eb21fe3b7 100644 --- a/README-EN.md +++ b/README-EN.md @@ -158,7 +158,7 @@ curl -sSL https://github.com/metersphere/metersphere/releases/latest/download/qu ## License & Copyright -Copyright (c) 2014-2022 飞致云 FIT2CLOUD, All rights reserved. +Copyright (c) 2014-2023 飞致云 FIT2CLOUD, All rights reserved. Licensed under The GNU General Public License version 3 (GPLv3) (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at From c5547e5228db34124438f3a3832d05628b31e8d6 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 3 Jan 2023 11:32:39 +0800 Subject: [PATCH 19/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6=E9=94=99?= =?UTF-8?q?=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=1021457 --user=赵勇 [BUG]GitHub #21035 场景中复制的场景/循环控制器/事物控制器/条件控制器下面中引用的接口case无法删除 https://www.tapd.cn/55049933/s/1321965 --- .../automation/scenario/common/ApiBaseComponent.vue | 4 ++-- .../automation/scenario/component/ApiComponent.vue | 12 +++--------- .../scenario/component/ApiScenarioComponent.vue | 2 ++ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue b/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue index 3401df0e35..97066b74cf 100644 --- a/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue @@ -267,14 +267,14 @@ export default { return ( !this.innerStep || (this.showBtn && - (!this.data.disabled || this.data.root || this.data.isCopy) && + (!this.data.disabled || this.data.root || this.data.isCopy || this.data.showExtend) && this.showVersion && this.stepFilter.get('ALlSamplerStep').indexOf(this.data.type) === -1) ); } return ( this.showBtn && - (!this.data.disabled || this.data.root || this.isDeleted || this.data.isCopy) && + (!this.data.disabled || this.data.root || this.isDeleted || this.data.isCopy || this.data.showExtend) && this.showVersion && this.stepFilter.get('ALlSamplerStep').indexOf(this.data.type) === -1 ); diff --git a/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue b/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue index b1ac050f9f..50c9533e22 100644 --- a/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue @@ -281,6 +281,8 @@ export default { if (this.request.id && this.request.referenced === 'REF') { this.request.disabled = true; this.request.root = this.node.parent.parent ? false : true; + this.request.showExtend = + this.node.parent && this.node.parent.data && this.node.parent.data.disabled ? false : true; } this.isShowNum = this.request.num ? true : false; if (this.request.protocol === 'HTTP') { @@ -332,15 +334,7 @@ export default { return {}; }, isCompReadOnly() { - if (this.request) { - if (this.request.disabled) { - return this.request.disabled; - } else { - return false; - } - } else { - return false; - } + return this.request.disabled; }, displayTitle() { if (this.isApiImport) { diff --git a/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue b/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue index 099008d0c5..6354db91b0 100644 --- a/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue @@ -156,6 +156,8 @@ export default { if (this.scenario.id && this.scenario.referenced === 'REF' && !this.scenario.loaded && this.scenario.hashTree) { this.scenario.root = this.node.parent.parent ? false : true; this.scenario.disabled = true; + this.scenario.showExtend = + this.node.parent && this.node.parent.data && this.node.parent.data.disabled ? false : true; this.recursive(this.scenario.hashTree, this.scenario.projectId, true); } if (this.scenario.id && this.scenario.referenced === 'Copy' && !this.scenario.isCopy && !this.scenario.disabled) { From c6f40309555ea01d7a0b8b36ef5072fce5a387c6 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 3 Jan 2023 10:56:31 +0800 Subject: [PATCH 20/28] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8Dswagger=E5=AF=BC=E5=87=BA=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021484 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001021484&from=worktable_title --- .../io/metersphere/api/parse/api/Swagger3Parser.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java index 78d9c6fd29..a55a951ba7 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/api/Swagger3Parser.java @@ -1004,9 +1004,12 @@ public class Swagger3Parser extends SwaggerAbstractParser { statusCodeInfo.put("content", buildContent(response)); statusCodeInfo.put("description", StringUtils.EMPTY); JSONObject jsonObject = statusCode.getJSONObject(i); - jsonObject.get("name"); - statusCodeInfo.put("description", jsonObject.get("value")); - responseBody.put(jsonObject.get("name").toString(), statusCodeInfo); + if (jsonObject.optString("value") != null) { + statusCodeInfo.put("description", jsonObject.optString("value")); + } + if (jsonObject.optString("name") != null) { + responseBody.put(jsonObject.optString("name"), statusCodeInfo); + } } return responseBody; } From e49e12c1fe8eccaa1f673c37ae482ef7a62c4279 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 3 Jan 2023 13:27:19 +0800 Subject: [PATCH 21/28] chore: v2.6.0 flyway --- .../src/main/resources/db/migration/V4__2.6.0_release.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 test-track/backend/src/main/resources/db/migration/V4__2.6.0_release.sql diff --git a/test-track/backend/src/main/resources/db/migration/V4__2.6.0_release.sql b/test-track/backend/src/main/resources/db/migration/V4__2.6.0_release.sql new file mode 100644 index 0000000000..73f0bcfe4c --- /dev/null +++ b/test-track/backend/src/main/resources/db/migration/V4__2.6.0_release.sql @@ -0,0 +1 @@ +-- init sql \ No newline at end of file From 92a1a5b5746cd3c626cad361f96bc44ed439d0bf Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 3 Jan 2023 13:32:38 +0800 Subject: [PATCH 22/28] chore: v2.6.0 flyway create index --- .../resources/db/migration/V4__2.6.0_release.sql | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test-track/backend/src/main/resources/db/migration/V4__2.6.0_release.sql b/test-track/backend/src/main/resources/db/migration/V4__2.6.0_release.sql index 73f0bcfe4c..d0a77bb52a 100644 --- a/test-track/backend/src/main/resources/db/migration/V4__2.6.0_release.sql +++ b/test-track/backend/src/main/resources/db/migration/V4__2.6.0_release.sql @@ -1 +1,12 @@ --- init sql \ No newline at end of file +-- init sql +-- 工单名称 v26_create_index +-- 创建人 guoyuqi +ALTER table issues ADD INDEX project_id_index(project_id); + +ALTER table issues ADD INDEX creator_index(creator); + +ALTER table custom_field ADD INDEX global_index(global); + +ALTER table custom_field ADD INDEX scene_index(scene); + +ALTER table custom_field ADD INDEX name_index(name); From a9c5fe283be3de5c0f1af1ecf400e8503f3741af Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 3 Jan 2023 12:48:09 +0800 Subject: [PATCH 23/28] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B?= =?UTF-8?q?=E8=AF=95):=20=E4=BF=9D=E7=95=99=E6=8E=A5=E5=8F=A3=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E6=AC=A1test=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1010697 --user=赵勇 接口TEST保留最近一次测试记录 https://www.tapd.cn/55049933/s/1322006 --- .../components/EditCompleteContainer.vue | 2 +- .../components/runtest/RunTestDubboPage.vue | 2 +- .../components/runtest/RunTestHTTPPage.vue | 160 ++++++++++-------- .../components/runtest/RunTestSQLPage.vue | 2 +- .../components/runtest/RunTestTCPPage.vue | 2 +- 5 files changed, 91 insertions(+), 77 deletions(-) diff --git a/api-test/frontend/src/business/definition/components/EditCompleteContainer.vue b/api-test/frontend/src/business/definition/components/EditCompleteContainer.vue index 089fddfc17..e913d31300 100644 --- a/api-test/frontend/src/business/definition/components/EditCompleteContainer.vue +++ b/api-test/frontend/src/business/definition/components/EditCompleteContainer.vue @@ -55,7 +55,7 @@ :api-template="apiTemplate" @validateBasic="validateBasic" />
-
+
+ ref="apiRequestForm" />

{{ $t('api_test.definition.request.res_param') }}

- +
+ ref="syncCaseConfig"> + ref="caseList" />