add popup close_status=found

This commit is contained in:
buyuxiang
2023-08-29 17:29:08 +08:00
parent 67088469c5
commit 20b2fa51af
4 changed files with 28 additions and 3 deletions

View File

@@ -27,6 +27,12 @@ var popups = [][]string{
{"管理使用时间", ".*忽略.*"},
}
const (
CloseStatusFound = "found"
CloseStatusSuccess = "success"
CloseStatusFail = "fail"
)
func findTextPopup(screenTexts OCRTexts) (closePoint *OCRText) {
for _, popup := range popups {
if len(popup) != 2 {
@@ -126,9 +132,13 @@ func (dExt *DriverExt) ClosePopupsHandler(options ...ActionOption) error {
break
}
screenResult.Popup.RetryCount = retryCount
if !screenResult.Popup.PopupArea.IsEmpty() {
screenResult.Popup.CloseStatus = CloseStatusFound
}
if screenResult.Popup.CloseArea.IsEmpty() {
break
}
screenResult.Popup.CloseStatus = CloseStatusFound
if err = dExt.tapPopupHandler(screenResult.Popup); err != nil {
return err