You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had an interesting use case reported in #51 today: the value of baseUrl setting in browser configuration isn't applied when $this->getSession()->visit('/some/relative/path') call is made.
The person was most likely working with Behat/MinkExtension before and expected similar to happen here as well. Of course this won't work in this library due absence of Gherkin or similar language that later would be transformed into actual PHP code. Here PHP code is written directly.
If there a need, then maybe the prepareUrl($url) protected method needs to be added to the test case class, that would:
parse given url
if it's a relative url, then prepend value from baseUrl setting in browser configuration
if it's an absolute url, then return as is
We can actually take these methods from MinkExtension itself.
I'm not sure if this is feature, that will be widely adopted among library users though.
The text was updated successfully, but these errors were encountered:
Note that $this->getSession()->visit('/some/relative/path') does not apply the base path either in MinkExtension. There is 2 ways to have the base path applied:
Yes, separate visit method, that would translate relative paths was my 2nd idea, but I wasn't sure if that won't create any more confusion knowing that $this->getSession() provides direct session access.
@parhamdoustdar, if you would like, then you can send PR for that feature (described above).
I've had an interesting use case reported in #51 today: the value of
baseUrl
setting in browser configuration isn't applied when$this->getSession()->visit('/some/relative/path')
call is made.The person was most likely working with Behat/MinkExtension before and expected similar to happen here as well. Of course this won't work in this library due absence of Gherkin or similar language that later would be transformed into actual PHP code. Here PHP code is written directly.
If there a need, then maybe the
prepareUrl($url)
protected method needs to be added to the test case class, that would:baseUrl
setting in browser configurationWe can actually take these methods from MinkExtension itself.
I'm not sure if this is feature, that will be widely adopted among library users though.
The text was updated successfully, but these errors were encountered: