Issue Type: Bug Bug
Affects Versions: 3.7.4
Assignee: Unassigned
Components: Core
Created: 06/Dec/12 6:34 PM
Description:

Scenarios parameterised by examples are skipped if scenario level meta filtering is used. This seems to be a direct result of changes introduced by JBEHAVE-846.

eg:

<metaFilters>
    <metaFilter>+foo *</metaFilter>
</metaFilters>

Meta:
@foo bar

Scenario:

Given I am a 'Partner' user

When a 'Business Support' case is created with:
|name                |value              |
|Code                |<Code>             |
|Process             |<Process>          |
|Sub Process         |<Sub Process>      |

Then the case has 1 item in basket 'Partner Team'

Examples:
|<Code>  |<Process>        |<Sub Process>         |
|XYZ     |Business Support |Bank Statement Upload |

Execution of the above results in the before and after steps being executed but all scenario steps being skipped.

Debugging the code shows that the check:

if ( !context.filter.allow(parameterMeta) ){
    continue;
}

in the method:

StoryRunner.java
private void runScenariosParametrisedByExamples(RunContext context, Scenario scenario, Meta storyAndScenarioMeta)
        throws Throwable {
    ExamplesTable table = scenario.getExamplesTable();
    reporter.get().beforeExamples(scenario.getSteps(), table);
    Keywords keywords = context.configuration().keywords();
    for (Map<String, String> scenarioParameters : table.getRows()) {
        Meta parameterMeta = parameterMeta(keywords, scenarioParameters);
        if ( !context.filter.allow(parameterMeta) ){
            continue;
        }
        reporter.get().example(scenarioParameters);
        if (context.configuration().storyControls().resetStateBeforeScenario()) {
            context.resetState();
        }
        runBeforeOrAfterScenarioSteps(context, scenario, storyAndScenarioMeta, Stage.BEFORE, ScenarioType.EXAMPLE);
        addMetaParameters(scenarioParameters, storyAndScenarioMeta);
        runGivenStories(scenario.getGivenStories(), scenarioParameters, context);
        runScenarioSteps(context, scenario, scenarioParameters);
        runBeforeOrAfterScenarioSteps(context, scenario, storyAndScenarioMeta, Stage.AFTER, ScenarioType.EXAMPLE);
    }
    reporter.get().afterExamples();
}

always passes resulting in 'continue' and the scenario execution being skipped.

Using the example above, context.filter='+foo *', but because the meta parameter 'foo' is at scenario level and not at examples table level, parameterMeta is empty and the filter.allow() is false resulting in 'continue'.

Project: JBehave
Priority: Major Major
Reporter: Paul Brunckhorst
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to