fix(测试跟踪): 修复测试计划失败top10 的用例是跨项目的,该用例跳转链接页面是当前项目问题

--bug=1025817 --user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001025817
This commit is contained in:
guoyuqi 2023-04-27 20:15:32 +08:00 committed by jianxing
parent 4b74b970b1
commit d2f3d9e6c8
4 changed files with 24 additions and 27 deletions

View File

@ -669,31 +669,27 @@
</update>
<select id="findFailureCaseInTestPlanByProjectIDAndExecuteTimeAndLimitNumber"
resultType="io.metersphere.dto.ExecutedCaseInfoResult">
SELECT * FROM (
SELECT
testCase.id AS testCaseID,
testCase.id AS id,
testCase.`name` AS caseName,
testCasePlan.testPlanName AS testPlan,
testCasePlan.testPlanId AS testPlanId,
count( executionInfo.id ) AS failureTimes,
'testCase' AS caseType
FROM
function_case_execution_info executionInfo
INNER JOIN (
SELECT
testPlanTestCase.id,
testPlanTestCase.case_id,
testPlan.id AS testPlanId,
testPlan.`name` AS testPlanName
FROM
test_plan_test_case testPlanTestCase
INNER JOIN test_plan testPlan ON testPlan.id = testPlanTestCase.plan_id
WHERE testPlan.project_id = #{projectId}
) testCasePlan ON testCasePlan.id = executionInfo.source_id
INNER JOIN test_case testCase ON testCase.id = testCasePlan.case_id
WHERE
testCase.`status` != 'Trash'
SELECT *
FROM (SELECT testCase.id AS testCaseID,
testCase.id AS id,
testCase.`name` AS caseName,
testCasePlan.testPlanName AS testPlan,
testCasePlan.testPlanId AS testPlanId,
count(executionInfo.id) AS failureTimes,
'testCase' AS caseType,
testCase.project_id AS projectId
FROM function_case_execution_info executionInfo
INNER JOIN (SELECT testPlanTestCase.id,
testPlanTestCase.case_id,
testPlan.id AS testPlanId,
testPlan.`name` AS testPlanName,
testPlan.project_id
FROM test_plan_test_case testPlanTestCase
INNER JOIN test_plan testPlan ON testPlan.id = testPlanTestCase.plan_id
WHERE testPlan.project_id = #{projectId}) testCasePlan
ON testCasePlan.id = executionInfo.source_id
INNER JOIN test_case testCase ON testCase.id = testCasePlan.case_id
WHERE testCase.`status` != 'Trash'
AND ( executionInfo.result = 'Failure' )
AND executionInfo.create_time >= #{startTimestamp}
GROUP BY testCase.id

View File

@ -231,7 +231,7 @@ export default {
};
},
created() {
let projectId = this.$route.query.projectId;
let projectId = this.$route.params.projectId;
if (projectId) {
this.ignoreTreeNodes = true;
if (projectId !== getCurrentProjectID() && projectId !== 'all') {

View File

@ -91,6 +91,7 @@ export default {
redirectID: uuid,
dataType: dataType,
dataSelectRange: selectType,
projectId: projectId,
},
});
break;

View File

@ -209,7 +209,7 @@ export default {
);
break;
case "testCase":
this.$emit("redirectPage", "testCase", "case", "single:" + param);
this.$emit("redirectPage", "testCase", "case", "single:" + param, projectId);
break;
}
},