需要快速帮助:如何对我们得到的输出进行数据库断言,例如 null、not null、contains、assert using karate frmework

Need quick help : How to do database assertions for output that we got like null, not null, contains, assert using karate frmework

我有 运行 数据库查询,我得到以下 json 响应

*def dataset = databaseMethods.runJsonQuery(结果,查询) 然后打印数据集

输出: [{"账号:"123","Key":"9989"},{"账号:"345","Key":"9889"},{"账号:"569","Key": "9989"}]

现在我想为每个和输出中的值做 notnull、null、present 等断言

例如:我在下面写了一个但它不起作用,我想我做错了你能纠正我并让我知道我如何区分断言并且我已经阅读了文档但仍然对使用感到困惑

则匹配数据集包含[账号:'notnull']

我必须做的检查点:帐户号不能为空,密钥不能为空

JSON 键中的特殊字符需要特殊处理:

Then match dataset contains { 'Account no': '#notnull', Key: '#string' }

另请阅读:https://github.com/intuit/karate#schema-validation