Java 如何使用io.cucumber的最新cucumber版本在运行时从功能文件中读取cucumber功能名称
在info.cucumber版本中,我曾经使用此代码在运行时从功能文件中读取功能名称,并且工作正常Java 如何使用io.cucumber的最新cucumber版本在运行时从功能文件中读取cucumber功能名称,java,cucumber,Java,Cucumber,在info.cucumber版本中,我曾经使用此代码在运行时从功能文件中读取功能名称,并且工作正常 **private String getFeatureFileNameFromScenarioId(Scenario scenario) { String featureName = "Feature "; String Feature = scenario.getId().split(";")[0].replace("-"," "); return Feature; }** 升级cucumbe
**private String getFeatureFileNameFromScenarioId(Scenario scenario) {
String featureName = "Feature ";
String Feature = scenario.getId().split(";")[0].replace("-"," ");
return Feature;
}**
升级cucumber版本后,将显示最新的依赖项列表
**io.cucumber cucumber-core 5.0.0-RC1 compile io.cucumber cucumber-java 5.0.0-RC1 compile io.cucumber cucumber-java8 5.0.0-RC1 compile io.cucumber cucumber-junit 5.0.0-RC1 compile io.cucumber cucumber-testng 5.0.0-RC1 compile**
上述代码已停止工作,并且在运行时未返回“Feature name from Feature file”
有人能帮我提出解决方案吗 您是否尝试过使用
scenario.getName()
?是的,它不起作用。如果你有info.cucumber版本,但没有io.cucumber版本,这是可行的