Skip to content

Commit

Permalink
fix drag_from_to_for_duration (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Apr 20, 2017
1 parent 4f5a474 commit d01ebd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions ios_tests/lib/ios/specs/ios/xcuitest_gestures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def after_last

t 'scroll' do
scroll direction: 'down'
text('Style Default').displayed?.must_be true
text('Style Default').displayed?.must_equal true
end

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

t 'drag_from_to_for_duration' do
drag_from_to_for_duration from_x: 100, from_y: 100, to_x: 100, to_y: 400
text('Standard Switch').displayed?.must_equal true
end

t 'pinch' do
pinch(scale: 0.5, velocity: -1)
end
Expand All @@ -50,12 +55,11 @@ def after_last
select_picker_wheel(element: e, order: 'next')

e.displayed?.must_be false
find_element(:name, 'Serena Auroux').displayed?.must_be true

back_click
find_element(:name, 'Serena Auroux').displayed?.must_equal true
end

t 'after_last' do
back_click
after_last
end
end
2 changes: 1 addition & 1 deletion lib/appium_lib/ios/xcuitest_gestures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def tap(x:, y:, element: nil)
def drag_from_to_for_duration(from_x:, from_y:, to_x:, to_y:, duration: 1.0, element: nil)
return 'require XCUITest(WDA)' unless automation_name_is_xcuitest?

args = { from_x: from_x, from_y: from_y, to_x: to_x, to_y: to_y, duration: duration }
args = { fromX: from_x, fromY: from_y, toX: to_x, toY: to_y, duration: duration }
args[:element] = element if element
execute_script 'mobile: dragFromToForDuration', args
end
Expand Down

0 comments on commit d01ebd2

Please sign in to comment.