From 6ddc5bf2e45292231b87722516d1eb02421cf35e Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Fri, 6 Aug 2021 17:33:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E3=80=81=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E3=80=81=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8=E5=8C=96):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E7=BB=9F=E8=AE=A1=E6=80=BB?= =?UTF-8?q?=E6=95=B0=E9=94=99=E8=AF=AF=E3=80=81=E8=BD=AC=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8A=A5=E9=94=99=E3=80=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E5=87=BA?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=20#1005697=20#1005694=20#1?= =?UTF-8?q?005686?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1005697 --user=宋天阳 【测试跟踪】首页,用例总数统计有误 https://www.tapd.cn/55049933/s/1033262 --bug=1005694 --user=宋天阳 【接口自动化】包含前/后置sql的场景,转性能测试会报错 https://www.tapd.cn/55049933/s/1033263 --bug=1005686 --user=宋天阳 【接口定义】点击首页用例名称,跳转到用例列表后,用例列表数据清空了 https://www.tapd.cn/55049933/s/1033264 --- .../io/metersphere/api/controller/APITestController.java | 1 + .../api/dto/datacount/ExecutedCaseInfoResult.java | 1 + .../api/dto/datacount/response/ExecutedCaseInfoDTO.java | 4 +++- .../request/processors/post/MsJDBCPostProcessor.java | 2 +- .../request/processors/pre/MsJDBCPreProcessor.java | 2 +- .../base/mapper/ext/ExtApiDefinitionExecResultMapper.xml | 8 ++++---- .../metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml | 2 +- .../io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml | 4 +++- .../api/homepage/components/FailureTestCaseList.vue | 2 +- .../components/track/review/commom/ReviewComment.vue | 2 +- 10 files changed, 17 insertions(+), 11 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/controller/APITestController.java b/backend/src/main/java/io/metersphere/api/controller/APITestController.java index 0ad23590a0..1123352bca 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -332,6 +332,7 @@ public class APITestController { dataDTO.setTestPlan(selectData.getTestPlan()); dataDTO.setFailureTimes(selectData.getFailureTimes()); dataDTO.setCaseType(selectData.getCaseType()); + dataDTO.setId(selectData.getId()); dataDTO.setTestPlanDTOList(selectData.getTestPlanDTOList()); } else { dataDTO.setCaseName(""); diff --git a/backend/src/main/java/io/metersphere/api/dto/datacount/ExecutedCaseInfoResult.java b/backend/src/main/java/io/metersphere/api/dto/datacount/ExecutedCaseInfoResult.java index e98e1be8c1..fac9cfd9a8 100644 --- a/backend/src/main/java/io/metersphere/api/dto/datacount/ExecutedCaseInfoResult.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/ExecutedCaseInfoResult.java @@ -13,6 +13,7 @@ import java.util.List; @Setter public class ExecutedCaseInfoResult { private String testCaseID; + private String id; //案例名称 private String caseName; //所属测试计划 diff --git a/backend/src/main/java/io/metersphere/api/dto/datacount/response/ExecutedCaseInfoDTO.java b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ExecutedCaseInfoDTO.java index e3437eedbf..d6e361e5c5 100644 --- a/backend/src/main/java/io/metersphere/api/dto/datacount/response/ExecutedCaseInfoDTO.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ExecutedCaseInfoDTO.java @@ -22,8 +22,10 @@ public class ExecutedCaseInfoDTO { private Long failureTimes; //案例类型 private String caseType; - //案例ID + //案例ID -- 目前被用为案例-测试计划 关联表ID private String caseID; + //ID + private String id; //测试计划集合 private List testPlanDTOList; } diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJDBCPostProcessor.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJDBCPostProcessor.java index 66a327aad6..c9e826b7ec 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJDBCPostProcessor.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJDBCPostProcessor.java @@ -236,7 +236,7 @@ public class MsJDBCPostProcessor extends MsTestElement { private JDBCPostProcessor jdbcPostProcessor(ParameterConfig config) { JDBCPostProcessor jdbcPostProcessor = new JDBCPostProcessor(); jdbcPostProcessor.setEnabled(this.isEnable()); - jdbcPostProcessor.setName(this.getName()); + jdbcPostProcessor.setName(this.getName() == null? "JDBCPostProcessor" : this.getName()); String name = this.getParentName(this.getParent()); if (StringUtils.isNotEmpty(name) && !config.isOperating()) { jdbcPostProcessor.setName(this.getName() + DelimiterConstants.SEPARATOR.toString() + name); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/pre/MsJDBCPreProcessor.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/pre/MsJDBCPreProcessor.java index 74ae9e6549..f1387e0b93 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/pre/MsJDBCPreProcessor.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/pre/MsJDBCPreProcessor.java @@ -236,7 +236,7 @@ public class MsJDBCPreProcessor extends MsTestElement { private JDBCPreProcessor jdbcPreProcessor(ParameterConfig config) { JDBCPreProcessor jdbcPreProcessor = new JDBCPreProcessor(); jdbcPreProcessor.setEnabled(this.isEnable()); - jdbcPreProcessor.setName(this.getName()); + jdbcPreProcessor.setName(this.getName() == null? "JDBCPreProcessor" : this.getName()); String name = this.getParentName(this.getParent()); if (StringUtils.isNotEmpty(name) && !config.isOperating()) { jdbcPreProcessor.setName(this.getName() + DelimiterConstants.SEPARATOR.toString() + name); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml index 6d3e2bb388..f9dee7538c 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml @@ -34,9 +34,9 @@ SELECT apiDef.protocol AS groupField,COUNT(testCase.id) AS countNumber FROM api_test_case testCase INNER JOIN api_definition apiDef ON testCase.api_definition_id = apiDef.id - WHERE testCase.project_id = #{0} AND apiDef.status != "Trash" + WHERE testCase.project_id = #{0} AND (testCase.status IS NULL or testCase.status != "Trash") GROUP BY apiDef.protocol - SELECT test_case.priority as groupField,count(id) AS countNumber FROM test_case WHERE project_id = #{projectId} GROUP BY test_case.priority + SELECT test_case.priority as groupField,count(id) AS countNumber FROM test_case + WHERE project_id = #{projectId} AND (test_case.status IS NULL OR test_case.status != 'Trash') + GROUP BY test_case.priority diff --git a/frontend/src/business/components/api/homepage/components/FailureTestCaseList.vue b/frontend/src/business/components/api/homepage/components/FailureTestCaseList.vue index 058c7a9ea3..cb53033957 100644 --- a/frontend/src/business/components/api/homepage/components/FailureTestCaseList.vue +++ b/frontend/src/business/components/api/homepage/components/FailureTestCaseList.vue @@ -9,7 +9,7 @@ diff --git a/frontend/src/business/components/track/review/commom/ReviewComment.vue b/frontend/src/business/components/track/review/commom/ReviewComment.vue index 7d3bc7a103..8c35b04b97 100644 --- a/frontend/src/business/components/track/review/commom/ReviewComment.vue +++ b/frontend/src/business/components/track/review/commom/ReviewComment.vue @@ -15,7 +15,7 @@
-
+