change: remove windowSize from DriverExt

This commit is contained in:
lilong.129
2024-11-23 22:06:34 +08:00
parent 270180603c
commit 0b598fa590
3 changed files with 9 additions and 7 deletions

View File

@@ -1 +1 @@
v5.0.0+2411232149
v5.0.0+2411232206

View File

@@ -3,16 +3,19 @@ package uixt
import (
"fmt"
"github.com/httprunner/httprunner/v4/hrp/code"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
)
func (dExt *DriverExt) Drag(fromX, fromY, toX, toY float64, options ...ActionOption) (err error) {
return dExt.Driver.Drag(fromX, fromY, toX, toY, options...)
}
windowSize, err := dExt.Driver.WindowSize()
if err != nil {
return errors.Wrap(code.DeviceGetInfoError, err.Error())
}
width := windowSize.Width
height := windowSize.Height
func (dExt *DriverExt) DragRelative(fromX, fromY, toX, toY float64, options ...ActionOption) (err error) {
width := dExt.windowSize.Width
height := dExt.windowSize.Height
orientation, err := dExt.Driver.Orientation()
if err != nil {
log.Warn().Err(err).Msgf("drag from (%v, %v) to (%v, %v) get orientation failed, use default orientation",

View File

@@ -20,7 +20,6 @@ type DriverExt struct {
Driver IWebDriver
ImageService IImageService // used to extract image data
windowSize Size
// funplugin
plugin funplugin.IPlugin
}