从 csv 加载数据时不考虑空手道嵌入式表达式

Karate Embedded Expression not being considered when data is loaded form csv

在上述场景中,我使用基于表达式的嵌入式表达式,在构造请求负载时忽略空值。 (注意:不是数组和 JSON)但是当我使用 .csv 文件做同样的事情时,数据不会被用于构建请求负载。

我已经在下面发布了所有详细信息link。

https://gist.github.com/Avinash9969/31c7709ba1344410ce098620dcbc06f0

请推荐

CSV 选项不会自动将空白转换为 null,它们将是空字符串。您需要执行转换步骤才能使 ##() 标记起作用:

Background:
* def emptyToNull = function(x){ karate.forEach(x, function(k, v){ if (v == '') x[k] = null }); return x }

Scenario Outline:
* def row = emptyToNull(__row)
# now use row.col as embedded expressions

Examples:
| read('data.csv') |