2020.1.3无法识别已经在逐步定义中定义的步骤。我只使用黄瓜-groovy,黄瓜-核心,黄瓜-junit:所有5.1.3版本.
我在下面试过了,它不起作用。
我指的是github:https://github.com/cucumber/cucumber-jvm-groovy/blob/main/examples/src/test/groovy/calc/CalculatorSteps.groovy上的这个项目
我的步骤定义包含如下代码
import io.cucumber.datatable.DataTable
import groovy.transform.Field
import groovyx.net.http.ContentType
import groovyx.net.http.HttpResponseException
import io.cucumber.groovy.EN
import io.cucumber.groovy.Hooks
this.metaClass.mixin(Hooks)
this.metaClass.mixin(EN)
def response
@Field evalResponse
@Field String DATABASENAME_CPGP01 = "011032"
@Field String DATABASENAME_CPGP02 = "011033"
@Field TetrisRESTClient tetrisRESTClient
@Field TetrisRESTClient jobRestClient
JemsTest.enableExtentReporting = false;
Before('@Functionality001') {
initializeSetUp()
}
Given(/I am on XYZ screen/) { -> }
And(/below are the given inputs/) { DataTable arg1 -> }发布于 2020-07-19 06:05:36
我自己弄明白了。步骤定义中使用的Regex语法是Java的语法,而不是引起问题的Groovy语法。我忽略了这个细微的差别。
发布于 2022-07-25 07:29:41
为了解决这个问题,您应该更新您的库。
如果没有帮助,那么试着阅读本教程:https://medium.com/@cheparsky/migration-cucumber-older-version-4-to-newer-version-6-133ffb60813d
https://stackoverflow.com/questions/62956227
复制相似问题