Skip to content

Commit

Permalink
docs(api): update examples to use async/await (#5081)
Browse files Browse the repository at this point in the history
  • Loading branch information
devoto13 authored and cnishina committed Mar 23, 2019
1 parent 1b2036e commit 7de6d85
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 199 deletions.
14 changes: 7 additions & 7 deletions lib/browser.ts
Expand Up @@ -747,8 +747,8 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
* the wrapped webdriver directly.
*
* @example
* browser.get('https://angularjs.org/');
* expect(browser.getCurrentUrl()).toBe('https://angularjs.org/');
* await browser.get('https://angularjs.org/');
* expect(await browser.getCurrentUrl()).toBe('https://angularjs.org/');
*
* @param {string} destination Destination URL.
* @param {number=} opt_timeout Number of milliseconds to wait for Angular to
Expand Down Expand Up @@ -894,9 +894,9 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
* Browse to another page using in-page navigation.
*
* @example
* browser.get('http://angular.github.io/protractor/#/tutorial');
* browser.setLocation('api');
* expect(browser.getCurrentUrl())
* await browser.get('http://angular.github.io/protractor/#/tutorial');
* await browser.setLocation('api');
* expect(await browser.getCurrentUrl())
* .toBe('http://angular.github.io/protractor/#/api');
*
* @param {string} url In page URL using the same syntax as $location.url()
Expand All @@ -922,8 +922,8 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
*
* @deprecated Please use `browser.getCurrentUrl()`
* @example
* browser.get('http://angular.github.io/protractor/#/api');
* expect(browser.getLocationAbsUrl())
* await browser.get('http://angular.github.io/protractor/#/api');
* expect(await browser.getLocationAbsUrl())
* .toBe('http://angular.github.io/protractor/#/api');
* @returns {Promise<string>} The current absolute url from
* AngularJS.
Expand Down

0 comments on commit 7de6d85

Please sign in to comment.