fix(接口测试): 修复测试计划统计卡片中的数据归类公式,增加通过&未完成和通过&已完成的统计归类

This commit is contained in:
Jianguo-Genius 2024-11-22 18:12:31 +08:00 committed by 刘瑞斌
parent cdcfab8e8f
commit 871b6c738c
5 changed files with 34 additions and 16 deletions

View File

@ -34,30 +34,36 @@ public class TestPlanCoverageDTO {
private int errorCode;
public void archivedAutoIncrement() {
archived++;
this.archived++;
}
public void notStartedAutoIncrement() {
prepared++;
unExecute++;
notPassed++;
this.prepared++;
this.unExecute++;
this.notPassed++;
}
public void successAutoIncrement() {
executed++;
passed++;
finished++;
public void passAndFinishedAutoIncrement() {
this.executed++;
this.passed++;
this.finished++;
}
public void passAndNotFinishedAutoIncrement() {
this.executed++;
this.passed++;
this.running++;
}
public void unSuccessAutoIncrement() {
executed++;
notPassed++;
finished++;
this.executed++;
this.notPassed++;
this.finished++;
}
public void testPlanRunningAutoIncrement() {
executed++;
notPassed++;
running++;
this.executed++;
this.notPassed++;
this.running++;
}
}

View File

@ -913,6 +913,8 @@
CASE
WHEN resource.last_exec_result is null
THEN 'PENDING'
WHEN resource.last_exec_result = ''
THEN 'PENDING'
WHEN resource.last_exec_result = '-'
THEN 'PENDING'
ELSE resource.last_exec_result

View File

@ -685,6 +685,8 @@
THEN 'PENDING'
WHEN resource.last_exec_result = '-'
THEN 'PENDING'
WHEN resource.last_exec_result = ''
THEN 'PENDING'
ELSE resource.last_exec_result
END AS execResult
from test_plan_api_scenario resource

View File

@ -812,6 +812,8 @@
THEN 'PENDING'
WHEN resource.last_exec_result = '-'
THEN 'PENDING'
WHEN resource.last_exec_result = ''
THEN 'PENDING'
ELSE resource.last_exec_result
END AS execResult
from test_plan_functional_case resource

View File

@ -1055,7 +1055,7 @@ public class TestPlanService extends TestPlanBaseUtilsService {
//目前只有三个状态如果同时包含多种状态(进行中/未开始进行中/已完成已完成/未开始进行中/未开始/已完成),根据算法可得测试计划都会是进行中
if (calculateList.size() == 1) {
if (calculateList.contains(ResultStatus.SUCCESS.name())) {
returnDTO.successAutoIncrement();
returnDTO.passAndFinishedAutoIncrement();
} else if (calculateList.contains(ExecStatus.PENDING.name())) {
returnDTO.notStartedAutoIncrement();
} else {
@ -1063,7 +1063,13 @@ public class TestPlanService extends TestPlanBaseUtilsService {
}
} else {
if (passphrase > executeRage) {
returnDTO.successAutoIncrement();
if (calculateList.contains(ExecStatus.PENDING.name())) {
// 通过却未完成
returnDTO.passAndNotFinishedAutoIncrement();
} else {
// 通过且完成
returnDTO.passAndFinishedAutoIncrement();
}
} else if (calculateList.contains(ExecStatus.PENDING.name())) {
// 存在还未完成的用例测试计划为进行中
returnDTO.testPlanRunningAutoIncrement();