These are two scenarios. One of the statement is used in both the scenarios but in second scenario it appear not defined, unless I use it same annotation with which it was used initially.
Scenario1:
Given I have items in cart <<
Then I can see total amount
Scenario2:
Given I am valid user
And I go to an item
When I click on add to cart
Then I have items in cart << Step is not defined
Scenario2:
Given I am valid user
And I go to an item
When I click on add to cart
Given I have items in cart << Step is found when used with Given
How can I fix this?
Reference post: Specflow calling steps within steps causes "No matching step definition" error
However my question is about JBehave not Specflow. I am using JBehave, Java, Windows 7
Comments
Post a Comment