For example i do
* def fooresponse = call read('../getfooid.feature')
* def jsfunction= """(fooresponse){
console.log(fooresponse)}"""
is that possible? what is the recommended way to do it?
Thanks!
edit: fixing js syntax lol
Yes, this will work if the function has been defined after the variable fooresponse:
* def jsfunction = function(){ karate.log(fooresponse) }
Yes, you can pass a single argument to karate.call().
Keep in mind that the #(foo) substitution does NOT apply to pure-JS, explained here: https://github.com/intuit/karate#karate-expressions
I think once you read the above link AND if you are familiar with JS, you will know what to do.
Like this:
* def fun = function(){ karate.call('foo.feature', { bar: 'baz' }) }
call read(../something.feature) we can pass in arguments like so {id : '#(response.id)'}, i was wondering if i can use the same curly braces style with a js function. i went through the following documentation github.com/intuit/karate/blob/master/karate-demo/src/test/java/… but it doesnt really show an example of passing values like we do in a call read
karate.call()just like we do it withcall read