From 2a5e13bfce7f78b9144fa4c6368bd33cb233620b Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Wed, 7 Apr 2021 15:25:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96-?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA=E6=89=80=E6=9C=89=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E8=AE=BE=E7=BD=AE=E6=93=8D=E4=BD=9C=E5=88=97=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E3=80=81=E8=A1=A8=E6=A0=BC=E9=AB=98=E5=BA=A6=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E3=80=81=E5=A2=9E=E5=8A=A0=E5=85=A8=E9=80=89=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 页面优化-测试跟踪所有表格设置操作列固定、表格高度固定、增加全选操作 --- .../api/controller/APITestController.java | 23 +- .../mapper/ext/ExtTestPlanApiCaseMapper.java | 2 + .../mapper/ext/ExtTestPlanApiCaseMapper.xml | 91 ++++ .../mapper/ext/ExtTestPlanLoadCaseMapper.java | 1 + .../mapper/ext/ExtTestPlanLoadCaseMapper.xml | 39 ++ .../ext/ExtTestPlanScenarioCaseMapper.java | 8 +- .../ext/ExtTestPlanScenarioCaseMapper.xml | 71 +++ .../mapper/ext/ExtTestPlanTestCaseMapper.java | 3 + .../mapper/ext/ExtTestPlanTestCaseMapper.xml | 98 +++++ .../mapper/ext/ExtTestReviewCaseMapper.java | 8 + .../mapper/ext/ExtTestReviewCaseMapper.xml | 170 ++++++++ .../TestPlanLoadCaseController.java | 5 +- .../TestPlanScenarioCaseController.java | 4 +- .../TestPlanTestCaseController.java | 7 + .../testcase/ApiCaseBatchCondition.java | 19 + .../testcase/ScenarioCaseBatchCondition.java | 19 + .../testcase/TestPlanApiCaseBatchRequest.java | 2 + .../testcase/TestPlanCaseBatchRequest.java | 2 + .../TestPlanScenarioCaseBatchRequest.java | 26 ++ .../request/testplan/BatchCondition.java | 20 + .../testplan/LoadCaseReportBatchRequest.java | 26 ++ .../TestPlanFuncCaseBatchRequest.java | 18 + .../TestPlanFuncCaseConditions.java | 18 + .../TestReviewCaseBatchRequest.java | 2 + .../testreview/QueryCaseReviewCondition.java | 18 + .../track/service/TestPlanApiCaseService.java | 18 +- .../service/TestPlanLoadCaseService.java | 31 ++ .../service/TestPlanScenarioCaseService.java | 27 +- .../service/TestPlanTestCaseService.java | 24 +- .../service/TestReviewTestCaseService.java | 22 +- .../automation/scenario/ApiScenarioList.vue | 2 +- .../components/case/ApiCaseList.vue | 62 ++- .../components/list/ApiCaseSimpleList.vue | 28 +- .../definition/components/list/ApiList.vue | 2 +- .../api/homepage/components/ApiInfoCard.vue | 108 +++-- .../api/homepage/components/SceneInfoCard.vue | 15 +- .../components/ScheduleTaskInfoCard.vue | 9 + .../homepage/components/TestCaseInfoCard.vue | 9 + .../components/track/case/TestCase.vue | 25 +- .../track/case/components/TestCaseList.vue | 26 +- .../track/home/components/CaseCountCard.vue | 9 + .../home/components/RelevanceCaseCard.vue | 9 + .../comonents/api/TestPlanApiCaseList.vue | 189 +++++--- .../comonents/api/TestPlanApiScenarioList.vue | 172 ++++++-- .../functional/FunctionalTestCaseList.vue | 115 +++-- .../comonents/load/TestPlanLoadCaseList.vue | 124 ++++-- .../report/components/TestPlanReportList.vue | 104 ++--- .../components/TestReviewTestCaseList.vue | 403 ++++++++++-------- frontend/src/common/js/tableUtils.js | 57 ++- frontend/src/i18n/en-US.js | 10 + frontend/src/i18n/zh-CN.js | 10 + frontend/src/i18n/zh-TW.js | 10 + 52 files changed, 1818 insertions(+), 502 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/track/request/testcase/ApiCaseBatchCondition.java create mode 100644 backend/src/main/java/io/metersphere/track/request/testcase/ScenarioCaseBatchCondition.java create mode 100644 backend/src/main/java/io/metersphere/track/request/testcase/TestPlanScenarioCaseBatchRequest.java create mode 100644 backend/src/main/java/io/metersphere/track/request/testplan/BatchCondition.java create mode 100644 backend/src/main/java/io/metersphere/track/request/testplan/LoadCaseReportBatchRequest.java create mode 100644 backend/src/main/java/io/metersphere/track/request/testplancase/TestPlanFuncCaseBatchRequest.java create mode 100644 backend/src/main/java/io/metersphere/track/request/testplancase/TestPlanFuncCaseConditions.java create mode 100644 backend/src/main/java/io/metersphere/track/request/testreview/QueryCaseReviewCondition.java 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 9a0b8f1f41..c6dd7c5e5a 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -1,5 +1,6 @@ package io.metersphere.api.controller; +import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.api.dto.*; @@ -10,6 +11,8 @@ import io.metersphere.api.dto.datacount.response.ApiDataCountDTO; import io.metersphere.api.dto.datacount.response.ExecutedCaseInfoDTO; import io.metersphere.api.dto.datacount.response.TaskInfoResult; import io.metersphere.api.dto.definition.RunDefinitionRequest; +import io.metersphere.api.dto.definition.request.ParameterConfig; +import io.metersphere.api.dto.scenario.environment.EnvironmentConfig; import io.metersphere.api.dto.scenario.request.dubbo.RegistryCenter; import io.metersphere.api.service.*; import io.metersphere.base.domain.*; @@ -34,10 +37,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; +import java.util.*; import static io.metersphere.commons.utils.JsonPathUtils.getListJson; @@ -70,6 +70,8 @@ public class APITestController { private CheckPermissionService checkPermissionService; @Resource private HistoricalDataUpgradeService historicalDataUpgradeService; + @Resource + private ApiTestEnvironmentService environmentService; @GetMapping("recent/{count}") public List recentTest(@PathVariable int count) { @@ -396,7 +398,18 @@ public class APITestController { @PostMapping(value = "/genPerformanceTestXml", consumes = {"multipart/form-data"}) public JmxInfoDTO genPerformanceTest(@RequestPart("request") RunDefinitionRequest runRequest, @RequestPart(value = "files") List bodyFiles) throws Exception { - HashTree hashTree = runRequest.getTestElement().generateHashTree(); + ParameterConfig config = new ParameterConfig(); + config.setProjectId(runRequest.getProjectId()); + + Map envConfig = new HashMap<>(); + Map map = runRequest.getEnvironmentMap(); + if (map != null && map.size() > 0) { + ApiTestEnvironmentWithBLOBs environment = environmentService.get(map.get(runRequest.getProjectId())); + EnvironmentConfig env = JSONObject.parseObject(environment.getConfig(), EnvironmentConfig.class); + envConfig.put(runRequest.getProjectId(), env); + config.setConfig(envConfig); + } + HashTree hashTree = runRequest.getTestElement().generateHashTree(config); String jmxString = runRequest.getTestElement().getJmx(hashTree); String testName = runRequest.getName(); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.java index 361e802c8c..780e92f3b3 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.java @@ -19,4 +19,6 @@ public interface ExtTestPlanApiCaseMapper { List getNotRelevanceCaseIds(@Param("planId")String planId, @Param("relevanceProjectIds")List relevanceProjectIds); List getStatusByTestPlanId(String id); + + List selectIds(@Param("request") ApiTestCaseRequest request); } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml index 0f8ba32614..ac097aa055 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml @@ -108,6 +108,97 @@ + + diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.java index 483dc83f09..f87aa9ae48 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.java @@ -1,14 +1,8 @@ package io.metersphere.base.mapper.ext; import io.metersphere.api.dto.automation.ApiScenarioDTO; -import io.metersphere.api.dto.automation.ApiScenarioRequest; import io.metersphere.api.dto.automation.TestPlanScenarioRequest; -import io.metersphere.api.dto.definition.ApiTestCaseRequest; -import io.metersphere.api.dto.definition.TestPlanApiCaseDTO; -import io.metersphere.base.domain.TestPlanApiCase; import io.metersphere.base.domain.TestPlanApiScenario; -import io.metersphere.track.dto.TestPlanDTO; -import io.metersphere.track.request.testcase.QueryTestPlanRequest; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -23,4 +17,6 @@ public interface ExtTestPlanScenarioCaseMapper { List getIdsByPlanId(String planId); List getNotRelevanceCaseIds(String planId, List relevanceProjectIds); + + List selectIds(@Param("request")TestPlanScenarioRequest request); } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml index 95c735f953..f372de0280 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml @@ -87,6 +87,77 @@ + + + + + + + +