使用@wip跳过某些数据行

时间:2016-11-14 19:16:38

标签: cucumber cucumberjs

所以我想知道是否有办法跳过黄瓜数据表的某些行。让我们说这个例子(取自黄瓜网站)

Scenario Outline: feeding a suckler cow
  Given the cow weighs <weight> kg
  When we calculate the feeding requirements
  Then the energy should be <energy> MJ
  And the protein should be <protein> kg

  Examples:
    | weight | energy | protein |
    |    450 |  26500 |     215 |
    |    500 |  29500 |     245 |
    |    575 |  31500 |     255 |
    |    600 |  37000 |     305 |

我想跳过第二条数据线(重量:500 ..)。这可能吗?如果不是,我在哪里可以找到黄瓜标签并添加我自己的定制标签?我喜欢@ wipR2 @ wipR4这样的解决方案,其中R2和R4表示第2行和第4行。

1 个答案:

答案 0 :(得分:1)

您可以通过将示例表拆分为两个并在其中一个上使用@wip标记来完成此操作。然后使用negate wip标签运行测试 - 〜@ wip in'tags'选项以过滤黄瓜选项。

Examples:
    | weight | energy | protein |
    |    450 |  26500 |     215 |
    |    575 |  31500 |     255 |
    |    600 |  37000 |     305 |

  @wip
  Examples:
    | weight | energy | protein |
    |    500 |  29500 |     245 |