const SELECTORS = { cardNumberEditText : driver . isAndroid ? 'card_number_edit_text' : 'card number' , expDateEditText : driver . isAndroid ? 'expiry_date_edit_text' : 'expiration date' , cvcEditText : driver . isAndroid ? 'cvc_edit_text' : 'CVC' , postalCodeEditText : driver . isAndroid ? 'postal_code_edit_text' : 'postal code' , } ; function getTextInputSelectorById ( id ) { return driver . isAndroid ? `//android.widget.EditText[@resource-id="com.example.reactnativestripesdk:id/${ id }"]` : `~${ id }` ; } class CardField { getEditTextElement ( selector ) { if ( driver . isAndroid ) { return $ ( getTextInputSelectorById ( selector ) ) ; } else { return $ ( `~${ selector }` ) ; } } setCardNumber ( value ) { this . getEditTextElement ( SELECTORS . cardNumberEditText ) . setValue ( value ) ; } setExpiryDate ( value ) { this . getEditTextElement ( SELECTORS . expDateEditText ) . setValue ( value ) ; } setCvcNumber ( value ) { this . getEditTextElement ( SELECTORS . cvcEditText ) . setValue ( value ) ; } setPostalCode ( value ) { this . getEditTextElement ( SELECTORS . cvcEditText ) . setValue ( value ) ; } } export default new CardField ( ) ;