On 29 Jul 2015 07:40, "SPK" <swap...@gmail.com> wrote:
>
> Hi,
>
> I am new to cucumber and have created a java code using cucumber.
>
> I created two different feature files. For both the features files, I have a corresponding step definition files, each having a Before and After hook.
Step definitions are global (by design) to help building a ubiquitous language. Hooks are also global.
> When I run the code, I observed that before hook for one step file is called and then immediately before hook for the other step file is called, see output below
>
> @search
> Feature: Search for a part
> BeforeResult
> BeforeHome
> AfterResult
> AfterHome
This seems correct. The only way to filter execution of hooks is with tags.
What you are trying to do looks like an anti-pattern to me... can you explain better what the hooks are meant to do?
> @search
> Scenario Outline: ...
> Given ...
> When ...
> Then ...
>
>
> Any explanation for the above behavior as I expected the output to be
> @search
> Feature: Search for a part
> BeforeHome
> AfterHome
>
> @search
> Scenario Outline: ...
> Given ...
> When ...
> Then ...
>
> Regards,
> SPK
>
> --
> Posting rules: http://cukes.info/posting-rules.html
> ---
> You received this message because you are subscribed to the Google Groups "Cukes" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
On 29 Jul 2015 07:40, "SPK" <swap...@gmail.com> wrote:
>
> Hi,
>
> I am new to cucumber and have created a java code using cucumber.
>
> I created two different feature files. For both the features files, I have a corresponding step definition files, each having a Before and After hook.Step definitions are global (by design) to help building a ubiquitous language. Hooks are also global.
> When I run the code, I observed that before hook for one step file is called and then immediately before hook for the other step file is called, see output below
>
> @search
> Feature: Search for a part
> BeforeResult
> BeforeHome
> AfterResult
> AfterHomeThis seems correct. The only way to filter execution of hooks is with tags.
What you are trying to do looks like an anti-pattern to me... can you explain better what the hooks are meant to do?