From 73f98975cc68c791f867a46b6b7373f5623ef419 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 21 Jan 2021 11:15:41 +0800 Subject: [PATCH 01/41] =?UTF-8?q?style(=E6=8E=A5=E5=8F=A3=E5=AE=9A?= =?UTF-8?q?=E4=B9=89):=20=E7=BB=9F=E4=B8=80TAG=20=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/scenario/EditApiScenario.vue | 2 +- .../api/automation/scenario/MsInputTag.vue | 191 ++++++++--- .../components/complete/BasisApi.vue | 4 +- .../complete/EditCompleteHTTPApi.vue | 318 +++++++++--------- 4 files changed, 306 insertions(+), 209 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index f0843743bf..a3910bdd22 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -72,7 +72,7 @@ - + diff --git a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue index bbd8f50874..c57493173e 100644 --- a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue +++ b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue @@ -1,68 +1,165 @@ diff --git a/frontend/src/business/components/api/definition/components/complete/BasisApi.vue b/frontend/src/business/components/api/definition/components/complete/BasisApi.vue index 8dc7951e7e..b9f96ddcf1 100644 --- a/frontend/src/business/components/api/definition/components/complete/BasisApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/BasisApi.vue @@ -53,12 +53,12 @@ - + - + - +
{{ $t('commons.save') }} @@ -34,6 +34,20 @@ + + + + + + + +
@@ -51,21 +65,8 @@ - - - - - - - - - + + @@ -73,7 +74,6 @@ - @@ -109,167 +109,167 @@ From 8840053d18b0fc9ad5f1dcb5680de62a3766e19d Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 21 Jan 2021 11:30:23 +0800 Subject: [PATCH 02/41] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E5=AE=9A?= =?UTF-8?q?=E4=B9=89):=20=E7=82=B9=E5=87=BB=E7=94=A8=E4=BE=8B=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E7=8A=B6=E6=80=81=EF=BC=8C=E5=B1=95=E5=BC=80=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E7=BB=93=E6=9E=9C=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json | 1 - .../automation/scenario/component/ApiResponseComponent.vue | 3 +++ .../api/definition/components/case/ApiCaseItem.vue | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 10bf93c1b4..ab73330e9e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -38,7 +38,6 @@ "vue-echarts": "^4.1.0", "vue-float-action-button": "^0.6.6", "vue-i18n": "^8.15.3", - "vue-input-tag": "^2.0.7", "vue-jsonpath-picker": "^1.1.5", "vue-papa-parse": "^2.0.0", "vue-pdf": "^4.2.0", diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiResponseComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiResponseComponent.vue index 8b74501e7c..1fd226a48b 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiResponseComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiResponseComponent.vue @@ -33,6 +33,9 @@ }, created() { this.getExecResult(); + if (this.apiItem.isActive) { + this.isActive = true; + } }, methods: { getExecResult() { diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 201d9465e2..7f7c4a326c 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -269,8 +269,9 @@ return true; } }, - showExecResult(data) { - this.$emit('showExecResult', data); + showExecResult(item) { + item.active = false; + item.isActive = true; }, getBodyUploadFiles(row) { let bodyUploadFiles = []; From 0ca5ae9565d1bbc9b534aad7024a802e11aa3a78 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 21 Jan 2021 11:32:06 +0800 Subject: [PATCH 03/41] =?UTF-8?q?style(=E6=8E=A5=E5=8F=A3=E5=AE=9A?= =?UTF-8?q?=E4=B9=89):=20tag=20=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/definition/components/case/ApiCaseItem.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 7f7c4a326c..219a83de3c 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -40,7 +40,9 @@ - +
+ +
@@ -326,6 +328,6 @@ } .tag-item { - margin-right: 30px; + margin-right: 20px; } From ca3a26a17155ff6e04ab43cd9ea725b3a5b501ca Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 21 Jan 2021 12:13:01 +0800 Subject: [PATCH 04/41] =?UTF-8?q?fix:=20=E6=A0=91=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=90=8E=E8=BF=87=E6=BB=A4=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/scenario/ApiScenarioModule.vue | 4 ++ .../environment/EnvironmentTcpConfig.vue | 45 +++++++++++++++++++ .../components/module/ApiModule.vue | 3 ++ .../components/track/common/NodeTree.vue | 19 ++++++-- .../track/common/TestCaseNodeTree.vue | 3 ++ 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 frontend/src/business/components/api/definition/components/environment/EnvironmentTcpConfig.vue diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue index 551e1e8532..855d04e0fa 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -119,6 +119,9 @@ buildNodePath(node, {path: ''}, moduleOptions); }); this.$emit('setModuleOptions', moduleOptions); + if (this.$refs.nodeTree) { + this.$refs.nodeTree.filter(this.condition.filterText); + } } }); }, @@ -142,6 +145,7 @@ }, (error) => { this.list(); }); + }, remove(nodeIds) { this.$post("/api/automation/module/delete", nodeIds, () => { diff --git a/frontend/src/business/components/api/definition/components/environment/EnvironmentTcpConfig.vue b/frontend/src/business/components/api/definition/components/environment/EnvironmentTcpConfig.vue new file mode 100644 index 0000000000..879c4b8b6f --- /dev/null +++ b/frontend/src/business/components/api/definition/components/environment/EnvironmentTcpConfig.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/frontend/src/business/components/api/definition/components/module/ApiModule.vue b/frontend/src/business/components/api/definition/components/module/ApiModule.vue index 73e221ba19..f9ef4094e3 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModule.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModule.vue @@ -126,6 +126,9 @@ buildNodePath(node, {path: ''}, moduleOptions); }); this.$emit('setModuleOptions', moduleOptions); + if (this.$refs.nodeTree) { + this.$refs.nodeTree.filter(this.condition.filterText); + } } }); }, diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index 324572a30c..4100d799e8 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -137,7 +137,15 @@ export default { return false; }, filter(val) { - this.$refs.tree.filter(val); + if (!val) { + val = this.filterText; + } else { + // 记录condition 的 filterText + this.filterText = val; + } + this.$nextTick(() => { + this.$refs.tree.filter(val); + }); }, nodeExpand(data) { if (data.id) { @@ -149,10 +157,15 @@ export default { this.expandedNode.splice(this.expandedNode.indexOf(data.id), 1); } }, - edit(node, data) { + edit(node, data, isAppend) { this.$set(data, 'isEdit', true); this.$nextTick(() => { this.$refs.nameInput.focus(); + if (!isAppend) { + this.$nextTick(() => { + this.filter(this.filterText); + }); + } }); }, append(node, data) { @@ -166,7 +179,7 @@ export default { this.$set(data, 'children', []) } data.children.push(newChild); - this.edit(node, newChild); + this.edit(node, newChild, true); node.expanded = true; this.$nextTick(() => { this.$refs.nameInput.focus(); diff --git a/frontend/src/business/components/track/common/TestCaseNodeTree.vue b/frontend/src/business/components/track/common/TestCaseNodeTree.vue index e18238be7a..c0ec0c222d 100644 --- a/frontend/src/business/components/track/common/TestCaseNodeTree.vue +++ b/frontend/src/business/components/track/common/TestCaseNodeTree.vue @@ -51,6 +51,9 @@ if (this.projectId) { this.result = this.$get("/case/node/list/" + this.projectId, response => { this.treeNodes = response.data; + if (this.$refs.nodeTree) { + this.$refs.nodeTree.filter(); + } }); } }, From feeb44155b2f5e8f993ae8d11bc0cb424ac4027c Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 21 Jan 2021 12:18:54 +0800 Subject: [PATCH 05/41] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E5=88=9D=E5=A7=8B=E5=8C=96TAG=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/automation/scenario/MsInputTag.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue index c57493173e..6e5b83d248 100644 --- a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue +++ b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue @@ -41,10 +41,15 @@ }, size: {type: String, default: "small"} }, + created() { + if (!this.currentScenario.tags) { + this.currentScenario.tags = []; + } + }, data() { return { newTag: '', - innerTags: [...this.currentScenario.tags] + innerTags: this.currentScenario.tags ? [...this.currentScenario.tags] : [] } }, watch: { From 6f8ac5fb46175d34aa4c455b6e22b10d4c0edb3f Mon Sep 17 00:00:00 2001 From: "song.tianyang" Date: Thu, 21 Jan 2021 13:36:39 +0800 Subject: [PATCH 06/41] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E7=BB=93=E6=9D=9F=E6=97=B6=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复定时任务结束时通知不正确的问题 --- .../constants/TestPlanReportStatus.java | 5 ++ .../track/service/TestPlanReportService.java | 72 ++++++++++++++++--- .../mail/TestPlanFailedNotification.html | 21 ++++++ .../mail/TestPlanSuccessfulNotification.html | 18 +++++ 4 files changed, 105 insertions(+), 11 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/commons/constants/TestPlanReportStatus.java create mode 100644 backend/src/main/resources/mail/TestPlanFailedNotification.html create mode 100644 backend/src/main/resources/mail/TestPlanSuccessfulNotification.html diff --git a/backend/src/main/java/io/metersphere/commons/constants/TestPlanReportStatus.java b/backend/src/main/java/io/metersphere/commons/constants/TestPlanReportStatus.java new file mode 100644 index 0000000000..ee327fbfdf --- /dev/null +++ b/backend/src/main/java/io/metersphere/commons/constants/TestPlanReportStatus.java @@ -0,0 +1,5 @@ +package io.metersphere.commons.constants; + +public enum TestPlanReportStatus { + RUNNING, COMPLETED, SUCCESS, FAILED +} diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java index 4ff490f8fe..7830c06e29 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java @@ -29,6 +29,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.lang.reflect.Array; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -78,6 +79,13 @@ public class TestPlanReportService { return returnList; } + /** + * 生成测试计划 + * @param planId + * @param userId + * @param triggerMode + * @return + */ public TestPlanReport genTestPlanReport(String planId, String userId,String triggerMode) { TestPlan testPlan = testPlanMapper.selectByPrimaryKey(planId); @@ -101,6 +109,7 @@ public class TestPlanReportService { TestPlanReport testPlanReport = new TestPlanReport(); testPlanReport.setTestPlanId(planId); testPlanReport.setId(testPlanReportID); + testPlanReport.setStatus(APITestStatus.Starting.name()); testPlanReport.setCreateTime(System.currentTimeMillis()); testPlanReport.setUpdateTime(System.currentTimeMillis()); try { @@ -244,13 +253,13 @@ public class TestPlanReportService { component.afterBuild(testCaseReportMetricDTO); }); - this.update(testPlanReport); - TestPlanReportDataExample example = new TestPlanReportDataExample(); example.createCriteria().andTestPlanReportIdEqualTo(planReportId); List testPlanReportDataList = testPlanReportDataMapper.selectByExampleWithBLOBs(example); + + TestPlanReportDataWithBLOBs testPlanReportData = null; if (!testPlanReportDataList.isEmpty()) { - TestPlanReportDataWithBLOBs testPlanReportData = testPlanReportDataList.get(0); + testPlanReportData = testPlanReportDataList.get(0); testPlanReportData.setExecuteResult(JSONObject.toJSONString(testCaseReportMetricDTO.getExecuteResult())); testPlanReportData.setFailurTestCases(JSONObject.toJSONString(testCaseReportMetricDTO.getFailureTestCases())); testPlanReportData.setModuleExecuteResult(JSONArray.toJSONString(testCaseReportMetricDTO.getModuleExecuteResult())); @@ -260,8 +269,49 @@ public class TestPlanReportService { testPlanReportDataMapper.updateByPrimaryKeyWithBLOBs(testPlanReportData); } + String testPlanStatus = this.getTestPlanReportStatus(testPlanReport,testPlanReportData); + testPlanReport.setStatus(testPlanStatus); + this.update(testPlanReport); } + /** + * 计算测试计划的状态 + * @param testPlanReport + * @return + */ + private String getTestPlanReportStatus(TestPlanReport testPlanReport, TestPlanReportDataWithBLOBs testPlanReportData) { + String status = TestPlanReportStatus.COMPLETED.name(); + if(testPlanReport!=null){ + if(testPlanReport.getIsApiCaseExecuting() || testPlanReport.getIsPerformanceExecuting() || testPlanReport.getIsScenarioExecuting()){ + status = TestPlanReportStatus.RUNNING.name(); + }else { + if(testPlanReportData == null){ + String failCaseString = testPlanReportData.getFailurTestCases(); + status = TestPlanReportStatus.SUCCESS.name(); + try { + JSONObject failurCaseObject = JSONObject.parseObject(failCaseString); + if(failurCaseObject.containsKey("apiTestCases")&&failurCaseObject.getJSONArray("apiTestCases").size()>=0){ + status = TestPlanReportStatus.FAILED.name(); + return status; + } + if(failurCaseObject.containsKey("loadTestCases")&&failurCaseObject.getJSONArray("loadTestCases").size()>=0){ + status = TestPlanReportStatus.FAILED.name(); + return status; + } + if(failurCaseObject.containsKey("scenarioTestCases")&&failurCaseObject.getJSONArray("scenarioTestCases").size()>=0){ + status = TestPlanReportStatus.FAILED.name(); + return status; + } + }catch (Exception e){ + status = TestPlanReportStatus.FAILED.name(); + } + }else { + status = TestPlanReportStatus.COMPLETED.name(); + } + } + } + return status; + } public void update(TestPlanReport report) { if (!report.getIsApiCaseExecuting() && !report.getIsPerformanceExecuting() && !report.getIsScenarioExecuting()) { @@ -295,26 +345,26 @@ public class TestPlanReportService { String subject = ""; String event = ""; - successContext = "接口测试定时任务通知:'" + testPlan.getName() + "'执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url; - failedContext = "接口测试定时任务通知:'" + testPlan.getName() + "'执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url; + successContext = "测试计划定时任务通知:'" + testPlan.getName() + "'执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url; + failedContext = "测试计划定时任务通知:'" + testPlan.getName() + "'执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url; subject = Translator.get("task_notification"); - if (StringUtils.equals("Success", testPlanReport.getStatus())) { - event = NoticeConstants.Event.EXECUTE_SUCCESSFUL; - } else { + if (StringUtils.equals(TestPlanReportStatus.FAILED.name(), testPlanReport.getStatus())) { event = NoticeConstants.Event.EXECUTE_FAILED; + } else { + event = NoticeConstants.Event.EXECUTE_SUCCESSFUL; } Map paramMap = new HashMap<>(); paramMap.put("testName", testPlan.getName()); paramMap.put("id", testPlanReport.getId()); - paramMap.put("type", "api"); + paramMap.put("type", "testPlan"); paramMap.put("url", url); paramMap.put("status", testPlanReport.getStatus()); NoticeModel noticeModel = NoticeModel.builder() .successContext(successContext) - .successMailTemplate("ApiSuccessfulNotification") + .successMailTemplate("TestPlanSuccessfulNotification") .failedContext(failedContext) - .failedMailTemplate("ApiFailedNotification") + .failedMailTemplate("TestPlanFailedNotification") .testId(testPlan.getId()) .status(testPlanReport.getStatus()) .event(event) diff --git a/backend/src/main/resources/mail/TestPlanFailedNotification.html b/backend/src/main/resources/mail/TestPlanFailedNotification.html new file mode 100644 index 0000000000..f6c3ddb8e7 --- /dev/null +++ b/backend/src/main/resources/mail/TestPlanFailedNotification.html @@ -0,0 +1,21 @@ + + + + + MeterSphere + + +
+
+

尊敬的用户:

+

您好: +

+
+

您所执行的 ${testName} 测试计划运行失败
+ 请点击下面链接进入测试报告页面

+ ${url}/#/${type}/report/view/${id} +
+ +
+ + \ No newline at end of file diff --git a/backend/src/main/resources/mail/TestPlanSuccessfulNotification.html b/backend/src/main/resources/mail/TestPlanSuccessfulNotification.html new file mode 100644 index 0000000000..738087eb37 --- /dev/null +++ b/backend/src/main/resources/mail/TestPlanSuccessfulNotification.html @@ -0,0 +1,18 @@ + + + + + MeterSphere + + +
+

尊敬的用户:

+

您好: +

+
+

您所执行的 ${testName} 测试计划运行成功
+ 请点击下面链接进入测试报告页面

+ ${url}/#/${type}/report/view/${id} +
+ + \ No newline at end of file From 29bb8eb816070e6a469656b4dd6d1c095f53cd29 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 21 Jan 2021 14:02:05 +0800 Subject: [PATCH 07/41] =?UTF-8?q?style(=E6=8E=A5=E5=8F=A3=E5=AE=9A?= =?UTF-8?q?=E4=B9=89):=20=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BE=8B=20=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=A4=84=E7=90=86=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/case/ApiCaseHeader.vue | 18 +------ .../components/case/ApiCaseItem.vue | 50 ++++++++++++++----- .../components/case/ApiCaseList.vue | 4 +- 3 files changed, 40 insertions(+), 32 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseHeader.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseHeader.vue index 3e031e4357..49c9f097ac 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseHeader.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseHeader.vue @@ -50,16 +50,8 @@ @setEnvironment="setEnvironment"/>
- - - +{{$t('api_test.definition.request.case')}} - - {{$t('api_test.automation.batch_execute')}} - {{$t('test_track.case.batch_edit_case')}} - - + +{{$t('api_test.definition.request.case')}}
@@ -166,14 +158,6 @@ addCase() { this.$emit('addCase'); }, - handleCommand(e) { - if (e === "run") { - this.$emit('batchRun'); - } - if (e === 'batch_edit_case') { - this.$emit('batchEditCase'); - } - }, getColor(enable, method) { if (enable) { return this.methodColorMap.get(method); diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 219a83de3c..e1cfe6c7e5 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -3,17 +3,23 @@
- - - -
-
{{ index + 1 }}
-
- - - - - + + + + + + + + +
+
{{ index + 1 }}
+
+ + + + +
+
@@ -41,7 +47,7 @@
- +
@@ -114,6 +120,7 @@ import MsRequestResultTail from "../response/RequestResultTail"; import MsJmxStep from "../step/JmxStep"; import ApiResponseComponent from "../../../automation/scenario/component/ApiResponseComponent"; + import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn"; export default { name: "ApiCaseItem", @@ -130,7 +137,8 @@ MsDubboBasisParameters, MsApiExtendBtns, MsRequestResultTail, - MsJmxStep + MsJmxStep, + ShowMoreBtn }, data() { return { @@ -146,6 +154,10 @@ condition: {}, responseData: {type: 'HTTP', responseResult: {}, subRequestResults: []}, isShowInput: false, + buttons: [ + {name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleRunBatch}, + {name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleEditBatch} + ], } }, props: { @@ -172,6 +184,12 @@ }, watch: {}, methods: { + handleRunBatch() { + this.$emit('batchRun'); + }, + handleEditBatch() { + this.$emit('batchEditCase'); + }, deleteCase(index, row) { this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', { confirmButtonText: this.$t('commons.confirm'), @@ -327,6 +345,12 @@ margin-right: 10px; } + .ms-opt-btn { + position: fixed; + left: 60px; + z-index: 1; + } + .tag-item { margin-right: 20px; } diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue index 55cfccbcfe..4d5ab0a566 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue @@ -7,9 +7,7 @@ @getApiTest="getApiTest" @setEnvironment="setEnvironment" @addCase="addCase" - @batchRun="batchRun" @selectAll="selectAll" - @batchEditCase="batchEditCase" :condition="condition" :priorities="priorities" :apiCaseList="apiCaseList" @@ -28,6 +26,8 @@ @singleRun="singleRun" @copyCase="copyCase" @showExecResult="showExecResult" + @batchEditCase="batchEditCase" + @batchRun="batchRun" :environment="environment" :is-case-edit="isCaseEdit" :api="api" From 773658eac216bd006e14ee0c7c844f548d0dd669 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 21 Jan 2021 14:22:56 +0800 Subject: [PATCH 08/41] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/automation/scenario/EditApiScenario.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 49cf1844f1..06a6b37201 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -218,7 +218,6 @@ import MsApiReportDetail from "../report/ApiReportDetail"; import MsVariableList from "./variable/VariableList"; import ApiImport from "../../definition/components/import/ApiImport"; - import InputTag from 'vue-input-tag' import "@/common/css/material-icons.css" import OutsideClick from "@/common/js/outside-click"; import ScenarioApiRelevance from "./api/ApiRelevance"; From 76d8e84341db69f6e32c83984fc955b6488811ce Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 21 Jan 2021 14:24:33 +0800 Subject: [PATCH 09/41] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/automation/scenario/EditApiScenario.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 06a6b37201..1c140b6258 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -239,7 +239,6 @@ MsInputTag, MsRun, MsApiCustomize, ApiImport, - InputTag, MsComponentConfig, }, data() { From 244dedc47c8ee3525aff532d1871761df16932d2 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 21 Jan 2021 14:25:41 +0800 Subject: [PATCH 10/41] =?UTF-8?q?feat:=20=E6=8E=A5=E5=8F=A3=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E6=A0=B9=E6=8D=AEtag=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml | 2 +- .../io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index 1ee90b76b7..549f8f016a 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -279,7 +279,7 @@ - and atc.name like CONCAT('%', #{request.name},'%') + and (atc.name like CONCAT('%', #{request.name},'%') or atc.tags like CONCAT('%', #{request.name},'%')) and atc.create_time >= #{request.createTime} 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 bcd364cd3f..3504ff4684 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 @@ -54,7 +54,7 @@ - and c.name like CONCAT('%', #{request.name},'%') + and (c.name like CONCAT('%', #{request.name},'%') or c.tags like CONCAT('%', #{request.name},'%')) and a.module_id in From 86991876735e778edfbd8d6b133432368dbfd30e Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 21 Jan 2021 14:54:56 +0800 Subject: [PATCH 11/41] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B?= =?UTF-8?q?=E8=AF=95):=20=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E6=98=BE?= =?UTF-8?q?=E7=A4=BAtags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtApiTestCaseMapper.xml | 2 +- .../components/list/ApiCaseSimpleList.vue | 67 +++++++++++-------- 2 files changed, 41 insertions(+), 28 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index 549f8f016a..62e675723d 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -238,7 +238,7 @@