当我如下定义功能时,它不起作用。我只想知道错误在哪里,我可以在同一个功能文件中使用两个场景大纲吗?

时间:2018-07-12 10:55:57

标签: cucumber cucumber-jvm

我是黄瓜框架的新手,只是我想知道如何使用

当我如下定义功能时,它不起作用。我只想知道错误在哪里,我可以在同一个功能文件中使用两个场景大纲

Scenario Outline: Checkout descriptions
   Given I am logged in as "<user>"
     And I have gone to the checkout after selecting various products
   When I purchase the items
   Then I should be able to checkout <with?> a description

 Examples:
   | user  | with?   |
   | Arun  | with    |
   | Ajay  | with    |
   | Ashok | with    |
   | Arun  | without |
   | Ajay  | without |
   | Ashok | without |

Scenario Outline: Checkout with description and accept the terms of service*
   Given I am logged in as "<user>"
     And I have gone to the checkout after selecting various products
   When I purchase the items
   Then I should be able to checkout with a description
     And I should be able to accept the terms of service*

 Examples:
   | user  |
   | Arun  |
   | Ajay  |
   | Ashok |

1 个答案:

答案 0 :(得分:0)

如果这是您的整个功能文件,那么您从顶部缺少一行:

Feature: Checkout Descriptions

   Scenario Outline: Checkout Descriptions
    ...

黄瓜无法解析在顶行中没有Feature / Business Need / Ability的功能文件。