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

chore(browser): deprecate browser.getLocationAbsUrl(). #3969

Merged
merged 1 commit into from
Jan 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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