XUnit Ignore test at runtime (with SpecFlow tag @IgnoreLocally)
Code –> https://github.com/chrismckelt/XUnit.OptionallyIgnore NuGet –> https://www.nuget.org/packages/Xunit.SpecFlow.AssertSkip/ As Xunit has no Assert.Ignore() using the OptionallyIgnoreTestFactAttribute attribute on a method and setting McKeltCustom.SpecflowPlugin.Settings.IgnoreLocally == true will ignore the test at runtime In SpecFlow set this as a plugin and use the tag @IgnoreLocally– before each test scenario is run turn on/off the setting to run this test. Sample usage: namespace Tester { public class Dummy { public Dummy() { McKeltCustom.SpecflowPlugin.Settings.IgnoreLocally = true; } } public class TestFixture : IUseFixture<Dummy> { [OptionallyIgnoreTestFact\] public void DoesThisWork() { Assert.True(false, "This should not be run"); } public void SetFixture(Dummy data) { throw new NotImplementedException(); } } } SpecFlow tag can be on a feature or a scenario ...