From 00f5263ca85f2d06c4c45513d549f51da45ec819 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Fri, 22 Sep 2023 18:36:28 +0800 Subject: [PATCH] fix: loop in finding popups --- hrp/pkg/uixt/popups.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hrp/pkg/uixt/popups.go b/hrp/pkg/uixt/popups.go index e64064de..bc77f151 100644 --- a/hrp/pkg/uixt/popups.go +++ b/hrp/pkg/uixt/popups.go @@ -1,8 +1,6 @@ package uixt import ( - "time" - "github.com/pkg/errors" "github.com/rs/zerolog/log" @@ -136,7 +134,7 @@ func (p *PopupInfo) getClosePoint(lastPopup *PopupInfo) (*PointF, error) { if p.ClosePoints == nil { // 关闭图标不存在 => 无法处理,抛异常 log.Error().Interface("popup", p).Msg("popup close area not found") - return nil, errors.New("popup close area not found") + return nil, errors.Wrap(code.MobileUIPopupError, "popup close area not found") } // 使用关闭图标作为关闭按钮 @@ -196,6 +194,5 @@ func (dExt *DriverExt) ClosePopupsHandler() (err error) { // wait 1s and check if popup still exists log.Info().Msg("tap close point success, check if popup still exists") - time.Sleep(1 * time.Second) - return dExt.ClosePopupsHandler() + return nil }