From bc965796384b13a4261472929b7732702b1a5377 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 24 Mar 2021 16:24:51 +0800 Subject: [PATCH 1/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=E4=BB=8E=E5=88=97=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=8A=A5=E5=91=8A=E5=8F=AA=E6=98=BE=E7=A4=BA=E4=BA=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=B5=8B=E8=AF=95=E7=BB=93=E6=9E=9C=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/track/service/TestPlanService.java | 3 +++ 1 file changed, 3 insertions(+) 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 a959dbf120..e7b0f49a3d 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -611,6 +611,9 @@ public class TestPlanService { List components = ReportComponentFactory.createComponents(componentIds.toJavaList(String.class), testPlan); List issues = buildFunctionalCaseReport(planId, components); + buildApiCaseReport(planId, components); + buildScenarioCaseReport(planId, components); + buildLoadCaseReport(planId, components); TestCaseReportMetricDTO testCaseReportMetricDTO = new TestCaseReportMetricDTO(); components.forEach(component -> { From bec225ff5e9810ca70d9087bc48ccf956413246c Mon Sep 17 00:00:00 2001 From: "song.tianyang" Date: Wed, 24 Mar 2021 16:30:02 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E6=89=BE=E4=B8=8D=E5=88=B0=E6=A1=88=E4=BE=8B?= =?UTF-8?q?=E6=97=B6=E6=8A=A5=E9=94=99=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复打开场景找不到案例时报错的bug --- .../io/metersphere/api/service/ApiTestCaseService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java index a5d9666588..c7282b0b65 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -149,10 +149,11 @@ public class ApiTestCaseService { public ApiTestCaseWithBLOBs get(String id) { // ApiTestCaseWithBLOBs returnBlobs = apiTestCaseMapper.selectByPrimaryKey(id); ApiTestCaseInfo model = extApiTestCaseMapper.selectApiCaseInfoByPrimaryKey(id); - if(StringUtils.equalsIgnoreCase(model.getApiMethod(),"esb")){ - esbApiParamService.handleApiEsbParams(model); + if(model != null ){ + if(StringUtils.equalsIgnoreCase(model.getApiMethod(),"esb")){ + esbApiParamService.handleApiEsbParams(model); + } } - return model; } From 524259dc5eb50bb28c90bdcf1ca2c717a6cf42a4 Mon Sep 17 00:00:00 2001 From: "song.tianyang" Date: Wed, 24 Mar 2021 16:44:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E5=9C=BA=E6=99=AF=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=8A=A5=E5=91=8A=E4=B8=80=E7=9B=B4running?= =?UTF-8?q?=EF=BC=8C=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=EF=BC=8C=20=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=B8=8D=E8=83=BD=E5=8F=91=E9=80=81=E9=80=9A=E7=9F=A5?= =?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 场景定时任务报告一直running,定时任务不能执行, 定时任务不能发送通知的问题 --- .../io/metersphere/api/jmeter/APIBackendListenerClient.java | 4 +--- .../java/io/metersphere/commons/constants/ApiRunMode.java | 2 +- .../java/io/metersphere/job/sechedule/ApiScenarioTestJob.java | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java index 6e5c3b058f..9801009c1b 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java @@ -5,7 +5,6 @@ import io.metersphere.api.service.*; import io.metersphere.base.domain.ApiDefinitionExecResult; import io.metersphere.base.domain.ApiScenarioReport; import io.metersphere.base.domain.ApiTestReport; -import io.metersphere.base.domain.TestPlanReport; import io.metersphere.commons.constants.*; import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.LogUtil; @@ -15,7 +14,6 @@ import io.metersphere.notice.sender.NoticeModel; import io.metersphere.notice.service.NoticeSendService; import io.metersphere.service.SystemParameterService; import io.metersphere.track.service.TestPlanReportService; -import io.metersphere.track.service.TestPlanService; import io.metersphere.track.service.TestPlanTestCaseService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -206,7 +204,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl } else { apiDefinitionExecResultService.saveApiResult(testResult, ApiRunMode.API_PLAN.name()); } - } else if (StringUtils.equalsAny(this.runMode, ApiRunMode.SCENARIO.name(), ApiRunMode.SCENARIO_PLAN.name(), ApiRunMode.SCHEDULE_SCENARIO_PLAN.name())) { + } else if (StringUtils.equalsAny(this.runMode, ApiRunMode.SCENARIO.name(), ApiRunMode.SCENARIO_PLAN.name(), ApiRunMode.SCHEDULE_SCENARIO_PLAN.name(),ApiRunMode.SCHEDULE_SCENARIO.name())) { // 执行报告不需要存储,由用户确认后在存储 testResult.setTestId(testId); ApiScenarioReport scenarioReport = apiScenarioReportService.complete(testResult, this.runMode); diff --git a/backend/src/main/java/io/metersphere/commons/constants/ApiRunMode.java b/backend/src/main/java/io/metersphere/commons/constants/ApiRunMode.java index b4a04a77cc..15283c30ef 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/ApiRunMode.java +++ b/backend/src/main/java/io/metersphere/commons/constants/ApiRunMode.java @@ -1,5 +1,5 @@ package io.metersphere.commons.constants; public enum ApiRunMode { - RUN, DEBUG, DEFINITION, SCENARIO, API_PLAN, JENKINS_API_PLAN, JENKINS, SCENARIO_PLAN, API, SCHEDULE_API_PLAN, SCHEDULE_SCENARIO_PLAN, SCHEDULE_PERFORMANCE_TEST + RUN, DEBUG, DEFINITION, SCENARIO, API_PLAN, JENKINS_API_PLAN, JENKINS, SCENARIO_PLAN, API, SCHEDULE_API_PLAN, SCHEDULE_SCENARIO,SCHEDULE_SCENARIO_PLAN, SCHEDULE_PERFORMANCE_TEST } diff --git a/backend/src/main/java/io/metersphere/job/sechedule/ApiScenarioTestJob.java b/backend/src/main/java/io/metersphere/job/sechedule/ApiScenarioTestJob.java index e118c90cf9..bc8f80dd04 100644 --- a/backend/src/main/java/io/metersphere/job/sechedule/ApiScenarioTestJob.java +++ b/backend/src/main/java/io/metersphere/job/sechedule/ApiScenarioTestJob.java @@ -3,6 +3,7 @@ package io.metersphere.job.sechedule; import io.metersphere.api.dto.automation.ExecuteType; import io.metersphere.api.dto.automation.RunScenarioRequest; import io.metersphere.api.service.ApiAutomationService; +import io.metersphere.commons.constants.ApiRunMode; import io.metersphere.commons.constants.ReportTriggerMode; import io.metersphere.commons.constants.ScheduleGroup; import io.metersphere.commons.utils.CommonBeanFactory; @@ -58,6 +59,7 @@ public class ApiScenarioTestJob extends MsScheduleJob { request.setExecuteType(ExecuteType.Saved.name()); request.setIds(this.scenarioIds); request.setReportUserID(this.userId); + request.setRunMode(ApiRunMode.SCHEDULE_SCENARIO.name()); apiAutomationService.run(request); } From f0456b36e9cc151eaa90752e78f922a04b56e524 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 24 Mar 2021 17:01:19 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=AA=E8=AF=BB?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=82=B9=E5=87=BB=E4=BF=9D=E5=AD=98=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E8=B7=B3=E8=BD=AC=E5=88=B0=E8=AE=BE=E7=BD=AE=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/case/components/TestCaseEdit.vue | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 558840eba0..0262267dc1 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -5,9 +5,13 @@
- - {{ $t('commons.save') }} - + {{ $t('commons.save') }} @@ -297,10 +301,12 @@ import {ELEMENTS} from "@/business/components/api/automation/scenario/Setting"; import TestCaseComment from "@/business/components/track/case/components/TestCaseComment"; import ReviewCommentItem from "@/business/components/track/review/commom/ReviewCommentItem"; import {API_STATUS, REVIEW_STATUS, TEST} from "@/business/components/api/definition/model/JsonData"; +import MsTableButton from "@/business/components/common/components/MsTableButton"; export default { name: "TestCaseEdit", components: { + MsTableButton, ReviewCommentItem, TestCaseComment, MsPreviousNextButton, MsInputTag, CaseComment, MsDialogFooter, TestCaseAttachment @@ -311,8 +317,8 @@ export default { multiple: true, lazy: true, lazyLoad: ((node, resolve) => { - const { level } = node; - if(node.level==0){ + const {level} = node; + if (node.level == 0) { const nodes = TEST .map(item => ({ value: item.id, @@ -321,10 +327,10 @@ export default { })); resolve(nodes) } - if(node.level==1){ + if (node.level == 1) { this.testOptions = []; let url = ''; - this.form.type=node.data.value + this.form.type = node.data.value if (this.form.type === 'testcase' || this.form.type === 'automation') { url = '/api/' + this.form.type + '/list/' + this.projectId } else if (this.form.type === 'performance' || this.form.type === 'api') { @@ -347,7 +353,7 @@ export default { }), }, options: REVIEW_STATUS, - statuOptions:API_STATUS, + statuOptions: API_STATUS, comments: [], result: {}, dialogFormVisible: false, @@ -366,13 +372,13 @@ export default { desc: '', result: '' }], - selected: [], + selected: [], remark: '', tags: [], demandId: '', demandName: '', - status:'Prepare', - reviewStatus:'Prepare', + status: 'Prepare', + reviewStatus: 'Prepare', }, readOnly: false, moduleOptions: [], @@ -465,14 +471,15 @@ export default { this.saveCase(); } else { this.saveCase(); - let tab={} - tab.name='add' - this.$emit('addTab',tab)} + let tab = {} + tab.name = 'add' + this.$emit('addTab', tab) + } }) - }else { + } else { this.saveCase(); } - }, + }, openComment() { this.$refs.testCaseComment.open() }, @@ -649,9 +656,9 @@ export default { this.dialogFormVisible = false; }, saveCase() { -/* - document.getElementById("inputDelay").focus(); -*/ + /* + document.getElementById("inputDelay").focus(); + */ // 保存前在input框自动失焦,以免保存失败 this.$refs['caseFrom'].validate((valid) => { @@ -703,7 +710,7 @@ export default { if (this.form.tags instanceof Array) { this.form.tags = JSON.stringify(this.form.tags); } - param.testId=JSON.stringify(this.form.selected) + param.testId = JSON.stringify(this.form.selected) param.tags = this.form.tags; param.type = 'functional' return param; @@ -797,14 +804,14 @@ export default { }, getDemandOptions() { if (this.demandOptions.length === 0) { - this.result = {loading : true}; + this.result = {loading: true}; this.$get("demand/list/" + this.projectId).then(response => { this.demandOptions = response.data.data; this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other'), platform: 'Other'}) - this.result = {loading : false}; + this.result = {loading: false}; }).catch(() => { this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other'), platform: 'Other'}) - this.result = {loading : false}; + this.result = {loading: false}; }) } },