diff --git a/lib/element.ts b/lib/element.ts index 05360cf89..bba6d985a 100644 --- a/lib/element.ts +++ b/lib/element.ts @@ -787,21 +787,7 @@ export class ElementArrayFinder extends WebdriverWebElement { export class ElementFinder extends WebdriverWebElement { parentElementArrayFinder: ElementArrayFinder; elementArrayFinder_: ElementArrayFinder; - - /** - * Access the underlying actionResult of ElementFinder. - * - * @alias element(locator).then(thenFunction) - * @param {function(webdriver.promise.Promise)} fn Function which takes - * the value of the underlying actionResult. - * @param {function(Error)} errorFn - * - * @returns {webdriver.promise.Promise} Promise which contains the results - * of evaluating fn. - */ - then(fn: Function, errorFn?: Function): wdpromise.Promise { - return null; - } + then: (fn: Function, errorFn?: Function) => wdpromise.Promise = null; constructor(public browser_: ProtractorBrowser, elementArrayFinder: ElementArrayFinder) { super(); @@ -813,6 +799,7 @@ export class ElementFinder extends WebdriverWebElement { // Only have a `then` method if the parent element array finder // has action results. if (this.parentElementArrayFinder.actionResults_) { + // Access the underlying actionResult of ElementFinder. this.then = (fn: (value: any) => {} | wdpromise.IThenable<{}>, errorFn?: (error: any) => any) => { return this.elementArrayFinder_.then((actionResults: any) => {