Skip to content

Commit

Permalink
chore(browser): deprecate browser.getLocationAbsUrl().
Browse files Browse the repository at this point in the history
Closes #3185
  • Loading branch information
sjelin committed Jan 27, 2017
1 parent 588901c commit 0d551d9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,13 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
}

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

0 comments on commit 0d551d9

Please sign in to comment.