TestElementName

annotation class TestElementName(val prefix: String = "", val postfix: String = "")(source)

Designates a test-registering function's String parameter as representing the test element's name.

The IDE plugin uses this annotation to detect the function parameter containing the element name. The optional prefix and postfix annotation parameters make the IDE plugin aware of modifications to the element name, so that a valid test element path can be produced by static analysis. Example for a Behavior/Gherkin-style Scenario function creating a test suite:

@TestRegistering
fun <Context : Any> TestSuiteScope.Scenario(
@TestElementName(prefix = "Scenario: ") description: String,
// ...
) {
testSuite("Scenario: $description", testConfig = testConfig) {
// ...
}
}

Note: A test-registering function below the top level, which uses its first parameter for the test element name, is not required to annotate it with @TestElementName.

Properties

Link copied to clipboard
Link copied to clipboard