mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-14 01:55:09 +08:00
fix: delete useless code
This commit is contained in:
@@ -153,12 +153,6 @@ func (dExt *DriverExt) DoubleTapOffset(param string, xOffset, yOffset float64) (
|
||||
dExt.ClosePopupHandler()
|
||||
}
|
||||
|
||||
// click on element, find by name attribute
|
||||
ele, err := dExt.FindUIElement(param)
|
||||
if err == nil {
|
||||
return ele.DoubleTap()
|
||||
}
|
||||
|
||||
var x, y, width, height float64
|
||||
if x, y, width, height, err = dExt.FindUIRectInUIKit(param); err != nil {
|
||||
return err
|
||||
@@ -166,29 +160,3 @@ func (dExt *DriverExt) DoubleTapOffset(param string, xOffset, yOffset float64) (
|
||||
|
||||
return dExt.Driver.DoubleTapFloat(x+width*xOffset, y+height*yOffset)
|
||||
}
|
||||
|
||||
// TapWithNumber sends one or more taps
|
||||
func (dExt *DriverExt) TapWithNumber(param string, numberOfTaps int) (err error) {
|
||||
return dExt.TapWithNumberOffset(param, numberOfTaps, 0.5, 0.5)
|
||||
}
|
||||
|
||||
func (dExt *DriverExt) TapWithNumberOffset(param string, numberOfTaps int, xOffset, yOffset float64) (err error) {
|
||||
// close popup if necessary
|
||||
if dExt.ClosePopup {
|
||||
dExt.ClosePopupHandler()
|
||||
}
|
||||
|
||||
if numberOfTaps <= 0 {
|
||||
numberOfTaps = 1
|
||||
}
|
||||
var x, y, width, height float64
|
||||
if x, y, width, height, err = dExt.FindUIRectInUIKit(param); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
x = x + width*xOffset
|
||||
y = y + height*yOffset
|
||||
|
||||
touchActions := NewTouchActions().Tap(NewTouchActionTap().WithXYFloat(x, y).WithCount(numberOfTaps))
|
||||
return dExt.PerformTouchActions(touchActions)
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ var (
|
||||
// android setting options
|
||||
var (
|
||||
WithSerialNumber = uixt.WithSerialNumber
|
||||
WithAdbIP = uixt.WithAdbIP
|
||||
WithAdbPort = uixt.WithAdbPort
|
||||
WithAdbLogOn = uixt.WithAdbLogOn
|
||||
WithAdbClosePopup = uixt.WithAdbClosePopup
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user