Change your step definition into:
When(/^I touch the “([^\"]*)“ button$/) do |button|
touch("button marked:'#{button}'")
sleep(STEP_PAUSE)
end
Question
I have a scenario in auth.feature file:
Scenario: Authorize
Given I am on the Main View
When I touch the "ServiceButton" button
and a step for touch in auth_steps.rb file:
When(/^I touch the "([^\"]*)" button$/) do |button|
touch("button marked:'#{button}'")
sleep(STEP_PAUSE)
end
When I try to use it, I have an error:
You can implement step definitions for undefined steps with these snippets:
When(/^I touch the “ServiceButton” button$/) do
pending # express the regexp above with the code you wish you had
end
I used several regex, but nothing is working. The only solution I found is
When(/^I touch the (.*) button$/) do |button|
but in this case, I need to write the button name without quotes, and this is not what I want.
This is what I use: Xamarin, iPhone SDK 6.1, calabash-iOs. To test my app with calabash, I launch app through Xamarin and then type in console cucumber NO_LAUNCH=1
.
I will be very grateful if someone could help me to solve this problem.
Solution
Change your step definition into:
When(/^I touch the “([^\"]*)“ button$/) do |button|
touch("button marked:'#{button}'")
sleep(STEP_PAUSE)
end