I'm searching a way to implement an AfterStep(@tag) passing the scenario as an argument. Unfortunately, this isn't working and I couldn't find a way to do it.
I also looked into the Cucumber Hooks documentation, but that didn't help as well.
The way I'm trying to implement:
AfterStep('@screenshot') do |scenario|
# Add screenshot to baseline folder.
@helper = Helper.new
undefined method `name' for #<Cucumber::Core::Test::Result::Passed:0x007f2b818e6d50> (NoMethodError)
As @Sam pointed out, using
After('@screenshot') do |scenario| did the trick for me.