@Peter I realize this is an old post, but I was wondering if you could possibly forward a working example of the karate-base and karate-config usage.
I am looking to setup a current project in a base root and service specific classpath structure, but would like to follow your recommended approach when implementing this base config.
The way I currently read the above and documentation is that it appears as though I would have to implement a config merge at the beginning of every feature run...is that correct?
Our base config would hold all environmental values based on the karate.env value while our service specific config would evaluate test data for that specific service as items like username, password, host header values, and other data items.
While I can output each config as a json object, the merge does not appear to work as detailed.
Background: Authentication PreRequisites
* def DataSourceRow = 4
* def configUpdate = call read('../../../service-config.js') {rowNum: '#(DataSourceRow)'}
resulting in
44: karate.log('serviceConfig is:', var_serviceConfig);
45: config = karate.merge(config, var_serviceConfig());
46: karate.log('karate config is now:', config);
47:
48: return var_serviceConfig;
49: }
<<<<
org.graalvm.polyglot.PolyglotException: ReferenceError: "config" is not defined
- <js>.teamConfig(Unnamed:45)
Trying the same in a feature file results in an error as well
Background: Authentication PreRequisites
* def DataSourceRow = 4
* def configUpdate = callonce read('../../../service-config.js') {rowNum: '#(DataSourceRow)'}
* print configUpdate
* config = karate.merge(config, configUpdate())
resulting in
* config = karate.merge(config, configUpdate())
no step-definition method match found for: config = karate.merge(config, configUpdate())