From 18fc22a29ba4d2cd7d4209db3df062f5314dcbf1 Mon Sep 17 00:00:00 2001 From: xucong053 Date: Wed, 9 Feb 2022 11:52:29 +0800 Subject: [PATCH] fix: inaccurate stat data in API test report --- models.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/models.go b/models.go index 7b10ed4..f5e43cf 100644 --- a/models.go +++ b/models.go @@ -272,12 +272,11 @@ func (s *Summary) appendCaseSummary(caseSummary *testCaseSummary) { s.Stat.TestSteps.Total += len(caseSummary.Records) if caseSummary.Success { s.Stat.TestCases.Success += 1 - s.Stat.TestSteps.Successes += len(caseSummary.Records) } else { s.Stat.TestCases.Fail += 1 - s.Stat.TestSteps.Successes += len(caseSummary.Records) - 1 - s.Stat.TestSteps.Failures += 1 } + s.Stat.TestSteps.Successes += caseSummary.Stat.Successes + s.Stat.TestSteps.Failures += caseSummary.Stat.Failures s.Details = append(s.Details, caseSummary) s.Success = s.Success && caseSummary.Success }