fix(测试计划): 执行历史结果展示问题
This commit is contained in:
parent
255ae52f41
commit
b91df98565
|
@ -555,7 +555,7 @@
|
|||
|
||||
<select id="getPlanChildrenTask" resultType="io.metersphere.plan.domain.TestPlanReport">
|
||||
select test_plan_report.id, test_plan.name from test_plan_report left join test_plan on test_plan_report.test_plan_id = test_plan.id
|
||||
where parent_id = #{reportId} and integrated = false order by test_plan_report.create_time desc
|
||||
where parent_id = #{reportId} and test_plan_report.id != #{reportId} and integrated = false order by test_plan_report.create_time desc
|
||||
</select>
|
||||
|
||||
<update id="resetRerunReport">
|
||||
|
|
|
@ -1441,10 +1441,10 @@ public class TestPlanReportService {
|
|||
* @return 用例执行情况
|
||||
*/
|
||||
private TestPlanReportDetailResponse calcTaskExecFinish(String reportId, String detailName, TestPlanReportDetailResponse detail) {
|
||||
detail.setId(reportId);
|
||||
detail.setName(detailName);
|
||||
TestPlanReport report = checkReport(reportId);
|
||||
BeanUtils.copyBean(detail, report);
|
||||
detail.setId(reportId);
|
||||
detail.setName(detailName);
|
||||
TestPlanReportSummary summary = getReportSummary(reportId);
|
||||
// 任务执行结果只需统计 接口 + 场景 (数据来源: 报告汇总)
|
||||
detail.setApiCaseCount(summary.getApiExecuteResult() == null ? CaseCount.builder().build() : JSON.parseObject(new String(summary.getApiExecuteResult()), CaseCount.class));
|
||||
|
@ -1452,6 +1452,7 @@ public class TestPlanReportService {
|
|||
detail.setApiCaseTotal(detail.getApiCaseCount().sum());
|
||||
detail.setApiScenarioTotal(detail.getApiScenarioCount().sum());
|
||||
detail.setExecuteCount(CountUtils.summarizeProperties(List.of(detail.getApiCaseCount(), detail.getApiScenarioCount())));
|
||||
detail.setCaseTotal(detail.getExecuteCount().sum());
|
||||
CaseCount executeCount = detail.getExecuteCount();
|
||||
detail.setExecuteRate(RateCalculateUtils.divWithPrecision((executeCount.sum() - executeCount.getPending()), executeCount.sum(), 2));
|
||||
detail.setPassRate(RateCalculateUtils.divWithPrecision(executeCount.getSuccess(), executeCount.sum(), 2));
|
||||
|
|
|
@ -724,7 +724,7 @@
|
|||
showReportDetail(record);
|
||||
} else if ([ExecuteTaskType.TEST_PLAN_GROUP, ExecuteTaskType.TEST_PLAN].includes(record.taskType)) {
|
||||
showTestPlanDetailDrawer.value = true;
|
||||
activeDetailId.value = record.reportId;
|
||||
activeDetailId.value = record.id;
|
||||
isTestPlanGroup.value = record.taskType === ExecuteTaskType.TEST_PLAN_GROUP;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,7 +132,6 @@
|
|||
} from '@/api/modules/test-plan/report';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useOpenNewPage from '@/hooks/useOpenNewPage';
|
||||
import { addCommasToNumber } from '@/utils';
|
||||
|
||||
import { ApiOrScenarioCaseItem } from '@/models/testPlan/report';
|
||||
import { ReportMetricsItemModel } from '@/models/testPlan/testPlanReport';
|
||||
|
@ -162,41 +161,7 @@
|
|||
const activePlan = ref('');
|
||||
|
||||
const reportAnalysisList = computed<ReportMetricsItemModel[]>(() => {
|
||||
if (props.isGroup) {
|
||||
return [
|
||||
{
|
||||
name: t('report.detail.testPlanTotal'),
|
||||
value: detail.value.planCount,
|
||||
unit: t('report.detail.number'),
|
||||
icon: 'plan_total',
|
||||
},
|
||||
{
|
||||
name: t('report.detail.testPlanCaseTotal'),
|
||||
value: detail.value.caseTotal,
|
||||
unit: t('report.detail.number'),
|
||||
icon: 'case_total',
|
||||
},
|
||||
{
|
||||
name: t('report.passRate'),
|
||||
value: detail.value.passRate,
|
||||
unit: '%',
|
||||
icon: 'passRate',
|
||||
},
|
||||
{
|
||||
name: t('report.detail.totalDefects'),
|
||||
value: addCommasToNumber(detail.value.bugCount),
|
||||
unit: t('report.detail.number'),
|
||||
icon: 'bugTotal',
|
||||
},
|
||||
];
|
||||
}
|
||||
return [
|
||||
{
|
||||
name: t('report.detail.threshold'),
|
||||
value: detail.value.passThreshold,
|
||||
unit: '%',
|
||||
icon: 'threshold',
|
||||
},
|
||||
{
|
||||
name: t('report.passRate'),
|
||||
value: detail.value.passRate,
|
||||
|
@ -204,17 +169,11 @@
|
|||
icon: 'passRate',
|
||||
},
|
||||
{
|
||||
name: t('report.detail.performCompletion'),
|
||||
name: t('report.detail.rate_completion'),
|
||||
value: detail.value.executeRate,
|
||||
unit: '%',
|
||||
icon: 'passRate',
|
||||
},
|
||||
{
|
||||
name: t('report.detail.totalDefects'),
|
||||
value: addCommasToNumber(detail.value.bugCount),
|
||||
unit: t('report.detail.number'),
|
||||
icon: 'bugTotal',
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
|
@ -347,6 +306,8 @@
|
|||
label: item.name,
|
||||
}));
|
||||
activePlan.value = res.children[0]?.id;
|
||||
} else {
|
||||
testPlanGroups.value = [];
|
||||
}
|
||||
searchList();
|
||||
} catch (error) {
|
||||
|
|
|
@ -31,6 +31,7 @@ export default {
|
|||
'report.detail.executionAnalysis': 'Execution Analysis',
|
||||
'report.detail.threshold': 'Pass threshold',
|
||||
'report.detail.performCompletion': 'Perform completion',
|
||||
'report.detail.rate_completion': 'Rate of completion',
|
||||
'report.detail.totalDefects': 'Total defects',
|
||||
'report.detail.useCaseAnalysis': 'Function of use case analysis',
|
||||
'report.detail.apiUseCaseAnalysis': 'Api use case analysis',
|
||||
|
|
|
@ -31,6 +31,7 @@ export default {
|
|||
'report.detail.executionAnalysis': '执行分析',
|
||||
'report.detail.threshold': '通过阈值',
|
||||
'report.detail.performCompletion': '执行完成率',
|
||||
'report.detail.rate_completion': '完成率',
|
||||
'report.detail.totalDefects': '缺陷总数',
|
||||
'report.detail.useCaseAnalysis': '功能用例分析',
|
||||
'report.detail.apiUseCaseAnalysis': '接口用例分析',
|
||||
|
|
Loading…
Reference in New Issue