mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
change: set closeResult nil to reduce unnecessary summary info
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0+2411112311
|
v5.0.0+2411122229
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ func (dExt *DriverExt) GenAbsScope(x1, y1, x2, y2 float64) AbsScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (dExt *DriverExt) DoAction(action MobileAction) (err error) {
|
func (dExt *DriverExt) DoAction(action MobileAction) (err error) {
|
||||||
log.Debug().
|
log.Info().
|
||||||
Str("method", string(action.Method)).
|
Str("method", string(action.Method)).
|
||||||
Interface("params", action.Params).
|
Interface("params", action.Params).
|
||||||
Msg("uixt action start")
|
Msg("uixt action start")
|
||||||
@@ -557,7 +557,7 @@ func (dExt *DriverExt) DoAction(action MobileAction) (err error) {
|
|||||||
Int64("elapsed(ms)", time.Since(actionStartTime).Milliseconds()).
|
Int64("elapsed(ms)", time.Since(actionStartTime).Milliseconds()).
|
||||||
Msg("uixt action end")
|
Msg("uixt action end")
|
||||||
} else {
|
} else {
|
||||||
log.Debug().
|
log.Info().
|
||||||
Str("method", string(action.Method)).
|
Str("method", string(action.Method)).
|
||||||
Interface("params", action.Params).
|
Interface("params", action.Params).
|
||||||
Int64("elapsed(ms)", time.Since(actionStartTime).Milliseconds()).
|
Int64("elapsed(ms)", time.Since(actionStartTime).Milliseconds()).
|
||||||
|
|||||||
@@ -283,3 +283,7 @@ type ClosePopupsResult struct {
|
|||||||
CloseArea Box `json:"closeArea"`
|
CloseArea Box `json:"closeArea"`
|
||||||
Text string `json:"text"`
|
Text string `json:"text"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c ClosePopupsResult) IsEmpty() bool {
|
||||||
|
return c.PopupArea.IsEmpty() && c.CloseArea.IsEmpty()
|
||||||
|
}
|
||||||
|
|||||||
@@ -90,23 +90,28 @@ func (dExt *DriverExt) GetScreenResult(options ...ActionOption) (screenResult *S
|
|||||||
dExt.Driver.GetSession().addScreenResult(screenResult)
|
dExt.Driver.GetSession().addScreenResult(screenResult)
|
||||||
|
|
||||||
if imageResult != nil {
|
if imageResult != nil {
|
||||||
screenResult.ImageResult = imageResult
|
|
||||||
screenResult.Texts = imageResult.OCRResult.ToOCRTexts()
|
screenResult.Texts = imageResult.OCRResult.ToOCRTexts()
|
||||||
screenResult.UploadedURL = imageResult.URL
|
screenResult.UploadedURL = imageResult.URL
|
||||||
screenResult.Icons = imageResult.UIResult
|
screenResult.Icons = imageResult.UIResult
|
||||||
|
|
||||||
if actionOptions.ScreenShotWithClosePopups && imageResult.ClosePopupsResult != nil {
|
if actionOptions.ScreenShotWithClosePopups && imageResult.ClosePopupsResult != nil {
|
||||||
screenResult.Popup = &PopupInfo{
|
if imageResult.ClosePopupsResult.IsEmpty() {
|
||||||
ClosePopupsResult: imageResult.ClosePopupsResult,
|
// set nil to reduce unnecessary summary info
|
||||||
PicName: imagePath,
|
imageResult.ClosePopupsResult = nil
|
||||||
PicURL: imageResult.URL,
|
} else {
|
||||||
}
|
screenResult.Popup = &PopupInfo{
|
||||||
|
ClosePopupsResult: imageResult.ClosePopupsResult,
|
||||||
|
PicName: imagePath,
|
||||||
|
PicURL: imageResult.URL,
|
||||||
|
}
|
||||||
|
|
||||||
closeAreas, _ := imageResult.UIResult.FilterUIResults([]string{"close"})
|
closeAreas, _ := imageResult.UIResult.FilterUIResults([]string{"close"})
|
||||||
for _, closeArea := range closeAreas {
|
for _, closeArea := range closeAreas {
|
||||||
screenResult.Popup.ClosePoints = append(screenResult.Popup.ClosePoints, closeArea.Center())
|
screenResult.Popup.ClosePoints = append(screenResult.Popup.ClosePoints, closeArea.Center())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
screenResult.ImageResult = imageResult
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debug().
|
log.Debug().
|
||||||
|
|||||||
Reference in New Issue
Block a user