Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit cbdfc3d

Browse files
committed
chore(browser): deprecate browser.getLocationAbsUrl().
Closes #3185
1 parent 6a4dc7a commit cbdfc3d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/browser.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,13 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
928928
}
929929

930930
/**
931-
* Returns the current absolute url from AngularJS.
931+
* Deprecated, use `browser.getCurrentUrl()` instead.
932932
*
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()`
933938
* @example
934939
* browser.get('http://angular.github.io/protractor/#/api');
935940
* expect(browser.getLocationAbsUrl())
@@ -938,6 +943,9 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
938943
* AngularJS.
939944
*/
940945
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`.');
941949
this.waitForAngular();
942950
return this.executeScriptWithDescription(
943951
clientSideScripts.getLocationAbsUrl, 'Protractor.getLocationAbsUrl()', this.rootEl);

0 commit comments

Comments
 (0)