Perfecto Automates Face ID Flows for iPhone X

//Perfecto Automates Face ID Flows for iPhone X

Prior to the iPhone X launch, many people doubted the premise of leveraging face ID as the exclusive biometric authentication measure. Post launch, the Face ID feature is widely used, and Apple is planning to transition all future devices to this authentication method.

For mobile brands, Face ID impacts user adoption and application usage tremendously. It streamlines key transactions in the user flow to a degree that was not possible before. Face ID can streamline in-app purchases, beyond logging into the app, for example, while playing a game. Prior to the usage of biometric sensors in apps, it would have been cumbersome for users to enter their credentials in the middle of a game. Further, users get a stronger sense of security when using Face ID.

From a developer standpoint, iPhone X includes changes in many aspects (covered here). All of these changes require integration of new APIs, rehash of layout (specifically considering the notch), and lots of testing. The integration of Face ID as the replacement for touch ID does not seem to be overly complex as they are using similar APIs (Source). The intricacies of the user flows that are all required include: safely disabling touch ID (see below), ensuring that users can reliably authenticate and that transactions aren’t approved accidentally just because the user is, well, looking at the screen. Let’s also keep in mind, developers have no time to conduct this testing: iPhone X adoption is happening (Source), and applications have to be ready.


Figure 1:Express app on iPhone X allows Touch ID

In order to facilitate interactive and automated testing of Face ID, Perfecto integrated Face ID APIs into the different interfaces of its testing solution. Relevant responses and error codes can be controlled via the script. Here’s a code sample describing how to automate Face ID flows in Java. Note: The samples contains preliminary API information.

//========================== Face ID  ===============================
// PerfectoUtils.setFaceIDState(driver, PerfectoUtils.FaceIDState.fail, PerfectoUtils.FaceIDErrorCode.userCancel);
// http://developers.perfectomobile.com/display/PD/Set+faceID
public static enum FaceIDErrorCode {authFailed,
    userCancel,
    userFallback,
    systemCancel,
    lockOut};
public static enum FaceIDState {success, fail};

public static void setFaceIDState(RemoteWebDriver driver, FaceIDState resultAuth, FaceIDErrorCode code) {
    Map<String, Object> params = new HashMap<>();

    if (null!= code)
        params.put(“errorType”, translateFaceIDStateErrorCodeToName(code));
    params.put(“resultAuth”, translateFaceIDStateToName(resultAuth));
    driver.executeScript(“mobile:faceID:set”, params);
}
private static String translateFaceIDStateErrorCodeToName(FaceIDErrorCode code){
    if (null == code) return “”;
    String codeString = code.name().toLowerCase();
    return codeString;
}
private static String translateFaceIDStateToName(FaceIDState state){
    if (null == state) return “”;
    String stateString = state.name().toLowerCase();
    return stateString;
}

 
 
 
 
 
 
 
 
Figure 2: iPhone X with Face ID set to ‘authFailed’ in Perfecto lab

As Face ID will become a reality across all iOS devices, testing of user flows will become a necessary part of the test coverage. As the number of test cases increase, the coverage matrix will mandate automation and devices it needs to be tested on will simply overwhelm any manual testing approach. Now there is a way to do this, with Perfecto.

Amir Rozenberg is the director of product management, responsible for core product strategy at Perfecto Mobile, the leading digital cloud and test automation company. Amir has pioneered mobile quality practices in Perfecto to extend the service across the application life cycle. Amir has extensive experience in the digital industry with expertise in areas including application development, testing, delivery and monitoring. Amir led successful synergies with Microsoft, Blazementer, HP and others to optimize value delivery to our customers. Prior to working at Perfecto Mobile, Amir led the mobile monitoring practice at Gomez/Compuware. Prior to Compuware he led the founding of Adva Mobile, a direct-to-fan mobile marketing startup, as well as various leadership positions at Groove Mobile, Nextcode Corp. etc. Find Amir on Twitter (@Amir_Rozenberg), and LinkedIn (http://www.linkedin.com/in/amirrozenberg). Amir commonly writes for Dzone, CIO Magazine and other publications.

Leave A Comment