【问题标题】:@Json in JBehave's StoryJBehave 故事中的 @Json
【发布时间】:2018-04-13 07:13:29
【问题描述】:

参数化场景可以通过 JBehave 的故事文件中的不同方式 (http://jbehave.org/reference/stable/parametrised-scenarios.html) 实现。但我想知道 Json 是否可以在参数化场景中使用,例如以下示例:

给定 ....................
何时 .... @Json{user}
那么 ....................

示例:
@Json: 用户{
fName: "xxxxx"
lName: "yyy"
}

提前致谢..

【问题讨论】:

    标签: automated-tests bdd jbehave serenity-bdd scenarios


    【解决方案1】:

    提供的示例将不起作用。

    可能的选项如下。

    内联参数:

    Given ..............
    When .... {
       "fName": "xxxxx",
       "lName": "yyy"
    }
    Then  ..............
    

    示例表:

    Given ...............
    When .... <userJson>
    Then  ..............
    
    Examples:
    |userJson                            |
    |{ "fName": "xxxxx", "lName": "yyy" }| 
    

    【讨论】:

      猜你喜欢
      • 2011-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-17
      • 2011-09-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多