mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
close popups before swipeToTapApp
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v4.3.6.2310081724
|
v4.3.6.2310111458
|
||||||
@@ -409,7 +409,7 @@ func (dExt *DriverExt) GetScreenResult(options ...ActionOption) (screenResult *S
|
|||||||
screenResult.UploadedURL = imageResult.URL
|
screenResult.UploadedURL = imageResult.URL
|
||||||
screenResult.Icons = imageResult.UIResult
|
screenResult.Icons = imageResult.UIResult
|
||||||
|
|
||||||
if actionOptions.ScreenShotWithClosePopups {
|
if actionOptions.ScreenShotWithClosePopups && imageResult.CPResult != nil {
|
||||||
screenResult.Popup = &PopupInfo{
|
screenResult.Popup = &PopupInfo{
|
||||||
Type: imageResult.CPResult.Type,
|
Type: imageResult.CPResult.Type,
|
||||||
Text: imageResult.CPResult.Text,
|
Text: imageResult.CPResult.Text,
|
||||||
|
|||||||
@@ -178,6 +178,11 @@ func (dExt *DriverExt) swipeToTapApp(appName string, options ...ActionOption) er
|
|||||||
return errors.Wrap(err, "go to home screen failed")
|
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
|
// swipe to first screen
|
||||||
for i := 0; i < 5; i++ {
|
for i := 0; i < 5; i++ {
|
||||||
dExt.SwipeRight()
|
dExt.SwipeRight()
|
||||||
|
|||||||
Reference in New Issue
Block a user