Protractor - Cucumber not picking values from Examples. I am using site "http://juliemr.github.io/protractor-demo/" in first text box it enters <key1> and <key2>.
Feature file is below
Feature: Navigate to calculator site and add two number
Scenario: Add two number using calculator site
Given Navigate to calculator site url "http://juliemr.github.io/protractor-demo/"
When Provide two numbers to add first number "< key1 >" and "< key2 >"
Then Click on add button on calculator site
Scenario Outline: Provide parameters
Examples:
| key1 | key2 |
| 2 | 3 |
| 2 | 60 |
Step definition file
import { Given, When, Then } from "cucumber";
import { browser } from "protractor";
import { calculator } from "../pageObjects/calculator";
let cal = new calculator();
Given('Navigate to calculator site url {string}', async (string)=> {
// Write code here that turns the phrase above into concrete actions
await browser.get(string);
});
When('Provide two numbers to add first number {string} and {string}', async (firstValue:string,
secondvalue:string)=> {
// Write code here that turns the phrase above into concrete actions
await cal.firstEditBox.sendKeys(firstValue);
await cal.secondEditBox.sendKeys(secondvalue);
});
Then('Click on add button on calculator site', async ()=> {
// Write code here that turns the phrase above into concrete actions
await cal.goButton.click;
cal.getResult.getText().then(function(text) {
console.log(text);
})
});
Error
