In Ruby, I can get the name of a Scenario file (e.g. "login.feature") using: scenario.file.to_s - (http://rdoc.info/gems/cucumber/Cucumber/Ast/HasLocation#file-instance_method)
Is there a way to do this in Cucumber-JVM?
In Ruby, I can get the name of a Scenario file (e.g. "login.feature") using: scenario.file.to_s - (http://rdoc.info/gems/cucumber/Cucumber/Ast/HasLocation#file-instance_method)
Is there a way to do this in Cucumber-JVM?
If you're using the junit runner, write your own formatter.
@RunWith(Cucumber.class)
@CucumberOptions(
features = "classpath:features/something.feature",
format = "com.blah.PrintingFormatter",
glue = "com.blah.steps")
public class CucumberTest {
}
Your PrintingFormatter should implement the gherkin.formatter.Formatter interface, specifically the uri method.
@Override
public void uri(String uri) {
//do something
}
Add a println and you'll see the name of your feature file.