Skip to content

Commit

Permalink
Merge pull request calabash#153 from jmoody/0.9.x-scroll-to-row-with-…
Browse files Browse the repository at this point in the history
…mark

adds scroll_to_row_with_mark to provide 'core' support for new server operation :scrollToRowWithMark
  • Loading branch information
krukow committed May 28, 2013
2 parents 6e8cdc2 + 30095b0 commit 94d0327
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions calabash-cucumber/lib/calabash-cucumber/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,31 @@ def scroll_to_cell(options={:query => "tableView",
views_touched
end


def scroll_to_row_with_mark(row_id, options={:query => 'tableView',
:scroll_position => :middle,
:animate => true})
uiquery = options[:query] || 'tableView'

args = []
if options.has_key?(:scroll_position)
args << options[:scroll_position]
else
args << 'middle'
end
if options.has_key?(:animate)
args << options[:animate]
end

views_touched=map(uiquery, :scrollToRowWithMark, row_id, *args)

if views_touched.empty? or views_touched.member? '<VOID>'
msg = options[:failed_message] || "Unable to scroll: '#{uiquery}' to: #{options}"
screenshot_and_raise msg
end
views_touched
end

def pinch(in_out, options={})
file = "pinch_in"
if in_out.to_sym==:out
Expand Down

0 comments on commit 94d0327

Please sign in to comment.