I have a nodejs script which is being used to encrypt a plain text password using npm-forge / forge() function. Next I intend to call this nodejs file during my Karate feature execution to generate the encrypted password in run-time and further make a login POST API call with it.
The Login POST API call works just fine on it's own, but the call() fails with the exception : org.graalvm.polyglot.PolyglotException: ReferenceError: "require" is not defined
* def myFun = read('encryptPass.js')
* def responseData = call myFun
* print responseData
Reponse : org.graalvm.polyglot.PolyglotException: ReferenceError: "require" is not defined