Run specific scenarios

Updated: 04 February 2023

SpecFlow converts tags in feature files to test case categories.

For xUnit

dotnet test --filter Category=done
dotnet test --filter "Category=us123 & Category=done"
dotnet test --filter "Category=done | Category=automated"
@US123
Feature: Breakfast

@done @important
Scenario: Eating cucumbers
  Given there are 12 cucumbers
  When I eat 5 cucumbers
  Then I should have 7 cucumbers

@automated
Scenario: Use all the sugar
  Given there is some sugar in the cup
  When I put all the sugar to my coffee
  Then the cup is empty

https://docs.specflow.org/projects/specflow/en/latest/Execution/Executing-Specific-Scenarios.html

Leave a comment