make sure url remains set even when entering called features
See original GitHub issuemoving this comment into a new ticket for clarity: https://github.com/karatelabs/karate/issues/2202#issuecomment-1338690477
there was confusion about whether a url
should “reset” when entering a “called” feature. I personally may have lost the original intent during some tricky refactoring and discussions
previous related threads: #2054 and #1990
but I have a couple more questions - there are 2 cases, when a call happens in “shared (global) scope” or “isolated (local) scope”: https://github.com/karatelabs/karate#shared-scope
my vote is: the url
should be reset if the call is “isolated scope” because the intent is to call “with a clean slate”
and the url
should behave just like it would in a single feature otherwise. which is to NOT reset when a call boundary is crossed
Issue Analytics
- State:
- Created 9 months ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
I actually looked for a
configure
option as my first solution. I think that would fit well with what the framework already does.thanks all for your comments. this helps a lot
for reference - I don’t know when I added this to the docs, but it could be after this confusion started to emerge.
https://github.com/karatelabs/karate#call
anyway, I will acknowledge the need to change or mis-understandings on my part and move forward.
can we all agree that only the
url
is “carried across” the call boundary. in other words, headers and path and parameters will be “lost”.we can take a decision to never reset the
url
within aScenario
no matter how many calls it goes through. one advantage of this approach is that it is easy to explain and there is no confusionthat said. I have a new suggestion. let me know if this makes sense:
so we introduce a new
configure
key. if you set it - it will be used throughout your tests, unless the user uses theurl
keyword !!how does that sound, that seems to me that it is the best solution for all the issues being discussed. we already have
configure headers
so it is not a big stretchlet me know !!