While using Karate framework for API testing I am trying to call a method in one feature file from other like this:
Scenario: Scenario description
* def util = callonce read('UtilFunctions.feature')
* def object =
"""
{"_yearsOffset":-20, "_daysOffset":0}
"""
* def customerAge = call util.getDate(object)
* print customerAge
The method just returns a date with a yearsOffset and daysOffset to move the date if desired.
When I execute this I have the following error:
not a callable feature or js function: [type: STRING, value: 30.03.2002]
Even though the value displayed in the log is correct and does what the function is asked to do, the execution fails.
Any guess? I am running out of ideas.