【问题标题】:cucumber converts string to integer?黄瓜将字符串转换为整数?
【发布时间】:2021-03-04 18:16:33
【问题描述】:

我正在做一些 BDD,但我遇到了一个我无法解决的问题。 我试图把它写成我在步骤定义中可见的小黄瓜线:

When the user has 2 overdue books where the fine is payed (fine is 0)

但是文字出来

the user has {int} overdue books where the fine is payed \\(fine is {int})

我尝试在字符前使用反斜杠转义并将整数字符串化,但这只是将它们转换为字符串。

【问题讨论】:

  • 您期望“fine is 0”中的“0”是什么?

标签: cucumber bdd gherkin


【解决方案1】:

Cucumber 通过建议它认为您可能希望您的步骤定义是什么来提供帮助。你没有跟随它。这也是一个有效的黄瓜表达式:

the user has 0 overdue books where the fine is payed \\(fine is 0)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-02-21
    • 2010-12-31
    相关资源
    最近更新 更多