Access ID does not work when testing a textfield with `isSecureTextEntry = true`

Viewed 563

So i am trying to access and confirm the presence of a password textfield in my uitests but as soon as assign their isSecureTextEntry = true the tests can no longer find them by the accessID. Does any one know why? and if there is a way around this so that i can find them and use them in the tests? Preferably so that i can still use the access ID to locate them in the tests.

My test is very simple:

func testHasPasswordTextField() {
    let passwordTextField = app.textFields[AccesID.passwordTextField]

    XCTAssertTrue(passwordTextField.isHittable)
}

I get the following error when running the test:

"No matches found for Find: Elements matching predicate '"Password" IN identifiers' from input {( TextField, 0x600000193e80, traits: 146029150208, identifier: 'Email', placeholderValue: 'Email' )}".

the test passes happily if isSecureTextEntry = false(or just not set)

1 Answers
Related