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

Commit 7de6d85

Browse files
devoto13cnishina
authored andcommitted
docs(api): update examples to use async/await (#5081)
1 parent 1b2036e commit 7de6d85

File tree

4 files changed

+177
-199
lines changed

4 files changed

+177
-199
lines changed

lib/browser.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,8 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
747747
* the wrapped webdriver directly.
748748
*
749749
* @example
750-
* browser.get('https://angularjs.org/');
751-
* expect(browser.getCurrentUrl()).toBe('https://angularjs.org/');
750+
* await browser.get('https://angularjs.org/');
751+
* expect(await browser.getCurrentUrl()).toBe('https://angularjs.org/');
752752
*
753753
* @param {string} destination Destination URL.
754754
* @param {number=} opt_timeout Number of milliseconds to wait for Angular to
@@ -894,9 +894,9 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
894894
* Browse to another page using in-page navigation.
895895
*
896896
* @example
897-
* browser.get('http://angular.github.io/protractor/#/tutorial');
898-
* browser.setLocation('api');
899-
* expect(browser.getCurrentUrl())
897+
* await browser.get('http://angular.github.io/protractor/#/tutorial');
898+
* await browser.setLocation('api');
899+
* expect(await browser.getCurrentUrl())
900900
* .toBe('http://angular.github.io/protractor/#/api');
901901
*
902902
* @param {string} url In page URL using the same syntax as $location.url()
@@ -922,8 +922,8 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
922922
*
923923
* @deprecated Please use `browser.getCurrentUrl()`
924924
* @example
925-
* browser.get('http://angular.github.io/protractor/#/api');
926-
* expect(browser.getLocationAbsUrl())
925+
* await browser.get('http://angular.github.io/protractor/#/api');
926+
* expect(await browser.getLocationAbsUrl())
927927
* .toBe('http://angular.github.io/protractor/#/api');
928928
* @returns {Promise<string>} The current absolute url from
929929
* AngularJS.

0 commit comments

Comments
 (0)