es1
es1

Reputation: 1556

How to open Passcode field in Swift XCTest UI with iOS 17.4

This code works when I run it in the iOS Simulator with iOS 17.0.1:

    let passcodeInput = springboard.secureTextFields["Passcode field"]
    _ = passcodeInput.waitForExistence(timeout: 10)
    passcodeInput.tap()

However if I run it on the iOS Simulator with iOS 17.4 I get this error:

    t =      nans     Checking existence of `"Passcode field" SecureTextField`
    t =      nans     Capturing debug information
    t =      nans         Requesting snapshot of accessibility hierarchy for app with pid 66943
    t =      nans     Tap "Passcode field" SecureTextField
    t =      nans         Wait for com.apple.springboard to idle
    t =      nans         Find the "Passcode field" SecureTextField
    t =      nans             Find the "Passcode field" SecureTextField (retry 1)
    t =      nans             Find the "Passcode field" SecureTextField (retry 2)
    t =      nans     Requesting snapshot of accessibility hierarchy for app with pid 66943
<unknown>:0: error: PRCheckUITests : Failed to tap "Passcode field" SecureTextField: No matches found for Descendants matching type SecureTextField from input {(
    Application, pid: 66943, label: ' '
)}

Did the hardcoded string "Passcode field" change for iOS 17.4? How can I access the passcode field through springboard in a test?

Upvotes: 0

Views: 62

Answers (1)

es1
es1

Reputation: 1556

I continued my investigation and I found out that the passcode field does not appear in the iOS 17.4 Simulator like it does in iOS 17.0.1. That is why the test code can't find the passcode field and therefore fails.

Upvotes: 0

Related Questions