Open brice opened 5 years ago
Hi @brice
I'm pretty sure I'm facing the same issue, did you find a solution ?
Everytime the first request is working but then the others fail with that error :
The string '' is not valid json (Exception)
If I remove the first request then the 2nd one works...etc
[EDIT]
Ok it seems to come from the resetHeaders happening between each step. Kind of complicating things
Did you achieve to resolve it?
Not yet but still working on it. It might be something particular to my case : My firewall denies access to the API (because no more header) and send a 401 back. Then behatch (or something else) receives this 401 and considered it invalid because there's no content.
That's why I'm having this weird message : The string '' is not valid json (Exception)
I'm running into the same issue. I'm trying to login in the first step and use cookies in the response in subsequent steps within the same scenario, but due to resetHttpHeaders
all cookies are cleared between requests.
It looks like this was introduced in https://github.com/Behatch/contexts/issues/163, but shouldn't that have happened between scenarios instead of after every request? Is it intentional that we should never be able to share cookies between steps in the same scenario?
We are having the same issue. @vincentchalamon @sanpii any chance you might be able to help, as you both worked on https://github.com/Behatch/contexts/pull/164 ?
Hello to all,
Recently we upgraded behatch contexts from 2.5 version to 2.8.1 with several upgrade and i encounter a problem with my API's tests.
So basically i send a request to a page that connect an user then
Before the update this code use to work, after it the last context return this message :
Current response status code is 403, but 200 expected. (Behat\Mink\Exception\ExpectationException)
The function related to the context I am connected as user extends RawMinkContext and simply set a session ID in cookies.
During a debug session i saw that Cookies are emptied between sessions. So that explains the 403 response but why cookies are emptied? Did anyone encountered this after an update? Let me know if i have something to add.
I also write a question on StackOverflow