Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scneario Outlines appear to ignore tagged hooks #209

Closed
restagner opened this issue Feb 17, 2012 · 1 comment
Closed

Scneario Outlines appear to ignore tagged hooks #209

restagner opened this issue Feb 17, 2012 · 1 comment

Comments

@restagner
Copy link

I've attempted to use a tagged hook within a given step definition class and then reused one of the Given steps contained in the same class as the tagged hook across 2 feature files. I've tagged a Scenario outline expecting to see the Before hook called prior to executing the Given step, but this does not appear to be happening.

It's a bit difficult to explain. Please see the public gist I've shared at https://gist.github.com/1850089 for the feature files and accompanying step definition classes, along with what I would expect the outcome to be and what the actual result is.

First feature file

@feature_1
Feature: Feature one

    Scenario: A 
        Given a step in A
        When an action in A
        Then the expected outcome is X

    @feature_2
    Scenario Outline: B
        Given a step in C
        When an action in B
        Then the outline's expected outcome is <result>

        Examples:
        | result |
        | Y      |
        | W      |

Second feature file

Feature: Feature 2

    @feature_2
    Scenario: C
        Given a step in C
        When an action in C
        Then the expected outcome is Z

EXPECTED OUTPUT

[class org.stag.hello.StepDefsForFeature_1]: Inside GIVEN step A
[class org.stag.hello.StepDefsForFeature_1]: Inside WHEN step A
[class org.stag.hello.StepDefsForFeature_1]: Inside THEN step X
[class org.stag.hello.StepDefsForFeature_2]: Inside tagged BEFORE hook -- tag = @feature_2
[class org.stag.hello.StepDefsForFeature_2]: Inside GIVEN step C
[class org.stag.hello.StepDefsForFeature_1]: Inside WHEN step B
[class org.stag.hello.StepDefsForFeature_1]: Inside THEN step Y
[class org.stag.hello.StepDefsForFeature_2]: Inside tagged BEFORE hook -- tag = @feature_2
[class org.stag.hello.StepDefsForFeature_2]: Inside GIVEN step C
[class org.stag.hello.StepDefsForFeature_1]: Inside WHEN step B
[class org.stag.hello.StepDefsForFeature_1]: Inside THEN step W
[class org.stag.hello.StepDefsForFeature_2]: Inside tagged BEFORE hook -- tag = @feature_2
[class org.stag.hello.StepDefsForFeature_2]: Inside GIVEN step C
[class org.stag.hello.StepDefsForFeature_2]: Inside WHEN step C
[class org.stag.hello.StepDefsForFeature_2]: Inside THEN step Z

ACTUAL OUTPUT

[class org.stag.hello.StepDefsForFeature_1]: Inside GIVEN step A
[class org.stag.hello.StepDefsForFeature_1]: Inside WHEN step A
[class org.stag.hello.StepDefsForFeature_1]: Inside THEN step X
[class org.stag.hello.StepDefsForFeature_2]: Inside GIVEN step C
[class org.stag.hello.StepDefsForFeature_1]: Inside WHEN step B
[class org.stag.hello.StepDefsForFeature_1]: Inside THEN step Y
[class org.stag.hello.StepDefsForFeature_2]: Inside GIVEN step C
[class org.stag.hello.StepDefsForFeature_1]: Inside WHEN step B
[class org.stag.hello.StepDefsForFeature_1]: Inside THEN step W
[class org.stag.hello.StepDefsForFeature_2]: Inside tagged BEFORE hook -- tag = @feature_2
[class org.stag.hello.StepDefsForFeature_2]: Inside GIVEN step C
[class org.stag.hello.StepDefsForFeature_2]: Inside WHEN step C
[class org.stag.hello.StepDefsForFeature_2]: Inside THEN step Z
@lock
Copy link

lock bot commented Oct 25, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants