All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.appium.java_client.android.AuthenticatesByFinger Maven / Gradle / Ivy

The newest version!
package io.appium.java_client.android;

import io.appium.java_client.CanRememberExtensionPresence;
import io.appium.java_client.CommandExecutionHelper;
import io.appium.java_client.ExecutesMethod;
import org.openqa.selenium.UnsupportedCommandException;

import java.util.Map;

import static io.appium.java_client.android.AndroidMobileCommandHelper.fingerPrintCommand;

public interface AuthenticatesByFinger extends ExecutesMethod, CanRememberExtensionPresence {

    /**
     * Authenticate users by using their finger print scans on supported emulators.
     *
     * @param fingerPrintId finger prints stored in Android Keystore system (from 1 to 10)
     */
    default void fingerPrint(int fingerPrintId) {
        final String extName = "mobile: fingerprint";
        try {
            CommandExecutionHelper.executeScript(assertExtensionExists(extName), extName, Map.of(
                    "fingerprintId", fingerPrintId
            ));
        } catch (UnsupportedCommandException e) {
            // TODO: Remove the fallback
            CommandExecutionHelper.execute(markExtensionAbsence(extName), fingerPrintCommand(fingerPrintId));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy