Hi Enrique,
good to hear that it works well! The latest release 3.6.8 is out with
this features. I'll make sure the EBNF grammar is updated.
As for Maven snapshots, you can surely consume them automatically -
that's one of the reasons Maven was created for. Just put the
'codehaus' profile found below in your settings:
https://github.com/jbehave/jbehave-core/blob/master/settings.xml
Cheers
On 05/07/2012 21:47, Jorge Pombar wrote:
Hi Mauro,
I tested with the latest 3.7-SNAPSHOT
(jbehave-core-3.7-20120629.105350-11.jar
<https://nexus.codehaus.org/content/repositories/snapshots/org/jbehave/jbehave-core/3.7-SNAPSHOT/jbehave-core-3.7-20120629.105350-11.jar>)
and it worked as advertized, thanks a lot J!
FYI, just make sure you have the “GivenStories” right after the
Narrative (before it won’t work) and before any scenarios on the story
On a side note, is there an easy “Maven” way to use these snapshots? I
manually copied the jar and replaced for the one I had in my local
repository for testing. I was wondering if there is a better way.
Thanks again for the fast feature!
Thanks,
Enrique
*From:*Mauro Talevi [mailto:[email protected]]
*Sent:* Friday, June 29, 2012 3:18 AM
*To:* [email protected]
*Subject:* Re: [jbehave-user] Story level GivenStories
Done - http://jira.codehaus.org/browse/JBEHAVE-792
A 3.7-SNAPSHOT has been published. Can you please test with it before
we proceed to release?
On 29/06/2012 02:10, Jorge Pombar wrote:
Excellent, I would love for this feature to be added too. As Mauro
said it would make the step visible and fully backwards compatible J
@Iulian
I didn’t want to implement it that way because it would make
scenarios dependant on other scenarios. However, you did give me
the idea of having a standalone scenario at the top that always
runs and has the GivenStory baseLogin.story. This fixed my problem
Thanks everyone for the help!
Enrique
*From:*Iulian Greculescu [mailto:[email protected]]
*Sent:* Thursday, June 28, 2012 3:26 PM
*To:* [email protected] <mailto:[email protected]>
*Subject:* Re: [jbehave-user] Story level GivenStories
>>having an optional GivenStories at story level as well as at
scenario level
To me that would be a very good to have feature. Not necessarily
you will always have GivenStories at both Story and Scenario level
(you could if you needed it) but because you have the flexibility
to choose which way is more appropiate for your concrete situation.
Cheers,
--- On *Thu, 28/6/12, Mauro Talevi /<[email protected]>
<mailto:[email protected]>/* wrote:
From: Mauro Talevi <[email protected]>
<mailto:[email protected]>
Subject: Re: [jbehave-user] Story level GivenStories
To: [email protected] <mailto:[email protected]>
Received: Thursday, 28 June, 2012, 10:26 PM
@Before and @After annotations are useful for technical tasks but
have the drawbacks of not being visible to the business (nor to
the team, at least not as visible).
I think having an optional GivenStories at story level as well as
at scenario level is possible and fully backward compatible.
On 28/06/2012 14:19, Andreas Ebbert-Karroum wrote:
Hi,
what about having a method annotated with @BeforeStories or
@BeforeScenario?
Andreas
2012/6/28 Iulian Greculescu <[email protected]
</mc/[email protected]>>
Hi Jorge,
I hope i understood your problem well.
Why don't u just say:
Scenario: User logs in and perform action A
Given Stories: baseLogin.story
Some action A steps
Scenario: Lodged on user can also perform action B
Some action B steps
....and so on
I somehow had/have similar problems caused by the fact that is
not quite easy to control what to run before all scenarios
from that story (so before the story) and what do I need to
run before each scenario. Such a feature would really be handy.
Cheers,
Julian
--- On *Thu, 28/6/12, Mauro Talevi
/<[email protected]
</mc/[email protected]>>/* wrote:
From: Mauro Talevi <[email protected]
</mc/[email protected]>>
Subject: Re: [jbehave-user] Story level GivenStories
To: "[email protected]
</mc/[email protected]>"
<[email protected]
</mc/[email protected]>>
Received: Thursday, 28 June, 2012, 5:32 PM
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]
<http://mc/[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
--
Mit freundlichen Grüßen / Best regards
Andreas Ebbert-Karroum | Bereichsleiter der Agilen Software
Factory
codecentric AG | Merscheider Straße 1 | 42699 Solingen |
Deutschland
tel: +49 (0) 212.23362825 | fax: +49 (0) 212.23362879 | mobil:
+49 (0) 175.2664109
www.codecentric.de <http://www.codecentric.de> |
blog.codecentric.de <http://blog.codecentric.de> |
www.meettheexperts.de <http://www.meettheexperts.de> |
www.more4fi.de <http://www.more4fi.de>
Sitz der Gesellschaft: Düsseldorf | HRB 63043
Vorstand: Klaus Jäger (Vorsitzender) | Mirko Novakovic .
Rainer Vehns
Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Bernd
Klinkmann . Jürgen Schütz
Diese E-Mail einschließlich evtl. beigefügter Dateien enthält
vertrauliche und/oder rechtlich geschützte Informationen. Wenn
Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und löschen Sie diese E-Mail und evtl. beigefügter
Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen
evtl. beigefügter Dateien sowie die unbefugte Weitergabe
dieser E-Mail ist nicht gestattet.