refactor: handlerDoubleTap

This commit is contained in:
lilong.129
2025-05-06 00:52:47 +08:00
parent 48e3d9002e
commit 71dac459e6
7 changed files with 48 additions and 30 deletions

View File

@@ -541,11 +541,16 @@ func (wd *BrowserDriver) TapFloat(x, y float64, opts ...option.ActionOption) err
// DoubleTap Sends a double tap event at the coordinate.
func (wd *BrowserDriver) DoubleTap(x, y float64, options ...option.ActionOption) error {
var err error
x, y, err = handlerDoubleTap(wd, x, y, options...)
if err != nil {
return err
}
data := map[string]interface{}{
"x": x,
"y": y,
}
_, err := wd.HttpPOST(data, wd.sessionId, "ui/double_tap")
_, err = wd.HttpPOST(data, wd.sessionId, "ui/double_tap")
return err
}