diff --git a/framework/sdk-parent/frontend/src/components/environment/EnvironmentEdit.vue b/framework/sdk-parent/frontend/src/components/environment/EnvironmentEdit.vue index bd6ad1a94d..4ccad9b39d 100644 --- a/framework/sdk-parent/frontend/src/components/environment/EnvironmentEdit.vue +++ b/framework/sdk-parent/frontend/src/components/environment/EnvironmentEdit.vue @@ -252,7 +252,7 @@ export default { jsonPath: [], xpath2: [], jsr223: [], - document: {type: "JSON", data: {json: [], xml: []}}, + document: {type: "JSON", data: {json: [], xml: []}, enable: true}, }); } }, @@ -301,7 +301,7 @@ export default { jsonPath: [], xpath2: [], jsr223: [], - document: {type: "JSON", data: {json: [], xml: []}}, + document: {type: "JSON", data: {json: [], xml: []}, enable: true}, }); } diff --git a/project-management/frontend/src/business/menu/environment/components/EnvironmentEdit.vue b/project-management/frontend/src/business/menu/environment/components/EnvironmentEdit.vue index b7418f6ba4..857215cb90 100644 --- a/project-management/frontend/src/business/menu/environment/components/EnvironmentEdit.vue +++ b/project-management/frontend/src/business/menu/environment/components/EnvironmentEdit.vue @@ -252,7 +252,7 @@ export default { jsonPath: [], xpath2: [], jsr223: [], - document: {type: "JSON", data: {json: [], xml: []}}, + document: {type: "JSON", data: {json: [], xml: []}, enable: true}, }); } }, @@ -301,7 +301,7 @@ export default { jsonPath: [], xpath2: [], jsr223: [], - document: {type: "JSON", data: {json: [], xml: []}}, + document: {type: "JSON", data: {json: [], xml: []}, enable: true}, }); } diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml index 6e0497799d..806f2acaf3 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml @@ -14,7 +14,7 @@ SELECT t.api_case_id AS id,a.name AS caseName,t.status AS execResult FROM test_plan_api_case t INNER JOIN api_test_case a ON t.api_case_id = a.id - WHERE t.test_plan_id = #{testPlanId} AND t.api_case_id in + WHERE t.test_plan_id = #{testPlanId} AND t.api_case_id in #{id} @@ -38,30 +38,35 @@ testCase.testPlanName AS testPlan, testCase.testPlanId AS testPlanId, caseErrorCountData.dataCountNumber AS failureTimes, - 'apiCase' AS caseType + 'apiCase' AS caseType, + testCase.protocol as protocol, + testCase.project_id as project_id FROM ( - SELECT testPlanCase.id AS testPlanCaseID, - apiCase.id AS id, - apiCase.`name` AS testCaseName, - testPlan.id AS testPlanId, - testPlan.`name` AS testPlanName - FROM api_test_case apiCase - INNER JOIN test_plan_api_case testPlanCase ON testPlanCase.api_case_id = apiCase.id - INNER JOIN test_plan testPlan ON testPlan.id = testPlanCase.test_plan_id - WHERE - (apiCase.`status` IS NULL OR apiCase.`status` != 'Trash') - AND apiCase.project_id = #{projectId} + SELECT testPlanCase.id AS testPlanCaseID, + apiCase.id AS id, + apiCase.`name` AS testCaseName, + testPlan.id AS testPlanId, + testPlan.`name` AS testPlanName, + api_definition.protocol as protocol, + api_definition.project_id as project_id + FROM api_test_case apiCase + INNER JOIN test_plan_api_case testPlanCase ON testPlanCase.api_case_id = apiCase.id + INNER JOIN test_plan testPlan ON testPlan.id = testPlanCase.test_plan_id + INNER JOIN api_definition on api_definition.id = apiCase.api_definition_id + WHERE + (apiCase.`status` IS NULL OR apiCase.`status` != 'Trash') + AND apiCase.project_id = #{projectId} ) testCase INNER JOIN (SELECT executionInfo.source_id AS sourceId, - COUNT(executionInfo.id) AS dataCountNumber - FROM api_case_execution_info executionInfo - INNER JOIN test_plan_api_case testPlanCase ON executionInfo.source_id = testPlanCase.id - WHERE executionInfo.`result` = 'ERROR' - AND executionInfo.create_time > #{startTimestamp} - - AND executionInfo.version = #{versionId} - - GROUP BY source_id + COUNT(executionInfo.id) AS dataCountNumber + FROM api_case_execution_info executionInfo + INNER JOIN test_plan_api_case testPlanCase ON executionInfo.source_id = testPlanCase.id + WHERE executionInfo.`result` = 'ERROR' + AND executionInfo.create_time > #{startTimestamp} + + AND executionInfo.version = #{versionId} + + GROUP BY source_id ) caseErrorCountData ON caseErrorCountData.sourceId = testCase.testPlanCaseID ) showTable ORDER BY showTable.failureTimes DESC LIMIT ${limitNumber} diff --git a/test-track/backend/src/main/java/io/metersphere/controller/TrackController.java b/test-track/backend/src/main/java/io/metersphere/controller/TrackController.java index 84458995e2..199a59bfb4 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/TrackController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/TrackController.java @@ -90,6 +90,8 @@ public class TrackController { dataDTO.setCaseType(selectData.getCaseType()); dataDTO.setId(selectData.getId()); dataDTO.setTestPlanDTOList(selectData.getTestPlanDTOList()); + dataDTO.setProtocol(selectData.getProtocol()); + dataDTO.setProjectId(selectData.getProjectId()); returnList.add(dataDTO); } } diff --git a/test-track/backend/src/main/java/io/metersphere/dto/ExecutedCaseInfoDTO.java b/test-track/backend/src/main/java/io/metersphere/dto/ExecutedCaseInfoDTO.java index 03326fe572..1a44c891c1 100644 --- a/test-track/backend/src/main/java/io/metersphere/dto/ExecutedCaseInfoDTO.java +++ b/test-track/backend/src/main/java/io/metersphere/dto/ExecutedCaseInfoDTO.java @@ -28,4 +28,6 @@ public class ExecutedCaseInfoDTO { private String id; //测试计划集合 private List testPlanDTOList; + private String protocol; + private String projectId; } diff --git a/test-track/backend/src/main/java/io/metersphere/dto/ExecutedCaseInfoResult.java b/test-track/backend/src/main/java/io/metersphere/dto/ExecutedCaseInfoResult.java index ad7ee3be5b..9e9e4a2bb5 100644 --- a/test-track/backend/src/main/java/io/metersphere/dto/ExecutedCaseInfoResult.java +++ b/test-track/backend/src/main/java/io/metersphere/dto/ExecutedCaseInfoResult.java @@ -23,4 +23,6 @@ public class ExecutedCaseInfoResult { //案例类型 private String caseType; private List testPlanDTOList; + private String protocol; + private String projectId; } diff --git a/test-track/frontend/src/business/home/TrackHome.vue b/test-track/frontend/src/business/home/TrackHome.vue index 1fad667930..b078e52b7a 100644 --- a/test-track/frontend/src/business/home/TrackHome.vue +++ b/test-track/frontend/src/business/home/TrackHome.vue @@ -77,7 +77,7 @@ export default { return {}; }, methods: { - redirectPage(page, dataType, selectType, title) { + redirectPage(page, dataType, selectType, projectId, protocol) { //api页面跳转 //传入UUID是为了进行页面重新加载判断 let uuid = getUUID(); @@ -118,7 +118,11 @@ export default { "/" + dataType + "/" + - selectType + selectType+ + "/" + + projectId + + "/" + + protocol ); break; case "issue": diff --git a/test-track/frontend/src/business/home/components/FailureTestCaseList.vue b/test-track/frontend/src/business/home/components/FailureTestCaseList.vue index 95a0344301..a009cf4e68 100644 --- a/test-track/frontend/src/business/home/components/FailureTestCaseList.vue +++ b/test-track/frontend/src/business/home/components/FailureTestCaseList.vue @@ -51,7 +51,7 @@ style="color: #783887; width: 100%" :underline="false" type="info" - @click="redirect(row.caseType, row.id)" + @click="redirect(row.caseType, row.id, row.protocol, row.projectId)" :disabled=" (row.caseType === 'apiCase' && apiCaseReadOnly) || (row.caseType === 'scenario' && apiScenarioReadOnly) || @@ -192,13 +192,13 @@ export default { }); } }, - redirect(pageType, param) { + redirect(pageType, param, protocol, projectId) { switch (pageType) { case "testPlanEdit": this.$emit("redirectPage", "testPlanEdit", null, param); break; case "apiCase": - this.$emit("redirectPage", "api", "apiTestCase", "single:" + param); + this.$emit("redirectPage", "api", "apiTestCase", "single:" + param, projectId , protocol); break; case "scenario": this.$emit(