mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-03 20:47:10 +08:00
change: log time duration for ui marker
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0-beta-2505051631
|
v5.0.0-beta-2505051635
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
@@ -303,6 +304,7 @@ func MarkUIOperation(driver IDriver, actionType ActionMethod, actionCoordinates
|
|||||||
if actionType == "" || len(actionCoordinates) == 0 {
|
if actionType == "" || len(actionCoordinates) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
start := time.Now()
|
||||||
|
|
||||||
// get screenshot
|
// get screenshot
|
||||||
compressedBufSource, err := driver.ScreenShot()
|
compressedBufSource, err := driver.ScreenShot()
|
||||||
@@ -340,13 +342,16 @@ func MarkUIOperation(driver IDriver, actionType ActionMethod, actionCoordinates
|
|||||||
err = SaveImageWithArrowMarker(compressedBufSource, from, to, imagePath)
|
err = SaveImageWithArrowMarker(compressedBufSource, from, to, imagePath)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("mark UI operation failed")
|
log.Error().Err(err).
|
||||||
|
Int64("duration(ms)", time.Since(start).Milliseconds()).
|
||||||
|
Msg("mark UI operation failed")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if imagePath != "" {
|
if imagePath != "" {
|
||||||
log.Info().Str("operation", string(actionType)).
|
log.Info().Str("operation", string(actionType)).
|
||||||
Str("imagePath", imagePath).
|
Str("imagePath", imagePath).
|
||||||
|
Int64("duration(ms)", time.Since(start).Milliseconds()).
|
||||||
Msg("mark UI operation success")
|
Msg("mark UI operation success")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user