I am able to get this in the cucumber version 1.X but upgrading cucumber to higher version not able to use (this) and it says scenario.getName() is not a function.
I require this because my test depends on the Scenario Name as it involves common function for different test data.
This is how I get the scenario name in the Cucumber version 1.x
`module.exports= function Steps() {
this.BeforeScenario(function (scenario, callback) {
var currentScenarioName = scenario.getName();
console.log(scenario.getName());
callback(null);
});
};`
And the other question is How to embed Text to my cucumber reports from my step Definition instead of doing in the hooks After function