Tags in Specflow Framework

Tags are used to execute the features and scenarios in a organized way.
Tags can be applied to the following Gherkin elements:

Feature
Scenario
Scenario Outline


Examples

Syntax : start with @, Ex: @smoke

 
@mustrun
Feature: To test the withdrawl,deposit and transaction feature
  @Priority
  Scenario Outline: To verify the Add customer functionality
    Given user navigate the url in the browser
    When user select the manager login
    And  add the customer with "", "", ""
    Then verify the success message with customer Id
    Then verify the added customer displayed in Customers Tab
    @smoke
   
Examples:

      |username        | lastname       | postcode     |
      |Tester          | smoke         | 32334        |
      |Develop         | smoke        | 32334        |
    @regression
   
Examples:

      |username        | lastname       | postcode     |
      |Designer        | regression       | 32334        |

  @smoke
  Scenario: Add the customer and deposit the amount
    Given user navigate the url in the browser
    When user select the manager login
    And add the customer with "username", "lastname", "postcode"
    And existing customer loggedIn
    And deposit the amount "50"

  @Regression
  Scenario: Verify user select the deposit amount and generate the report
    Given user navigate the url in the browser
    When user select the manager login
    And add the customer with "username", "lastname", "postcode"
    And existing customer loggedIn
    Then download the report
 

 

In Scenario Outline, we can use tags with different examples:

 

  @smoke
    Examples:
      |username        | lastname       | postcode     |
      |Tester          | smoke         | 32334        |
      |Develop         | smoke        | 32334        |
  @regression
    Examples:
      |username        | lastname       | postcode     |
      |Designer        | regression       | 32334        |

 

Related Tutorials