【问题标题】:jbehave writing a story step in multiple linesjbehave在多行中写一个故事步骤
【发布时间】:2013-09-27 14:31:59
【问题描述】:

我有一个步骤足够长,由于它具有的参数数量而不能完全可见。我希望它分成两行,但是当我这样做时,该步骤无法识别。

When CC payment is made with amount=100 type=VISA name=card-holder-name number=1234567890123456
    verification code=000 expiry month=09 expiry year=14

有没有办法做到这一点?

【问题讨论】:

    标签: automated-tests bdd jbehave


    【解决方案1】:

    当我在一个步骤中有很多参数时,我会使用带有 transformer=FROM_LANDSCAPE 选项的表参数,如下所示:

    {transformer=FROM_LANDSCAPE}
    |amount           |100|
    |type             |Visa|
    |name             |card-holder-name|
    |number           |1234567890123456|
    |verification code|000|
    |expiry month     |09|
    |expiry year      |14|
    

    http://jbehave.org/reference/stable/tabular-parameters.html

    另一种方法是在使用 @Given 注释之前设置所有参数

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-31
      • 2011-09-07
      • 1970-01-01
      • 2011-05-02
      相关资源
      最近更新 更多