Tool to generate the SpecFlow step definition in VS Code with with familiar Visual Studio IDE experince with additional options togenerate full Binding class.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Specflow Step Definition Generator is a tool to generate the SpecFlow step definition in VS Code with familiar Visual Studio IDE experince with additional options togenerate full Binding class.
Getting started: Setting up SpecFlow in VS Code IDE
Different options available to Generate the Step Definition:
[a] - Generate step definition for the selected step(s) with class definition in Clipborad or click CTRL+SHIFT+1
[b] - Generate step definition by creating a class with step definitions for the selected step(s) in a file selected by user or use CTRL+ALT+2 as shortcut keys
[c] - Generate step definition by copy to clipboard or alternatively use keys CTRL+ALT+3
Using the extension:
Open any .feature file in vs code editor
Select the step(s) which needs to generate step definition(s)
Right click on the editor and select the appropriate option to generate the Step Definition(s)
If you select "SpecFlow Step Definition - Generate Class to Clipboard", it will copy the steps definition method(s) along with complete class structure in Clipboard.
Note: This option is useful when you wanted to create a new step definition file from scratch.
In case you have selected the option "SpecFlow Step Definition - Generate to Clipboard", it will only copy the steps definition method(s) to clipboard.
Note: This option is recommended when you wanted to copy selected method(s) to an existing file.
If you select the option "SpecFlow Step Definition - Generate in an existing file", then it will show the option for searching and selecting an existing C# class file and override the file contents with copied step definitions along with full class structure.
Note: This option is useful when you wanted to create a new step definition file from scratch after you have already created skeleton for your solution.
Future Enhancements/Known Bugs:
Handling Table paramemter in step deinition currently it is not adding Table parameter in step definition.
Existing Steps Definition checking while generating steps definitions.
Fixed Default variable type is appearing as string, workaround is to update post steps generation. Will be adding a configuration for override the default type and set it as "dynamic" so that it works well.
Release Notes:
[1.0.5]
Removal of punctuations from Method names
1.0.4
Fixed the issue "Default variable type is appearing as string". Now step bindings correctly picking up string and numbers.