Tags should also be utilized for testing types. Scenario Outlines contain data tables to run over, and it’s an effective use of these tables to divide the tests run into Smoke and Regression tests. Create smaller subsets of the data for a Smoke test, and tag the larger tables as Regression. Additional testing types can also be rolling into this structure, with little effect on the tests.
#Scenario Outline Example
@SearchTest
Scenario Outline: Verify Login Functionality
When I fill in "input[id='email']" with "<email>"
And I fill in "input[id='passwd']" with "<password>"
And I click on "button[id='SubmitLogin']"
Then I should see heading "<heading>"
@RegressionTest
Examples:
| email | password | heading |
| goswami.tarun77+7@gmail.com | test1234 | My account |
| wrongusername@gmail.com | test | Authentication |
@SmokeTest
Examples:
| email | password | heading |
| wrongusername@gmail.com | test | Authentication |
In above above scenario, I want to execute only one set of data for Smoke Test and 2 rows for Regression Test. Remember Here you need to repeat Examples: Keyword and headers. So, When you will specify RegressionTest, it will execute 2 rows of examples and when you will specify smoke test it will execute one row of examples.