user14146382
user14146382

Reputation: 98

How to pass karate.scenario.failed to another scenario

I currently have my afterScenerio for my scenarios configured as such

configure afterScenario = karate.call(helperFolder + 'jama/updateJama.feature', {id: jamaId, failed: karate.scenario.failed}) 

Inside my updateJama.feature, I want to be able to update results based on whether the calling scenario passes or fails. The issue is, "failed" is always true inside updateJama.feature. I'm assuming that this is because karate.scenrio.failed is being evaluated for the called scenario and not the calling scenario. So, what is the correct way to achieve this?

Upvotes: 1

Views: 461

Answers (1)

user14146382
user14146382

Reputation: 98

I was able to get it working by using this:

* configure afterScenario =  function(){ karate.call(helperFolder + 'jama/updateJama.feature', {id: jamaId, failed: karate.scenario.failed}); } 

Upvotes: 1

Related Questions