Need an example of using "@AfterStory(uponGivenStory=true)"? and BeforeStories, AfterStories

1,106 views
Skip to first unread message

Ali Ostadsaraie

unread,
Oct 11, 2013, 5:28:28 PM10/11/13
to thucydid...@googlegroups.com
Can somebody please give me a simple example of using:
@AfterStory(uponGivenStory=true)
@BeforeStories
@AfterStories

The problem is that I don't know how to tell the program after which story file (uponGivenStory) execute method the method under @AfterStory(uponGivenStory=true)".

And, I don't know how to tell the program after which story files execute the method under @AfterStories.

How we mark story files and make a collection of them? So, the the method under @AFterStories will be executed.

John Smart

unread,
Oct 11, 2013, 8:28:26 PM10/11/13
to Ali Ostadsaraie, thucydid...@googlegroups.com
JBehave doesn't have very good support for this, unfortunately - AFAIK, the @Before* and @After* annotations are intended to be system-wide actions, not story-specific ones. 

That said, you could use the Thucydides.getCurrentSession().getMetaData() method and JBehave tag annotations.This gives you access to any tags defined in the Meta: sections of JBehave stories and scenarios.

 


--
You received this message because you are subscribed to the Google Groups "Thucydides Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send an email to thucydid...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
___________________________________________________
John Smart | Wakaleo Consulting  |  +61 407 247 642
Optimizing your software development process
http://www.wakaleo.com  |  john....@wakaleo.com
___________________________________________________

Check out our upcoming BDD/TDD Master classes, coming 
___________________________________________________
Reply all
Reply to author
Forward
0 new messages