Is there a way to call a variable from karate-config.js that contains the reusable feature file path?

Viewed 112

I'm starting to use Karate to create API tests and i have multiple reusable feature files. So i have created variables in the the karate-config.js that contain each the reusable feature files paths but it does not work for me? Could anyone help me? Thanks in advance.

1 Answers

You just need to do this in karate-config.js :

config.reusableFeature = 'classpath:tools/reusableFeature.feature';

Then, in any feature, you can call this :

Then def response = call read(reusableFeature)
Related