Cucumber JVM undefined step(Cucumber JVM 未定义步骤)
问题描述
我无法为项目执行一个简单的黄瓜测试.我在 Intellij 13 社区,有黄瓜插件.
I can't execute a simple test with cucumber for a project. I am on Intellij 13 Community, with cucumber plugin.
我在我的 features 目录中编写了我的功能文件,我还实现了我的步骤,在插件的帮助下创建它们.而且我在feature files中的steps被intellij识别,可以导航到step implementation.
I wrote my feature file in my features directory, I have also implemented my steps, creating them with the help of the plugin. And my steps in the feature files are recognized by intellij, which can navigate and go to the step implementation.
但是当我尝试运行我的场景时,它总是失败,因为对于每个步骤,它都会显示未定义步骤:".
But when I try to run my scenario, it always fails because for each step, it says "Undefined step : ".
这是我的项目的组织方式:
Here is how is organized my project :
正如我之前所说,您可以看到我的步骤被 Intellij 识别:
And as I said before, you can see that my steps are recognized by Intellij :
这怎么可能,我该如何纠正?
How is that possible, and how can I correct this?
任何帮助都会很棒!
现在我为跑步者添加了选项:
Now that I added options to my runner :
@CucumberOptions( monochrome = true,
features = "src/test/resources/features/",
format = { "pretty","html: cucumber-html-reports",
"json: cucumber-html-reports/cucumber.json" },
dryRun = false,
glue = "fr.tlasnier.cucumber" )
有效!
然而,我注意到在此之前,我有两个场景大纲.一个完美运行,另一个找不到步骤定义!
Yet, I noticed that before that, I had two scenario outline. One worked perfectly, the other one could not find step definition!
真的很奇怪,因为在这两种情况下都有一些步骤.
Really weird, since there were some steps in both scenario.
推荐答案
@RunWith(Cucumber.class)
@CucumberOptions( monochrome = true,
tags = "@tags",
features = "src/test/resources/features/",
format = { "pretty","html: cucumber-html-reports",
"json: cucumber-html-reports/cucumber.json" },
dryRun = false,
glue = "fr.tlasnier.cucumber" )
public class RunCucumber_Test {
//Run this
}
这篇关于Cucumber JVM 未定义步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Cucumber JVM 未定义步骤


基础教程推荐
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- 在螺旋中写一个字符串 2022-01-01