validation - 当空手道 jsonpath 的数组为空时,验证失败
问题描述
问题在于验证。在这里,当我运行测试时,两个验证都通过了,但我可以在响应中看到它们,价格为 null ( price[]
)。我的疑问是originalPrice
当价格数组本身为空时它是如何发现的。
在验证中,我有以下内容:
And matchResponse.data.abc[].price[] == '#array'
和 match Response.data.abc[].price[].originalPrice == '#present'
。
Sample response:
"data": {
"abc": [
"abcnumber":001,
"price": [],
]}
解决方案
推荐阅读
- python - Scikit-Learn LinearReression 在非常简单的数据集上表现不佳,
- git - gitlab-runner 或 Docker 默认缓存 /builds 目录吗?
- time-complexity - 大 O 时间复杂度简化
- javascript - 如何设置 currentTime 在
- javascript - 无法让 request() 在函数内工作
- git - 如何撤消几次提交之前发生的合并,同时保留那些后来的提交
- c - 为什么 sin_family 成员存在?
- mysql - MySQL 根据 join 生成条件结果
- reactjs - 使用 REDUX 设置存储值
- node.js - “抛出错误”错误消息不断出现