【问题标题】:How can I use an int value as scenario outline examples如何使用 int 值作为场景大纲示例
【发布时间】:2018-10-22 11:24:15
【问题描述】:

我想在我的步骤中使用 int 作为参数,但使用 场景大纲示例,代码如下:

And Skill Pop Up: Add new skill <skill name> with rate <rate>
    Examples:
  | skill name | rate |
  | java       | 1    |

应该是:

 @And("^(.+): Add new skill (.+) with rate (\\d+)$")

但不幸的是它必须是“(.+)”,在其他方面步骤是未定义的。

是否可以在场景大纲中使用整数?

【问题讨论】:

    标签: int cucumber gherkin outline


    【解决方案1】:

    您是否尝试从 \d 中删除“\”

    我试过了:

    ^(.+): Add new skill (.+) with rate (\d+)$
    

    并且工作正常

    使用下面的链接测试您的正则表达式:

    http://rubular.com/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多