代码之家  ›  专栏  ›  技术社区  ›  Mostafa Hussein

Cucumber:在预期注释、功能、标记之一时找到场景

  •  0
  • Mostafa Hussein  · 技术社区  · 12 年前

    我正试图运行一个cumber测试,但我遇到了一个奇怪的错误!使用 gem 'cucumber-rails', '1.0.6'

    features/hidden_links.feature: Parse error at features/hidden_links.feature:1. Found scenario when expecting one of: comment, feature, tag. (Current state: root). (Gherkin::Parser::ParseError)
    

    隐藏链接功能

    Scenario: Edit project link is hidden for non-signed-in users
      Given I am on the homepage
      When I follow "TextMate 2"
      Then I should not see the "Edit Project" link
    
    Scenario: Edit project link is hidden for signed-in user
      Given I am signed in as "user@ticketee.com"
      When I follow "TextMate 2"
      Then I should not see the "Edit Project" link
    
    Scenario: Edit project link is shown to admin
      Given I am signed in as "admin@ticketee.com"
      When I follow "TextMate 2"
      Then I should see the "Edit Proeject" link
    
    Scenario: Delete project link is hidden for non-signed-in users
      Given I am on the homepage
      When I follow "TextMate 2"
      Then I should not see the "Delete Project" link
    
    Scenario: Delete project link is hidden for signed-in users
      Given I am signed in as "user@ticketee.com"
      When I follow "TextMate 2"
      Then I should not see the "Delete Project" link
    
    Scenario: Delete project link is shown to admins
      Given I am signed in as "admin@ticketee.com"
      When I follow "TextMate 2"
      Then I should see the "Delete Project" link
    
    1 回复  |  直到 12 年前
        1
  •  3
  •   Andrei Botalov    12 年前

    功能文件 should start from Feature keyword, not from Scenario .

    Feature: Hidden links