diff --git a/lib/browser.ts b/lib/browser.ts index 1acb8980f..f40db4a79 100644 --- a/lib/browser.ts +++ b/lib/browser.ts @@ -843,6 +843,21 @@ export class ProtractorBrowser { return this.get(href, opt_timeout); } + /** + * @see webdriver.WebDriver.refresh + * + * Makes a reload of the current page. + * + * Method calls location.reload function of browsers + */ + async reload() { + if (!await this.waitForAngularEnabled()) { + return this.driver.navigate().refresh(); + } + + return this.executeScriptWithDescription('return location.reload()', 'Protractor reload page'); + } + /** * Mixin navigation methods back into the navigation object so that * they are invoked as before, i.e. driver.navigate().refresh() diff --git a/lib/element.ts b/lib/element.ts index 1fafa5d2a..afb0e3d9c 100644 --- a/lib/element.ts +++ b/lib/element.ts @@ -235,8 +235,8 @@ export class ElementArrayFinder extends WebdriverWebElement { } /** - * Get an element within the ElementArrayFinder by index. The index starts at - * 0. Negative indices are wrapped (i.e. -i means ith element from last) + * Get an element within the ElementArrayFinder by index. The index starts at 0. + * Negative indices are wrapped (i.e. -i means ith element from last) * This does not actually retrieve the underlying element. * * @alias element.all(locator).get(index)