Having used Cucumber about a year ago, I got used to writing scenarios this way.
Scenario: user tries to vote on a comment
Given I have a post
And I have a comment on that post
And I am logged in as a different user
And I am on the post page
When I click on "upvote" within the "comment"
Then the comment score should raise
And the comment author should get points
however recently I discovered, that since Cucumber 1.1, the basic step definitions such as
When I click on "upvote" within the "comment"
are not available anymore, since they're considered a bad practice. I can see how that makes sense, but I'm not really sure how abstract should I write my features now.
Examples that come to mind.
When I upvote on a comment
Then the comment should get points
or less abstract
Given I have a post with a comment
And I'm not the author
When I upvote on the comment
Then the comment author should get points
or even less abstract
Given I have a post with a comment
And I'm not the author
When I upvote on the comment
Then the comment score should increase
And the comment author should get 1 point
or very specific in the Given
part
Given I have a post with a comment
And I'm not the author
And I am on the page for that post
When I upvote on the comment
Then the comment score should increase
And the comment author should get 1 point
I know this is a matter of preferrence, but I'm trying to seek some best practices here. Which is the best way to specify scenarios?