Is there a way to parameterize Calabash touch or query

336 views Asked by At

Does anyone know if there is a way to uses variables in a calabash touch/query/etc function?

For example, say I have a variable called hotel_name and I wanted to touch("* marked:#{hotel_name}") and use that in a test step like:

Given(/I select "(.*?)"$/) |hotel_name|

touch("* marked:#{hotel_name}") end

it is not working for me. So can someone tell me if this can be done and how?

Thanks

1

There are 1 answers

1
kjuri On BEST ANSWER

There are missing apostrophes in your query and do in your block :) Proper code should look like that:

Given(/^I select "(.*?)"$/) do |hotel_name|
  touch("* marked:'#{hotel_name}'")
end

I think it should help :)