Reputation: 547
How can I set values in karate-config.js in a feature? Ex: I create a cat in one of my features and I would like to put this id in karate-config.js in the value named catId
var config = {
env: env,
baseUrl: 'blabla.com',
catId: 'put id here'
}
Upvotes: 1
Views: 1104
Reputation: 58058
It is bad practice to expect a feature to depend on some other feature. Or think of it this way - if you skip a feature (using code-commenting, tags etc), it should not cause some other feature to fail.
So Karate does not support updating anything set via karate-config.js
by default.
That said, refer to the doc on "hooks", specifically the karate.callSingle()
method - which may be the answer you are looking for.
Upvotes: 2