在 Scenario Outline 的示例中,单元格为空的地方未省略 json 键。需要进行哪些更改?

The json key is not being omitted where the cells are empty in examples of Scenario Outline .What change needs to be done?

以下是我用过的场景大纲。在第一行和第二行中,display_name 是空的,但仍在我的请求负载中发送 display_name。

Scenario Outline: Negative cases

  Given path '/api/check'
  And request {name: <name> , description: <description> , display_name: <display_name>}
  When method POST
  Then status <status>

示例:

| name     |   description    |    display_name              |status  | 
|""        |     "sasadss"    |                              | 400    |                                     
|"fddsd"   |      ""          |                              | 400    |
| "ccs"    |       ""         |      "disp "                 | 400    |

不幸的是 Cucumber Example 表发送了一个空字符串。您可以使用 table 作为替代,也可以将整个 JSON 放入一个列中,很多团队都这样做。

| value            |
| { some: 'json' } |

参考这个例子:https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/outline/examples.feature