mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 11:29:48 +08:00
change: remove windowSize from DriverExt
This commit is contained in:
@@ -1 +1 @@
|
||||
v5.0.0+2411232149
|
||||
v5.0.0+2411232206
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -20,7 +20,6 @@ type DriverExt struct {
|
||||
Driver IWebDriver
|
||||
ImageService IImageService // used to extract image data
|
||||
|
||||
windowSize Size
|
||||
// funplugin
|
||||
plugin funplugin.IPlugin
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user