当前位置: 首页 > 知识库问答 >
问题:

无法分析cucumber中的功能文件

薛经纶
2023-03-14
I am unable to parse my feature file in cucumber while running i am getting following error, i am creating a BDD test framework to do API testing using cumber feature file concept

我的功能文件如下

end2end_test.feature

Scenario Outline: User generates token for Authorisation
    Given I am an authorized user

Scenario Outline: the Authorized user can Add and Remove a phone
    Given A list of phones are available
    When I add a phone to store
    Then the phone is added
    When I update a phone in my store
    Then the phone is updated
    When I remove a phone from my store
    Then the book is removed
    When I am reading my phone details
    Then I read my Phone Details

我的runner.java文件如下所示

testRunner.java

package runners;

import org.junit.runner.RunWith;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "src/test/resources/functionalTests",
        glue = {"stepDefinitions"},
        monochrome = true,
        strict = true
)
public class TestRunner {
}

共有1个答案

漆雕皓轩
2023-03-14

对于场景大纲您需要示例

如果不需要示例,只需使用scenaria

Feature: My feature name
  As a customer
  I should be able to do something
  So that I can benefit

 Scenario: Some test - some test description
  Given i have something
  When i do some action
  Then the results are displayed


 Scenario Outline: Some other test - scenario outline needs examples
  Given i have something
  When i do some action with <example_name>
  Then the results are displayed
Examples:
  | example_name |
  | test         |
 类似资料:
  • 我需要一些帮助运行一个功能文件。 这是Maven项目的骨架: 这是我的pom.xml文件: 我不能运行功能文件,与此,我不能运行任何与cucumber相关的。你能帮帮我吗? 提前谢了。

  • 我已经安装了cucumber eclipse插件。我已经用空手道编写了我的简单功能文件,当我试图将其作为cucumber测试运行时,我被要求实现缺少的步骤。当我使用专用的运行程序运行同一个功能文件时,它的执行不会出现任何问题。请你帮忙。我正在尝试在不使用专用跑步者的情况下进行这项测试

  • 尝试使用ChromeDriver 2.9运行测试时出现以下错误: 未知错误:无法解析功能: chromeOptionsorg.openqa.selenium.WebDriverExctive:未知错误:无法解析功能: chromeOptions from未知错误:必须是字典(驱动程序信息: chromeDrive=2.9.248315,平台=Windows NT 6.1 SP1 x86)(警告:服

  • 我已经创建了一个项目在eclipse开普勒使用cucumber和jUnit运行。我也使用log4j.properties文件放在配置文件夹在我的项目。Log4j属性配置定义如下在Base类。 Profile.feature RunnerTest.java 现在当我运行配置文件时。eclipse中的功能文件- java.io.FileNotFound异常:config\log4j.propertie

  • 假设我有以下功能文件: 我ogin.feature 功能:登录网站 场景:现场登录验证 给定导航到站点登录页 家特色 功能:欢迎页面验证 场景:验证登录后出现的页面 已成功完成给定登录 登录成功后的页面出现时 然后测试完成 在Home.feature文件中,我需要先执行Login.feature,然后调用home.feature.所以当我从运行器测试中执行home时,它会依次执行login,然后是

  • 本文向大家介绍thinkPHP5分页功能实现方法分析,包括了thinkPHP5分页功能实现方法分析的使用技巧和注意事项,需要的朋友参考一下 本文实例讲述了thinkPHP5分页功能实现方法。分享给大家供大家参考,具体如下: 其实分页自身的内容也不是很多。不过牵扯到样式的问题感觉挺烦。于是找到了分页类看了一下。把大体的结构说一下。如果有需要修改页面样式的可以自行修改样式。最好提前备份,防止意外。 首