export class Selector { private queries : Array < string > = new Array < string > ( ) ; public ByText ( text ) { if ( driver . isAndroid ) { this . queries . push ( `.text("${ text }")` ) ; } else { this . queries . push ( `label LIKE '${ text }'` ) ; } return this ; } public ByContainedText ( text ) { if ( driver . isAndroid ) { this . queries . push ( `.textContains("${ text }")` ) ; } else { this . queries . push ( `label CONTAINS '${ text }'` ) ; } return this ; } public build ( ) { if ( driver . isAndroid ) { return `android=new UiSelector()${ this . queries . join ( '' ) }` ; } return `-ios predicate string:${ this . queries . join ( ' AND ' ) }` ; } }