Skip to content

Commit 4f5a474

Browse files
authored
add offset (#551)
1 parent 491a142 commit 4f5a474

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/appium_lib/ios/xcuitest_gestures.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,18 @@ def drag_from_to_for_duration(from_x:, from_y:, to_x:, to_y:, duration: 1.0, ele
128128
# https://github.com/appium/appium-xcuitest-driver/pull/420
129129
# @param order [String] The order to move picker to. "next" or "previous".
130130
# @param element [Element] Element id to perform select picker wheel on.
131+
# @option opts [Integer] :offset The value in range [0.01, 0.5]. Default is 0.2 in server side.
132+
# https://github.com/facebook/WebDriverAgent/pull/549/files
131133
#
132134
# ```ruby
133135
# select_picker_wheel order: "next", element: find_element(:accessibility_id, "some picker")
134136
# ```
135-
def select_picker_wheel(element:, order:)
137+
def select_picker_wheel(element:, order:, offset: nil)
136138
return 'require XCUITest(WDA)' unless automation_name_is_xcuitest?
137139
return 'Set "next" or "previous" for :order' unless %w(next previous).include?(order)
138140

139141
args = { element: element.ref, order: order }
142+
args[:offset] = offset if offset
140143
execute_script 'mobile: selectPickerWheelValue', args
141144
end
142145
end # module XcuitestGesture

0 commit comments

Comments
 (0)