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
{{ message }}
Repository navigation
[Regression] grabFromCurrentUrl() doesn't work with REST in v2.2 #3197
After upgrading to v2.2, grabFromCurrentUrl() does no longer return the url requested using sendGET() but instead errors after printing [LogicException] The page history is empty.. This change is not mentioned in the release notes.
Minimal example
The following example works v2.1 but fails in v2.2 acceptance.suite.yml:
I think that this is not even a bug, sendGET is a REST method, grabFromCurrentUrl is a method of PhpBrowser - mixing methods of REST module and connection module in one test is not documented and not recommended
I think that this is not even a bug,
sendGET is a REST method, grabFromCurrentUrl is a method of PhpBrowser - mixing methods of REST module and connection module in one test is not documented and not recommended
I'm actually not keen on mixing them, but the REST modules lacks an analogous method.
REST requests are no longer added to browser history, so PhpBrowser methods that are relying on history are not working.
What's the reason for this behavior? And why is a breaking change like this one not mentioned in the release notes?
And why is a breaking change like this one not mentioned in the release notes?
Yes, this was our fault. I think we had a discussion about history list for REST module but forgot to set it in the changelog. Sorry.
Basically REST module doesn't change history so can't access current URL.
There is a good reason for that. If you need to execute API requests inside PhpBrowser acceptance test you shouldn't have it to change request history. This way you can be sure that *currentUrl methods work only with currently opened web page.
REST modules lacks an analogous method.
Yes, there is no. Could you provide a use case for it? This way we could also agree on a patch to Codeception or provie an alternative way to solve your issue.
The grabFromCurrentUrl() is required for an actor method that verifies that a value in the JSON response equals the requested URL. This is a requirement of the API. This is what I assume to add the missing functionality.
Activity
Naktibalda commentedon Jun 9, 2016
I think that this is not even a bug,
sendGETis a REST method,grabFromCurrentUrlis a method ofPhpBrowser- mixing methods of REST module and connection module in one test is not documented and not recommendedNaktibalda commentedon Jun 9, 2016
REST requests are no longer added to browser history, so PhpBrowser methods that are relying on history are not working.
konstin commentedon Jun 9, 2016
I'm actually not keen on mixing them, but the REST modules lacks an analogous method.
What's the reason for this behavior? And why is a breaking change like this one not mentioned in the release notes?
DavertMik commentedon Jun 16, 2016
Yes, this was our fault. I think we had a discussion about history list for REST module but forgot to set it in the changelog. Sorry.
Basically REST module doesn't change history so can't access current URL.
There is a good reason for that. If you need to execute API requests inside PhpBrowser acceptance test you shouldn't have it to change request history. This way you can be sure that
*currentUrlmethods work only with currently opened web page.Yes, there is no. Could you provide a use case for it? This way we could also agree on a patch to Codeception or provie an alternative way to solve your issue.
konstin commentedon Jun 20, 2016
The grabFromCurrentUrl() is required for an actor method that verifies that a value in the JSON response equals the requested URL. This is a requirement of the API. This is what I assume to add the missing functionality.
konstin commentedon Aug 15, 2016
@DavertMik: Any progress here?
[REST] requests are added to browser history
konstin commentedon Aug 27, 2016
Thank you!