From 058c3b3dd4a98315d5a12f6fd8e4cdc2eaef3e9c Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Mon, 25 Jan 2021 10:10:21 +0800 Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20pr=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/api/parse/Swagger2Parser.java | 1 - .../environment/EnvironmentHttpConfig.vue | 16 +++++++--------- .../api/definition/model/EnvironmentModel.js | 6 +++--- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java b/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java index ad8a7ab7e0..eed1130ce9 100644 --- a/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java +++ b/backend/src/main/java/io/metersphere/api/parse/Swagger2Parser.java @@ -275,7 +275,6 @@ public class Swagger2Parser extends SwaggerAbstractParser { } else { propertyList.add(new JSONObject()); } - jsonObject.put(key, propertyList); } else { jsonObject.put(key, new ArrayList<>()); diff --git a/frontend/src/business/components/api/definition/components/environment/EnvironmentHttpConfig.vue b/frontend/src/business/components/api/definition/components/environment/EnvironmentHttpConfig.vue index 91b4d256f9..6f98ce26ac 100644 --- a/frontend/src/business/components/api/definition/components/environment/EnvironmentHttpConfig.vue +++ b/frontend/src/business/components/api/definition/components/environment/EnvironmentHttpConfig.vue @@ -49,8 +49,13 @@ }, methods: { validateSocket(socket) { - // if (!socket) return true; - if (socket !== ''){ + if (!socket) { + this.httpConfig.domain = socket; + this.httpConfig.port = ''; + this.httpConfig.socket = socket; + return true; + } + let urlStr = this.httpConfig.protocol + '://' + socket; let url = {}; try { @@ -67,13 +72,6 @@ this.httpConfig.socket = this.httpConfig.domain + path; } return true; - }else { - this.httpConfig.domain = socket; - this.httpConfig.port = ''; - this.httpConfig.socket = socket; - return true; - } - }, validate() { let isValidate = false; diff --git a/frontend/src/business/components/api/definition/model/EnvironmentModel.js b/frontend/src/business/components/api/definition/model/EnvironmentModel.js index 2be5d57666..0462553e13 100644 --- a/frontend/src/business/components/api/definition/model/EnvironmentModel.js +++ b/frontend/src/business/components/api/definition/model/EnvironmentModel.js @@ -64,11 +64,11 @@ export class HttpConfig extends BaseConfig { constructor(options = {}) { super(); - this.socket = undefined; - this.domain = undefined; + this.socket = ''; + this.domain = ''; this.headers = []; this.protocol = 'https'; - this.port = undefined; + this.port = ''; this.set(options); this.sets({headers: KeyValue}, options); From e005e3932630fa0cef3e53f5f80b379a54f02036 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 25 Jan 2021 10:59:26 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E7=8A=B6=E6=80=81=E7=AD=9B=E9=80=89=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/ext/ExtTestPlanLoadCaseMapper.xml | 20 +++++++++++++++++++ .../request/testplan/LoadCaseRequest.java | 4 ++++ .../service/TestPlanLoadCaseService.java | 10 ++++++++++ .../comonents/load/TestPlanLoadCaseList.vue | 14 ++++++------- 4 files changed, 41 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml index 8c8e030dc9..c26e9fc31f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml @@ -40,6 +40,26 @@ and (lt.name like CONCAT('%', #{request.name},'%') or lt.num like CONCAT('%', #{request.name},'%')) + + + + + + and lt.status in + + #{value} + + + + + + + + order by + + tplc.${order.name} ${order.type} + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/track/request/testplan/LoadCaseRequest.java b/backend/src/main/java/io/metersphere/track/request/testplan/LoadCaseRequest.java index a13bb7b7a6..83ac312d9c 100644 --- a/backend/src/main/java/io/metersphere/track/request/testplan/LoadCaseRequest.java +++ b/backend/src/main/java/io/metersphere/track/request/testplan/LoadCaseRequest.java @@ -1,10 +1,12 @@ package io.metersphere.track.request.testplan; import io.metersphere.base.domain.TestPlanLoadCase; +import io.metersphere.controller.request.OrderRequest; import lombok.Getter; import lombok.Setter; import java.util.List; +import java.util.Map; @Getter @Setter @@ -12,4 +14,6 @@ public class LoadCaseRequest extends TestPlanLoadCase { private String projectId; private List caseIds; private String name; + private Map> filters; + private List orders; } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanLoadCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanLoadCaseService.java index 555ceb6fae..b1a9fd0f7f 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanLoadCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanLoadCaseService.java @@ -5,6 +5,7 @@ import io.metersphere.base.mapper.LoadTestMapper; import io.metersphere.base.mapper.LoadTestReportMapper; import io.metersphere.base.mapper.TestPlanLoadCaseMapper; import io.metersphere.base.mapper.ext.ExtTestPlanLoadCaseMapper; +import io.metersphere.controller.request.OrderRequest; import io.metersphere.performance.service.PerformanceTestService; import io.metersphere.track.dto.TestPlanLoadCaseDTO; import io.metersphere.track.request.testplan.LoadCaseReportRequest; @@ -50,6 +51,15 @@ public class TestPlanLoadCaseService { } public List list(LoadCaseRequest request) { + List orders = request.getOrders(); + if (orders == null || orders.size() < 1) { + OrderRequest orderRequest = new OrderRequest(); + orderRequest.setName("create_time"); + orderRequest.setType("desc"); + orders = new ArrayList<>(); + orders.add(orderRequest); + } + request.setOrders(orders); return extTestPlanLoadCaseMapper.selectTestPlanLoadCaseList(request); } diff --git a/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue index f0ccfc853d..89516a4d39 100644 --- a/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue @@ -284,15 +284,15 @@ export default { }, sort(column) { // 每次只对一个字段排序 - // if (this.condition.orders) { - // this.condition.orders = []; - // } - // _sort(column, this.condition); - // this.initTable(); + if (this.condition.orders) { + this.condition.orders = []; + } + _sort(column, this.condition); + this.initTable(); }, filter(filters) { - // _filter(filters, this.condition); - // this.initTable(); + _filter(filters, this.condition); + this.initTable(); }, getReport(data) { const {loadReportId} = data; From 829f912d8f8111009353ecf7e2c802043fdb605f Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Mon, 25 Jan 2021 12:51:03 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix(xPack):=20=E4=BF=AE=E6=94=B9substring?= =?UTF-8?q?=E7=9A=84=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/metersphere/xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 77a4db3ee5..e4521190f0 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 77a4db3ee59003d88aed53601d0d2bfa09ec272f +Subproject commit e4521190f0f1be113c8b84fbdcdf8ff273bf274e From 33cd6b37e86d3e03d5d71b6f156e61e6edf8763c Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 25 Jan 2021 13:49:59 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E5=BE=AA=E7=8E=AF=E6=8E=A7=E5=88=B6=E5=99=A8=20?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/loop/CountController.java | 2 + .../controller/loop/MsForEachController.java | 2 + .../controller/loop/MsWhileController.java | 1 + .../api/automation/report/ApiReportDetail.vue | 1 - .../scenario/common/ApiBaseComponent.vue | 1 + .../scenario/component/LoopController.vue | 154 +++++++++++++++++- .../components/response/RequestMetric.vue | 4 + .../api/definition/model/ApiTestModel.js | 6 +- 8 files changed, 165 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/CountController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/CountController.java index 808b67cc9e..c55db9540d 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/CountController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/CountController.java @@ -7,4 +7,6 @@ public class CountController { private int loops; private int interval; private boolean proceed; + private Object requestResult; + } diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/MsForEachController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/MsForEachController.java index 30a4a59e7f..8e97a204f2 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/MsForEachController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/MsForEachController.java @@ -7,4 +7,6 @@ public class MsForEachController { private String inputVal; private String returnVal; private String interval; + private Object requestResult; + } diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/MsWhileController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/MsWhileController.java index 7781abbb0b..4ed9a8cc67 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/MsWhileController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/loop/MsWhileController.java @@ -8,4 +8,5 @@ public class MsWhileController { private String operator; private String value; private int timeout; + private Object requestResult; } diff --git a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue index c6cd8c15d7..13aaa79791 100644 --- a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue +++ b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue @@ -110,7 +110,6 @@ if (this.isNotRunning) { try { this.content = JSON.parse(this.report.content); - console.log(this.content) if (!this.content) { this.content = {scenarios: []}; } diff --git a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue index 9b0a3f362a..45b2211e7c 100644 --- a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue @@ -24,6 +24,7 @@
+ diff --git a/frontend/src/business/components/api/automation/scenario/component/LoopController.vue b/frontend/src/business/components/api/automation/scenario/component/LoopController.vue index a8d5fb7e07..bccb5c6766 100644 --- a/frontend/src/business/components/api/automation/scenario/component/LoopController.vue +++ b/frontend/src/business/components/api/automation/scenario/component/LoopController.vue @@ -7,7 +7,7 @@ :draggable="true" color="#02A7F0" background-color="#F4F4F5" - :title="$t('api_test.automation.loop_controller')"> + :title="$t('api_test.automation.loop_controller')" v-loading="loading"> + + +
@@ -69,17 +78,34 @@ ms
+

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

+ + +
+ +
+
+
+ + + @@ -180,6 +322,14 @@ font-weight: normal; } + .tip { + padding: 3px 5px; + font-size: 16px; + border-radius: 4px; + border-left: 4px solid #783887; + margin: 20px 0; + } + .icon.is-active { transform: rotate(90deg); } diff --git a/frontend/src/business/components/api/definition/components/response/RequestMetric.vue b/frontend/src/business/components/api/definition/components/response/RequestMetric.vue index 660da3ecae..3d7f5af105 100644 --- a/frontend/src/business/components/api/definition/components/response/RequestMetric.vue +++ b/frontend/src/business/components/api/definition/components/response/RequestMetric.vue @@ -1,6 +1,10 @@