mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-26 01:51:29 +08:00
fix: 修复文件名过长,并打印部分有效信息
This commit is contained in:
@@ -49,7 +49,8 @@ func NewVEDEMImageService() (*vedemCVService, error) {
|
||||
type vedemCVService struct{}
|
||||
|
||||
func (s *vedemCVService) ReadFromPath(imagePath string, opts ...option.ActionOption) (
|
||||
imageResult *CVResult, err error) {
|
||||
imageResult *CVResult, err error,
|
||||
) {
|
||||
imageBuf, err := os.ReadFile(imagePath)
|
||||
if err != nil {
|
||||
err = errors.Wrap(code.CVPrepareRequestError,
|
||||
@@ -61,7 +62,8 @@ func (s *vedemCVService) ReadFromPath(imagePath string, opts ...option.ActionOpt
|
||||
}
|
||||
|
||||
func (s *vedemCVService) ReadFromBuffer(imageBuf *bytes.Buffer, opts ...option.ActionOption) (
|
||||
imageResult *CVResult, err error) {
|
||||
imageResult *CVResult, err error,
|
||||
) {
|
||||
actionOptions := option.NewActionOptions(opts...)
|
||||
log.Debug().Interface("options", actionOptions).Msg("vedem.ReadFromBuffer")
|
||||
screenshotActions := actionOptions.List()
|
||||
@@ -77,7 +79,7 @@ func (s *vedemCVService) ReadFromBuffer(imageBuf *bytes.Buffer, opts ...option.A
|
||||
if err != nil {
|
||||
logger = log.Error().Err(err)
|
||||
} else {
|
||||
logger = log.Debug()
|
||||
logger = log.Info()
|
||||
if imageResult.URL != "" {
|
||||
logger = logger.Str("url", imageResult.URL)
|
||||
}
|
||||
|
||||
@@ -176,9 +176,6 @@ func (dExt *XTDriver) GetScreenTexts(opts ...option.ActionOption) (ocrTexts ai.O
|
||||
|
||||
func (dExt *XTDriver) FindScreenText(text string, opts ...option.ActionOption) (textRect ai.OCRText, err error) {
|
||||
options := option.NewActionOptions(opts...)
|
||||
if options.ScreenShotFileName == "" {
|
||||
opts = append(opts, option.WithScreenShotFileName(fmt.Sprintf("find_screen_text_%s", text)))
|
||||
}
|
||||
|
||||
// convert relative scope to absolute scope
|
||||
if options.AbsScope == nil && len(options.Scope) == 4 {
|
||||
|
||||
Reference in New Issue
Block a user