Scenarios & Tags

Every Gherkio test file describes a single test scenario. The root of the YAML document contains the top-level keys for execution metadata, tagging, and execution phases.


🏗️ Top-Level Key Reference

All keys in the Gherkio DSL are case-sensitive and must be written in lowercase.

KeyTypeRequiredDescriptionExample
scenariostringYesHuman-readable name of the test scenarioscenario: Create new user
descriptionstringNoDetailed description of what this scenario tests. Shown in HTML report headerdescription: Verify user can login with valid credentials
tagsarrayNoList of categories/labels for execution filteringtags: [smoke, active]
setuparrayNoPre-condition HTTP requests or composed files(See Setup/Teardown chapter)
stepsarrayYesPrimary sequence of API request and assertion steps(See Steps chapter)
teardownarrayNoPost-condition cleanup steps (guaranteed to run)(See Setup/Teardown chapter)

🏷️ Tagging & Filtering Conventions

Tags are strings that allow you to segment and filter test executions. They are extremely valuable for executing specific subsets of a test suite (e.g. running only light tests on commit, and full suites nightly).

scenario: Authenticated checkout flow
description: Verifies a logged-in user can add items to cart and complete checkout with valid payment.
tags:
  - e2e
  - checkout
  - high-priority

Filtering test runs from CLI:

# Run tests containing the 'smoke' tag
gherkio run tests/ --tag smoke

# Run tests containing BOTH 'core' AND 'user' tags (Logical AND)
gherkio run tests/ --tag core --tag user