close popups before swipeToTapApp

This commit is contained in:
buyuxiang
2023-10-11 14:59:49 +08:00
parent 41f705c0d9
commit 79c91637db
3 changed files with 7 additions and 2 deletions

View File

@@ -1 +1 @@
v4.3.6.2310081724
v4.3.6.2310111458

View File

@@ -409,7 +409,7 @@ func (dExt *DriverExt) GetScreenResult(options ...ActionOption) (screenResult *S
screenResult.UploadedURL = imageResult.URL
screenResult.Icons = imageResult.UIResult
if actionOptions.ScreenShotWithClosePopups {
if actionOptions.ScreenShotWithClosePopups && imageResult.CPResult != nil {
screenResult.Popup = &PopupInfo{
Type: imageResult.CPResult.Type,
Text: imageResult.CPResult.Text,

View File

@@ -178,6 +178,11 @@ func (dExt *DriverExt) swipeToTapApp(appName string, options ...ActionOption) er
return errors.Wrap(err, "go to home screen failed")
}
// automatic handling popups before swipe
if err := dExt.ClosePopups(); err != nil {
log.Error().Err(err).Msg("auto handle popup failed")
}
// swipe to first screen
for i := 0; i < 5; i++ {
dExt.SwipeRight()