Last active
September 13, 2024 14:49
-
-
Save SarahElson/a2e0f88b768201a0a0dc059af61c57d6 to your computer and use it in GitHub Desktop.
How to Test Biometric Authentication With Appium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HomePage { | |
private final AndroidDriver androidDriver; | |
public HomePage(final AndroidDriver androidDriver) { | |
this.androidDriver = androidDriver; | |
} | |
private WebElement biometricBtn() { | |
return this.androidDriver.findElement(AppiumBy.id("com.poc.sample:id/biometric")); | |
} | |
public void performSuccessBioMetricAuthenticationOnRealDevice() { | |
biometricBtn().click(); | |
this.androidDriver.executeScript("lambda-biometric-injection=pass"); | |
} | |
public String getMessageText () { | |
return this.androidDriver.findElement(AppiumBy.xpath("/hierarchy/android.widget.Toast[1]")).getText(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment