I have the following feature file Feature: Employee_EditEmployeeFeature Check Edit Employee Page
@Employee_EditEmployeeFeature
Scenario Outline: Verify invalid format field error displayed (Email Address)
Given I enter an invalid worker email address <EmailAddress>
When I click on the Employee Edit Save button
Then Check invalid format error displayed for worker Email Address field
Examples:
| EmailAddress |
| invalidaddress |
| invalid address@acme.com |
| invalidaddress@acme |
@Employee_EditEmployeeFeature
Scenario Outline: Verify invalid format field error displayed (Passport Number)
Given I enter invalid worker passport number <PassportNo>
When I click on the Employee Edit Save button
Then Check invalid format error displayed for worker passport field
Examples:
| PassportNo |
| 1234 |
| AS1234567 |
I get the following step code generated for the Given statements
[Given(@"I enter an invalid worker email address invalidaddress")]
public void GivenIEnterAnInvalidWorkerEmailAddressInvalidaddress()
{
ScenarioContext.Current.Pending();
}
[Given(@"I enter invalid worker passport number (.*)")]
public void GivenIEnterInvalidWorkerPassportNumber(int p0)
{
ScenarioContext.Current.Pending();
}
Because the email address step has been generated incorrectly e.g. with no parameter, when the test is run it fails with the following, Test Name: VerifyInvalidFormatFieldErrorDisplayedEmailAddress_Invalidaddress Result Message: Assert.Inconclusive failed. No matching step definition found for one or more steps.
using System;
using TechTalk.SpecFlow;
namespace MyNamespace
{
[Binding]
public class StepDefinitions
{
[Given(@"I enter an invalid worker email address invalidaddress")]
public void GivenIEnterAnInvalidWorkerEmailAddressInvalidaddress()
{
ScenarioContext.Current.Pending();
}
I have trawled the internet and see other people have had this issue, and I have tried some of their solutions to no avail. Any advice as I cannot really move on until I can consistently generate correct step code for Scenario Outline features.