mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
fix: loop in finding popups
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
package uixt
|
package uixt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
|
||||||
@@ -136,7 +134,7 @@ func (p *PopupInfo) getClosePoint(lastPopup *PopupInfo) (*PointF, error) {
|
|||||||
if p.ClosePoints == nil {
|
if p.ClosePoints == nil {
|
||||||
// 关闭图标不存在 => 无法处理,抛异常
|
// 关闭图标不存在 => 无法处理,抛异常
|
||||||
log.Error().Interface("popup", p).Msg("popup close area not found")
|
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
|
// wait 1s and check if popup still exists
|
||||||
log.Info().Msg("tap close point success, check if popup still exists")
|
log.Info().Msg("tap close point success, check if popup still exists")
|
||||||
time.Sleep(1 * time.Second)
|
return nil
|
||||||
return dExt.ClosePopupsHandler()
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user