In case of error I want to be able to log the scenario name. I'm using cucumber.js and node.
Feature file
Scenario: As me I can go to google
Given that I have a computer
When I go to google
Then I see wondrous stuff
I have tried the code below, but the name comes back as an empty string.
When(/^I go to google$/, (scenario) => {
// do something
var scenarioName = scenario.name;
});
By stepping through the code I can see that it's a function. It has :
[[FunctionLocation]] = Object
[[Scopes]] = Scopes(6)
length = 2
name= ""