The best BDD test automation framework for .NET
Use Cases and Deployment Scope
I use SpecFlow for implementing BDD in the test automation framework in my current workplace. SpecFlow helps us to implement the automated test cases so in a human readable form so it's easy for non-technical members of the team and stakeholders to understand the test cases, features and the functionalities of the application. I have implemented SpecFlow based automated tests for UI based tests, API tests, and performance tests. The versatility of SpecFlow enables us to utilize it for all kinds of test automation use cases.
Pros
- Versatility to be used in combination with different kinds of automated testing like automated performance testing, API testing, UI testing etc. I use JavaScript, Selenium, C#, email testing libraries, database testing libraries in combination with BDD with SpecFlow. I am able to use all these with SpecFlow to make my automation framework to be able to automate any kind of automated testing.
- It provides different widely used runner options like NUnit, XUnit etc. Before I started to work on establishing proper test automation in my workplace, the previous automation framework (non-BDD based) as well as unit tests used NUnit runner. The transition to using BDD was smooth because we could use the same runner and there were no compatibility issues.
- The auto-complete feature is good. I use it with Visual Studio as well as Rider and I don't have to recall the entire Gherkin statements. I just type a few words and the entire Gherkin statement implemented in framework is auto-suggested by SpecFlow. It saves time and context switching.
Cons
- SpecFlow does not accepts optional input variables in the methods defined during Gherkin statement implementation. Cucumber supports optional input variables in the methods defined during Gherkin statement implementation.
- The tests identified while using SpecFlow with NUnit removes all white spaces in the scenario names. It makes the tests less readable. If the white spaces are not auto-removed, it would be much better for readability as well as their actual identification in the repository.
Most Important Features
- Gherkin implementation representing the test automation code in a human readable form
- Reduction in the reliance on technical team members to gather information about existing functionalities by going through automated test cases
Return on Investment
- Everyone stays on the same page regarding the behavior of existing functionalities whether it be technical or non-technical individuals. So there is less need for multiple people to get involved which saves time and thus money.
- Reusing the same code through the implemented Gherkin statement saves test automation time and thus reduces cost.
- We combine SpecFlow with other opensource testing technologies to make our automation framework more versatile which further saves costs for us.
Alternatives Considered
Behave, CucumberStudio, from SmartBear and Ghost Inspector
Other Software Used
JetBrains Rider, PostgreSQL, .NET