Skip to content

Instantly share code, notes, and snippets.

@mmichaelis
Created November 8, 2011 13:55
Show Gist options
  • Save mmichaelis/1347783 to your computer and use it in GitHub Desktop.
Save mmichaelis/1347783 to your computer and use it in GitHub Desktop.
BDD: Ambiguous Step Definitions
@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) {
...
}
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
...
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment