New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getLocationAbsUrl()
does not (always) return $location.absUrl()
#3185
Comments
No reason I can't use Basically, I think that (for Angular pages) I reported this mostly because (1) the documentation is wrong and/or (2) the behavior is unexpected (i.e. the returned value doesn't match the name). I wasn't sure though how it should be best handled. |
Introduced by commit 0e9c2f4, why don't you remove the lines added in |
@bbaia, the problem is not with fixing this (it's easy to change |
I say we deprecate it: add a |
Bug report
Protractor Version:
3.3.0
A relevant example test
Output from running the test
As seen in protractor.ts#L864-L869 and clientsidescripts.js#L651-L658, the return value of
getLocationAbsUrl()
is different whenangular.getTestability
is available and most importantly it is not theabsUrl
(in the$location
sense).Basically, when
angular.getTestability
is not available,$location.absUrl()
is returned (which is the expected behavior). But whenangular.getTestability
is available (i.e. since AngularJS v1.3.0-rc.0 - see angular.js#85880a6),$location.url()
is returned instead (because that is what$$testability
returns).This is the case since at least Protractor v1.1.1 (see 0e9c2f4).
Returning
$location.url()
from a function namedgetLocationAbsUrl()
isn't very intuitive, but this has been the case for a long time. For the next breaking release, it might be a good idea to expose two methods (on Protractor and$$testability
) to retrieve both the.url()
and the.absUrl()
, e.g.getLocationUrl()
andgetLocationAbsUrl()
.The text was updated successfully, but these errors were encountered: