【问题标题】:In Gherkin syntax, what's the difference between Example and Scenario?在 Gherkin 语法中,Example 和 Scenario 有什么区别?
【发布时间】:2020-10-19 07:50:20
【问题描述】:

在他们的网站上:https://cucumber.io/docs/gherkin/reference/

它在关键字下列出了示例(或场景)。是否有区别,或者可以用一个关键字完成的所有事情都可以用另一个关键字完成?

【问题讨论】:

    标签: gherkin


    【解决方案1】:

    场景是一个带有步骤的测试。 Scenario Outline 适用于您要循环使用表数据的场景,Example 是该表的标题。

    Scenario: Test something
      Given I am logged in
      And I select the "Add" tab
      And I select the "New" button
      Then the form is displyed
    
    Scenario Outline: Test something else
      Given I am logged in as "<user>"
      And I select the "Add" tab
      And I select the "<item>" button
      Then the form is displyed
    Examples:
        | user | item |
        | aaaa | Add  |
        | bbbb | Edit |
    

    【讨论】:

    • 关闭,我找到了答案。注意:表格的标题是“示例”而不是“示例”。 Gherkin Syntax 文档中有一行声明“Example”是“Scenario”的同义词。
    猜你喜欢
    • 2021-10-17
    • 1970-01-01
    • 2020-06-18
    • 2020-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-09
    • 1970-01-01
    相关资源
    最近更新 更多