lib/appium_lib/ios/xcuitest/command/gestures.rb in appium_lib-11.0.0 vs lib/appium_lib/ios/xcuitest/command/gestures.rb in appium_lib-11.1.0

- old
+ new

@@ -77,11 +77,11 @@ # # ```ruby # double_tap x: 100, y: 100 # double_tap element: find_element(:accessibility_id, "some item") # ``` - def double_tap(x: nil, y: nil, element: nil) # rubocop:disable Naming/UncommunicativeMethodParamName + def double_tap(x: nil, y: nil, element: nil) return 'Set x, y or element' if (x.nil? || y.nil?) && element.nil? args = element.nil? ? { x: x, y: y } : { element: element.ref } @driver.execute_script 'mobile: doubleTap', args end @@ -94,11 +94,11 @@ # ```ruby # touch_and_hold x: 100, y: 100 # touch_and_hold x: 100, y: 100, duration: 2.0 # touch_and_hold element: find_element(:accessibility_id, "some item") # ``` - def touch_and_hold(x: nil, y: nil, element: nil, duration: 1.0) # rubocop:disable Naming/UncommunicativeMethodParamName + def touch_and_hold(x: nil, y: nil, element: nil, duration: 1.0) return 'Set x, y or element' if (x.nil? || y.nil?) && element.nil? args = element.nil? ? { x: x, y: y } : { element: element.ref } args[:duration] = duration @driver.execute_script 'mobile: touchAndHold', args @@ -119,13 +119,13 @@ # @option opts [Element] :element Element id to long tap on. x and y tap coordinates will be calculated # relatively to the current element position on the screen if this argument is provided. # Otherwise they should be calculated relatively to screen borders. # # ```ruby - # tap x: 100, y: 100 - # tap x: 100, y: 100, element: find_element(:accessibility_id, "some item") + # one_finger_tap x: 100, y: 100 + # one_finger_tap x: 100, y: 100, element: find_element(:accessibility_id, "some item") # ``` - def tap(x:, y:, element: nil) # rubocop:disable Naming/UncommunicativeMethodParamName + def one_finger_tap(x:, y:, element: nil) args = { x: x, y: y } args[:element] = element.ref if element @driver.execute_script 'mobile: tap', args end