I am new to protractor with cucumber. I have to automate a flow wherein on entering first name, last name, and postcode, a new user is created. I am trying to add the data to be entered in the feature file in examples in the scenario outline as follows:
Feature: Demo
Scenario Outline: Create a customer
Given I open the application and click on create customer button
When I enter <firstName>, <lastName>, <postCode>
Then customer should be created
Examples:
| firstName | lastName | postCode |
| Saloni | Singhal | 12345 |
| Harry | Potter | 67890 |
For the when clause, I added the following code in the step def.:
When('I enter {string}, {string}, {int}', async function (string,string,int) {
browser.sleep(10000);
await BankManagerButton.click();
await firstName.sendKeys(string);
await lastName.sendKeys(string);
await postCode.sendKeys(int);
return await addCustButton.click();
});
But on running this one, it gives me error as undefined, and suggest the following:
Undefined. Implement with the following snippet:
When('I enter Saloni, Singhal, {int}', function (int) {
// When('I enter Saloni, Singhal, {float}', function (float) {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});