Skip to content
GitHub

TestMetadata

Fluent builder for test case metadata. Metadata is automatically applied when the builder is destroyed (RAII). Each setter records an operation that is executed once the builder leaves scope, so chains stay cheap and side-effect free until destruction. Builders are intended for use on the thread executing the current test case.

Default constructor

void TestMetadata()

Copy constructor

void TestMetadata( other)

Parameters:

NameTypeDescription
otherThe object to copy construct from

Move constructor

void TestMetadata( other)

Parameters:

NameTypeDescription
otherThe object to move construct from

Destructor

void ~TestMetadata()

Copy assignment operator

void operator=( other)

Parameters:

NameTypeDescription
otherThe object to copy assign from

Move assignment operator

void operator=( other)

Parameters:

NameTypeDescription
otherThe object to move assign from

Set a plain-text description of the test.

void description(std::string_view desc)

Parameters:

NameTypeDescription
descstd::string_viewDescription text.

Set an HTML-formatted description of the test.

void descriptionHtml(std::string_view html)

Parameters:

NameTypeDescription
htmlstd::string_viewHTML description; caller is responsible for valid markup.

Add an epic label.

void epic(std::string_view epic)

Parameters:

NameTypeDescription
epicstd::string_viewEpic identifier.

Add a feature label.

void feature(std::string_view feature)

Parameters:

NameTypeDescription
featurestd::string_viewFeature identifier.

Mark the test as flaky.

void flaky()

Add a parameter whose value is hidden in the report.

void hiddenParameter(std::string_view name, std::string_view value)

Parameters:

NameTypeDescription
namestd::string_viewParameter name.
valuestd::string_viewParameter value.

Shortcut for adding an issue link.

void issue(std::string_view name, std::string_view url)

Parameters:

NameTypeDescription
namestd::string_viewIssue identifier.
urlstd::string_viewIssue URL.

Mark the test as known (expected) failure.

void known()

Add a custom label.

void label(std::string_view name, std::string_view value)

Parameters:

NameTypeDescription
namestd::string_viewLabel name.
valuestd::string_viewLabel value.

Add a link to an external system.

void link(std::string_view name, std::string_view url, std::string_view type)

Parameters:

NameTypeDescription
namestd::string_viewDisplay name of the link.
urlstd::string_viewTarget URL.
typestd::string_viewLink type (e.g., “issue”, “tms”, or custom). Defaults to “custom”.

Add a parameter whose value is masked in the report.

void maskedParameter(std::string_view name, std::string_view value)

Parameters:

NameTypeDescription
namestd::string_viewParameter name.
valuestd::string_viewParameter value.

Mark the test as muted (do not affect build status).

void muted()

Set the test display name.

void name(std::string_view name)

Parameters:

NameTypeDescription
namestd::string_viewHuman-readable test name.

Add an owner label.

void owner(std::string_view owner)

Parameters:

NameTypeDescription
ownerstd::string_viewResponsible person or team.

Add a visible parameter.

void parameter(std::string_view name, std::string_view value)

Parameters:

NameTypeDescription
namestd::string_viewParameter name.
valuestd::string_viewParameter value.

Add a severity label.

void severity(std::string_view severity)

Parameters:

NameTypeDescription
severitystd::string_viewSeverity value (e.g., “critical”, “minor”).

Add a story label.

void story(std::string_view story)

Parameters:

NameTypeDescription
storystd::string_viewStory identifier.

Add a tag label.

void tag(std::string_view tag)

Parameters:

NameTypeDescription
tagstd::string_viewArbitrary tag value.

Shortcut for adding a TMS link.

void tms(std::string_view name, std::string_view url)

Parameters:

NameTypeDescription
namestd::string_viewTMS case identifier.
urlstd::string_viewTMS URL.