Hi,

the @Before/After annotations are not able to take any runtime parameters.

If you want to reset after a single parametrised scenario then you can simply define a reset step and make it part of the scenario.

Cheers

On 27/01/2014 15:26, Corbin, J.D. wrote:
Hi Mauro,

Thanks for that suggestion. It happens to work in my case since I only have one parameterized scenario, but what if I had two and only wanted the reset behavior for a single parameterized scenario. Is that possible? I would think the scenario would have to be named in some way.

J.D.


On Sat, Jan 25, 2014 at 2:21 AM, Mauro Talevi <[email protected] <mailto:[email protected]>> wrote:

    Use annotation specifying the scenario type

    @BeforeScenario(uponType=ScenarioType.EXAMPLE)

    Cheers


    On 24/01/2014 23:14, Corbin, J.D. wrote:

        We are using the tabular scenario format to run multiple sets
        of data through a single jbehave scenario using the Examples:
        tabular format.

        We are using a custom scenario scope that has our global
        scenario state.  Using this approach, we get a new instance of
        our global state object at the beginning of each scenario
        which is what we want.

        The problem is that there is some state we'd like to reset in
        between the tabular runs for the scenario but I don't see
        where to inject some behavior into JBehave.  JBehave doesn't
        treat each run as a new scenario, just runs the new set of
        parameterized data through the same scenario instance, so we
        cannot figure out where to reset the state in between the
        runs.  We have gotten around this by resetting the state in
        one of the steps of the scenario but this is not ideal because
        its possible that this step is used in other scenarios and we
        don't necessary want this state reset in those cases.

        Is there such a thing as tabular scope or some place we can
        introduce some behavior in between parameterized runs of a
        single scenario?

        J.D.




    ---------------------------------------------------------------------
    To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply via email to