Skip to content

Commit d01ebd2

Browse files
authored
fix drag_from_to_for_duration (#553)
1 parent 4f5a474 commit d01ebd2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

ios_tests/lib/ios/specs/ios/xcuitest_gestures.rb

+8-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def after_last
2424

2525
t 'scroll' do
2626
scroll direction: 'down'
27-
text('Style Default').displayed?.must_be true
27+
text('Style Default').displayed?.must_equal true
2828
end
2929

3030
t 'swipe' do
@@ -34,6 +34,11 @@ def after_last
3434
proc { text('Style Default') }.must_raise ::Selenium::WebDriver::Error::NoSuchElementError
3535
end
3636

37+
t 'drag_from_to_for_duration' do
38+
drag_from_to_for_duration from_x: 100, from_y: 100, to_x: 100, to_y: 400
39+
text('Standard Switch').displayed?.must_equal true
40+
end
41+
3742
t 'pinch' do
3843
pinch(scale: 0.5, velocity: -1)
3944
end
@@ -50,12 +55,11 @@ def after_last
5055
select_picker_wheel(element: e, order: 'next')
5156

5257
e.displayed?.must_be false
53-
find_element(:name, 'Serena Auroux').displayed?.must_be true
54-
55-
back_click
58+
find_element(:name, 'Serena Auroux').displayed?.must_equal true
5659
end
5760

5861
t 'after_last' do
62+
back_click
5963
after_last
6064
end
6165
end

lib/appium_lib/ios/xcuitest_gestures.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def tap(x:, y:, element: nil)
118118
def drag_from_to_for_duration(from_x:, from_y:, to_x:, to_y:, duration: 1.0, element: nil)
119119
return 'require XCUITest(WDA)' unless automation_name_is_xcuitest?
120120

121-
args = { from_x: from_x, from_y: from_y, to_x: to_x, to_y: to_y, duration: duration }
121+
args = { fromX: from_x, fromY: from_y, toX: to_x, toY: to_y, duration: duration }
122122
args[:element] = element if element
123123
execute_script 'mobile: dragFromToForDuration', args
124124
end

0 commit comments

Comments
 (0)