に対応する文字列パラメータを受け付けます現在のステップ名を格納するListener。
あなたのテストランナーでこれを試してください:あなたのステップで
//import net.serenitybdd.cucumber.CucumberWithSerenity;
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(...
そして:
//import net.thucydides.core.model.TestStep;
//import net.thucydides.core.steps.StepEventBus;
if (!StepEventBus.getEventBus().isBaseStepListenerRegistered()) {
return "Unknown"; // CucumberWithSerenity is required.
}
String currentStepDescr = StepEventBus.getEventBus().getCurrentStep()
.transform(TestStep::getDescription)
.get();
依存関係:
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
</dependency>
別の代替は、([QAFガーキンクライアント]でありますhttps://qmetry.github.io/qaf/latest/gherkin_client.html)には、[ステップリスナー](https://qmetry.github.io/qaf/latest/qaf_listeners.html#teststep-リスナー)を使用することができます。 – user861594