Is there a way to run specific code block before and after each cucumber feature with certain tag?
Since setup process is very expensive I don't want to run it before each scenario.
The hooks for cucumber are described in this wiki page which show the before and after hooks you can have.
Taken from that page is this example:
The following example will cause scenarios tagged with @fast to fail if the execution takes longer than 0.5 seconds:
Around('@fast') do |scenario, block|
Timeout.timeout(0.5) do
block.call
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With