refactor: XTDriver

This commit is contained in:
lilong.129
2025-02-11 15:34:51 +08:00
parent b35116fdf7
commit 72f7b77bc8
28 changed files with 100 additions and 121 deletions

View File

@@ -73,7 +73,7 @@ func TestSwipe(t *testing.T) {
func TestTap(t *testing.T) {
setupShootsAndroidDriver(t)
err := shootsAndroidDriver.Tap(900, 400)
err := shootsAndroidDriver.TapXY(900, 400)
if err != nil {
t.Fatal(err)
}
@@ -81,7 +81,7 @@ func TestTap(t *testing.T) {
func TestDoubleTap(t *testing.T) {
setupShootsAndroidDriver(t)
err := shootsAndroidDriver.DoubleTap(500, 500)
err := shootsAndroidDriver.DoubleTapXY(500, 500)
if err != nil {
t.Fatal(err)
}

View File

@@ -200,22 +200,22 @@ func (s *ShootsIOSDriver) Orientation() (orientation types.Orientation, err erro
return s.WDADriver.Orientation()
}
// Tap Sends a tap event at the coordinate.
func (s *ShootsIOSDriver) Tap(x, y float64, opts ...option.ActionOption) error {
// TapXY Sends a tap event at the coordinate.
func (s *ShootsIOSDriver) TapXY(x, y float64, opts ...option.ActionOption) error {
err := s.setUpWda()
if err != nil {
return err
}
return s.WDADriver.Tap(x, y, opts...)
return s.WDADriver.TapXY(x, y, opts...)
}
// DoubleTap Sends a double tap event at the coordinate.
func (s *ShootsIOSDriver) DoubleTap(x, y float64, opts ...option.ActionOption) error {
// DoubleTapXY Sends a double tap event at the coordinate.
func (s *ShootsIOSDriver) DoubleTapXY(x, y float64, opts ...option.ActionOption) error {
err := s.setUpWda()
if err != nil {
return err
}
return s.WDADriver.DoubleTap(x, y, opts...)
return s.WDADriver.DoubleTapXY(x, y, opts...)
}
// TouchAndHold Initiates a long-press gesture at the coordinate, holding for the specified duration.