fix(接口测试): 修复接口测试首页已覆盖跳转数据不对的问题

--bug=1019760 --user=宋天阳 【接口测试】接口、用例、场景的接口覆盖率跳转不正确
https://www.tapd.cn/55049933/s/1299684
This commit is contained in:
song-tianyang 2022-11-21 16:05:06 +08:00 committed by 刘瑞斌
parent eae9608e9b
commit b8ff9deca8
4 changed files with 11 additions and 14 deletions

View File

@ -810,7 +810,7 @@
</if>
</if>
<if test="request.apiCoverage == 'coverage' ">
<if test="request.apiCoverage == 'covered' ">
and
(
api_definition.id in (SELECT api_definition_id FROM api_test_case WHERE `status` is null or `status` !=
@ -829,7 +829,7 @@
and api_definition.id not in
(SELECT api_definition_id FROM api_test_case WHERE `status` is null or `status` != 'Trash')
</if>
<if test="request.apiCaseCoverage == 'coverage' ">
<if test="request.apiCaseCoverage == 'covered' ">
and api_definition.id in
(SELECT api_definition_id FROM api_test_case WHERE `status` is null or `status` != 'Trash')
</if>
@ -842,7 +842,7 @@
</if>
</if>
<if test="request.scenarioCoverage == 'coverage' ">
<if test="request.scenarioCoverage == 'covered' ">
<if test=" request.coverageIds != null and request.coverageIds.size() > 0">
and api_definition.id in
<foreach collection="request.coverageIds" item="nodeId" separator="," open="(" close=")">
@ -926,7 +926,7 @@
</if>
</if>
<if test="request.apiCoverage == 'coverage' ">
<if test="request.apiCoverage == 'covered' ">
and
(
api_definition.id in (SELECT api_definition_id FROM api_test_case WHERE `status` is null or `status` !=
@ -945,7 +945,7 @@
and api_definition.id not in
(SELECT api_definition_id FROM api_test_case WHERE `status` is null or `status` != 'Trash')
</if>
<if test="request.apiCaseCoverage == 'coverage' ">
<if test="request.apiCaseCoverage == 'covered' ">
and api_definition.id in
(SELECT api_definition_id FROM api_test_case WHERE `status` is null or `status` != 'Trash')
</if>
@ -958,7 +958,7 @@
</if>
</if>
<if test="request.scenarioCoverage == 'coverage' ">
<if test="request.scenarioCoverage == 'covered' ">
<if test=" request.coverageIds != null and request.coverageIds.size() > 0">
and api_definition.id in
<foreach collection="request.coverageIds" item="nodeId" separator="," open="(" close=")">

View File

@ -399,8 +399,7 @@ public class ApiDefinitionService {
if (StringUtils.equalsAnyIgnoreCase(request.getApiCoverage(), ApiHomeFilterEnum.NOT_COVERED, ApiHomeFilterEnum.COVERED)) {
//计算没有用例接口的覆盖数量
definitionList = this.selectEffectiveIdByProjectIdAndHaveNotCase(request.getProjectId());
}
if (StringUtils.equalsAnyIgnoreCase(request.getScenarioCoverage(), ApiHomeFilterEnum.NOT_COVERED, ApiHomeFilterEnum.COVERED)) {
} else if (StringUtils.equalsAnyIgnoreCase(request.getScenarioCoverage(), ApiHomeFilterEnum.NOT_COVERED, ApiHomeFilterEnum.COVERED)) {
//计算全部用例
definitionList = this.selectEffectiveIdByProjectId(request.getProjectId());
}

View File

@ -670,17 +670,16 @@ export default {
this.condition.selectThisWeedData = false;
this.condition.apiCaseCoverage = null;
this.condition.apiCoverage = null;
this.condition.scenarioCoverage = null;
switch (this.selectDataRange) {
case 'thisWeekCount':
this.condition.selectThisWeedData = true;
break;
case 'notCovered':
this.condition.apiCoverage = 'unCovered';
this.condition.scenarioCoverage = null;
break;
case 'covered':
this.condition.apiCoverage = '"covered"';
this.condition.scenarioCoverage = 'covered';
this.condition.apiCoverage = 'covered';
break;
case 'notCoveredTestCase':
this.condition.apiCaseCoverage = 'unCovered';
@ -690,11 +689,9 @@ export default {
break;
case 'coveredScenario':
this.condition.scenarioCoverage = 'covered';
this.condition.apiCoverage = null;
break;
case 'notCoveredScenario':
this.condition.scenarioCoverage = 'unCovered';
this.condition.apiCoverage = null;
break;
case 'Prepare':
this.condition.filters.status = [this.selectDataRange];

View File

@ -191,7 +191,7 @@ export default {
}
.api-home-layout :deep(.home-table-cell) {
height: 38px;
height: 40px;
background-color: #f5f6f7;
font-size: 14px;
font-weight: 500;
@ -215,6 +215,7 @@ export default {
.api-home-layout :deep(.el-table__row),
.adjust-table :deep(.el-table__row .el-link) {
height: 40px;
font-size: 14px;
font-weight: 400;
line-height: 22px;