Is there a way to have SpecFlow reuse Step Definitions?
In other tools I have used a GivenWhenThen base class that contains methods such as
WhenAnOrderIsCreated — this inits a protected order member to be used by inheriting classes.
Just cant seem to get this working with SpecFlow (doesnt seem to like inheritance)
Is there a way to share steps across features?
Many thanks
Why yes it’s possible – check out the calling steps from step feature (https://specflow.org/documentation/Calling-Steps-from-Step-Definitions/)
In short you create a step definition class that inherits from Steps like this:
And then you can simply call other steps like this:
I hope I understood your question correctly and that this was an answer to it