Cucumber JVM

dependencies {
    testImplementation("dev.tracera:tracera-cucumber:<version>")
}

Requires JDK ≥ 17 and Cucumber ≥ 7 (see Autotest adapters). tracera-cucumber on Maven Central.

Environment variables and run mode: Autotest adapters.

Cucumber-JVM has no stock retry API — there is no CUCUMBER_RETRY Env key.

Register the plugin:

cucumber.plugin=dev.tracera.TraceraCucumberPlugin

Or via @CucumberOptions(plugin = ["dev.tracera.TraceraCucumberPlugin"]).

Bind testCaseId and autotestName

Put tags on the Scenario (preferred):

@tracera.id:42
@tracera.name:e2e%2Flogin
Scenario: Login
  Given the user opens login

Optional @tracera.name: is URL-encoded. If the name tag is omitted, autotestName takes the value of the Scenario name.

Inside a step or hook:

import dev.tracera.Tracera

Tracera.testCase(42, "e2e/login")

Skip

Use stock Cucumber skip / pending. The skip reason is added to the result as comment.

Steps

Gherkin steps map to the result’s Test section. Nest with Tracera.step("…") { … }, Tracera.suspendStep("…") { … } for coroutines, or put @Tracera.Step("…") on glue methods (sync and suspend). With @Tracera.Step, if the title is empty or omitted, the step title becomes the method name; {0} / {name} in the title are filled from the method arguments. Before / After scenario hooks map to Setup / Teardown. Feature / suite hooks are not reported.

import dev.tracera.Tracera
import io.cucumber.java.en.When

class CheckoutSteps {
    @Tracera.Step("add {sku}")
    fun addSku(sku: String) {
    }

    @When("the user checks out with {string}")
    fun checkout(sku: String) {
        addSku(sku)
        Tracera.step("pay") { }
    }
}

Comments, errors, and attachments

Comments, errors, and attachments: Autotest adapters.

Tracera.comment("result-level note")
Tracera.error("result-level error text")
Tracera.step("open login") {
    Tracera.comment("landed on login")
}

Parameterized tests

Each Examples row gets a Scenario name with <…> already filled in by Cucumber. Put a fixed @tracera.id: on the Outline or Scenario, or call Tracera.testCase when the id varies per example.

@tracera.id:42
Scenario Outline: Login as <login>
  Given the user signs in as "<login>"
  Examples:
    | login |
    | ok    |
    | sso   |