Tool for SpecFlow test analysis and improvements
This is a plugin for Specflow
It allows to find statements in test scenarious that do not affect tests. For example, it can find suspicious line that can be safely removed from test and test will be still green.
This plugin can improve quality of SpecFlow tests. Very usefull during refactoring as it can help to identify problem lines in your tests.
Solution contains Examples for different test providers, languages and platforms.
- .NET Framework 4.7.1, .NET Core 2.0 and higher
- Specflow 3.0 and higher
- C# and VB
Do the following steps in your test project:
- Add nuget package SpecFlowMaster. Note: if you want to do it in an existing project then you must remove references to Specflow.*.SpecflowPlugin.
- Add nuget package SpecFlow.Tools.MsBuild.Generation.
- You can configure testing famework for generated files by adding specflowmaster.json file. See Examples
- Executes tests and find failed tests in classes named XXXFeatureMaster. Exeption and test name will help you to find problems in your tests.
- If want to ignore some tests generated by plugin you can use special commands #IgnoreMasterFeature, #IgnoreMasterScenario, #IgnoreMasterStep.
- Currently this plugin does not handle correctly tests that use hooks by attributes like BeforeFeature, AfterScenario etc.
- For xUnit tests you need to add attribute for disaling test parrallelization [assembly:CollectionBehavior(DisableTestParallelization = true)]