karatelabs/karate-npm

Request to support karate.properties configuration to allow pass the variables

SerenaIce opened this issue · 5 comments

I'm using this library and not able to find a way to pass the variables which are the response data from pre javascript functions calls.

ANd I'm trying to find a way to pass the response data to karate. karate.properties should be the way, but for now in this library we don't provide the ability for users to customize the command prefix.
I know we could add my requests in .feature files, but those requests are some previous steps which doesn't make sense to involve them to the test features.

I'm wondering whether you could please raise a PR to support '-DMY_VARIABLE=some_value' to the excutable command?

image

I'm not able to understand this at all. anyway I'll leave it open for some time in case someone is interested to contribute code

@ptrthomas , to simplify my question is that for now we could just pass env variables like --env, --port, and other limited ones. What if I want to pass other variables like -Dmy_variable into karate?

For now in the source code, it fixs the prefix part which only allows the user to config the config.dir, could not config the other properties. This part is what I'm asking.

@ptrthomas , btw, can I raise a PR to contribute on this?

karate is designed so that you can read any number of custom parameters from the system environment. this is explained in the documentation: https://github.com/karatelabs/karate#karate-configjs

if that does not fit your needs sure, we can consider a PR (after seeing how it solves the problem). for now I'm closing this as wontfix

I just realized the properties could be passed by jvm.args and then my problems should be solved. Thanks.