We're using Cucumber and Selenium with Ruby. After reading the documentation on hooks I've tried my hand at setting a few tags to set (for example) some environment variables.
Here's a contrived example that demonstrates the problem.
When I establish a Before
hook like so:
Before('@tag1', '@tag2') do
puts "in the before hook!"
end
It'll take effect with a scenario defined like so:
@tag1 @tag2
Scenario Outline: This is a test scenario
Given I run my first step for "<user>"
Then I complete my test
@firstrun
Scenarios:
|user|
|fred|
@secondrun
Scenarios:
|user|
|barney|
..however if I move @tag1
and @tag2
to the individual scenarios and not the scenario outline, the hook is never called, for instance:
@secondrun @tag1 @tag2
Scenarios:
|user|
|barney|
Is it possible to 'hook in' individual scenarios, or just the outlines?