karate
karate copied to clipboard
responseStatus not visible from functions created using callSingle or callOnce
expected: js functions created from callOnce or callSingle should be able to see responseStatus
actual: responseStatus is not defined from those functions callOnce in feature background even breaks local js function ability to view responseStatus
workaround:
- Use karate.call instead of karate.callSingle
versions effected: 1.3.0 -> 1.4.0
e.g.
replace config = karate.callSingle('classpath:my.feature', config);
with config = karate.call('classpath:my.feature', config);
minimal example: https://github.com/ericdriggs/karate-responseStatus-missing-callSingle-callOnce/tree/main
yet to investigate. as a workaround for these JS cases I think you are aware that JS has issues with these edge cases, especially callSingle and anyone is welcome to dive in and contribute a PR
- try
karate.get('responseStatus')
- also explore if the new
karate.response
JS API helps: https://github.com/karatelabs/karate/issues/1962
Hi Sir, I think I found a solution a little different to the issue #1962 do, can you assign this to me so that I get a PR?
@Songshen1996 consider this assigned to you. feel free to submit a PR
thanks @Songshen1996 for the fix !
1.5.0 released