Skip to content

Commit

Permalink
chore(browser): deprecate browser.getLocationAbsUrl(). (#3969)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjelin authored Jan 30, 2017
1 parent 9327020 commit db45145
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 db45145

Please sign in to comment.