使用 IntelliJ 的 Cucumber 找不到步骤定义

2024-05-07

我遇到了以下问题。我在 IntelliJ 中有四个 Cucumber 功能文件。我通过 IntelliJ 插件添加了 Cucumber 支持。创建功能后,我按如下方式编辑了配置,以便可以执行功能文件。

This is how my configuration looks like Glue should be the name of the package the step definitions reside in. In my case the package is called stepdefinitions.

The following image shows what my project structure looks like. The feature files reside in /src/test/resource/features while the stepdefinitions are stored in /src/test/java/stepdefinitions. This is how my project structure looks like

遗憾的是,当我尝试使用步骤定义运行黄瓜功能时,我收到提示“您可以使用以下代码片段来实现缺失的步骤:”但我已经这样做了。我已经将这些片段复制到步骤定义文件中。当我将鼠标悬停在场景上时,IntelliJ 会告诉我““未实现的子步骤定义”。

这两件事让我得出这样的结论:IntelliJ 没有找到我的步骤定义。也许你们中的一个人知道我做错了什么。


我终于找到了我的问题的解决方案。该错误是由一个名为的插件引起的Substep IntelliJ 插件。您需要在 IntelliJ 插件部分中搜索它并禁用或卸载它。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 IntelliJ 的 Cucumber 找不到步骤定义 的相关文章

随机推荐