Customize your SpecFlow templates and more
February 1, 2011
I got this tip from a non-developer. An intern, actually. He’s brilliant though and figured this out by himself, about 3 months after I introduced him to SpecFlow. Thank you, Dejen – you’re great!
The fact that this is not documented anywhere just adds to the coolness, but also makes the solution a bit hackish. Sorry for that.
SpecFlow stores templates for the feature files in this folder:
C:\Program Files (x86)\TechTalk\SpecFlow\ItemTemplates\
I’m using a 64-bit system, so your path may not contain the (x86) part.
Here, you’ll find several zip archives containing the templates. You can modify the EventDefinition, StepDefinition, and (maybe most commonly) the Feature template. All the structure is the same, so you can follow it in the same manner as described below.
How to Modify the Feature Template
- Make a copy of the current template (
SpecFlowFeature.zip
) to...