cucumber/cucumber-ruby-core

Feature level tags not available during scenario execution

Closed this issue · 5 comments

na-na commented

before_tag(tags) should list the feature level tag for each scenario run

If we have a feature file:

@tag1
Feature: This is a feature
Scenario: This is a scenario

During execution, the tag list in the before_tags method in formatter does not capture the feature level tags when running the scenario.

Expectation: Feature tags should be available at scenario level as well.

Please let me know if I am correct in my expectation.
Also, let me know if there is a way to know which tag is feature level and which is scenario level.

Thanks!

I'll look into this, but I can tell you right now there won't be a good way to differentiate between feature- and scenario-level tags. I do like the idea of making feature-level tags accessible at the scenario level though.

Thanks for the suggestion @na-na and sorry it's taken so long to get back to you!

before_tags is part of the old formatter API. The recommendation would be to move to the new formatter API as exemplified in this feature, using the following events

Thanks for the suggestion @brasmusson!

This issue is resolved using the new events API, @na-na. I just created a PR with tests for it in cucumber/cucumber-ruby#1128.

lock commented

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.