From 7cc2737a5f8269e1e3ead9e6d0c52f25d5e9716b Mon Sep 17 00:00:00 2001 From: "song.tianyang" Date: Wed, 31 Mar 2021 15:58:50 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96excel=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=AF=BC=E5=85=A5=EF=BC=8C=E6=A8=A1=E5=9D=97=E5=AD=97?= =?UTF-8?q?=E6=95=B0=E8=B6=85=E6=A0=87=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化excel模板导入,模块字数超标的提示 --- .../excel/listener/TestCaseDataListener.java | 10 ++++++++++ .../definition/components/case/ApiCaseItem.vue | 16 +++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java b/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java index 05615842c0..f1d2d639c5 100644 --- a/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java +++ b/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java @@ -67,6 +67,16 @@ public class TestCaseDataListener extends EasyExcelListener { break; } } + //增加字数校验,每一层不能超过100字 + for (int i = 0; i < nodes.length; i++) { + String nodeStr = nodes[i]; + if(StringUtils.isNotEmpty(nodeStr)){ + if(nodeStr.trim().length()>100){ + stringBuilder.append(Translator.get("module") + Translator.get("test_track.length_less_than") + "100:"+nodeStr); + break; + } + } + } } // if (StringUtils.equals(data.getType(), TestCaseConstants.Type.Functional.getValue()) && StringUtils.equals(data.getMethod(), TestCaseConstants.Method.Auto.getValue())) { 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 227102ac01..ec53fe028a 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -27,7 +27,7 @@ + @blur="saveTestCase(apiCase,true)" :placeholder="$t('commons.input_name')" ref="nameEdit"/> {{ apiCase.id ? apiCase.name : '' }} @@ -48,7 +48,7 @@
- +
@@ -291,7 +291,7 @@ } }); }, - saveCase(row) { + saveCase(row,hideAlert) { let tmp = JSON.parse(JSON.stringify(row)); this.isShowInput = false; if (this.validate(tmp)) { @@ -328,16 +328,18 @@ row.createTime = data.createTime; row.updateTime = data.updateTime; if (!row.message) { - this.$success(this.$t('commons.save_success')); - this.$emit('refresh'); + if(!hideAlert){ + this.$success(this.$t('commons.save_success')); + this.$emit('refresh'); + } } }); }, - saveTestCase(row) { + saveTestCase(row,hideAlert) { if (this.api.saved) { this.addModule(row); } else { - this.saveCase(row); + this.saveCase(row,hideAlert); } }, showInput(row) { From 5b3df1ab1526d9f6264b72c78358e987ef8e386b Mon Sep 17 00:00:00 2001 From: "song.tianyang" Date: Wed, 31 Mar 2021 16:13:16 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E7=8E=87=E7=9A=84loading=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=EF=BC=9A=E6=94=B9=E4=B8=BA=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化接口覆盖率的loading方式:改为图标 --- .../components/api/homepage/components/SceneInfoCard.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/api/homepage/components/SceneInfoCard.vue b/frontend/src/business/components/api/homepage/components/SceneInfoCard.vue index 19f64837d2..130628bdf8 100644 --- a/frontend/src/business/components/api/homepage/components/SceneInfoCard.vue +++ b/frontend/src/business/components/api/homepage/components/SceneInfoCard.vue @@ -68,7 +68,7 @@ - {{interfaceCoverage}} + {{interfaceCoverage}} @@ -161,7 +161,11 @@ export default { color: var(--count_number); margin:20px auto; } - +.lading-icon{ + font-size: 25px; + color: var(--count_number); + font-weight: bold; +} .main-number-show { width: 100px; height: 100px; From 3d939cbd8321cf1cb394a11ccbad896bf5fc2a4c Mon Sep 17 00:00:00 2001 From: song-tianyang <75963100+song-tianyang@users.noreply.github.com> Date: Wed, 31 Mar 2021 16:57:11 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=A6=96=E9=A1=B5=E5=85=B3=E9=97=ADswagger?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E4=B8=8D=E5=BD=BB=E5=BA=95?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复接口测试首页关闭swagger定时任务不彻底的问题 --- .../io/metersphere/api/service/ApiAutomationService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 1694d72efe..05dc4aee97 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -30,6 +30,7 @@ import io.metersphere.commons.utils.*; import io.metersphere.controller.request.ScheduleRequest; import io.metersphere.i18n.Translator; import io.metersphere.job.sechedule.ApiScenarioTestJob; +import io.metersphere.job.sechedule.SwaggerUrlImportJob; import io.metersphere.job.sechedule.TestPlanTestJob; import io.metersphere.service.ScheduleService; import io.metersphere.track.dto.TestPlanDTO; @@ -816,7 +817,9 @@ public class ApiAutomationService { if (StringUtils.equals(request.getGroup(), ScheduleGroup.TEST_PLAN_TEST.name())) { scheduleService.addOrUpdateCronJob( request, TestPlanTestJob.getJobKey(request.getResourceId()), TestPlanTestJob.getTriggerKey(request.getResourceId()), TestPlanTestJob.class); - } else { + }else if(StringUtils.equals(request.getGroup(), ScheduleGroup.SWAGGER_IMPORT.name())){ + scheduleService.addOrUpdateCronJob(request, SwaggerUrlImportJob.getJobKey(request.getResourceId()), SwaggerUrlImportJob.getTriggerKey(request.getResourceId()), SwaggerUrlImportJob.class); + } else{ scheduleService.addOrUpdateCronJob( request, ApiScenarioTestJob.getJobKey(request.getResourceId()), ApiScenarioTestJob.getTriggerKey(request.getResourceId()), ApiScenarioTestJob.class); }