Cucumber feature file does not identify the steps(黄瓜特征文件不识别步骤)
问题描述
我已经编写了我的耐寒黄瓜功能文件.当我将功能文件作为 Cucumber Feature 运行时,出现以下错误
I have written my firsy cucumber feature file. When I run the feature file as Cucumber Feature, I get below errors
- 警告:Cucumber-JVM 的 --format 选项已弃用.请改用 --plugin."- 我在跑步者类的@CucumberOptions 中使用了插件",但仍然遇到同样的错误
2.它说我没有任何场景和步骤功能:验证模块化 GUI 页面
2.It says I do not have any scenario and steps Feature: Validate Modular GUI pages
场景:验证登录页面#C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3给定:模块化 GUI 已打开何时:验证登录页面然后:登录到模块化
Scenario: Validate Login Page # C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3 Given: Modular GUI is opened When: Validate the login page Then: Login to the Modular
0 场景0 步
- 我没有收到我的步骤的片段.
我已将以下 jar 添加到库中罐子
I have added following jars to the library Jars
这是我的跑步课,包图形界面;
This is my runner class, package GUI;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
format = {"pretty", "json:target/"},
features = {"src/GUI/"}
)
public class GUIRunner {
}
这是我的功能文件,
Feature: Validate Modular GUI pages
Scenario: Validate Login Page
Given: Modular GUI is opened
When: Validate the login page
Then: Login to the Modular
如果有人能指出我的代码中缺少的内容,我将不胜感激.
I would really appreciate if someone can point out what is missing in my code.
非常感谢
[已编辑]这是实际的错误:
This is the actual error:
警告:Cucumber-JVM 的 --format 选项已弃用.请用--plugin 代替.功能:验证模块化 GUI 页面
WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead. Feature: Validate Modular GUI pages
场景:验证登录页面#C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3给定:模块化 GUI 已打开时间:验证登录页面然后:登录到模块化
Scenario: Validate Login Page # C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3 Given: Modular GUI is opened When: Validate the login page Then: Login to the Modular
0 场景 0 步 0m0.000s
0 Scenarios 0 Steps 0m0.000s
推荐答案
在 Given、When 和 Then 之后,我的功能文件中多了一个:".
I had an extra ":" in my feature file after Given, When and Then.
现在可以了.
这篇关于黄瓜特征文件不识别步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:黄瓜特征文件不识别步骤


- 转换 ldap 日期 2022-01-01
- Eclipse 的最佳 XML 编辑器 2022-01-01
- 获取数字的最后一位 2022-01-01
- 未找到/usr/local/lib 中的库 2022-01-01
- 将 Java Swing 桌面应用程序国际化的最佳实践是什么? 2022-01-01
- java.lang.IllegalStateException:Bean 名称“类别"的 BindingResult 和普通目标对象都不能用作请求属性 2022-01-01
- 如何指定 CORS 的响应标头? 2022-01-01
- GC_FOR_ALLOC 是否更“严重"?在调查内存使用情况时? 2022-01-01
- 在 Java 中,如何将 String 转换为 char 或将 char 转换 2022-01-01
- 如何使 JFrame 背景和 JPanel 透明且仅显示图像 2022-01-01