diff --git a/backend/src/main/java/io/metersphere/track/service/utils/ParallelExecTask.java b/backend/src/main/java/io/metersphere/track/service/utils/ParallelExecTask.java index c2c57f24f0..0901c84a4e 100644 --- a/backend/src/main/java/io/metersphere/track/service/utils/ParallelExecTask.java +++ b/backend/src/main/java/io/metersphere/track/service/utils/ParallelExecTask.java @@ -30,6 +30,7 @@ public class ParallelExecTask implements Callable { TestPlanLoadCase testPlanLoadCase = new TestPlanLoadCase(); testPlanLoadCase.setId(request.getTestPlanLoadId()); testPlanLoadCase.setLoadReportId(reportId); + testPlanLoadCase.setStatus("run"); testPlanLoadCaseMapper.updateByPrimaryKeySelective(testPlanLoadCase); return (T) reportId; diff --git a/backend/src/main/java/io/metersphere/track/service/utils/SerialExecTask.java b/backend/src/main/java/io/metersphere/track/service/utils/SerialExecTask.java index 6b75d00fdc..bf61690e6b 100644 --- a/backend/src/main/java/io/metersphere/track/service/utils/SerialExecTask.java +++ b/backend/src/main/java/io/metersphere/track/service/utils/SerialExecTask.java @@ -38,6 +38,7 @@ public class SerialExecTask implements Callable { TestPlanLoadCase testPlanLoadCase = new TestPlanLoadCase(); testPlanLoadCase.setId(request.getTestPlanLoadId()); testPlanLoadCase.setLoadReportId(reportId); + testPlanLoadCase.setStatus("run"); testPlanLoadCaseMapper.updateByPrimaryKeySelective(testPlanLoadCase); LoadTestReportWithBLOBs report = null; // 轮询查看报告状态,最多200次,防止死循环 diff --git a/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue b/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue index 46d861dfcf..21d90fd9d4 100644 --- a/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue +++ b/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue @@ -18,18 +18,18 @@ ref="table" > - - - - - - - - + + + + + + + @@ -124,70 +124,70 @@ export default { MsTable, MsTableColumn }, - data() { - return { - condition: {}, - selectCase: {}, - result: {}, - moduleId: "", - typeArr: [ - {id: 'priority', name: this.$t('test_track.case.priority')}, - ], - priorityFilters: [ - {text: 'P0', value: 'P0'}, - {text: 'P1', value: 'P1'}, - {text: 'P2', value: 'P2'}, - {text: 'P3', value: 'P3'} - ], - valueArr: { - priority: CASE_PRIORITY, - }, - methodColorMap: new Map(API_METHOD_COLOUR), - screenHeight: 'calc(100vh - 400px)',//屏幕高度 - tableData: [], - currentPage: 1, - pageSize: 10, - total: 0, - environmentId: "" - } + data() { + return { + condition: {}, + selectCase: {}, + result: {}, + moduleId: "", + typeArr: [ + {id: 'priority', name: this.$t('test_track.case.priority')}, + ], + priorityFilters: [ + {text: 'P0', value: 'P0'}, + {text: 'P1', value: 'P1'}, + {text: 'P2', value: 'P2'}, + {text: 'P3', value: 'P3'} + ], + valueArr: { + priority: CASE_PRIORITY, + }, + methodColorMap: new Map(API_METHOD_COLOUR), + screenHeight: 'calc(100vh - 400px)',//屏幕高度 + tableData: [], + currentPage: 1, + pageSize: 10, + total: 0, + environmentId: "" + } + }, + props: { + currentProtocol: String, + selectNodeIds: Array, + visible: { + type: Boolean, + default: false, }, - props: { - currentProtocol: String, - selectNodeIds: Array, - visible: { - type: Boolean, - default: false, - }, - isApiListEnable: { - type: Boolean, - default: false, - }, - isReadOnly: { - type: Boolean, - default: false - }, - isCaseRelevance: { - type: Boolean, - default: false, - }, - projectId: String, - planId: String, - isTestPlan: Boolean + isApiListEnable: { + type: Boolean, + default: false, }, - created: function () { + isReadOnly: { + type: Boolean, + default: false + }, + isCaseRelevance: { + type: Boolean, + default: false, + }, + projectId: String, + planId: String, + isTestPlan: Boolean + }, + created: function () { + this.initTable(); + }, + watch: { + selectNodeIds() { this.initTable(); }, - watch: { - selectNodeIds() { - this.initTable(); - }, - currentProtocol() { - this.initTable(); - }, - projectId() { - this.initTable(); - } + currentProtocol() { + this.initTable(); }, + projectId() { + this.initTable(); + } + }, computed: { selectRows() { if (this.$refs.table) { @@ -207,16 +207,18 @@ export default { if (projectId != null && typeof projectId === 'string') { this.condition.projectId = projectId; } else if (this.projectId != null) { - this.condition.projectId = this.projectId; - } - if (this.currentProtocol != null) { - this.condition.protocol = this.currentProtocol; - } - let url = '/api/testcase/list/'; - if (this.isTestPlan) { - url = '/test/plan/api/case/relevance/list/'; - this.condition.planId = this.planId; - } + this.condition.projectId = this.projectId; + } + if (this.currentProtocol != null) { + this.condition.protocol = this.currentProtocol; + } + let url = '/api/testcase/list/'; + if (this.isTestPlan) { + url = '/test/plan/api/case/relevance/list/'; + this.condition.planId = this.planId; + } else { + this.condition.ids = []; + } this.result = this.$post(url + this.currentPage + "/" + this.pageSize, this.condition, response => { this.total = response.data.itemCount; @@ -259,22 +261,22 @@ export default { return path + "/" + this.currentPage + "/" + this.pageSize; }, handleTestCase(testCase) { - this.$get('/api/definition/get/' + testCase.apiDefinitionId, (response) => { - let api = response.data; - let selectApi = api; - let request = {}; - if (Object.prototype.toString.call(api.request).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { - request = api.request; - } else { - request = JSON.parse(api.request); - } - if (!request.hashTree) { - request.hashTree = []; - } - selectApi.url = request.path; - this.$refs.caseList.open(selectApi, testCase.id); - }); - }, + this.$get('/api/definition/get/' + testCase.apiDefinitionId, (response) => { + let api = response.data; + let selectApi = api; + let request = {}; + if (Object.prototype.toString.call(api.request).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { + request = api.request; + } else { + request = JSON.parse(api.request); + } + if (!request.hashTree) { + request.hashTree = []; + } + selectApi.url = request.path; + this.$refs.caseList.open(selectApi, testCase.id); + }); + }, setEnvironment(data) { this.environmentId = data.id; }, @@ -288,39 +290,39 @@ export default { let sampleSelectRows = this.$refs.table.getSelectRows(); let batchParam = buildBatchParam(this); let param = {}; - if(batchParam.condition){ + if (batchParam.condition) { param = batchParam.condition; param.projectId = batchParam.projectId; - }else{ + } else { param = batchParam; } param.ids = Array.from(sampleSelectRows).map(row => row.id); return param; } }, - } +}