I am learning how to cucumber.js, protractor, bdd etc. I can't find out how to use 'Scenario Outlines' in cucumber.js and protractor
- I have the following in my .feature file
Scenario Outline : Invalid Login
When I enter invalid <user>
And I enter invalid <pass>
And I press login button
Then I should see an error message
Examples:
|user |pass|
|abc |def|
|bcd |efg|
- I have the following code in my steps.js file
this.When('I enter invalid username', function (callback) {
var userNameElement = element(by.id('username'));
userNameElement.sendKeys('userA');
callback();
});
this.When('I enter invalid password', function (callback) {
var passwordElement = element(by.id('password'));
passwordElement.sendKeys('userB');
callback();
});
- How can I pass the 'example' data from the 'feature' file to my 'steps' file and run the test with the data table define in the 'feature' file?