【问题标题】:BDD SpecFlow ScenariosBDD SpecFlow 场景
【发布时间】:2016-09-16 16:08:03
【问题描述】:

今天我开始使用 SpecFlow + Selenium 研究 BDD,我发现了几个仅显示 1 返回的示例。

如何编写返回多个项目的场景。例如:

Given a name "test"
I click on the SEARCH button

那么结果将等于下表:

name | last name
test | fulano
test | siclano

在这种情况下,我该如何写 THEN?,接受返回显示的表的 2 行?

【问题讨论】:

    标签: c# .net testing bdd specflow


    【解决方案1】:

    场景:

    Given a name "test"
    When I click on the SEARCH button
    Then the result will be 
    | name | last name
    | test | fulano
    | test | siclano
    

    代码:

    [Then("The result will be")]
    public void ThenTheResultWillBe(Table table)
    {
        //check that the result contains all the values in the table
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-29
      • 2018-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-03
      • 2018-03-10
      • 2014-10-12
      相关资源
      最近更新 更多