How to force easyb to fail scenario on first failed step (not proceeding to run other steps) ?

21 views
Skip to first unread message

Iakiv Kramarenko

unread,
Feb 23, 2014, 3:53:42 AM2/23/14
to easyb...@googlegroups.com
Hi guys,

Subj.

If some step of scneario is already failed, I don't want to run other ones. I want just to proceed with the next scenario to not waste the time.

How can I configure this? Is it even possible?

Thanks,
Iakiv

Juergen Kindler

unread,
Mar 10, 2014, 6:32:03 AM3/10/14
to easyb...@googlegroups.com
Hi Iakiv,

I guess the question is, how much time you "waste" there.
Normally, the idea is to check all assertions as being independent of each other.

You might either put more stuff into one step – losing transparency about what really caused the problem on the report level.
Or, to get around this might also think of creating a FailFasterPlugin that can let subsequent steps fail if a previous step failed.
Basically in code it could look like:

using "FailFaster"
then "the super criteria must be fulfilled", { 
   // … 
}
and "a subordinate step is checked", {
   ensureSuccessOf "the super criteria must be fulfilled", { 
   // … Do check your stuff …
   }
}

Basically, your code in other steps would then only be executed, if the important step succeeded. Otherwise ensureSuccessOf would throw an exception.
Well, just a rough idea … there are different ways, you could implement for such a plugin – and I don't know the specifics of your problem. ;-)

Cheers
  Jürgen
--
Jürgen Kindler

--
You received this message because you are subscribed to the Google Groups "Easyb Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to easyb-users...@googlegroups.com.
To post to this group, send email to easyb...@googlegroups.com.
Visit this group at http://groups.google.com/group/easyb-users.
For more options, visit https://groups.google.com/groups/opt_out.

Iakiv Kramarenko

unread,
Mar 10, 2014, 2:41:16 PM3/10/14
to easyb...@googlegroups.com
Hi Jürgen,

Thanks for the response!

I believe that in terms of BDD, steps should not be independent, GIVEN can't be independent, the same at least with WHEN... And it has not any sense to proceed with THEN if GIVEN or WHEN were failed.

Scenarios - yeah, they should be independent. Unfortunately there is no way to do this in a DRY way with easyb, because before_each does not work in the latest version... But this is a separate story...

I understood that the only option is to extend easyb to achieve this.... Either add new feature and send pull request, or write a plugin...

By the way... Do you know any examples of plugins/extensions to easyb in public? It would be nice to read them before I start to write my own...

Thanks,
Yakiv


--
You received this message because you are subscribed to a topic in the Google Groups "Easyb Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/easyb-users/KJIXewdd914/unsubscribe.
To unsubscribe from this group and all its topics, send an email to easyb-users...@googlegroups.com.

To post to this group, send email to easyb...@googlegroups.com.
Visit this group at http://groups.google.com/group/easyb-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages