lundi 5 février 2018

Calabash-ios Cucumber cant find step def

I have the following Scenario:

Given I am on the profile page
When I click on Settings
And click on More
Then next to Online field the option should say "No"

I have 2 step def files. One is a generic one (generic-steps.rb). The other is for this specific Scenario (profile-steps.rb).

profile-steps.rb is used to pass the first 3 lines which works fine:

For the last step my profile-steps.rb is shown below:

 Then(/^next to Online field field the option should say "([^"]*)"$/) do |option|
step "check to see if element with id \"ProfileOnline\" equals the value #{option}"
end

and in my generic file my step is :

Then(/^check to see if element with id "([^"]*)" equals the value "([^"]*)"$/) do |elementID, value|
query("* id:'#{elementID}'",:text)[0] == value
end

But I get this error:

Undefined dynamic step: "check to see if element with id "ProfileOnline" equals the value No$/" (Cucumber::UndefinedDynamicStep)

The generic file is linked with the profile file properly because I have other scenarios in this file and they all work fine using the generic steps. Its just this step that doesnt work

Any help is much appreciated

Aucun commentaire:

Enregistrer un commentaire