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

Commit 8d2fc07

Browse files
authored
chore(browser): deprecate browser.getLocationAbsUrl(). (#3969)
Closes #3185
1 parent 995b146 commit 8d2fc07

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/browser.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1120,8 +1120,13 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
11201120
}
11211121

11221122
/**
1123-
* Returns the current absolute url from AngularJS.
1123+
* Deprecated, use `browser.getCurrentUrl()` instead.
11241124
*
1125+
* Despite its name, this function will generally return `$location.url()`, though in some
1126+
* cases it will return `$location.absUrl()` instead. This function is only here for legacy
1127+
* users, and will probably be removed in Protractor 6.0.
1128+
*
1129+
* @deprecated Please use `browser.getCurrentUrl()`
11251130
* @example
11261131
* browser.get('http://angular.github.io/protractor/#/api');
11271132
* expect(browser.getLocationAbsUrl())
@@ -1130,6 +1135,8 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
11301135
* AngularJS.
11311136
*/
11321137
getLocationAbsUrl(): wdpromise.Promise<any> {
1138+
logger.warn(
1139+
'`browser.getLocationAbsUrl()` is deprecated, please use `browser.getCurrentUrl` instead.');
11331140
return this.waitForAngular().then(
11341141
() => this.executeScriptWithDescription(
11351142
clientSideScripts.getLocationAbsUrl, 'Protractor.getLocationAbsUrl()', this.rootEl));

0 commit comments

Comments
 (0)