Currently we have a reference to Scenario object in @After hook only.
Can we have a reference to this static Scenario object in my step definition class (other than @After hook) so that I use Scenario.write in any of my step definition class?
Thanks!
--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
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/groups/opt_out.
On Thu, Feb 7, 2013 at 7:11 AM, Yogesh Aggarwal <yogesh70...@gmail.com> wrote:
Currently we have a reference to Scenario object in @After hook only.
Can we have a reference to this static Scenario object in my step definition class (other than @After hook) so that I use Scenario.write in any of my step definition class?
I wouldn't do that, there is a new instance created before each scenario, and holding on to old ones in static fields is guaranteed to mess things up.Any class that defines an @After hook can get a reference to the Scenario passed in. Why don't you just add an @After to each class that needs a ref to the Scenario?Aslak
On Thursday, February 7, 2013 12:51:03 PM UTC+5:30, Aslak Hellesøy wrote:On Thu, Feb 7, 2013 at 7:11 AM, Yogesh Aggarwal <yogesh70...@gmail.com> wrote:
Currently we have a reference to Scenario object in @After hook only.
Can we have a reference to this static Scenario object in my step definition class (other than @After hook) so that I use Scenario.write in any of my step definition class?
I wouldn't do that, there is a new instance created before each scenario, and holding on to old ones in static fields is guaranteed to mess things up.Any class that defines an @After hook can get a reference to the Scenario passed in. Why don't you just add an @After to each class that needs a ref to the Scenario?Aslak
Can we have multiple @After hooks?
If yes, then do all of them execute after then scenario?
How do we get a control of their execution?