const SELECTORS = { ANDROID_LISTVIEW : '//android.widget.ListView' , IOS_PICKERWHEEL : '-ios predicate string:type == \'XCUIElementTypePickerWheel\'' , DONE : '~done_button' , } ; class Picker { /**
     * Wait for the picker to be shown
     */ static async waitForIsShown ( isShown = true ) { const selector = driver . isIOS ? SELECTORS . IOS_PICKERWHEEL : SELECTORS . ANDROID_LISTVIEW ; await $ ( selector ) . waitForExist ( { timeout : 11000 , reverse : ! isShown , } ) ; } /**
     * Select a value from the picker
     */ static async selectValue ( value ) { await this . waitForIsShown ( true ) ; if ( driver . isIOS ) { await this . setIOSValue ( value ) ; } else { await this . setAndroidValue ( value ) ; } await this . waitForIsShown ( false ) ; } /**
     * Set the value for Android
     */ private static async setAndroidValue ( value ) { await $ ( `${ SELECTORS . ANDROID_LISTVIEW }/*[@text='${ value }']` ) . click ( ) ; } /**
     * Set the value for IOS
     */ private static async setIOSValue ( value ) { await $ ( SELECTORS . IOS_PICKERWHEEL ) . addValue ( value ) ; await $ ( SELECTORS . DONE ) . click ( ) ; } } export default Picker ;