You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There was a rush to introduce ssl support and we ended up with the syntax ssl enabled
Come to think of it there may be a few more similar needs in the future. An immediate need that comes to mind is setting a default time-out duration.
Would be great to get feedback on the following proposals. I'd like to "unify" the means to set config within the existing keywords as far as possible. One principle is to not bloat the syntax.
using set, and Karate will introduce a config special variable. Downside is that the name config could tend to be used as a variable name by users. Also, extra code needs to be added to "detect" a property change
* set config.ssl.enabled = true
use a built in function and pass json, quite generic. hmm, there's no way to just execute a block of JS code other than assert, interesting. I think I'll keep it that way and restrict the extensibility entry-point of Karate to the call keyword
* assert configure({ sslEnabled: true })
# if we decide to introduce an 'execute' keyword, but 'side-effects' are bad :P* execute configure({ sslEnabled: true }}
# maybe one keyword for all 'configure' needs would be a good solution* configure { sslEnabled: true }
# one nice thing is possibly multiple config in one operation* configure { sslEnabled: true, timeOut: 60 }
One more idea. The way headers works today is not aligned with the rest of Karate, it is a "magic variable" and a user is expected to modify this at the start of a script. There is a significant risk that users would use the name headers for other variables.
I propose to unify this into configuration as well, and it seems to make sense. Now, since the "headersFunction" is a non-primitive, that too a JS function, forcing it into a JSON envelope does not sound right. So how about this, and assume we have one configure keyword.
There was a rush to introduce ssl support and we ended up with the syntax
ssl enabled
Come to think of it there may be a few more similar needs in the future. An immediate need that comes to mind is setting a default time-out duration.
Would be great to get feedback on the following proposals. I'd like to "unify" the means to set config within the existing keywords as far as possible. One principle is to not bloat the syntax.
set
, and Karate will introduce aconfig
special variable. Downside is that the nameconfig
could tend to be used as a variable name by users. Also, extra code needs to be added to "detect" a property change* set config.ssl.enabled = true
assert
, interesting. I think I'll keep it that way and restrict the extensibility entry-point of Karate to thecall
keywordconfigure
function* call configure { sslEnabled: true, timeOut: 60 }
The text was updated successfully, but these errors were encountered: