fix: failed to record the step of occuring error in the html report

This commit is contained in:
xucong053
2022-07-01 16:41:33 +08:00
parent 6a40da46e0
commit fac75e2be3
4 changed files with 34 additions and 30 deletions

View File

@@ -239,6 +239,16 @@ func runStepWebSocket(r *SessionRunner, step *TStep) (stepResult *StepResult, er
if err != nil {
stepResult.Attachment = err.Error()
}
// update summary
r.summary.Records = append(r.summary.Records, stepResult)
r.summary.Stat.Total += 1
if stepResult.Success {
r.summary.Stat.Successes += 1
} else {
r.summary.Stat.Failures += 1
// update summary result to failed
r.summary.Success = false
}
}()
// override step variables
@@ -385,16 +395,6 @@ func runStepWebSocket(r *SessionRunner, step *TStep) (stepResult *StepResult, er
stepResult.Success = true
}
// update summary
r.summary.Records = append(r.summary.Records, stepResult)
r.summary.Stat.Total += 1
if stepResult.Success {
r.summary.Stat.Successes += 1
} else {
r.summary.Stat.Failures += 1
// update summary result to failed
r.summary.Success = false
}
return stepResult, nil
}