import { DEFAULT_PIN , INCORRECT_PIN } from './Constants' ; class Biometrics { private get iosAllowBiometry ( ) { return $ ( '~Don’t Allow' ) ; } private get allowBiometry ( ) { return $ ( '~OK' ) ; } private get androidBiometryAlert ( ) { const selector = 'android=new UiSelector().textContains("Please log in")' ; return $ ( selector ) ; } /**
     * Submit biometric login
     */ async submitBiometricLogin ( successful ) { if ( driver . isIOS ) { return this . submitIosBiometricLogin ( successful ) ; } return this . submitAndroidBiometricLogin ( successful ? DEFAULT_PIN : INCORRECT_PIN ) ; } /**
     * Submit iOS biometric login
     */ async submitIosBiometricLogin ( successful ) { await this . allowIosBiometricUsage ( ) ; return driver . touchId ( successful ) ; } /**
     * Allow biometric usage on iOS if it isn't already accepted
     */ async allowIosBiometricUsage ( ) { try { await this . iosAllowBiometry . waitForDisplayed ( { timeout : 3000 } ) ; await this . allowBiometry . click ( ) ; } catch ( e ) { } } /**
     * Submit Android biometric login
     */ async submitAndroidBiometricLogin ( fingerprintId ) { await this . androidBiometryAlert . waitForDisplayed ( ) ; await driver . fingerPrint ( fingerprintId ) ; } } export default new Biometrics ( ) ;