Stop execution if a test fails on any input from where block

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Stop execution if a test fails on any input from where block

ssoomro
Hi, I was wondering if there is a way to stop execution if a feature method would fail in any of the inputs provided in the where block and shouldn't continue with the execution of further tests.

Help appreciated.
Thanks,
-SS

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Stop execution if a test fails on any input from where block

Kostis Kapelonis
Hello

As far as I know, this is not supported by Spock in an obvious way.

However, I consider this a good thing. Knowing in advance all failed
inputs of a parameterized test, would allow you to fix them all at
once.
Otherwise you would need to fix one case, run the test again, see it
fail on another case, fix it, run it again and so on.

If I have a where: block with 100 lines and after a single commit, 73
of them break, I would like to locate them all at once, instead of
having to run the test 73 times in order to see which case fails each
time.

What is your real world scenario?

If by "further tests" you mean other test methods in the same class
that holds the parameterized method, then the @Stepwize annotation
will work as expected. Any error in the parameterized test method,
will skip all other test methods that follow it.

Kostis

On Wed, Jun 10, 2015 at 10:03 PM,  <[hidden email]> wrote:

> Hi, I was wondering if there is a way to stop execution if a feature method
> would fail in any of the inputs provided in the where block and shouldn't
> continue with the execution of further tests.
>
> Help appreciated.
> Thanks,
> -SS
>
> --
> You received this message because you are subscribed to the Google Groups
> "Spock Framework - User" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at http://groups.google.com/group/spockframework.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Loading...