Closed mbittner closed 7 years ago
So it seems that the "Then the response status code should not be 200" do not use the same response object used by the When I request step.
The "When I request" step is define by your extension and the "response status code" is defined by the MinkContext.
Is there a way to use both step in the same scnenario?
That might be tricky. I haven't looked into Mink, so I'm not sure if it would be possible to share responses. That would require that both extensions use the same library for requests / responses though. That might actually be the case already for all I know.
imbo/behat-api-extension
has a step quite similar to the Then
-step you are using though:
Then the response code is :code
Then the response code is not :code
imbo/behat-api-extension
uses Guzzle 6, which uses PSR-7 interfaces for requests and responses, so if Mink uses a library which also uses PSR-7 the exchange of the response should be doable.
It seems Mink itself doesn't do the actual HTTP requests, but simply forwards them to the driver in use, which might not even be written in PHP, so there isn't a feasible way to do what you're asking.
Closing this issue for now.
The "Then" step in my scenario erros out saying "Unable to access the response before visiting a page". Installed it today, with composer "imbo/behat-api-extension": "^2.0",
Any idea what can cause this? I seem pretty inline with the documentation, I set my body/header prior to the When step that should actually do the HTTP GET.
Here is my scenario: