1
1
import { protractor } from './ptor' ;
2
+ import { ElementFinder } from './element' ;
2
3
let webdriver = require ( 'selenium-webdriver' ) ;
3
4
4
5
/* globals browser */
@@ -167,7 +168,7 @@ export class ExpectedConditions {
167
168
* @return {!function } An expected condition that returns a promise
168
169
* representing whether the element is clickable.
169
170
*/
170
- elementToBeClickable ( elementFinder : any ) : Function {
171
+ elementToBeClickable ( elementFinder : ElementFinder ) : Function {
171
172
return this . and (
172
173
this . visibilityOf ( elementFinder ) ,
173
174
elementFinder . isEnabled . bind ( elementFinder ) ) ;
@@ -188,7 +189,7 @@ export class ExpectedConditions {
188
189
* @return {!function } An expected condition that returns a promise
189
190
* representing whether the text is present in the element.
190
191
*/
191
- textToBePresentInElement ( elementFinder : any , text : string ) : Function {
192
+ textToBePresentInElement ( elementFinder : ElementFinder , text : string ) : Function {
192
193
var hasText = ( ) => {
193
194
return elementFinder . getText ( ) . then ( ( actualText : string ) : boolean => {
194
195
return actualText . indexOf ( text ) > - 1 ;
@@ -212,7 +213,7 @@ export class ExpectedConditions {
212
213
* @return {!function } An expected condition that returns a promise
213
214
* representing whether the text is present in the element's value.
214
215
*/
215
- textToBePresentInElementValue ( elementFinder : any , text : string ) : Function {
216
+ textToBePresentInElementValue ( elementFinder : ElementFinder , text : string ) : Function {
216
217
var hasText = ( ) => {
217
218
return elementFinder . getAttribute ( 'value' ) . then (
218
219
( actualText : string ) : boolean => {
@@ -307,7 +308,7 @@ export class ExpectedConditions {
307
308
( actualUrl : string ) : boolean => { return actualUrl === url ; } ) ;
308
309
} ;
309
310
}
310
-
311
+
311
312
/**
312
313
* An expectation for checking that an element is present on the DOM
313
314
* of a page. This does not necessarily mean that the element is visible.
@@ -323,7 +324,7 @@ export class ExpectedConditions {
323
324
* @return {!function } An expected condition that returns a promise
324
325
* representing whether the element is present.
325
326
*/
326
- presenceOf ( elementFinder : any ) : Function {
327
+ presenceOf ( elementFinder : ElementFinder ) : Function {
327
328
return elementFinder . isPresent . bind ( elementFinder ) ;
328
329
} ;
329
330
@@ -341,7 +342,7 @@ export class ExpectedConditions {
341
342
* @return {!function } An expected condition that returns a promise
342
343
* representing whether the element is stale.
343
344
*/
344
- stalenessOf ( elementFinder : any ) : Function {
345
+ stalenessOf ( elementFinder : ElementFinder ) : Function {
345
346
return this . not ( this . presenceOf ( elementFinder ) ) ;
346
347
}
347
348
@@ -361,7 +362,7 @@ export class ExpectedConditions {
361
362
* @return {!function } An expected condition that returns a promise
362
363
* representing whether the element is visible.
363
364
*/
364
- visibilityOf ( elementFinder : any ) : Function {
365
+ visibilityOf ( elementFinder : ElementFinder ) : Function {
365
366
return this . and (
366
367
this . presenceOf ( elementFinder ) ,
367
368
elementFinder . isDisplayed . bind ( elementFinder ) ) ;
@@ -381,7 +382,7 @@ export class ExpectedConditions {
381
382
* @return {!function } An expected condition that returns a promise
382
383
* representing whether the element is invisible.
383
384
*/
384
- invisibilityOf ( elementFinder : any ) : Function {
385
+ invisibilityOf ( elementFinder : ElementFinder ) : Function {
385
386
return this . not ( this . visibilityOf ( elementFinder ) ) ;
386
387
}
387
388
@@ -398,7 +399,7 @@ export class ExpectedConditions {
398
399
* @return {!function } An expected condition that returns a promise
399
400
* representing whether the element is selected.
400
401
*/
401
- elementToBeSelected ( elementFinder : any ) : Function {
402
+ elementToBeSelected ( elementFinder : ElementFinder ) : Function {
402
403
return this . and (
403
404
this . presenceOf ( elementFinder ) ,
404
405
elementFinder . isSelected . bind ( elementFinder ) ) ;
0 commit comments