我正在尝试找出是否有一个选项来确定当前正在执行的黄瓜步骤,我正在尝试根据步骤名称执行特定的操作。
我可以看到StepDefinitionMatch类获得了这些步骤,但我不确定如何在运行时访问这些步骤。有什么帮助吗?如果有帮助,可以添加调用堆栈的快照。
public StepDefinitionMatch(List<Argument> arguments, StepDefinition stepDefinition, String featurePath, Step step, LocalizedXStreams localizedXStreams) {
super(arguments, stepDefinition.getLocation(false));
this.stepDefinition = stepDefinition;
this.featurePath = featurePath;
this.step = step;
this.localizedXStreams = localizedXStreams;
}

发布于 2018-05-18 19:37:02
只需等待Cucumber 3.0.0发布,您可以使用@AfterStep和@BeforeStep注释访问步骤名称。
https://github.com/cucumber/cucumber-jvm/blob/master/CHANGELOG.md https://github.com/cucumber/cucumber-jvm/pull/1323
感谢Aniket (Coding-Yogi) https://github.com/coding-yogi
https://stackoverflow.com/questions/50401007
复制相似问题