mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-04 23:16:57 +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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/httprunner/httprunner/v4/hrp/code"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (dExt *DriverExt) Drag(fromX, fromY, toX, toY float64, options ...ActionOption) (err error) {
|
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()
|
orientation, err := dExt.Driver.Orientation()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn().Err(err).Msgf("drag from (%v, %v) to (%v, %v) get orientation failed, use default orientation",
|
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
|
Driver IWebDriver
|
||||||
ImageService IImageService // used to extract image data
|
ImageService IImageService // used to extract image data
|
||||||
|
|
||||||
windowSize Size
|
|
||||||
// funplugin
|
// funplugin
|
||||||
plugin funplugin.IPlugin
|
plugin funplugin.IPlugin
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user