From cc4e72906ee826ee255bc1ab5331b8398507265f Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Mon, 15 Jun 2020 10:59:10 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/ext/ExtTestPlanTestCaseMapper.xml | 3 + .../track/dto/TestCaseReportMetricDTO.java | 1 + .../QueryTestPlanCaseRequest.java | 2 + .../track/service/TestPlanService.java | 19 ++- .../FailureResultComponent.vue | 119 ++++++++++++++++++ .../TemplateComponent/TemplateComponent.vue | 7 +- 6 files changed, 146 insertions(+), 5 deletions(-) create mode 100644 frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/FailureResultComponent.vue diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml index d82ed5dbba..cabc50ee96 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml @@ -36,6 +36,9 @@ #{nodeId} + + and test_plan_test_case.status = #{request.status} + and test_plan_test_case.executor = #{request.executor} diff --git a/backend/src/main/java/io/metersphere/track/dto/TestCaseReportMetricDTO.java b/backend/src/main/java/io/metersphere/track/dto/TestCaseReportMetricDTO.java index 68bc086c1e..e061230151 100644 --- a/backend/src/main/java/io/metersphere/track/dto/TestCaseReportMetricDTO.java +++ b/backend/src/main/java/io/metersphere/track/dto/TestCaseReportMetricDTO.java @@ -11,6 +11,7 @@ public class TestCaseReportMetricDTO { private List executeResult; private List moduleExecuteResult; + private List failureTestCases; private List executors; private String principal; private Long startTime; diff --git a/backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java b/backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java index 434a3ee576..c4af29338c 100644 --- a/backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java +++ b/backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java @@ -25,4 +25,6 @@ public class QueryTestPlanCaseRequest extends TestPlanTestCase { private String workspaceId; private String name; + + private String status; } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index 14a64840b7..6e3db32e8d 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -3,10 +3,7 @@ package io.metersphere.track.service; import com.alibaba.fastjson.JSON; import io.metersphere.base.domain.*; -import io.metersphere.base.mapper.TestCaseMapper; -import io.metersphere.base.mapper.TestCaseNodeMapper; -import io.metersphere.base.mapper.TestPlanMapper; -import io.metersphere.base.mapper.TestPlanTestCaseMapper; +import io.metersphere.base.mapper.*; import io.metersphere.base.mapper.ext.ExtProjectMapper; import io.metersphere.base.mapper.ext.ExtTestPlanMapper; import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper; @@ -67,6 +64,9 @@ public class TestPlanService { @Resource ExtProjectMapper extProjectMapper; + @Resource + TestCaseReportMapper testCaseReportMapper; + public void addTestPlan(TestPlan testPlan) { if (getTestPlanByName(testPlan.getName()).size() > 0) { MSException.throwException(Translator.get("plan_name_already_exists")); @@ -256,6 +256,8 @@ public class TestPlanService { QueryTestPlanRequest queryTestPlanRequest = new QueryTestPlanRequest(); queryTestPlanRequest.setId(planId); TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0); + TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId()); +// testCaseReport.get Set executors = new HashSet<>(); Map reportStatusResultMap = new HashMap<>(); @@ -274,6 +276,7 @@ public class TestPlanService { }); List testPlanTestCases = listTestCaseByPlanId(planId); + List failureTestCases = new ArrayList<>(); Map moduleResultMap = new HashMap<>(); @@ -281,6 +284,7 @@ public class TestPlanService { executors.add(testCase.getExecutor()); getStatusResultMap(reportStatusResultMap, testCase); getModuleResultMap(childIdMap, moduleResultMap, testCase, nodeTrees); + getFailureTestCases(failureTestCases, testCase); } nodeTrees.forEach(rootNode -> { @@ -303,10 +307,17 @@ public class TestPlanService { testCaseReportMetricDTO.setExecutors(new ArrayList<>(executors)); testCaseReportMetricDTO.setExecuteResult(new ArrayList<>(reportStatusResultMap.values())); testCaseReportMetricDTO.setModuleExecuteResult(new ArrayList<>(moduleResultMap.values())); + testCaseReportMetricDTO.setFailureTestCases(failureTestCases); return testCaseReportMetricDTO; } + private void getFailureTestCases(List failureTestCases, TestPlanCaseDTO testCase) { + if (StringUtils.equals(testCase.getStatus(), TestPlanTestCaseStatus.Failure.name())) { + failureTestCases.add(testCase); + } + } + private void getStatusResultMap(Map reportStatusResultMap, TestPlanCaseDTO testCase) { TestCaseReportStatusResultDTO statusResult = reportStatusResultMap.get(testCase.getStatus()); if (statusResult == null) { diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/FailureResultComponent.vue b/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/FailureResultComponent.vue new file mode 100644 index 0000000000..b1840b028c --- /dev/null +++ b/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/FailureResultComponent.vue @@ -0,0 +1,119 @@ + + + + + diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/TemplateComponent.vue b/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/TemplateComponent.vue index dfb5d74f8f..a4bcff464a 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/TemplateComponent.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/TemplateComponent.vue @@ -7,6 +7,7 @@ + @@ -15,6 +16,7 @@ + @@ -25,9 +27,12 @@ import TestResultComponent from "./TestResultComponent"; import TestResultChartComponent from "./TestResultChartComponent"; import RichTextComponent from "./RichTextComponent"; + import FailureResultComponent from "./FailureResultComponent"; export default { name: "TemplateComponent", - components: {RichTextComponent, TestResultChartComponent, TestResultComponent, BaseInfoComponent}, + components: { + FailureResultComponent, + RichTextComponent, TestResultChartComponent, TestResultComponent, BaseInfoComponent}, props: { preview: { type: Object From 12537966640726e719707cd172201976e0e4fa49 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Mon, 15 Jun 2020 11:28:56 +0800 Subject: [PATCH 02/28] =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=9B=E5=BB=BA=E6=B5=8B=E8=AF=95=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/head/ApiHeaderMenus.vue | 2 +- .../components/common/head/CreateTest.vue | 3 +-- .../head/PerformanceHeaderMenus.vue | 2 +- .../performance/test/PerformanceTestPlan.vue | 19 ++++++++----------- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/frontend/src/business/components/api/head/ApiHeaderMenus.vue b/frontend/src/business/components/api/head/ApiHeaderMenus.vue index e59943b152..7246c6d84f 100644 --- a/frontend/src/business/components/api/head/ApiHeaderMenus.vue +++ b/frontend/src/business/components/api/head/ApiHeaderMenus.vue @@ -35,7 +35,7 @@ - + diff --git a/frontend/src/business/components/common/head/CreateTest.vue b/frontend/src/business/components/common/head/CreateTest.vue index 1c28a9f13d..c01577b02c 100644 --- a/frontend/src/business/components/common/head/CreateTest.vue +++ b/frontend/src/business/components/common/head/CreateTest.vue @@ -1,5 +1,5 @@ @@ -8,7 +8,6 @@ export default { name: "MsCreateTest", props: { - show: Boolean, to: [String, Object], title: { type: String, diff --git a/frontend/src/business/components/performance/head/PerformanceHeaderMenus.vue b/frontend/src/business/components/performance/head/PerformanceHeaderMenus.vue index 5813802675..cb0fc1c071 100644 --- a/frontend/src/business/components/performance/head/PerformanceHeaderMenus.vue +++ b/frontend/src/business/components/performance/head/PerformanceHeaderMenus.vue @@ -36,7 +36,7 @@ - + diff --git a/frontend/src/business/components/performance/test/PerformanceTestPlan.vue b/frontend/src/business/components/performance/test/PerformanceTestPlan.vue index 9e4419a759..68a5d12331 100644 --- a/frontend/src/business/components/performance/test/PerformanceTestPlan.vue +++ b/frontend/src/business/components/performance/test/PerformanceTestPlan.vue @@ -3,17 +3,9 @@ Date: Mon, 15 Jun 2020 15:05:26 +0800 Subject: [PATCH 03/28] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E7=A9=BA=E9=97=B4=E6=8F=8F=E8=BF=B0=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/business/components/settings/system/SystemWorkspace.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/business/components/settings/system/SystemWorkspace.vue b/frontend/src/business/components/settings/system/SystemWorkspace.vue index 19bf9e366a..f3f6bac586 100644 --- a/frontend/src/business/components/settings/system/SystemWorkspace.vue +++ b/frontend/src/business/components/settings/system/SystemWorkspace.vue @@ -61,7 +61,7 @@ - + From df313fb05ca55418068d4bc8e33f41edfa7572ca Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 15 Jun 2020 15:58:53 +0800 Subject: [PATCH 04/28] =?UTF-8?q?fix=20=E6=8F=8F=E8=BF=B0=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/business/components/settings/system/Organization.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/business/components/settings/system/Organization.vue b/frontend/src/business/components/settings/system/Organization.vue index e257088563..ccdba1a9b3 100644 --- a/frontend/src/business/components/settings/system/Organization.vue +++ b/frontend/src/business/components/settings/system/Organization.vue @@ -61,7 +61,7 @@ - +