Rickard Öberg wrote:
Can you give me more details please?
Ok, I want this to be a "setup":
Given a client
When I add an account
Then an account is added
Given an account
When I change settings to username=rickardoberg, password=rickardoberg,
server=http://localhost/
Then settings are updated
Given an account
When I register
The user is registered
Given an account
When I connect
Then the account is connected
---
The above is what in my case is required to start doing anything at all
in the UI. I could repeat them in every single scenario I need to do,
but that seems like a waste. So, I want to encapsulate this base
scenario in some way so that I can then easily build other scenarios on
top of it. What is the best way to do this?
Hi Rickard,
now I understand the use case better. It would surely be addressable
by http://jira.codehaus.org/browse/JBEHAVE-126, but in the meantime, the
workaround I've found useful in my projects is to use a naming
convention, together with the fact that scenarios are run in
alphabetical order.
So, if you e.g. prefix your scenarios with an incremental number s<n>,
you can create a s0_client_account_is_setup.scenario that gets executed
as first scenario. Of course, this works if you need to setup the
scenario once, an not before each scenario.
Alternatively, you could try using the @BeforeScenario annotation in
your Steps instance to execute some setup code. But this has the
disadvantage of not being declarative via a textual scenario.
But, as I said above, I'd like kick-start the GivenScenarios approach
again. I hope to get some time soon in the next week or so.
Cheers
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email