I saw in the doc that it it possible to define a function in the background part and execute it after each scenario. see: https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/hooks/hooks.feature
But i need to send args to this function and don't find any solutions...
In the doc:
* configure afterScenario =
"""
function(){
var info = karate.info;
karate.log('after', info.scenarioType + ':', info.scenarioName);
karate.call('after-scenario.feature', { caller: info.featureFileName });
}
"""
What i would like to do:
utils/js/afterFunc.js:
function fn(args){
karate.log('after', args.msg);
}
myTest.feature:
* configure afterScenario = read('classpath:utils/js/afterFunc.js') {msg: 'Hello !'}