黄瓜功能文件无法识别步骤 [英] Cucumber feature file does not identify the steps

查看:111
本文介绍了黄瓜功能文件无法识别步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了我的易碎黄瓜特征文件.当我将功能文件作为黄瓜功能运行时,出现以下错误

I have written my firsy cucumber feature file. When I run the feature file as Cucumber Feature, I get below errors

  1. 警告:不建议使用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个步骤

  1. 我的步骤没有摘要.

我已将以下罐子添加到库中 Jars

I have added following jars to the library Jars

这是我的跑步者班, 包GUI;

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.

非常感谢

这是实际的错误:

警告:不建议使用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

推荐答案

在给定的时间和时间之后,我的功能文件中还有一个额外的:".

I had an extra ":" in my feature file after Given, When and Then.

现在正在工作.

这篇关于黄瓜功能文件无法识别步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆