相关疑难解决方法(0)

"rake"运行我所有的Cucumber测试都很好,但"黄瓜"没有步骤

我继承了一个Rails(3)应用程序,并试图掌握现有的Cucumber测试.我在应用程序的'features'文件夹中有以下设置(我错过了任何不相关的文件,例如额外的功能和步骤)

/features
  /people
    new-person.feature
  /step_definitions
    people_steps.rb
    web_steps.rb
  /support
    env.rb
    paths.rb
    selectors.rb
Run Code Online (Sandbox Code Playgroud)

如果我运行'rake',它会运行features/people/new-person.feature中的所有功能,正确使用step_definitions中列出的步骤.

但是,我不想每次都运行rake因为它需要太长时间,我只想在Cucumber中运行一个特定的测试,例如 cucumber features/people/new-person.feature -l 8

当我这样做时,它运行该功能但尚未加载步骤.我得到了回报:

Using the default profile...
Feature: Add a new person
  In order to allocate tasks to people
  As a community manager
  I want to add a new person

  Scenario: Secondary navigation should contain "Add new person" # features/people/new-person.feature:8
    Given I am on the new person page                            # features/people/new-person.feature:9
      Undefined step: "I am on the new person page" (Cucumber::Undefined)
      features/people/new-person.feature:9:in `Given I am on …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails cucumber ruby-on-rails-3

14
推荐指数
1
解决办法
2420
查看次数

标签 统计

cucumber ×1

ruby-on-rails ×1

ruby-on-rails-3 ×1