When i create a project and i try to add a feature file, feature file gets created without designer code(i.e a .cs file is not getting created)All the tags "Given ,when, then , Scenario" is not getting recognized.
Which .dll are getting are missed, can somebody help me on this??
You need the SpecFlow NuGet package.
Related
Can anyone please guide me how can I convert Add-Ins to VSPackage Extention without recreating/replicating everything into VSIX?
I have one addin which is supporting VS2010 to VS2013. I have everything in .sln. I want to migrate/create .addin into .vsix for compatibility issue of VS2015. After few research, I have found that the code what is written in IDTCommandTarget.Exec method has to run into my custom command class of vsix project...
So, I created a new .vsix project in same solution & add a reference of my .addin project into .vsix project and I am able to load initial controls of my addin project as like below...
enter image description here
but as per the code, I want to create CreateToolWindow2 on double click of my tree node but I am getting following error (null AddInInstance)...
enter image description here
Can anyone please guide me how can I create an Instance of AddIn class to create ToolWindow2?
This is not quite the way to do this. You create a .VSIX project, then add a Custom Command, and you add the code/logic that was in your old addin's Exec method, to the custom commands MenuItemCallback method.
Note, you no longer need to programmatically create the menus/commands, toolbars, etc. VSPackages have an entirely different (and much more effective way) via the .VSCT file.
FAQ: Converting Add-ins to VSPackage Extensions
To convert an add-in to a package is not easy or trivial, you need to use .vsct file to create menus, toolbars, commands, etc.
About toolwindows:
The usual way for packages is:
HOWTO: Create a toolwindow with a ToolWindowPane class in a Visual Studio package
http://www.visualstudioextensibility.com/articles/packages/
But you can do it in the same way as add-ins:
HOWTO: Create a toolwindow without a ToolWindowPane class in a Visual Studio package
(same link)
About not "duplicating everything" when migrating an add-in to a package, see my post:
Strategies migrating from Visual Studio add-ins to packages
I have installed Visual Studio 2013 with Update 2 and installed Web Essentials.
I had thought this was going to make adding LESS to my views a piece of cake, but am missing something.
The editor is great, and I imagine that it is compiling to css on save...
But I don't know where the generated css is, and I don't have any clue as to how to get it reference in my view.
I've tried a lot of searching, but can't get through the web of links about installing this and the features of that.
Any help at all will be greatly appreciated.
Thanks!
When you add a .less file and save, the Web Essentials will compile and generate the .css and .min.css files. You will see an arrow in your solution explorer, or you can also confirm in your file system that the files are in the same folder.
Haven't used less with vs2013 but I have used sass and my guess would be the same. By default the generated css gets generated in the same directory as the source (as it seemed to me) but you can check via tools>options>web essentials and there should be a set of options for less compile on save, build and directory to name but a few.
If you right click on the solution there should be an option to create a web essentials settings file for the solution - these create and adds a json file of web essentials settings to the solution which means your settings are local to the solution which could be important if you are changing the output directory.
I've been happily developing SpecFlow tests on this machine for a while now. Today when I changed some tests and tried to regenerate them I keep getting
Custom tool error: Could not load file or assembly 'TechTalk.SpecFlow, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies.
I have SpecFlow 1.8.1 installed on my computer and am pulling in the SpecFlow package from NuGet. I've tried reinstalling both of these components with no luck.
Any suggestions as to why this might be happening or where I should go to find more information would be much appreciated.
You need to add reference to the SpecFlow dll into your project AND set its "Copy Local" property to TRUE. Then it should work.
However, if you are trying to run the ms test from TFS, then you may still get this error. (I'm still trying to find out how to fix that.) But at least the above should fix your immediate problem.
I've been playing with SpecFlow recently, but I failed to make it work properly. Steps I took are:
1. Downloaded and installed SpecFlow
2. Downloaded and launched Guestbook solution (VS2010)
3. Run NavigationToHomepage test from this project using Visual NUnit under debugger.
4. Got Null Reference Exception on Scenario: Navigation to homepage line.
StackTrace:
in Guestbook.Spec.Features.BrowsingFeature.ScenarioSetup(ScenarioInfo scenarioInfo) in F:\VS Projects\SteveSanderson-GuestbookDemo-bf2bdab\SteveSanderson-GuestbookDemo-bf2bdab\Guestbook.Spec\Features\Browsing.feature.cs:line 0
in Guestbook.Spec.Features.BrowsingFeature.NavigationToHomepage() in f:\VS Projects\SteveSanderson-GuestbookDemo-bf2bdab\SteveSanderson-GuestbookDemo-bf2bdab\Guestbook.Spec\Features\Browsing.feature:line 6
What might be wrong?
UPDATED
I tried to perform the same actions on the another computer and everything worked fine there. I'm completely confused.
I think the best thing to do is create your own:
Create a new solution with a class project.
Add a reference to the TechTalk.SpecFlow dll.
Create a new SpecFlow Feature File.
This will give you a basic spec feature for a calculator.
Compile the app and run it in Nunit test runner.
You'll be given a load of 'no matching step..' errors.
Create a new SpecFlow Step Definition file.
Copy the methods that Nunit test runner gave you into the definition file.
Recompile and run it in Nunit.
Then you just need to implement the guts of each method.
I'm loving SpecFlow for making me write smarter, more manageable code.
I found that this custom tool is used for generation of .cs files from SpecFlow's .feature file.
Is there a way to use this tool outside of VS?
I would like to call this tool from console for specific .feature file when building my project with NAnt.
Regards,
Vajda Vladimir
You sure can! That is if you mean: "Can I generate unit test code from my .feature-files without using Visual Studio"
I've written about that here: http://www.marcusoft.net/2010/12/specflowexe-and-mstest.html but in short you can use the SpecFlow.exe with the "generateAll" switch, and it will inspect your project settings and generate the appropiate unit tests for you (in my example it's MsTest but it can be any of the supported testing frameworks).
The SpecFlow.exe's help we get the following concise help:
Generate tests from all feature files in a project
usage: specflow generateall projectFile [/force] [/verbose]
projectFile Visual Studio Project File containing features
So for a project called Specs.csproj it would be:
"%ProgramFiles(x86)%\TechTalk\SpecFlow\SpecFlow.exe" generateAll Specs\Specs.csproj /force /verbose
You can read more in my blog post - but this is basically it.