Skip to content

Commit

Permalink
angular-protractor: Additional signature for protractor.ElementArrayF…
Browse files Browse the repository at this point in the history
…inder.map
  • Loading branch information
Timothy Schubert authored and Timothy Schubert committed Jan 27, 2016
1 parent 7ce80da commit 17fa1e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion angular-protractor/angular-protractor-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,19 @@ function TestElementArrayFinder() {
elementArrayFinder.each(function(element: protractor.ElementFinder){
// nothing
});

stringPromise = elementArrayFinder.map(function(element: protractor.ElementFinder, index: number){
return 'abc';
})
});

stringPromise = elementArrayFinder.map<string>(function(element: protractor.ElementFinder, index: number): string {
return 'abc';
});

stringPromise = elementArrayFinder.map<string, webdriver.promise.Promise<string>>(function(element: protractor.ElementFinder, index: number): webdriver.promise.Promise<string> {
return element.getText();
});

elementArrayFinder = elementArrayFinder.filter(function(element: protractor.ElementFinder, index: number){
return element.getText().then((text: string) => {
return text === "foo";
Expand Down
1 change: 1 addition & 0 deletions angular-protractor/angular-protractor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ declare module protractor {
* of values returned by the map function.
*/
map<T>(mapFn: (element: ElementFinder, index: number) => T): webdriver.promise.Promise<T[]>;
map<T, T2>(mapFn: (element: ElementFinder, index: number) => T2): webdriver.promise.Promise<T[]>;

/**
* Apply a filter function to each element within the ElementArrayFinder. Returns
Expand Down

0 comments on commit 17fa1e5

Please sign in to comment.