mmichaelis
11/8/2011 - 1:55 PM

BDD: Ambiguous Step Definitions

BDD: Ambiguous Step Definitions

Given I logged in as normal user
...
Given I logged in as user A
...
When I log in as existing user with valid credentials
Then I want to see the welcome message
...
When I try to log in as non-existing user
Then I want to see the registration page
...
When I log in as existing user with invalid credentials
Then I want to get an invalid login message
...
Given I logged in too many times with invalid credentials as user A
When I log in as user A with invalid credentials
Then I want to get an account blocked message
Given I logged in as user qwert with password asdf
...
When I log in as user qwert with password asdf
...
When I log in as user named qwert with password asdf
...
@When("I log in as user $user with password $password")
public void login1(String user, String password) {
  ...
}
[...]
@When("I log in as user named $user with password $password")
public void login2(String user, String password) {
  ...
}