Reputation: 142
I need to pass response value from feature file to javascript function which is defined at config.js file for some computation purposes . Please help on how to call function which is present at config.js file?
Upvotes: 1
Views: 1296
Reputation: 58078
First refer to this: https://github.com/intuit/karate#javascript-functions
Just keep the JS as a *.js
file and re-use it from any feature or the karate-config.js
. Note that karate.call()
is possible from JS, including karate-config.js
and you can even call a feature file, not just JS.
Maybe you should also look at the example for karate.callSingle()
which is new in 0.7.0. As of the time of this post, version 0.7.0.RC5 is available to test.
Upvotes: 2