In side my calabash test feature,in the middle of the flow I add four known numbers like
one after another and this order.(something like a user saved his credit card numbers) and in the final view I show them in a UITableView each row contains a number which is like xxxxxx1111
. This table view shows the numbers sorted according to the Oldest to Newest I want to verify it . How should I do it using calabash ?
I Tried this and it works for me now. I declare a step definition in _steps.rb file
Then /^I see cell label "([^"]*)" row num (\d+) in section (\d+)$/ do |cellLabel, row, section|
###### diff cells with labels in table, vertically orderd ######
## E.g. Then I see cell label "abc" row num 1 in section 0
res = query("label marked:'#{cellLabel}' parent tableViewCell indexPath:#{row},#{section}").empty?
if (res)
screenshot_and_raise "There is no cell label with text #{cellLabel} in indexpath #{row},#{section}"
end
end
and use it in calabash feature file like
Hope this will be useful to someone :)