diff --git a/Sources/SpeziAccount/AccountValue/Keys/PasswordKey.swift b/Sources/SpeziAccount/AccountValue/Keys/PasswordKey.swift index ea319bbe..f9ef2a2f 100644 --- a/Sources/SpeziAccount/AccountValue/Keys/PasswordKey.swift +++ b/Sources/SpeziAccount/AccountValue/Keys/PasswordKey.swift @@ -77,7 +77,12 @@ extension PasswordKey { switch accountViewType { case .signup, .none: VerifiableTextField(fieldType.localizedStringResource, text: $password, type: .secure) + #if targetEnvironment(simulator) + // we do not use `.newPassword` within simulator builds to not interfer with UI tests + .textContentType(.password) + #else .textContentType(.newPassword) + #endif .disableFieldAssistants() case .overview: // display description labels in the PasswordChangeSheet (as we have two password fields) DescriptionGridRow { @@ -86,7 +91,12 @@ extension PasswordKey { SecureField(text: $password) { Text(fieldType.localizedPrompt) } + #if targetEnvironment(simulator) + // we do not use `.newPassword` within simulator builds to not interfer with UI tests + .textContentType(.password) + #else .textContentType(.newPassword) + #endif .disableFieldAssistants() } diff --git a/Tests/UITests/TestAppUITests/AccountOverviewTests.swift b/Tests/UITests/TestAppUITests/AccountOverviewTests.swift index a0d52cb8..713f43e6 100644 --- a/Tests/UITests/TestAppUITests/AccountOverviewTests.swift +++ b/Tests/UITests/TestAppUITests/AccountOverviewTests.swift @@ -15,8 +15,6 @@ final class AccountOverviewTests: XCTestCase { try super.setUpWithError() continueAfterFailure = false - - try disablePasswordAutofill() } func testRequirementLevelsOverview() throws { diff --git a/Tests/UITests/TestAppUITests/AccountSetupTests.swift b/Tests/UITests/TestAppUITests/AccountSetupTests.swift index 7ac3eea7..26609a45 100644 --- a/Tests/UITests/TestAppUITests/AccountSetupTests.swift +++ b/Tests/UITests/TestAppUITests/AccountSetupTests.swift @@ -15,8 +15,6 @@ final class AccountSetupTests: XCTestCase { try super.setUpWithError() continueAfterFailure = false - - try disablePasswordAutofill() } func testEmbeddedViewValidation() throws {