You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2018. It is now read-only.
bmabey edited this page Aug 13, 2010
·
23 revisions
It is possible to call steps from step definitions:
Given /^The user (.*) exists$/ do |name|
# ...
end
Given /^I log in as (.*)$/ do |name|
# ...
end
Given /^(.*) is logged in$/ do |name|
Given "The user #{name} exists"
Given "I log in as #{name}"
end
This is practical if you have several common steps that you want to perform in several scenarios. This allows you to do this in a Scenario:
Scenario: View last incidents
Given Linda is logged in # This will in fact invoke 2 step definitions
When I go to the incident page
Instead of having a lot of repetition:
Scenario: View last incidents
Given The user Linda exists
And I log in as Linda
When I go to the incident page