You don't need a @Feature annotation if you name the JUnit class like
the feature file.
See Class Javadocs for @Cucumber:
https://github.com/cucumber/cucumber-jvm/blob/master/junit/src/main/java/cucumber/junit/Cucumber.java
> My question is: is
> one-class-per-feature the general approach?
>
It's currently the general approach if you're using JUnit to kick off Cucumber.
> This question links to a suggestion I read to organise your acceptance tests
> in two sets:
> - current iteration
> - hierarchy structure for past iterations
>
Where did you read this? Sounds dubious to me. I have never found a
need to do anything more sophisticated than tagging features with
@slow. Then I'll run all the not slow (--tags ~@slow) while
developing, and run them all before I push - and also in CI.
This workflow is a little cumbersome using the JUnit runner. The CLI
runner is better suited for this since you can pass --tags to it.
Aslak
> This means I'll be moving my feature files from current Iteration to
> hierarchy structure after they are finished, and also means we'll
> consequentially have to change every Some_Test class' @Feature annotation
> to point to the new location.
>
> Is this the expected/usual workflow?
>
> Cheers,
>
> Miguel
>
> --
> 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
> http://groups.google.com/group/cukes?hl=en.
>
On Wed, Oct 26, 2011 at 5:05 PM, Miguel Almeida
<migueld...@gmail.com> wrote:
> Dear all,
>
> As I understand, in cucumber-java you need a Some_Test class annotated with
> @Feature to tell cucumber where to find feature files.You don't need a @Feature annotation if you name the JUnit class like
the feature file.
See Class Javadocs for @Cucumber:
https://github.com/cucumber/cucumber-jvm/blob/master/junit/src/main/java/cucumber/junit/Cucumber.java> My question is: is
> one-class-per-feature the general approach?
>It's currently the general approach if you're using JUnit to kick off Cucumber.
> This question links to a suggestion I read to organise your acceptance tests
> in two sets:
> - current iteration
> - hierarchy structure for past iterations
>Where did you read this? Sounds dubious to me. I have never found a
need to do anything more sophisticated than tagging features with
@slow. Then I'll run all the not slow (--tags ~@slow) while
developing, and run them all before I push - and also in CI.
I recommend organizing features to support long-term living
documentation and using tags to group scenarios around temporary
things like user stories or iterations. Reorganizing your features at
the end of every iteration just adds unnecessary work. Moreover, it's
useful to see new scenarios in the context of existing scenarios for a
larger feature.
Richard
>
>> This workflow is a little cumbersome using the JUnit runner. The CLI
>> runner is better suited for this since you can pass --tags to it.
>>
>> Aslak
>>
>> > This means I'll be moving my feature files from current Iteration to
>> > hierarchy structure after they are finished, and also means we'll
>> > consequentially have to change every Some_Test class' @Feature
>> > annotation
>> > to point to the new location.
>> >
>> > Is this the expected/usual workflow?
>> >
>> > Cheers,
>> >
>> > Miguel
>> >
>> > --
>> > 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
>> > http://groups.google.com/group/cukes?hl=en.
>> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cukes/-/GYhra1TODBsJ.
I recommend organizing features to support long-term living
documentation and using tags to group scenarios around temporary
things like user stories or iterations. Reorganizing your features at
the end of every iteration just adds unnecessary work. Moreover, it's
useful to see new scenarios in the context of existing scenarios for a
larger feature.Richard
I recall Aslak saying you'd have to use the CLI runner in cucumber-jvm
to filter by tag. In Ruby Cucumber, you'd run
cucumber --tags @currentiteration
to run just scenarios with that tag. I imagine there's something
similar for cucumber-jvm.
Richard
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cukes/-/tW91P9h3FWYJ.
Where did you read this? Sounds dubious to me. I have never found a
need to do anything more sophisticated than tagging features with
@slow. Then I'll run all the not slow (--tags ~@slow) while
developing, and run them all before I push - and also in CI.This workflow is a little cumbersome using the JUnit runner. The CLI
runner is better suited for this since you can pass --tags to it.
Aslak
https://github.com/cucumber/cucumber-jvm/issues/83
> (also, if you could have a look at yesterday's post on how to run from CLI
> it'd be great!)
>
> Cheers,
>
> Miguel Almeida
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cukes/-/Yi4ImZhn48AJ.