Detecting whether in Given/When/Then section

34 views
Skip to first unread message

Lorin Hochstein

unread,
Jul 10, 2013, 11:06:59 AM7/10/13
to lettuc...@googlegroups.com
Does lettuce have any built-in support for checking whether the current step is in a "Given", "When", or "Then" section? e.g., if I have a test that looks like:


Given setup step 1
and setup step 2
and setup step 3
When I do action 1
and I do action 2
and I do action 3
Then I check assertion 1


If I'm at step "and setup step 2", is there a way to know that this is in the "Given" section of the test?

Lorin 

jenisys

unread,
Feb 2, 2014, 10:58:52 AM2/2/14
to lettuc...@googlegroups.com, lo...@nimbisservices.com
Sorry, I don't have the solution that you are looking for.
But I am curious: Why do you care (to know in which section you are).

Your step implementation does not differ or cannot change.
Each step definition/implementation implements a specific behavior.
It is either:
 * a generic step which may occur everywhere
 * A specific step for one of the sections

Certain Given steps make also sense as When steps.
But in both cases the implementation/behaviour shouldn't differ.
Reply all
Reply to author
Forward
0 new messages