diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index 868f9c57..57dde1ca 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v5.0.0+2411232207 +v5.0.0+2411232210 diff --git a/hrp/pkg/uixt/ai_vedem_test.go b/hrp/pkg/uixt/ai_vedem_test.go index b0c0abf3..df0eaee5 100644 --- a/hrp/pkg/uixt/ai_vedem_test.go +++ b/hrp/pkg/uixt/ai_vedem_test.go @@ -74,5 +74,5 @@ func TestDriverExtOCR(t *testing.T) { checkErr(t, err) t.Logf("point.X: %v, point.Y: %v", point.X, point.Y) - driverExt.Driver.TapFloat(point.X, point.Y-20) + driverExt.Driver.Tap(point.X, point.Y-20) } diff --git a/hrp/pkg/uixt/android_adb_driver.go b/hrp/pkg/uixt/android_adb_driver.go index dbc06324..b8ee0a59 100644 --- a/hrp/pkg/uixt/android_adb_driver.go +++ b/hrp/pkg/uixt/android_adb_driver.go @@ -315,11 +315,7 @@ func (ad *adbDriver) AppTerminate(packageName string) (successful bool, err erro return true, nil } -func (ad *adbDriver) Tap(x, y int, options ...ActionOption) error { - return ad.TapFloat(float64(x), float64(y), options...) -} - -func (ad *adbDriver) TapFloat(x, y float64, options ...ActionOption) (err error) { +func (ad *adbDriver) Tap(x, y float64, options ...ActionOption) (err error) { actionOptions := NewActionOptions(options...) if len(actionOptions.Offset) == 2 { @@ -663,7 +659,7 @@ func (ad *adbDriver) tapByTextUsingHierarchy(hierarchy *Hierarchy, text string, } for _, bound := range bounds { width, height := bound.Center() - err := ad.TapFloat(width, height, options...) + err := ad.Tap(width, height, options...) if err != nil { return err } diff --git a/hrp/pkg/uixt/android_test.go b/hrp/pkg/uixt/android_test.go index 33489871..1d58f672 100644 --- a/hrp/pkg/uixt/android_test.go +++ b/hrp/pkg/uixt/android_test.go @@ -225,7 +225,7 @@ func TestDriver_Tap(t *testing.T) { } //time.Sleep(time.Second) // - //err = driverExt.Driver.TapFloat(60.5, 125.5, WithIdentifier("test")) + //err = driverExt.Driver.Tap(60.5, 125.5, WithIdentifier("test")) //if err != nil { // t.Fatal(err) //} diff --git a/hrp/pkg/uixt/android_uia2_driver.go b/hrp/pkg/uixt/android_uia2_driver.go index a8396852..5d76558c 100644 --- a/hrp/pkg/uixt/android_uia2_driver.go +++ b/hrp/pkg/uixt/android_uia2_driver.go @@ -320,11 +320,7 @@ func (ud *uiaDriver) DoubleFloatTap(x, y float64) error { return err } -func (ud *uiaDriver) Tap(x, y int, options ...ActionOption) error { - return ud.TapFloat(float64(x), float64(y), options...) -} - -func (ud *uiaDriver) TapFloat(x, y float64, options ...ActionOption) (err error) { +func (ud *uiaDriver) Tap(x, y float64, options ...ActionOption) (err error) { // register(postHandler, new Tap("/wd/hub/session/:sessionId/appium/tap")) actionOptions := NewActionOptions(options...) diff --git a/hrp/pkg/uixt/harmony_hdc_driver.go b/hrp/pkg/uixt/harmony_hdc_driver.go index b72b0eaa..b25fc00b 100644 --- a/hrp/pkg/uixt/harmony_hdc_driver.go +++ b/hrp/pkg/uixt/harmony_hdc_driver.go @@ -154,11 +154,7 @@ func (hd *hdcDriver) Orientation() (orientation Orientation, err error) { return OrientationPortrait, nil } -func (hd *hdcDriver) Tap(x, y int, options ...ActionOption) error { - return hd.TapFloat(float64(x), float64(y), options...) -} - -func (hd *hdcDriver) TapFloat(x, y float64, options ...ActionOption) error { +func (hd *hdcDriver) Tap(x, y float64, options ...ActionOption) error { actionOptions := NewActionOptions(options...) if len(actionOptions.Offset) == 2 { diff --git a/hrp/pkg/uixt/interface.go b/hrp/pkg/uixt/interface.go index 8d62ab16..6c0afec5 100644 --- a/hrp/pkg/uixt/interface.go +++ b/hrp/pkg/uixt/interface.go @@ -577,8 +577,7 @@ type IWebDriver interface { Orientation() (orientation Orientation, err error) // Tap Sends a tap event at the coordinate. - Tap(x, y int, options ...ActionOption) error - TapFloat(x, y float64, options ...ActionOption) error + Tap(x, y float64, options ...ActionOption) error // DoubleTap Sends a double tap event at the coordinate. DoubleTap(x, y float64, options ...ActionOption) error diff --git a/hrp/pkg/uixt/ios_driver.go b/hrp/pkg/uixt/ios_driver.go index 97c8dccd..9a98f0d3 100644 --- a/hrp/pkg/uixt/ios_driver.go +++ b/hrp/pkg/uixt/ios_driver.go @@ -495,11 +495,7 @@ func (wd *wdaDriver) AssertForegroundApp(bundleId string, viewControllerType ... return nil } -func (wd *wdaDriver) Tap(x, y int, options ...ActionOption) error { - return wd.TapFloat(float64(x), float64(y), options...) -} - -func (wd *wdaDriver) TapFloat(x, y float64, options ...ActionOption) (err error) { +func (wd *wdaDriver) Tap(x, y float64, options ...ActionOption) (err error) { // [[FBRoute POST:@"/wda/tap/:uuid"] respondWithTarget:self action:@selector(handleTap:)] actionOptions := NewActionOptions(options...) @@ -548,7 +544,7 @@ func (wd *wdaDriver) TouchAndHold(x, y float64, options ...ActionOption) (err er if actionOptions.Duration == 0 { options = append(options, WithDuration(1)) } - return wd.TapFloat(x, y, options...) + return wd.Tap(x, y, options...) } func (wd *wdaDriver) Drag(fromX, fromY, toX, toY float64, options ...ActionOption) (err error) { diff --git a/hrp/pkg/uixt/ios_stub_driver.go b/hrp/pkg/uixt/ios_stub_driver.go index 359383bf..82b20624 100644 --- a/hrp/pkg/uixt/ios_stub_driver.go +++ b/hrp/pkg/uixt/ios_stub_driver.go @@ -219,7 +219,7 @@ func (s *stubIOSDriver) Orientation() (orientation Orientation, err error) { } // Tap Sends a tap event at the coordinate. -func (s *stubIOSDriver) Tap(x, y int, options ...ActionOption) error { +func (s *stubIOSDriver) Tap(x, y float64, options ...ActionOption) error { err := s.setUpWda() if err != nil { return err @@ -227,14 +227,6 @@ func (s *stubIOSDriver) Tap(x, y int, options ...ActionOption) error { return s.wdaDriver.Tap(x, y, options...) } -func (s *stubIOSDriver) TapFloat(x, y float64, options ...ActionOption) error { - err := s.setUpWda() - if err != nil { - return err - } - return s.wdaDriver.TapFloat(x, y, options...) -} - // DoubleTap Sends a double tap event at the coordinate. func (s *stubIOSDriver) DoubleTap(x, y float64, options ...ActionOption) error { err := s.setUpWda() diff --git a/hrp/pkg/uixt/tap.go b/hrp/pkg/uixt/tap.go index 784a701d..522f4570 100644 --- a/hrp/pkg/uixt/tap.go +++ b/hrp/pkg/uixt/tap.go @@ -10,7 +10,7 @@ import ( func (dExt *DriverExt) TapAbsXY(x, y float64, options ...ActionOption) error { // tap on absolute coordinate [x, y] - err := dExt.Driver.TapFloat(x, y, options...) + err := dExt.Driver.Tap(x, y, options...) if err != nil { return errors.Wrap(code.MobileUITapError, err.Error()) }