I can imagine doing this by writing a "Background Outline" with a table of specifics (parallel to how Scenario outlines work). Alternatively I could abstract a list of Scenarios into a separate file and 'include' the scenarios into two different features (each with their own background)
Tim,
On 11/9/12 6:39 AM, Tim Diggins wrote:
> I've got a feature which was written for one user group (and explicitly
> excluded from another) and now times (and requirements) have changed and
> we need to make the same feature available to another user group. So
> ideally I'd like to run the same set of Scenarios with two different
> backgrounds. I can imagine doing this by writing a "Background Outline"
> with a table of specifics (parallel to how Scenario outlines work).
> Alternatively I could abstract a list of Scenarios into a separate file
> and 'include' the scenarios into two different features (each with their
> own background).
>
> Is there any way of supporting this in Gherkin? Or failing that where
> would I start (and at least not-totally-inadvisable) to extend Gherkin
> to do either of these?
>
> I've written this up in more detail
> in http://stackoverflow.com/questions/13141894/how-to-test-for-same-feature-with-multiple-backgrounds-in-cucumber.
> Feel free to reply in either place.
The stackoverflow posting shows the syntax you imagine, but doesn't
really show the need for it.
The logic applied to tags is a little lacking. Being able to express something like{@DESKTOP @SMOKE} {@MOBILE}Scenario: ....where each group expressed a run, and the information contained in the tag could then be used a before method to start a scope within the spring context.
On 19 Dec 2012, at 18:43, Rex Hoffman wrote:The logic applied to tags is a little lacking. Being able to express something like{@DESKTOP @SMOKE} {@MOBILE}Scenario: ....where each group expressed a run, and the information contained in the tag could then be used a before method to start a scope within the spring context.Wouldn't that amount to duplication though, because you'd have to put those brackets on every scenario where you used that tag pattern?
I've been thinking it would be nice to be able to document the tags somewhere - explain what each one means. Maybe we should have a cucumber.tags file where you can put both these bits of information?
On Friday, December 21, 2012 12:47:41 PM UTC-8, Matt Wynne wrote:On 19 Dec 2012, at 18:43, Rex Hoffman wrote:The logic applied to tags is a little lacking. Being able to express something like{@DESKTOP @SMOKE} {@MOBILE}Scenario: ....where each group expressed a run, and the information contained in the tag could then be used a before method to start a scope within the spring context.Wouldn't that amount to duplication though, because you'd have to put those brackets on every scenario where you used that tag pattern?Again the late reply on my part, but here goes...It would be a bit of duplication, but far less than the duplication of feature files (one for each target environment?) Though this could be used at the top of a feature as well.If you do something like this.SomeCapabilityCommonToAllApps.feature {@DESKTOP @MOBILE}SomeCapabilityDesktop.feature {@DESKTOP}SomeCapabilityMobile.feature {@MOBILE}Or if you don't mind the duplication by putting it on the scenario level you could have one file for cohesion (all the information around that capability described in one place.)
I've been thinking it would be nice to be able to document the tags somewhere - explain what each one means. Maybe we should have a cucumber.tags file where you can put both these bits of information?Having a description of intended use would be beneficial, but right now we're not exploiting the capabilities of the jvm (multithreading, stateless object reuse, and some very important state management of Dependency Injection containers) and that would be a much higher priority as that affects adoption rates by java based organizations, and within those organizations.Fast turn around is always a win.The documentation is very easy for an organization to express either in print out in a build or else where. Lack of communication about how to run cucumber-jvm is a barrier to adoption, but I dont see us getting around that soon in jvm land with the cucumber-junit and Main runners, not to mention the nascent ide plugins. Perhaps cleaning that up would lead to a more stable, capable api which could allow for those jvm capabilities to be exploited, though? hmm.I would not mind doing some of this work but I wouldn't want is to be rejected out of hand, or languishing in pull request for months, wasting all of our time.
Happy Festivus,Rexcheers,Matt--
Freelance programmer & coach
Author, http://pragprog.com/book/hwcuc/the-cucumber-book
Teacher, http://bddkickstart.com
--
-- 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
On 31 Dec 2012, at 19:26, Rex Hoffman wrote:On Friday, December 21, 2012 12:47:41 PM UTC-8, Matt Wynne wrote:On 19 Dec 2012, at 18:43, Rex Hoffman wrote:The logic applied to tags is a little lacking. Being able to express something like{@DESKTOP @SMOKE} {@MOBILE}Scenario: ....where each group expressed a run, and the information contained in the tag could then be used a before method to start a scope within the spring context.Wouldn't that amount to duplication though, because you'd have to put those brackets on every scenario where you used that tag pattern?Again the late reply on my part, but here goes...It would be a bit of duplication, but far less than the duplication of feature files (one for each target environment?) Though this could be used at the top of a feature as well.If you do something like this.SomeCapabilityCommonToAllApps.feature {@DESKTOP @MOBILE}SomeCapabilityDesktop.feature {@DESKTOP}SomeCapabilityMobile.feature {@MOBILE}Or if you don't mind the duplication by putting it on the scenario level you could have one file for cohesion (all the information around that capability described in one place.)I've worked with a team that builds an app that runs on multiple different TVs and set-top boxes. They use one set of features, but not all of the devices support all of the scenarios. They way they approach this is to tag scenarios that are _not_ supported on a particular platform. Using that model you'd have @not-desktop @not-mobile etc on some of the scenarios. This works well for them,Would that work for you?
I've been thinking it would be nice to be able to document the tags somewhere - explain what each one means. Maybe we should have a cucumber.tags file where you can put both these bits of information?Having a description of intended use would be beneficial, but right now we're not exploiting the capabilities of the jvm (multithreading, stateless object reuse, and some very important state management of Dependency Injection containers) and that would be a much higher priority as that affects adoption rates by java based organizations, and within those organizations.Fast turn around is always a win.The documentation is very easy for an organization to express either in print out in a build or else where. Lack of communication about how to run cucumber-jvm is a barrier to adoption, but I dont see us getting around that soon in jvm land with the cucumber-junit and Main runners, not to mention the nascent ide plugins. Perhaps cleaning that up would lead to a more stable, capable api which could allow for those jvm capabilities to be exploited, though? hmm.I would not mind doing some of this work but I wouldn't want is to be rejected out of hand, or languishing in pull request for months, wasting all of our time.I can't really comment on the JVM project, but I don't think pull requests with documentation in will languish. Other issues should just be dealt with in small pieces. I think a nice way to start the conversation is with a failing feature that describes what you'd like the tool to be able to do.