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

Commit

Permalink
and the rest of element
Browse files Browse the repository at this point in the history
  • Loading branch information
cnishina committed Nov 16, 2018
1 parent 86b4dcd commit 1ef106d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/element.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {By, error as wderror, promise as wdpromise, WebElement, WebElementPromise} from 'selenium-webdriver';
import {By, error as wderror, WebElement, WebElementPromise} from 'selenium-webdriver';

import {ElementHelper, ProtractorBrowser} from './browser';
import {isProtractorLocator, Locator} from './locators';
Expand Down Expand Up @@ -81,7 +81,7 @@ let WEB_ELEMENT_FUNCTIONS = [
export class ElementArrayFinder extends WebdriverWebElement {
constructor(
public browser_: ProtractorBrowser, public getWebElements: () => Promise<WebElement[]> = null,
public locator_?: any, public actionResults_: wdpromise.Promise<any> = null) {
public locator_?: any, public actionResults_: Promise<any> = null) {
super();

// TODO(juliemr): might it be easier to combine this with our docs and just
Expand Down Expand Up @@ -540,7 +540,7 @@ export class ElementArrayFinder extends WebdriverWebElement {
* an array of ElementFinders represented by the ElementArrayFinder.
*/
then<T>(
fn?: (value: ElementFinder[]|any[]) => T | wdpromise.IThenable<T>,
fn?: (value: ElementFinder[]|any[]) => T | Promise<T>,
errorFn?: (error: any) => any): Promise<T> {
if (this.actionResults_) {
return this.actionResults_.then(fn, errorFn) as Promise<T>;
Expand Down Expand Up @@ -798,8 +798,8 @@ export class ElementFinder extends WebdriverWebElement {
parentElementArrayFinder: ElementArrayFinder;
elementArrayFinder_: ElementArrayFinder;
then?:
(fn: (value: any) => any | wdpromise.IThenable<any>,
errorFn?: (error: any) => any) => wdpromise.Promise<any> = null;
(fn: (value: any) => any | Promise<any>,
errorFn?: (error: any) => any) => Promise<any> = null;

constructor(public browser_: ProtractorBrowser, elementArrayFinder: ElementArrayFinder) {
super();
Expand All @@ -813,7 +813,7 @@ export class ElementFinder extends WebdriverWebElement {
if (this.parentElementArrayFinder.actionResults_) {
// Access the underlying actionResult of ElementFinder.
this.then =
(fn: (value: any) => any | wdpromise.IThenable<any>, errorFn?: (error: any) => any) => {
(fn: (value: any) => any | Promise<any>, errorFn?: (error: any) => any) => {
return this.elementArrayFinder_.then((actionResults: any) => {
if (!fn) {
return actionResults[0];
Expand Down

0 comments on commit 1ef106d

Please sign in to comment.