There is a FeatureContext as well as the more commonly used ScenarioContext. FeatureContext exists during the execution of the entire feature, whereas the ScenarioContext only exists for the duration of a scenario.


FeatureContext also has a Current property which accesses a Dictionary. Otherwise FeatureContext works exactly the same way as ScenarioContext.Current.


FeatureInfo provides more information than ScenarioInfo, but it works the same:

In the .feature file:

    Scenario: Showing information of the feature
  When I execute any scenario in the feature
  Then the FeatureInfo contains the following information
    | Field          | Value                               |
    | Tags           | showUpInScenarioInfo, andThisToo    |
    | Title          | FeatureContext features             |
    | TargetLanguage | CSharp                              |
    | Language       | en-US                               |
    | Description    | In order to                         |

and in the step definition:

    private class FeatureInformation
        public string Title { get; set; }
        public GenerationTargetLanguage TargetLanguage { get; set; }
        public string Description { get; set; }
        public string Language { get; set; }
        public string[] Tags { get; set; }

    [When(@"I execute any scenario in the feature")]
    public void ExecuteAnyScenario() { }

    [Then(@"the FeatureInfo contains the following information")]
    public void FeatureInfoContainsInterestingInformation(Table table)
        // Create our small DTO for the info from the step
        var fromStep =  table.CreateInstance<FeatureInformation>();
        fromStep.Tags = table.Rows[0]["Value"].Split(',');

        var fi = FeatureContext.Current.FeatureInfo;

        // Assertions
        for (var i = 0; i < fi.Tags.Length - 1; i++)

FeatureContext exposes a Binding Culture property that simply points to the culture the feature is written in (en-US in our example).