mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-05 07:49:37 +08:00
refactor: get ImagePath from ScreenResult
This commit is contained in:
@@ -26,7 +26,7 @@ type DriverSession struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *DriverSession) addScreenResult(screenResult *ScreenResult) {
|
func (d *DriverSession) addScreenResult(screenResult *ScreenResult) {
|
||||||
d.screenResults[screenResult.imagePath] = screenResult
|
d.screenResults[screenResult.ImagePath] = screenResult
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *DriverSession) addRequestResult(driverResult *DriverResult) {
|
func (d *DriverSession) addRequestResult(driverResult *DriverResult) {
|
||||||
@@ -43,11 +43,11 @@ func (d *DriverSession) GetAll() map[string]interface{} {
|
|||||||
screenShots := make([]string, 0)
|
screenShots := make([]string, 0)
|
||||||
screenShotsUrls := make(map[string]string)
|
screenShotsUrls := make(map[string]string)
|
||||||
for _, screenResult := range d.screenResults {
|
for _, screenResult := range d.screenResults {
|
||||||
screenShots = append(screenShots, screenResult.imagePath)
|
screenShots = append(screenShots, screenResult.ImagePath)
|
||||||
if screenResult.UploadedURL == "" {
|
if screenResult.UploadedURL == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
screenShotsUrls[screenResult.imagePath] = screenResult.UploadedURL
|
screenShotsUrls[screenResult.ImagePath] = screenResult.UploadedURL
|
||||||
}
|
}
|
||||||
|
|
||||||
data := map[string]interface{}{
|
data := map[string]interface{}{
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
|
|
||||||
type ScreenResult struct {
|
type ScreenResult struct {
|
||||||
bufSource *bytes.Buffer // raw image buffer bytes
|
bufSource *bytes.Buffer // raw image buffer bytes
|
||||||
imagePath string // image file path
|
ImagePath string // image file path
|
||||||
ImageResult *ImageResult // image result
|
ImageResult *ImageResult // image result
|
||||||
|
|
||||||
Resolution Size `json:"resolution"`
|
Resolution Size `json:"resolution"`
|
||||||
@@ -54,7 +54,7 @@ func (dExt *DriverExt) GetScreenResult(options ...ActionOption) (screenResult *S
|
|||||||
}
|
}
|
||||||
screenResult = &ScreenResult{
|
screenResult = &ScreenResult{
|
||||||
bufSource: bufSource,
|
bufSource: bufSource,
|
||||||
imagePath: imagePath,
|
ImagePath: imagePath,
|
||||||
Tags: nil,
|
Tags: nil,
|
||||||
Resolution: windowSize,
|
Resolution: windowSize,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user