How to get tags from scenario into step definition in Ruby?
**@TAGS**
Scenario: Showing information of the scenario
When I execute any scenario
Now my step definition is this:
And(/^When I execute any scenario$/) do |page|
How to get tag = @TAGS in step definition..
end
Not a direct solution, but hooks (Before, After, AfterStep, etc) can be set to run for specific tags, which allows you to set instance variables that are accessible in the scenario
You could also use the fact that
Before
hooks get the scenario passed to them and use that to set an instance variable to the tag names