parent
5fb85b377d
commit
f88e2f69cb
|
@ -28,7 +28,9 @@ public class ApiDataCountDTO {
|
|||
private long runningCount = 0;
|
||||
private long finishedCount = 0;
|
||||
private long notStartedCount = 0;
|
||||
//本周执行次数
|
||||
private long executedTimesInWeek = 0;
|
||||
//历史执行总次数
|
||||
private long executedCount = 0;
|
||||
private long notExecutedCount = 0;
|
||||
private long passCount = 0;
|
||||
|
@ -119,6 +121,15 @@ public class ApiDataCountDTO {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取执行过的数据数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public long getExecutedData() {
|
||||
return this.unPassCount + this.fakeErrorCount + this.passCount;
|
||||
}
|
||||
|
||||
public void countApiCaseRunResult(List<ExecuteResultCountDTO> executeResultCountDTOList) {
|
||||
for (ExecuteResultCountDTO execResult : executeResultCountDTOList) {
|
||||
if (StringUtils.isEmpty(execResult.getExecResult())) {
|
||||
|
|
|
@ -117,7 +117,7 @@ public class ApiHomeController {
|
|||
DecimalFormat coveredRateFormat = new DecimalFormat("0.0");
|
||||
apiCountResult.setPassRate(coveredRateFormat.format(coveredRateNumber) + "%");
|
||||
|
||||
float executedRateNumber = (float) apiCountResult.getExecutedCount() * 100 / apiCountResult.getTotal();
|
||||
float executedRateNumber = (float) apiCountResult.getExecutedData() * 100 / apiCountResult.getTotal();
|
||||
DecimalFormat executedRateFormat = new DecimalFormat("0.0");
|
||||
apiCountResult.setExecutedRate(executedRateFormat.format(executedRateNumber) + "%");
|
||||
} else {
|
||||
|
@ -137,6 +137,7 @@ public class ApiHomeController {
|
|||
apiCountResult.setCreatedInWeek(dateCountByCreateInThisWeek);
|
||||
long executedInThisWeekCountNumber = apiScenarioReportService.countByProjectIdAndCreateInThisWeek(projectId);
|
||||
apiCountResult.setExecutedTimesInWeek(executedInThisWeekCountNumber);
|
||||
//所有执行次数
|
||||
long executedCount = apiAutomationService.countExecuteTimesByProjectID(projectId, null);
|
||||
apiCountResult.setExecutedCount(executedCount);
|
||||
//未执行、未通过、已通过
|
||||
|
@ -148,7 +149,7 @@ public class ApiHomeController {
|
|||
float coveredRateNumber = (float) apiCountResult.getPassCount() * 100 / executedCount;
|
||||
apiCountResult.setPassRate(df.format(coveredRateNumber) + "%");
|
||||
//执行率
|
||||
float executedRateNumber = (float) apiCountResult.getExecutedCount() * 100 / apiCountResult.getTotal();
|
||||
float executedRateNumber = (float) apiCountResult.getExecutedData() * 100 / apiCountResult.getTotal();
|
||||
apiCountResult.setExecutedRate(df.format(executedRateNumber) + "%");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue