mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-07 00:17:37 +08:00
avoid incorrect sleep because of screenshot after step (or each loop of step)
This commit is contained in:
@@ -643,10 +643,11 @@ func runStepMobileUI(s *SessionRunner, step *TStep) (stepResult *StepResult, err
|
|||||||
|
|
||||||
// wait for screenshot actions done
|
// wait for screenshot actions done
|
||||||
uiDriver.Wg.Wait()
|
uiDriver.Wg.Wait()
|
||||||
// save screenshot after each step
|
// save screenshot after each step, except the step ends with sleep
|
||||||
err := uiDriver.SaveScreenShot(builtin.GenNameWithTimestampMS("step_%d_") + step.Name)
|
if len(actions) > 0 && actions[len(actions)-1].Method != uixt.CtlSleep {
|
||||||
if err != nil {
|
if err := uiDriver.SaveScreenShot(builtin.GenNameWithTimestampMS("step_%d_") + step.Name); err != nil {
|
||||||
log.Error().Err(err).Str("step", step.Name).Msg("take screenshot failed on step finished")
|
log.Error().Err(err).Str("step", step.Name).Msg("take screenshot failed on step finished")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// save attachments
|
// save attachments
|
||||||
|
|||||||
Reference in New Issue
Block a user