我遇到Intellij 2019.2.4 Ultimate的问题,无法从Cucumber功能文件导航到粘合代码。 Intellj抱怨“未定义步骤参考”。但是,从控制台或通过运行配置执行黄瓜测试是成功的。
黄瓜版本5.5.0Junit版本4.13
基于相似性报告的问题,这是我到目前为止尝试过的:
为了说明我的问题,我生成了一个简单的项目:
src / test / java / hellocucumber
package hellocucumber;
import io.cucumber.junit.CucumberOptions;
import io.cucumber.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
plugin = {"pretty", "html:target/cucumber"},
features = {"src/test/resources/hellocucumber"},
glue={"hellocucumber"},
monochrome = true
)
public class RunCucumberTest {
}
我的粘合代码
package hellocucumber;
import io.cucumber.java.en.Given;
public class StepDefinitions {
@Given("today is Monday")
public void today_is_Monday() {
System.out.println("Today is monday");
}
}
和我的功能文件:src / test / resources / hellocucumber / test.feature
Feature: This is a test
Scenario: Today is or is not Friday
Given today is Monday
Intellij抱怨缺少胶水代码:
我迷路了,不胜感激。谢谢
编辑:上传的项目OneDrive
[另外请注意,如果我将黄瓜版本从5.5.0降级到5.x.x之前的版本(例如4.8.1),则可以从特征导航到粘合!
此项目在IntelliJ IDEA 2019.3.3中正常工作,如果使用的是最新Cucumber版本,请考虑updating。>>