Video: Traits in SpecFlow

Sophie Keiblinger from TechTalk has taken time out from her testing duties to share a couple of insights into how she and her team use traits (tags) in SpecFlow. This ranges from keeping track of the user stories associated with changes to scenarios, using traits to communicate the status of tests with other team members and managing which tests should be executed for different builds.

2 replies
  1. Graham England
    Graham England says:

    Thanks, this video showed me that I’m on the right lines, and that tags and traits are the same thing. However, I’m using Visual Studio (15.7.2) with SpecFlow and NUnit3, my feature files have tags (e.g. “@TEST_GALILEO”), which auto-generates C# code like this: “[NUnit.Framework.CategoryAttribute(“TEST_GALILEO”)]”, and my “Group by Traits” button in the Test Explorer is greyed out and all I see are the names of each feature, not any tag/trait information. Am I doing anything wrong?

    Reply
    • Stephen McCafferty
      Stephen McCafferty says:

      The ability to sort by trait in the Test Explorer is a feature of SpecFlow+ Runner. So without SpecFlow you can still use tags to organise your tests and communicate with other team members, you just can’t group them in the Test Explorer.

      Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *