Weee.... Finally I found a solution to this :)
I ended up adding following lines to the core_frank_steps.rb file:
# -- PickerView -- #
Then /^I should see picker "([^\"]*)"$/ do |expected_mark|
check_element_exists("view:'UIPickerView'
marked:'#{expected_mark}'")
end
When /^I select (\d*)(?:st|nd|rd|th)? row in picker "([^\"]*)"$/ do |
row_index, theview|
selector = "view:'UIPickerView' marked:'#{theview}'"
row_index = row_index.to_i
views_switched = frankly_map( selector,
'selectRow:inComponent:animated:', row_index, 0, false )
raise "could not find anything matching [#{row_index}] to switch" if
views_switched.empty?
end
What did I do?
1) The first issue was my selector. I used tag instead of marked. I
made the The I should see picker step to help figure out why it did
not worked and found it a handy step to have so I kept.
2) After I got the selector to work I got EOFError returned when I
called When I select step, which I could not quite figure out till I
ran the test while having the app in the debugger and found an
NSRangeException being thrown due to a pretty weird 8 digit index,
which of course is out range ;) I found a solution to this issue in
this post:
http://groups.google.com/group/frank-discuss/browse_thread/thread/0d5d2abfd4105bf1
Please notice the row_index = row_index.to_i - this is necessary in
order to convert the value to an integer, otherwise I will not work :)
Maybe this could a possible add-in to the official core_frank_steps.rb
file?
Best regards
Leif
On Aug 3, 10:37 am, Leif Bredgaard Andersen <
lband...@acosys.dk>
wrote: