From db4514507c3696728762a30d9b12ef7122ec0e3e Mon Sep 17 00:00:00 2001 From: Sammy Jelin Date: Mon, 30 Jan 2017 13:46:32 -0800 Subject: [PATCH] chore(browser): deprecate `browser.getLocationAbsUrl()`. (#3969) Closes https://github.com/angular/protractor/issues/3185 --- lib/browser.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/browser.ts b/lib/browser.ts index 81107a6..3524cd0 100644 --- a/lib/browser.ts +++ b/lib/browser.ts @@ -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()) @@ -1130,6 +1135,8 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver { * AngularJS. */ getLocationAbsUrl(): wdpromise.Promise { + logger.warn( + '`browser.getLocationAbsUrl()` is deprecated, please use `browser.getCurrentUrl` instead.'); return this.waitForAngular().then( () => this.executeScriptWithDescription( clientSideScripts.getLocationAbsUrl, 'Protractor.getLocationAbsUrl()', this.rootEl));