问题
What is the best way to use the response of scenario in 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
回答1:
Try function without input params
* configure afterScenario = function(){if(response.key){ karate.log('key is present');} else{karate.log('key is not present');} }
if the response
variable available for hooks this should work.
来源:https://stackoverflow.com/questions/55112948/karate-how-to-use-response-of-scenario-in-afterscenario