黄瓜特征文件未识别步骤

Ash*_*Ash 5 java eclipse selenium cucumber gherkin

我已经编写了我的 firsy 黄瓜功能文件。当我将功能文件作为 Cucumber 功能运行时,出现以下错误

  1. “警告:不推荐使用 Cucumber-JVM 的 --format 选项。请改用 --plugin。” - 我在 runner 类的 @CucumberOptions 中使用了“插件”,但仍然遇到相同的错误

2.它说我没有任何场景和步骤功能:验证模块化 GUI 页面

场景:验证登录页面 # C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3 给定:打开模块化 GUI 时间:验证登录页面 然后:登录到模块化

0 场景 0 步骤

  1. 我没有得到我的步骤的片段。

我加入以下jar添加到库

这是我的跑步者类,包 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 {

}
Run Code Online (Sandbox Code Playgroud)

这是我的功能文件,

Feature: Validate Modular GUI pages

  Scenario: Validate Login Page
    Given: Modular GUI is opened
    When: Validate the login page
    Then: Login to the Modular
Run Code Online (Sandbox Code Playgroud)

如果有人能指出我的代码中缺少什么,我将不胜感激。

非常感谢

[已编辑] 这是实际错误:

警告:不推荐使用 Cucumber-JVM 的 --format 选项。请改用--plugin。功能:验证模块化 GUI 页面

场景:验证登录页面 # C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3 给定:打开模块化 GUI 时间:验证登录页面 然后:登录到模块化

0 场景 0 步骤 0m0.000s

Ash*_*Ash 5

在 Given、When 和 Then 之后,我的功能文件中有一个额外的“:”。

它现在正在工作。