mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
fix: check popup exists
This commit is contained in:
@@ -115,7 +115,10 @@ func (p *PopupInfo) isIdentical(lastPopup *PopupInfo) bool {
|
||||
}
|
||||
|
||||
func (p *PopupInfo) exists() bool {
|
||||
return p.PopupArea.IsEmpty() || p.CloseArea.IsEmpty()
|
||||
if p.PopupArea.IsEmpty() || p.CloseArea.IsEmpty() {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (dExt *DriverExt) ClosePopups(options ...ActionOption) error {
|
||||
@@ -149,7 +152,7 @@ func (dExt *DriverExt) ClosePopupsHandler(options ...ActionOption) error {
|
||||
|
||||
popup := screenResult.Popup
|
||||
if popup == nil || !popup.exists() {
|
||||
log.Debug().Msg("no popup found")
|
||||
log.Debug().Interface("popup", popup).Msg("no popup found")
|
||||
break
|
||||
}
|
||||
popup.CloseStatus = CloseStatusFound
|
||||
|
||||
Reference in New Issue
Block a user