Skip to content

Conversation

@corinned
Copy link

@corinned corinned commented Apr 5, 2016

Use @before with a call to getFeature() on the Scenario object to get the instance of the Feature. Use the Feature instance to get information about the Feature for logging.

public void get_feature_name(Scenario scenario) {
Feature feature = scenario.getFeature();
featureName = feature.getName();
tags = feature.getSourceTagNames();
}
#902

@Purus
Copy link

Purus commented May 9, 2016

+1

@b-lal
Copy link

b-lal commented Jul 18, 2016

Hi,
I was actually looking for this functionality, great idea Corinne.
When this is due to be released?

@brasmusson
Copy link
Contributor

When upgrading Cucumber-JVM to use Gherkin v4.0.0 with the new Gherkin compiler (which is where I focus my effort currently), the Feature information will not be available when running compiled scenarios. So @b-lal, my answer would be that this PR will not be merged (I'm sorry @corinned).

@aldosuwandi
Copy link

+1

@brasmusson
Copy link
Contributor

Now that the master branch as been updated to use Gherkin v4, this pull-request has been invalidated - and it is not possible to provide the feature name to Before or After Hooks (see this comment).

@brasmusson brasmusson closed this Jun 18, 2017
@nsidhaye
Copy link

Hmm. Want to run cleanups after feature file. :(

@lock
Copy link

lock bot commented Dec 21, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

6 participants