Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Scneario Outlines appear to ignore tagged hooks #209

Closed
restagner opened this Issue · 0 comments

2 participants

@restagner

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.