mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
fix: override action error
This commit is contained in:
@@ -385,7 +385,7 @@ func (dExt *DriverExt) GenAbsScope(x1, y1, x2, y2 float64) AbsScope {
|
|||||||
return AbsScope{absX1, absY1, absX2, absY2}
|
return AbsScope{absX1, absY1, absX2, absY2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dExt *DriverExt) DoAction(action MobileAction) error {
|
func (dExt *DriverExt) DoAction(action MobileAction) (err error) {
|
||||||
log.Debug().
|
log.Debug().
|
||||||
Str("method", string(action.Method)).
|
Str("method", string(action.Method)).
|
||||||
Interface("params", action.Params).
|
Interface("params", action.Params).
|
||||||
@@ -393,11 +393,19 @@ func (dExt *DriverExt) DoAction(action MobileAction) error {
|
|||||||
actionStartTime := time.Now()
|
actionStartTime := time.Now()
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Err(err).
|
||||||
|
Str("method", string(action.Method)).
|
||||||
|
Interface("params", action.Params).
|
||||||
|
Int64("elapsed(ms)", time.Since(actionStartTime).Milliseconds()).
|
||||||
|
Msg("uixt action end")
|
||||||
|
} else {
|
||||||
log.Debug().
|
log.Debug().
|
||||||
Str("method", string(action.Method)).
|
Str("method", string(action.Method)).
|
||||||
Interface("params", action.Params).
|
Interface("params", action.Params).
|
||||||
Int64("elapsed(ms)", time.Since(actionStartTime).Milliseconds()).
|
Int64("elapsed(ms)", time.Since(actionStartTime).Milliseconds()).
|
||||||
Msg("uixt action end")
|
Msg("uixt action end")
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
switch action.Method {
|
switch action.Method {
|
||||||
|
|||||||
@@ -604,8 +604,8 @@ func runStepMobileUI(s *SessionRunner, step *TStep) (stepResult *StepResult, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
// automatic handling of pop-up windows on each step finished
|
// automatic handling of pop-up windows on each step finished
|
||||||
if err = uiDriver.AutoPopupHandler(); err != nil {
|
if err2 := uiDriver.AutoPopupHandler(); err2 != nil {
|
||||||
log.Error().Err(err).Str("step", step.Name).Msg("auto handle popup failed")
|
log.Error().Err(err2).Str("step", step.Name).Msg("auto handle popup failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
// save attachments
|
// save attachments
|
||||||
|
|||||||
Reference in New Issue
Block a user