我有一个响应,它是一个数组,该数组的大小将不断变化,我需要为数组中的每个元素断言一个特定值。这就是我的压缩响应的样子:
{} JSON
kind: SecretList
apiVersion: v1{}
metadata
[]items{}
0{}
1{}
2{}
3{}
数组项的大小会改变,所以我想在循环中迭代它,我可以得到如下断言:
* assert response.items[0].status.conditions[4].type == 'Ready'
* assert response.items[1].status.conditions[4].type == 'Ready'
* assert response.items[2].status.conditions[4].type == 'Ready'
如何在空手道中完成此操作,因为我知道我可以使用 for 循环在 java 中完成此操作。有人可以帮忙吗?