Testing / Cucumber Interview Questions
What are tags in Cucumber?
Tags are @-prefixed labels placed above a Feature, Scenario, or Examples block, used to categorize scenarios so a test run can be filtered to include or exclude specific groups without physically separating files.
@smoke Scenario: basic health check Given the service is running When a health check request is sent Then the response status should be 200 @regression @slow Scenario: full end-to-end checkout flow ...
A tag applied at the Feature level applies to every scenario inside it, while a tag on an individual scenario or examples block applies more narrowly. At runtime, a tag expression (like @smoke or @regression and not @slow) passed to the Cucumber runner determines exactly which subset of scenarios executes, which is what makes it practical to keep a fast subset for every commit and a slower, fuller suite for less frequent runs.
More Related questions...