I have a single feature in my solution as follows:
Feature: Login
The login screen
Scenario Outline: Logging in with invalid credentials
Given A user account has been created and activated
When I enter the username < username >
And I enter the password < password >
And I press Login
Then An error message is displayed
Examples:
| username | password |
| joe.bloggs | abcd1234 |
| known.user | ck |
The steps file contains:
[Binding]
public class LoginSteps
{
[Given(@"A user account has been created and activated")]
public void GivenAUserAccountHasBeenCreatedAndActivated()
{
int a = 1;
}
[When(@"When I enter the username (.*)")]
public void WhenIEnterTheUsername(string username)
{
int a = 1;
}
[When(@"When I enter the password (.*)")]
public void WhenIEnterThePassword(string password)
{
int a = 1;
}
[When(@"I press Login")]
public void WhenIPressLogin()
{
int a = 1;
}
[Then(@"An error message is displayed")]
public void ThenAnErrorMessageIsDisplayed()
{
int a = 1;
}
}
*i've added the 'int a = 1;' lines temporarily to keep it simple for debugging
When I right click on the feature and select 'Debug Specflow Scenarios' the following error occurs: No matching step definition found for one or more steps : 'An error message is displayed'
The scenario is all colour coded correctly and Go to step definition works for the 'An error message is displayed' step.
Anyone else seen this before or got any suggestions on how to fix?