Intellij Community Edition 2020.1.3无法识别stepdefinition中已定义的步骤。 我只使用黄瓜常规,黄瓜芯,黄瓜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 -> }
答案 0 :(得分:0)
弄清楚自己。步骤定义中使用的Regex语法是Java而不是引起问题的Groovy。我忽略了这种微小的差异。