Reputation: 1307
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.
Upvotes: 5
Views: 1114
Reputation: 574
There is an easier way to do this.
For scenario Test Scenario
in file xxx.feature.cs
there is a method TestScenario()
. You can just mark it as [Explicit]
.
Upvotes: 0
Reputation: 6961
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. :-)
Upvotes: 7