I have just upgraded my automation system from Karate v0.9.6 => v1.2.
I am seeing some unexpected behavior in one of my tests related to features called from within other features.
My test makes some Rest API calls to create an object in the system under test, and waits for its state to change. I use a retry until call to poll for the change:
* def active_pat = "$..[?(@.active =~ /^true/i)]"
* configure retry = { count: 3, interval: 3000 }
Given url server
And path monitoringProfile
And param hms_id = hms_id
And param states = ALL_STATES
And retry until (karate.jsonPath(response.response.states, active_pat).length != 0 || response.response.changing == true)
When method GET
Then status 200
I also have an afterScenario function setup to capture some data if the state does not change:
* configure afterScenario = function(){ karate.call(getRuleHistory, {"access_token": access_token, "start_time": armed_home.ts}); karate.call(getAuditEvents, {"access_token": access_token, "hms_id": hms_id}); }
When the retry is exceed, my getRuleHistory feature is called, it sets up some parameters of its own, and makes a GET call:
* def util_parameters = {"startTime": "#(start_time)", "endTime": "#(end_time)", "timezone": "#(timezone)"}
Given url server
And path rulesHistoryEndpoint
And params util_parameters
When method GET
The problem is in this second GET call, all of the parameters from the request in the calling feature are included as well as the new ones specified in the called feature!
Also, the original retry until condition is still in effect...
Is this expected for the params and retry until condition to persist? If so, how can I clear / reset them in my called feature?