{"id":9738,"date":"2023-11-23T19:23:35","date_gmt":"2023-11-23T19:23:35","guid":{"rendered":"https:\/\/putridparrot.com\/blog\/?p=9738"},"modified":"2023-11-23T19:23:35","modified_gmt":"2023-11-23T19:23:35","slug":"specflow-gherkin-tags","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/specflow-gherkin-tags\/","title":{"rendered":"Specflow\/Gherkin tags"},"content":{"rendered":"<p>We&#8217;re going to take a look at <em>tags<\/em>.<\/p>\n<p>We add <em>tags<\/em> to our features like this, using the @ to prefix a name<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n@Calculator\r\nScenario: Calculate two values\r\n# Given\/When\/Then steps\r\n<\/pre>\n<p>We can have multiple tags for a scenario, just comma separate them, like this<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n@Calculator, @Math\r\nScenario: Calculate two values\r\n# Given\/When\/Then steps\r\n<\/pre>\n<p><strong>Great, so what use do I have for tags?<\/strong><\/p>\n<p>Tags can be used to create documentation, they can be used to for start up and clean up code and they can be uses within the test runners to run groups of tests via their category, you guessed it, denoted by the tag, for example<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\/\/ run tests on anything tagged Math\r\ndotnet test MyTests.dll --filter Category=Math\r\n\r\n\/\/ to run tests with both Calculator and Math tags\r\ndotnet test MyTests.dll --filter &quot;Category=Calculator &amp; Category=Math&quot;\r\n\r\n\/\/ to run tests with either Calculator or Math tags\r\ndotnet test MyTests.dll --filter &quot;Category=Calculator | Category=Math&quot;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re going to take a look at tags. We add tags to our features like this, using the @ to prefix a name @Calculator Scenario: Calculate two values # Given\/When\/Then steps We can have multiple tags for a scenario, just comma separate them, like this @Calculator, @Math Scenario: Calculate two values # Given\/When\/Then steps Great, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[33],"tags":[],"class_list":["post-9738","post","type-post","status-publish","format-standard","hentry","category-specflow"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=9738"}],"version-history":[{"count":5,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9738\/revisions"}],"predecessor-version":[{"id":10194,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9738\/revisions\/10194"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=9738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=9738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=9738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}