空手道:如何在示例测试数据中发送整数

Karate: How to send an Integer in Examples test data

{
"address" : <address>
}

Examples:
| address |
| 00247 |

And match $.address == <address>

在上述情况下,我需要将 'address' 属性作为整数而不是字符串传递。 但是脚本将其作为 247 而不是 00247 传递。

actual: '247', expected: '00247', reason: not equal

您的帮助将不胜感激。谢谢!

包含在文档中:https://github.com/intuit/karate#scenario-outline-enhancements

进行此更改:

Scenario Outline:
* def body = { address: '#(address)' }
* And match $.address == address

Examples:
| address! |
| 00247    |