enter code here
I am able to run the feature file if no parameters in the scenario. With parameter I been getting this ? Given User has successfully navigated to the Manufacturing "DEV" Application
Undefined. Implement with the following snippet:
Given('User has successfully navigated to the Manufacturing {string} Application', function (string) {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});
feature:
Feature: Protractor Test
@TEST
Scenario Outline: Login Test
Given User has successfully navigated to the Manufacturing "<ENV>" Application
Examples:
| ENV |
| DEV |
LoginSteps.ts
import { browser, protractor } from "protractor";
import {LoginPage} from "../pages/LoginPage";
const { When, Then , Given} = require("cucumber");
const loginpage: LoginPage = new LoginPage();
Given('User has successfully navigated to the Manufacturing (.*?) Application.', async (env) => {
await loginpage.OpenBrowser(env)
});
Loginpage.ts
import {browser, by, element, $, ElementFinder} from 'protractor';
export class LoginPage {
OpenBrowser = async (env) => {
switch (env) {
case("DEV"):
await browser.sleep(5000);
await browser.get("https://angularjs.org/");
}
}
}
enter code here