Skip to content

Should the step definition attribute in the .feature file be the same as the one defined in the step implementation? #112

Closed Answered by ajeckmans
Biwya asked this question in Q&A
Discussion options

You must be logged in to vote

The given, when, then are tightly coupled to the place in the scenario, yes. And AFAIK have always been in specflow and now Reqroll.

(If you start a scenario with just And it will also imply/infer you meant Given and search for a step marked with that.)

I don't know if the tight coupling was actually a conscious choice, but it does allow you to have two different implementations for an otherwise equal given, when and even then step. Never ran into a situation that was handy, but hey, it is there.

Marking the step with two attributes is quite common in at least the projects I've worked on.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Biwya
Comment options

Answer selected by Biwya
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants