This repository was archived by the owner on Jul 29, 2024. It is now read-only.
File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -928,8 +928,13 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
928
928
}
929
929
930
930
/**
931
- * Returns the current absolute url from AngularJS .
931
+ * Deprecated, use `browser.getCurrentUrl()` instead .
932
932
*
933
+ * Dispite its name, this function will generally return `$location.url()`, though in some
934
+ * cases it will return `$location.absUrl()` instead. This function is only here for legacy
935
+ * users, and will probably be removed in Protractor 6.0.
936
+ *
937
+ * @deprecated Please use `browser.getCurrentUrl()`
933
938
* @example
934
939
* browser.get('http://angular.github.io/protractor/#/api');
935
940
* expect(browser.getLocationAbsUrl())
@@ -938,6 +943,9 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
938
943
* AngularJS.
939
944
*/
940
945
getLocationAbsUrl ( ) : wdpromise . Promise < any > {
946
+ logger . warn (
947
+ 'You are using `browser.getLocationAbsUrl()`, with is deprecated, inaccurately named, ' +
948
+ 'inconsistent, and needlessly queries angular.js. Please use `browser.getCurrentUrl`.' ) ;
941
949
this . waitForAngular ( ) ;
942
950
return this . executeScriptWithDescription (
943
951
clientSideScripts . getLocationAbsUrl , 'Protractor.getLocationAbsUrl()' , this . rootEl ) ;
You can’t perform that action at this time.
0 commit comments