Just looking for some examples of BDD/SpecFlow - ideally a projectб so I can see how to use SpecFlow on big projects where multiple features my reference the same steps etc.
I've read a few blogs over the last few months, but haven't had a nice, juicy project of someone else's to mooch around through.
The official example set of SpecFlow can be found on github: http://github.com/techtalk/SpecFlow-Examples
The ASP.NET-MVC/BookShop sample is the one that you can have a look. It is not a very big project though. (If you a need VS2010 sample, switch to the VS2010 branch.)
Another great place to find examples are from the tests for the SpecFlow project itself.
In particular those used to test the Gherkin parsing: https://github.com/techtalk/SpecFlow/tree/master/Tests/TechTalk.SpecFlow.Specs/Features
Those tests show a lot of ways to write scenarios using syntax for mutliline parameters, table parameters, templates, and more.
Also check out Steve Sanderson's GuestbookDemo, which shows off how to use SpecFlow with WatiN in ASP.NET MVC.
Also, see Brandon Satrom's recent MSDN article on the topic: http://msdn.microsoft.com/en-us/magazine/gg490346.aspx
We have used SpecFlow to formulate scenarios on the CQRS Journey project. Check out the overview of how we did it and then take a look at the acceptance tests themselves in the code repo.
I know it is an answered question. Just in case some one needs a quick simple web test project skeleton. I have created a nuget package SeleniumNUnitSpecflow for quickly setting up Specflow with Nunit and Selenium.
PM> Install-Package SeleniumNUnitSpecflow
Details: Web page BDD test with selenium specflow nunit
Related
I am planning to integrate Mvc.Futures in my project, but am unable to find any official documentation for this library.
Official project page on nuget.org points to old asp.net project page on codeplex and even there is not so clear where information about Futures can be found.
I might be missing something, but would appreciate if anyone can give me pointers to the right place.
Thanks.
This is follow up on my own question:
I haven't found anything else related to Mvc.Futures after i posted this question, so i ended up using T4MVC which seem to get more love from MSFT than the Futures itself (lead developer of this template is MSFT employee David Ebbo).
We are using it quite successfully so far (more than 8 months) and i am pleased with the results.
For better integration with Visual Studio i am using AutoT4MVC extensions which runs the T4 templates on each change in the sections of the MVC app that require rebuild (such as Controllers, Content*, Views etc..)
To sum up - i would suggest that you stay out of Mvc.Futures for now and use T4MVC instead.
Maybe it's very easy but I'm trying to add support for xUnit in Visual Web Developer 2010 Express. I followed this tutorial on how to install everything but the main problem is that this tutorial only show how to add a test project to a new project and not to an existing one. When I do "Add New Project", there is not "xunit" or "test project" anywhere...
Anybody know how or can point me to a good tutorial?
A standard Windows Library (.DLL) project will work fine and is the normal project type used for xUnit.net Tests - all the existing mechanism really added was the inclusion of some example tests to start you off.
This (not having templates) is the approach being taken with future xUnit versions. You'll find some discussion of the reasoning behind this on http://xunit.codeplex.com/discussions
I'd like to try unit test in ASP.NET MVC framework. But I don't know which unit test framework I have to choose.
NUnit, xUnit.net, MbUnit. or the unit test framework included with Visual Studio, which one is better?
If you are interested in following BDD guidelines, I highly recommend xUnit.NET with Moq as the mocking framework. The two are some of the most forward looking and modern unit testing frameworks available these days, and combined they make both a powerful and flexible unit testing platform. xUnit.NET is extremely extensible as its Fact and Trait attributes can be extended with your own attributes, and the testing frameworks behavior can be changed to suit your needs.
A great example of this flexibility is the ObservationAttribute and supporting framework to allow BDD style testing with xunit.net, found here:
http://iridescence.no/post/Extending-xUnit-with-a-Custom-ObservationAttribute-for-BDD-Style-Testing.aspx
I use the above BDD-style testing to create Test-Class-Per-Unit style BDD tests for my ASP.NET MVC controllers (well, and everything else I unit test, too.)
ASP.Net MVC doesn't make any specific demands of a framework, any will work just fine. NUnit is the most widely used, and for that reason it is my default choice.
Once you get into unit testing, some of the other frameworks offer different advanced features that you may like to check out.
I don't know anyone using the MS unit testing framework.
I would recommend to start from xUnit if your have not used any testing framework before. It's hard to decide which framework is better but I think that xUnit is the "most modern" among NUnit, MbUnit and MSTest. Start learning xUnit from this article and then this
I am using MSTest :) so now you know one ;)
Seriously, I think that MSTest is a the best framework for the start with TDD.
It is liteweight and it is generating all that you need for the wrapup and the most important thing, it is integrated in the visual studio...so, why don't you start with mstest and later on you can switch to advanced frameworks with no problems.
So in short, I would recomend a MSTest.
cheers
I recently began to use the NexusLight, a functional test automation framework.
Are there more frameworks that does a similar job?
Related question: End-to-End application testing from a users standpoint
I haven't really looked into NexusLight but I think InCisif.net is supposed to provide a functional test framework as well. You could look into it.
I test asp.net web apps for years and the only tool I use is Watir.
VSTT 2010 should be a good bet if you are looking for functional test automation. Web Services Testing, UI testing, Biztalk testing and Data Driven Testing Support. Please look at VSTT - http://msdn.microsoft.com/en-us/library/ee338734(v=vs.90).aspx
You can also try VSTT - http://blogs.msdn.com/b/slumley/archive/2009/05/28/vsts-2010-feature-enhancements-for-web-test-playback-ui.aspx
Telerik Test Tools - http://www.telerik.com/automated-testing-tools.aspx
Visual Studio UI Test Extensibility–Scenarios & Guiding Principles - http://blogs.msdn.com/b/mathew_aniyan/archive/2011/03/28/visual-studio-ui-test-extensibility-scenarios-amp-guiding-principles.aspx
VSTS Web Test Step-by-Step Primer - http://blogs.msdn.com/b/jimmymay/archive/2009/02/23/vsts-web-test-step-by-step-primer-7-minute-video-by-microsoft-a-c-e-performance-engineer-chris-lundquist-with-copious-notes-screen-shots-from-your-humble-correspondent.aspx
Found this one too:
http://www.automatedqa.com/products/testcomplete/index.asp
Unfortunately it's not free.
Reading a list made by Scott Hanselman, I found these two tools:
WatiN, to automated the tests;
WatiN Test Recorder, to automate the test code generation.
From WatiN page:
[...]WatiN (pronounced as What-in) website. Inspired by Watir development of WatiN started in December 2005 to make a similar kind of Web Application Testing possible for the .Net languages.
And from WatiN Test Recorder:
The purpose of the application is to generate code compatible with the WatiN (Web Application Testing In .NET) project.
Have a look at Seleno. It uses Selenium under the bonnet but abstracts all browser automation into Page Objects, which lead to well structured and fluid C# based tests.
It is particularly well suited to ASP.NET MVC, as each Page Object can be strongly typed (using Generics) to an equivalent MVC ViewModel, leading to a consistent relationship between View, ViewModel and Page Object.
Check out some of the samples in the Seleno codebase to see this in action.
Does anybody know a good code generation tool (other than Subsonic because it doesn't support IQueryable in current version) to generate repository and other projects in a way Rob Conery worked in MVC Storefront?
Rob Conery has put out a Visual Studio plug-in that generates MVC code, using repositories that use IQueryable, although I believe the model is generated using Linq to SQL classes in visual studio, which wasn't the case in MVC Storefront.
You can find it here.
S#arp Architecture may be overkill, but if you haven't checked it out already, I would recommend. It has a very nice tutorial as part of the download as well as a working Northwind sample.
Is T4 the answer for your needs?