mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-07 05:32:43 +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"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rs/zerolog/log"
|
||||
@@ -303,6 +304,7 @@ func MarkUIOperation(driver IDriver, actionType ActionMethod, actionCoordinates
|
||||
if actionType == "" || len(actionCoordinates) == 0 {
|
||||
return nil
|
||||
}
|
||||
start := time.Now()
|
||||
|
||||
// get screenshot
|
||||
compressedBufSource, err := driver.ScreenShot()
|
||||
@@ -340,13 +342,16 @@ func MarkUIOperation(driver IDriver, actionType ActionMethod, actionCoordinates
|
||||
err = SaveImageWithArrowMarker(compressedBufSource, from, to, imagePath)
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
if imagePath != "" {
|
||||
log.Info().Str("operation", string(actionType)).
|
||||
Str("imagePath", imagePath).
|
||||
Int64("duration(ms)", time.Since(start).Milliseconds()).
|
||||
Msg("mark UI operation success")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user