From b062fc5a56ed993002a3cc308b9cbe90d93ae216 Mon Sep 17 00:00:00 2001
From: wxg0103 <727495428@qq.com>
Date: Mon, 20 Mar 2023 18:44:50 +0800
Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E5=A4=B1=E8=B4=A5case?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=A1=B5=E9=9D=A2=E9=94=99=E8=AF=AF=E7=9A=84?=
=?UTF-8?q?=E7=BC=BA=E9=99=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
--bug=1024638 --user=王孝刚 【测试跟踪】过去7天测试计划失败用例中 TCP/Dubbo 协议接口case跳转页面错误
https://www.tapd.cn/55049933/s/1353208
---
.../environment/EnvironmentEdit.vue | 4 +-
.../components/EnvironmentEdit.vue | 4 +-
.../mapper/ext/ExtTestPlanApiCaseMapper.xml | 49 ++++++++++---------
.../controller/TrackController.java | 2 +
.../metersphere/dto/ExecutedCaseInfoDTO.java | 2 +
.../dto/ExecutedCaseInfoResult.java | 2 +
.../frontend/src/business/home/TrackHome.vue | 8 ++-
.../home/components/FailureTestCaseList.vue | 6 +--
8 files changed, 46 insertions(+), 31 deletions(-)
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(