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
- Then I see cell label "xxxx1111" row num 0 in section 0
- Then I see cell label "xxxx2222" row num 1 in section 0
- Then I see cell label "xxxx4444" row num 2 in section 0
- Then I see cell label "xxxx3333" row num 3 in section 0
Hope this will be useful to someone :)