The first way is using quotation marks ("") in features.
Feature: Sign In
Scenario: Login Failure
Given User is on Home Page
And Sign In link is displayed
When User clicks the Sign In link
And User enters wrong "username" and "password"
Then User should see the failed message
Scenario: Login Failure
Given User is on Home Page
And Sign In link is displayed
When User clicks the Sign In link
And User enters wrong "username" and "password"
Then User should see the failed message
So the "username" and "password" will be passed to step definition method as parameters.
@When("User enters wrong \"(.*)\" and \"(.*)\"")
public void user_enters_wrong_username_and_password(String username, String password) {
...
}
public void user_enters_wrong_username_and_password(String username, String password) {
...
}
No comments:
Post a Comment