A solution to add newline support is to take the variables out of the string in the features so that the newline can be added by the ruby code:
Then I see a popup with latitude 10 and longitude 20
Calls:
Then /^I see a popup with latitude (\d+) and longitude (\d+)$/ do |lat, lon|
msg = "Latitude:#{lat}\nLongitude:#{lon}"
should_see_alert_with_text msg
end
Using:
def should_see_alert_with_text (text)
wait_poll(:until_exists => 'alertView', :timeout => 5) do
actual = query('alertView child label', :text).first
unless actual.eql? text
screenshot_and_raise "should see alert view with message '#{text}' but found '#{actual}'"
end
end
end