Slide 15
Slide 15 text
Example
Steps
Feature: Authentication
In order to protect sensitive data,
users have to login with their name
and password.
Scenario Outline: Validate credentials
Given I entered “” as username
And I entered “” as password
When I click login
Then I should see “”
Examples:
|user |pass |msg |
|andre |wrong |Invalid password.|
|andre |secret |Welcome. |
| |pass |No username. |
|user | |No password. |
@Given("^I entered \"(.+)\" as (.+)$")
public void I_entered_(String text, String as) {
//perform action on UI
}
@Given("^I click (.+)$")
public void I_click_on_(String text) {
//perform action on UI
}
@Given("^I should see \"(.+)\"$")
public void I_should_see_(String text) {
//perform assertion on UI
}