-
Notifications
You must be signed in to change notification settings - Fork 203
Conversation
…hem when reset/restart session. They are on Behat\Mink\Driver\BrowserKitDriver and there is no way to get them.
The rest-context is a huge mistake altogether. Mink is not a REST client (browsers are not REST clients either). There is no point using the Mink driver to perform the REST API calls. It is the wrong tool for the job. |
@stof what would be your preferred method of testing a restful API? |
use theWebApiContext from Behat's CommonContexts repo for Behat 2.5 and the WebApiExtension or the RestExtension for Behat 3 (they should get merged together once I get some time to work on this again). They are all using an HTTP client (Buzz or Guzzle) to perform API calls rather than using Mink |
The current main problem of In order to go in this direction, I proposed this PR: |
@stof totally agree with you... but it's a question of reality vs pragmatism. The merge of this PR would be very helpful to help making a smooth transition to modern REST extensions. |
👍 |
ping @sanpii for dev-behat-3.x? |
This PR is for the behat-2.x branch. I can also embed in master (except if I miss something). |
@sanpii ok, would be very helpful if you merge it today. |
@sanpii just tell us, we can make a PR for another branch if you will. |
Done, in behat-2.x and master. |
👍 |
Thanks. :) |
With
"behat/mink-browserkit-driver": "~1.2@dev"
and this change https://github.com/Behat/MinkBrowserKitDriver/pull/53.Headers setted here are stored on
Behat\Mink\Driver\BrowserKitDriver
and no more on client.BTW, when we try to make a request from
behatch/rest-context
, there is no headers given to the request (since it not usesvisit
method ofBehat\Mink\Driver\BrowserKitDriver
).I add a stack of headers on this context but a getter
getServerParameters
onBehat\Mink\Driver\BrowserKitDriver
would be better imho. Any idea about this ? ping @stof @sanpiips: This PR is only for users which uses
behat/mink-browserkit-driver: ~1.2@dev
so we should not merge it NOW (before mink-browserkit-driver is released)