kneerace / LearnJavaSelenium

this is for learning Git and Java-Seleinum
1 stars 1 forks source link

Add Tag in Step Definition and Runner, so that only specific Scenario is run #36

Open kneerace opened 5 years ago

kneerace commented 5 years ago

To add Tag in StepDefinition, as well as link those with the runner file, so that only specific test is run as needed. This is useful to segregate test as required bucket - say regression, test1, feature1, smoke etc... so that when the required test is tagged in runner, only that specific test with mentioned tag runs. NOTE:- we can add as many tag as we like to a test.

kneerace commented 5 years ago

added multiple tags and validated by running them.

if we run the test from the feature file, it will run all the scenarios, but if we mention the tag and run from the runner, it will only run the scenarios which is tagged and mentioned under tags. we can put multiple tags, as well as with condition and|or. tag is helpful in segregating scenarios and run the required one , as @Regression, @Smoke, @feature1, etc....