diff --git a/hrp/pkg/uixt/input.go b/hrp/pkg/uixt/input.go index c9d36607..38ad3c51 100644 --- a/hrp/pkg/uixt/input.go +++ b/hrp/pkg/uixt/input.go @@ -8,5 +8,8 @@ import ( func (dExt *DriverExt) Input(text string) (err error) { err = dExt.Driver.Input(text) - return errors.Wrap(code.MobileUIInputError, err.Error()) + if err != nil { + return errors.Wrap(code.MobileUIInputError, err.Error()) + } + return nil } diff --git a/hrp/pkg/uixt/screenshot.go b/hrp/pkg/uixt/screenshot.go index 449efb7d..fd665975 100644 --- a/hrp/pkg/uixt/screenshot.go +++ b/hrp/pkg/uixt/screenshot.go @@ -172,7 +172,6 @@ func (dExt *DriverExt) GetScreenShot(fileName string) (raw *bytes.Buffer, path s return nil, "", errors.Wrap(code.DeviceScreenShotError, fmt.Sprintf("save screenshot file failed: %s", err.Error())) } - log.Debug().Str("path", path).Msg("save screenshot file success") return compressed, path, nil } diff --git a/hrp/pkg/uixt/swipe.go b/hrp/pkg/uixt/swipe.go index f30b92c4..193b341b 100644 --- a/hrp/pkg/uixt/swipe.go +++ b/hrp/pkg/uixt/swipe.go @@ -35,7 +35,10 @@ func (dExt *DriverExt) SwipeRelative(fromX, fromY, toX, toY float64, options ... toX = float64(width) * toX toY = float64(height) * toY err = dExt.Driver.SwipeFloat(fromX, fromY, toX, toY, options...) - return errors.Wrap(code.MobileUISwipeError, err.Error()) + if err != nil { + return errors.Wrap(code.MobileUISwipeError, err.Error()) + } + return nil } func (dExt *DriverExt) SwipeTo(direction string, options ...ActionOption) (err error) { diff --git a/hrp/pkg/uixt/tap.go b/hrp/pkg/uixt/tap.go index 4893c414..dcf1ff0d 100644 --- a/hrp/pkg/uixt/tap.go +++ b/hrp/pkg/uixt/tap.go @@ -11,7 +11,10 @@ import ( func (dExt *DriverExt) TapAbsXY(x, y float64, options ...ActionOption) error { // tap on absolute coordinate [x, y] err := dExt.Driver.TapFloat(x, y, options...) - return errors.Wrap(code.MobileUITapError, err.Error()) + if err != nil { + return errors.Wrap(code.MobileUITapError, err.Error()) + } + return nil } func (dExt *DriverExt) TapXY(x, y float64, options ...ActionOption) error { @@ -88,7 +91,10 @@ func (dExt *DriverExt) DoubleTapXY(x, y float64, options ...ActionOption) error x = x * float64(windowSize.Width) y = y * float64(windowSize.Height) err = dExt.Driver.DoubleTapFloat(x, y, options...) - return errors.Wrap(code.MobileUITapError, err.Error()) + if err != nil { + return errors.Wrap(code.MobileUITapError, err.Error()) + } + return nil } func (dExt *DriverExt) DoubleTap(param string, options ...ActionOption) (err error) { @@ -102,5 +108,8 @@ func (dExt *DriverExt) DoubleTapOffset(param string, xOffset, yOffset float64, o } err = dExt.Driver.DoubleTapFloat(point.X+xOffset, point.Y+yOffset, options...) - return errors.Wrap(code.MobileUITapError, err.Error()) + if err != nil { + return errors.Wrap(code.MobileUITapError, err.Error()) + } + return nil }