Each cucumber structure has a set of predefined steps. Of course, these steps do not cover all the possibilities. If you need additional functionality, you must define your own steps:
When /^I scroll (up|down) until I see "([^\"]*)"$/ do |direction, something_to_see|
I can’t help you with the exact implementation (what is “Value”?), But you can find the main functions here
You probably need a function
scroll(uiquery, direction)
(where uiquery will be a tableView )
If you take this function and element_is_not_hidden , you can create a while that will scroll down until you see the “Value”.
Perhaps something similar to the following (I don't know Calabash, but I know Frank a little)
When /^I scroll (up|down) until I see "([^\"]*)"$/ do |direction, something_to_see| max_scroll_tries = 10 [0..max_scroll_tries].each do break if element_is_not_hidden("view marked:'#{something_to_see}'") scroll("tableView", direction) end check_element_exists_and_is_visible("view marked:'#{something_to_see}'") end
source share