Is there a way to mark a Specflow test with an "Explicit" attribute? I am aware that a test can be marked with the "Ignore" attribute via the use of the special tag @ignore.
In order to start generating reports, you will need the NUnit console to execute the Specflow tests. Install NUnit console by downloading the executable package file for windows here. Download NUnit-Console -3.9.
A single Gherkin scenario is a flow of events through the Feature being described and maps 1:1 with an executable test case for the system. You can have multiple Scenarios in one Feature-file. Feature: Calculator.
Ignored Tests Just like with normal unit tests, you can also ignore SpecFlow tests. To do so, tag the feature or scenario with the @ignore tag.
Maybe.
If you look at the generated xxx.feature.cs, you will see that it is defined as
public partial class xxx{...
So you can add another file to your project xxx.partial.cs
that contains the other part of your partial definition.
And that's the end of what I know, now for you might be able to do.
In theory you could use the partial class definition and modify it, to make it abstract. Then you could add a derived class where you override the test in question, this would have to be a new
as we can't use virtual
in the xxx, and add your [Explicit]
there.
I have no idea if this will work. You could have all sorts of issues with the abstract not taking, or the test attributes disappearing on the derived class, etc. But maybe it might get you going.
P.S. I'm also not sure this is anything near to good practice. :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With