fix(测试跟踪): 修复首页失败case跳转页面错误的缺陷

--bug=1024638 --user=王孝刚 【测试跟踪】过去7天测试计划失败用例中 TCP/Dubbo 协议接口case跳转页面错误
https://www.tapd.cn/55049933/s/1353208
This commit is contained in:
wxg0103 2023-03-20 18:44:50 +08:00 committed by fit2-zhao
parent 135bc509a7
commit b062fc5a56
8 changed files with 46 additions and 31 deletions

View File

@ -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},
});
}

View File

@ -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},
});
}

View File

@ -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
<foreach collection="apiCaseIds" item="id" separator="," open="(" close=")">
#{id}
</foreach>
@ -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}
<if test="versionId != null">
AND executionInfo.version = #{versionId}
</if>
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}
<if test="versionId != null">
AND executionInfo.version = #{versionId}
</if>
GROUP BY source_id
) caseErrorCountData
ON caseErrorCountData.sourceId = testCase.testPlanCaseID
) showTable ORDER BY showTable.failureTimes DESC LIMIT ${limitNumber}

View File

@ -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);
}
}

View File

@ -28,4 +28,6 @@ public class ExecutedCaseInfoDTO {
private String id;
//测试计划集合
private List<TestPlanDTO> testPlanDTOList;
private String protocol;
private String projectId;
}

View File

@ -23,4 +23,6 @@ public class ExecutedCaseInfoResult {
//案例类型
private String caseType;
private List<TestPlanDTO> testPlanDTOList;
private String protocol;
private String projectId;
}

View File

@ -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":

View File

@ -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(