[JVM] [Ruby] [JS] Feature Inquiry: Filtering on Feature Filenames

47 views
Skip to first unread message

@CuriousAgilist

unread,
May 4, 2013, 10:10:18 AM5/4/13
to cu...@googlegroups.com
As I understand it the cucumber command line allows for choosing a subset of the tests to be run in three ways:
a) based on tags at both the feature and scenario level (--tags)
b) matches with scenario titles (--name)
c) explicit path specification for where to find the feature files (vs. default of all feature files in/under /features folder)

But, is there any way to filter the tests to be run based on the name of the features files? If not, then could a match similar to what's used for --name but for file names be used (perhaps --file) to enable this functionality?

My reasoning goes like this:
Premise: Tracking systems used on large projects number pretty much everything: requirements, tests, etc., e.g. JIRA.

Premise: Those same tracking systems try to track the association between "requirements" and the "tests" that ensure the requirements are being met (requirements coverage?). Cucumber effectively treats requirements and tests as one-in-the-same, and allows them to be managed the same as the code of the app.

Conclusion: Naming Gherkin feature files prefixed with an id assigned by a tracking system for a given requirement takes nothing away and can add value by allowing what's in the source repository to more easily be associated with business functionality being tracked, i.e. I can see which features I've got feature files for without resorting to searching the tag names.





@CuriousAgilist

unread,
May 4, 2013, 10:23:07 AM5/4/13
to cu...@googlegroups.com

On Saturday, May 4, 2013 10:10:18 AM UTC-4, @CuriousAgilist wrote:
As I understand it the cucumber command line allows for choosing a subset of the tests to be run in three ways:
a) based on tags at both the feature and scenario level (--tags)
b) matches with scenario titles (--name)
c) explicit path specification for where to find the feature files (vs. default of all feature files in/under /features folder)

But, is there any way to filter the tests to be run based on the name of the features files? If not, then could a match similar to what's used for --name but for file names be used (perhaps --file) to enable this functionality?

Almost as good, and maybe easier, would extending the current --name option to include matching a portion of a feature title (not just scenario titles) be possible?

Julien Biezemans

unread,
May 10, 2013, 5:24:08 AM5/10/13
to cu...@googlegroups.com
On Sat, May 4, 2013 at 4:23 PM, @CuriousAgilist <bal...@pillartechnology.com> wrote:

On Saturday, May 4, 2013 10:10:18 AM UTC-4, @CuriousAgilist wrote:
As I understand it the cucumber command line allows for choosing a subset of the tests to be run in three ways:
a) based on tags at both the feature and scenario level (--tags)
b) matches with scenario titles (--name)
c) explicit path specification for where to find the feature files (vs. default of all feature files in/under /features folder)

But, is there any way to filter the tests to be run based on the name of the features files? If not, then could a match similar to what's used for --name but for file names be used (perhaps --file) to enable this functionality?

No you can't do that in Cucumber. You could use the "find" command and pass its results to cucumber with xargs (assuming you're on UNIX here). 

Almost as good, and maybe easier, would extending the current --name option to include matching a portion of a feature title (not just scenario titles) be possible?

 
My reasoning goes like this:
Premise: Tracking systems used on large projects number pretty much everything: requirements, tests, etc., e.g. JIRA.

Premise: Those same tracking systems try to track the association between "requirements" and the "tests" that ensure the requirements are being met (requirements coverage?). Cucumber effectively treats requirements and tests as one-in-the-same, and allows them to be managed the same as the code of the app.

Conclusion: Naming Gherkin feature files prefixed with an id assigned by a tracking system for a given requirement takes nothing away and can add value by allowing what's in the source repository to more easily be associated with business functionality being tracked, i.e. I can see which features I've got feature files for without resorting to searching the tag names.





--
-- 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.
 
 

Matt Wynne

unread,
May 10, 2013, 6:07:18 AM5/10/13
to cu...@googlegroups.com
On 10 May 2013, at 10:24, Julien Biezemans <j...@jbpros.com> wrote:

On Sat, May 4, 2013 at 4:23 PM, @CuriousAgilist <bal...@pillartechnology.com> wrote:

On Saturday, May 4, 2013 10:10:18 AM UTC-4, @CuriousAgilist wrote:
As I understand it the cucumber command line allows for choosing a subset of the tests to be run in three ways:
a) based on tags at both the feature and scenario level (--tags)
b) matches with scenario titles (--name)
c) explicit path specification for where to find the feature files (vs. default of all feature files in/under /features folder)

But, is there any way to filter the tests to be run based on the name of the features files? If not, then could a match similar to what's used for --name but for file names be used (perhaps --file) to enable this functionality?

No you can't do that in Cucumber. You could use the "find" command and pass its results to cucumber with xargs (assuming you're on UNIX here). 

Almost as good, and maybe easier, would extending the current --name option to include matching a portion of a feature title (not just scenario titles) be possible?

 
My reasoning goes like this:
Premise: Tracking systems used on large projects number pretty much everything: requirements, tests, etc., e.g. JIRA.

Premise: Those same tracking systems try to track the association between "requirements" and the "tests" that ensure the requirements are being met (requirements coverage?). Cucumber effectively treats requirements and tests as one-in-the-same, and allows them to be managed the same as the code of the app.

Conclusion: Naming Gherkin feature files prefixed with an id assigned by a tracking system for a given requirement takes nothing away and can add value by allowing what's in the source repository to more easily be associated with business functionality being tracked, i.e. I can see which features I've got feature files for without resorting to searching the tag names.

Could this not be achieved using tags?







--
-- 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.
 
 


--
-- 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.
 
 

aslak hellesoy

unread,
May 10, 2013, 7:24:16 AM5/10/13
to Cucumber Users
On Fri, May 10, 2013 at 4:24 AM, Julien Biezemans <j...@jbpros.com> wrote:
On Sat, May 4, 2013 at 4:23 PM, @CuriousAgilist <bal...@pillartechnology.com> wrote:

On Saturday, May 4, 2013 10:10:18 AM UTC-4, @CuriousAgilist wrote:
As I understand it the cucumber command line allows for choosing a subset of the tests to be run in three ways:
a) based on tags at both the feature and scenario level (--tags)
b) matches with scenario titles (--name)
c) explicit path specification for where to find the feature files (vs. default of all feature files in/under /features folder)

But, is there any way to filter the tests to be run based on the name of the features files? If not, then could a match similar to what's used for --name but for file names be used (perhaps --file) to enable this functionality?

No you can't do that in Cucumber. You could use the "find" command and pass its results to cucumber with xargs (assuming you're on UNIX here). 

You don't even have to use find - your shell will do glob expansion [1]

cucumber features/**/*foo*.feature
ls features/**/*foo*.feature

This will run all features with foo as part of the filename.

Rick Beyer

unread,
May 17, 2013, 10:25:59 PM5/17/13
to cu...@googlegroups.com
You could put all similar named feature files into sub directories within your features directory and then point cucumber to only look for feature files within that subdirectory.


On Saturday, May 4, 2013 10:10:18 AM UTC-4, @CuriousAgilist wrote:
Reply all
Reply to author
Forward
0 new messages