Hi, 

You are right.  GivenStories apply to a scenario, but to satisfy your usecase 
you need only define a first scenario with your desired given story. 

We can discuss the pros and cons of adding it to story level as standalone. 

Cheers

On 28 Jun 2012, at 03:07, Jorge Pombar <[email protected]> wrote:

> From my testing it seems like GivenStories can only be used at the Scenario 
> level and not at the Story level. Is this correct?
>  
> If so, I’m a little stuck on my use case. I’m testing a webApp and the first 
> thing every Scenario need to do is log in. Hence I have a “baseLogin.story” 
> that my scenarios use to log in. However, if I call this for every scenario 
> it doesn’t work because once you log in once if the session is still open the 
> next time you are taken to the login page directly so the second scenario on 
> the story fails when the GivenStory tries to execute for the second time.
>  
> I was hoping to be able to use “GivenStories” at the story level. In this 
> case the GivenStory will execute only once at the beginning of any scenario 
> and then all the scenarios in the story will execute.
>  
> I was also thinking that I have the option of logging out after every 
> scenario (don’t like because is very inefficient) or write code that detects 
> if I’m logged in at the “baseLogin.story” level (seems bulky and wasteful). 
> Is there a more elegant/proper way I’m missing?
>  
> Thanks in advance of the help,
> Enrique
>  

Reply via email to