groovy - 更新 cucumber-groovy 后,我得到“对'PickleStepTestStep'的访问超出其访问权限”
问题描述
在将 cucumber-groovy 从版本更新4.7.1
到之后,6.1.2
我开始收到错误消息Access to 'PickleStepTestStep' exceeds its access rights
。在旧版本中,它在cucumber.api.PickleStepTestStep
,现在在io.cucumber.core.runner.PickleStepTestStep
我PickleStepTestStep
现在看到的是私人课程。
我现在如何获取当前步骤名称?
我如何使用它的示例:
class ErrorLogger {
List<String> errorHolder = new ArrayList<>()
PickleStepTestStep currentStepDef
int currentStepDefIndex = 0
void setNewStepState(TestCase testCase) {
List<PickleStepTestStep> stepDefs = testCase.getTestSteps().findAll { it instanceof PickleStepTestStep } as List<PickleStepTestStep>
currentStepDef = stepDefs.get(currentStepDefIndex)
newStep = true
currentStepDefIndex++
}
private void addNewStepInfoToList() {
errorHolder.add('############################################################')
errorHolder.add('[ERROR] STEP NAME: ' + currentStepDef.getStepText())
newStep = false
}
}
我对 TestCase 类有同样的问题。
进口情况如下:
cucumber_groovy : "io.cucumber:cucumber-groovy:6.1.2",
cucumber_junit : "io.cucumber:cucumber-junit:4.7.1",
groovy : 'org.codehaus.groovy:groovy-all:3.0.5',
解决方案
推荐阅读
- javascript - (bootstrap Jquery)在多个输入字段中预先输入,如何从触发预先输入的位置查找
- machine-learning - 训练后如何预测?
- bash - 获取使用 $() 执行的 bash 命令的退出代码
- python - 将 pandas df 列拆分为多列
- css - div不使用高度自动扩展高度
- xamarin - 在 Azure devops microsoft 托管构建服务器上安装新版本的依赖项
- prolog - Prolog:使用可选事实实施规则
- go - 如何在golang中围绕我的数据绘制一个框并打印它?
- html - 在谷歌日历(python)上找不到 SVG 元素
- javascript - Bootstrap 5 工具提示、弹出框和 toast 在 Ruby on Rails 6 中不起作用