Replies: 1 comment
-
As always, this is not that simple. 😎 We have removed it from SpecFlow not only because it is an anti-pattern, but also because it has caused quite a maintenance headache: it essentially introduces nested steps and our step management infra (e.g. step hooks, error handling, etc) does not support nested steps and currently there are no plans to implement that. (Also consider reporting!) It is possible to make a "good enough" solution though that works in someone's project, but to include it to the main codebase it has to be conceptually clear. So my suggestion is that someone should make that "good enough" implementation and share the code (as a community plugin or just a gist), so that if someone needs it they can try. |
Beta Was this translation helpful? Give feedback.
-
Hello.
Not really a new idea, but :)
Any chance to bring back the ability to call steps from other step files? It was present in early versions of Specflow, you could basically go with smth like
Steps.Call("When user adds two numbers together");
in your steps code. It was removed by Specflow team with the reasoning that unit tests should not need this anti-pattern and they will never bring it back.Unfortunately a lot of ppl use BDD for end-to-end tests and reusing steps for preconditions or frequently used actions would be very, very helpful.
We still do it, as even worse anti-patterns, like reflection or
new StepDefinitions().WhenUserAddsTwoNumbersTogether();
. Which is painful to look at.Pretty please? :)
Beta Was this translation helpful? Give feedback.
All reactions