空手道 运行 场景 outline/examples 并行时如何保存每个响应
Karate How to save each response when running scenario outline/examples in parallel
鉴于我有这样的东西:
Scenario Outline: test
Given request {"movie":"<title>","age":"<age>"}
When method post
Then status 201
Then match response contains {"something": 52.0833} || {"something": 27.160493}
Examples:
| title | age
| test | 30
| test1 | 40
现在我想验证给定的响应 52.0833 和 27.160493 是否存在于每个响应正文中。
鉴于这些是 运行 并行的,空手道是否有办法将两个请求保存到一个变量或做我上面尝试过的事情,即使用 ||运算符或 'either'。
这会起作用,请参考文档:https://github.com/intuit/karate#self-validation-expressions
Given def response = { something: 52.0833 }
Then match response contains { something : '#? _ == 52.0833 || _ == 27.160493' }
您永远不应该考虑将回复保存到文件中,总是当场验证然后继续。
鉴于我有这样的东西:
Scenario Outline: test
Given request {"movie":"<title>","age":"<age>"}
When method post
Then status 201
Then match response contains {"something": 52.0833} || {"something": 27.160493}
Examples:
| title | age
| test | 30
| test1 | 40
现在我想验证给定的响应 52.0833 和 27.160493 是否存在于每个响应正文中。
鉴于这些是 运行 并行的,空手道是否有办法将两个请求保存到一个变量或做我上面尝试过的事情,即使用 ||运算符或 'either'。
这会起作用,请参考文档:https://github.com/intuit/karate#self-validation-expressions
Given def response = { something: 52.0833 }
Then match response contains { something : '#? _ == 52.0833 || _ == 27.160493' }
您永远不应该考虑将回复保存到文件中,总是当场验证然后继续。