在afterScenario中使用场景响应的最佳方法是什么?
Background:
* configure afterScenario = function(response){if(response.key){ karate.log('key is present');} else{karate.log('key is not present');} }
Scenario: get all users
Given path 'users'
When method get
Then status 200
答案 0 :(得分:2)
不带输入参数的Try函数
* configure afterScenario = function(){if(response.key){ karate.log('key is present');} else{karate.log('key is not present');} }
如果response
变量可用于钩子,则此方法应该起作用。