Skip to content

Tags and Attributes

aryehcitron@gmail.com edited this page May 17, 2026 · 6 revisions

Tags control how scenarios are categorised and filtered in the generated reports.

Happy Path

Mark a scenario as a "happy path" to support filtering in the HTML reports.

Framework How to mark
xUnit [HappyPath] attribute on the test method
NUnit [HappyPath] attribute on the test method
MSTest [HappyPath] attribute on the test method
BDDfy .WithTags("happy-path")
LightBDD [HappyPath] attribute on the scenario method (from Kronikol.LightBDD.Core — extends LabelAttribute)
ReqNRoll @happy-path tag on the Gherkin scenario

In the HTML reports, happy path scenarios are sorted first within each feature and display a "Happy Path" badge. Use the "Happy Paths Only" toggle in the filtering toolbar to show only happy path scenarios.

Endpoint

Associate a feature/test class with an API endpoint. This appears as metadata in the reports.

Framework How to set
xUnit [Endpoint("/api/cake")] attribute on the test class
NUnit [Endpoint("/api/cake")] attribute on the test fixture class
MSTest [Endpoint("/api/cake")] attribute on the test class
BDDfy .WithTags("endpoint:/api/cake")
ReqNRoll @endpoint:/api/cake tag on the Gherkin Feature

Category

Assign categories to scenarios for grouping and filtering in the reports. Categories appear as filterable tags in the search bar using the @tag syntax.

Framework How to set
xUnit [Trait("Category", "smoke")] attribute on the test method
NUnit [Category("smoke")] attribute on the test method
MSTest [TestCategory("smoke")] attribute on the test method
BDDfy .WithTags("category:smoke")
LightBDD [Label("smoke")] attribute on the scenario method
ReqNRoll @category:smoke tag on the Gherkin scenario or feature

In the HTML reports, categories are searchable using @smoke in the search bar. See Search Syntax#Tag Filtering (@tag).

Labels

Labels provide additional metadata attached to features and scenarios. In LightBDD, labels are set via [Label("...")] attributes and appear in the report alongside the scenario name. In ReqNRoll/BDDfy, tags that don't match the happy-path, endpoint:, or category: prefixes are treated as general labels.

DocString

Gherkin DocString content (triple-quoted blocks in .feature files) is captured as part of scenario steps and rendered as <pre> code blocks in the HTML reports. The optional media type (e.g. json, xml) specified after the opening """ delimiter controls syntax highlighting in the rendered output.

Framework How to use
ReqNRoll Use triple-quoted """ blocks in .feature files. Optionally specify a media type: """json

Step Comments

Step comments (text annotations on individual test steps) are captured and rendered in the HTML reports below the step text. In LightBDD, step comments are added via the StepExecution.Current.Comment() API.

Home


Demo


Getting Started

Common Tasks

Integration Guides

Extensions

Configuration

Features

Reference

Clone this wiki locally