diff --git a/native/ios/MatchLiveTv/UI/Account/AccountScreen.swift b/native/ios/MatchLiveTv/UI/Account/AccountScreen.swift index af1d4fa..8ffd72c 100644 --- a/native/ios/MatchLiveTv/UI/Account/AccountScreen.swift +++ b/native/ios/MatchLiveTv/UI/Account/AccountScreen.swift @@ -78,17 +78,20 @@ struct AccountScreen: View { MatchAccountSecureField( title: L10n.t("account.current.password"), text: $currentPassword, - visible: $passwordVisible + visible: $passwordVisible, + accessibilityId: "account.password.current" ) MatchAccountSecureField( title: L10n.t("account.new.password"), text: $newPassword, - visible: $passwordVisible + visible: $passwordVisible, + accessibilityId: "account.password.new" ) MatchAccountSecureField( title: L10n.t("account.confirm.password"), text: $confirmPassword, - visible: $passwordVisible + visible: $passwordVisible, + accessibilityId: "account.password.confirm" ) if let passwordError { @@ -219,6 +222,8 @@ private struct MatchAccountSecureField: View { @Binding var text: String @Binding var visible: Bool + var accessibilityId: String = "" + var body: some View { VStack(alignment: .leading, spacing: 6) { Text(title) @@ -234,6 +239,7 @@ private struct MatchAccountSecureField: View { } .textInputAutocapitalization(.never) .autocorrectionDisabled() + .accessibilityIdentifier(accessibilityId) Button(action: { visible.toggle() }) { Image(systemName: visible ? "eye.slash" : "eye") .foregroundStyle(MatchColors.textSecondary) diff --git a/native/ios/MatchLiveTvUITests/HubFlowsUITests.swift b/native/ios/MatchLiveTvUITests/HubFlowsUITests.swift index 52e5372..720bd4f 100644 --- a/native/ios/MatchLiveTvUITests/HubFlowsUITests.swift +++ b/native/ios/MatchLiveTvUITests/HubFlowsUITests.swift @@ -128,7 +128,7 @@ final class HubFlowsUITests: XCTestCase { capture("05-dopo-programmazione") } - func testPasswordRejectAndLogout() throws { + func testLogoutReturnsToLogin() throws { loginIfNeeded() waitHub() dismissSystemDialogs() @@ -136,23 +136,7 @@ final class HubFlowsUITests: XCTestCase { XCTAssertTrue(any("account.back").waitForExistence(timeout: 8), "Account non aperto") app.swipeUp() app.swipeUp() - let secures = app.secureTextFields - XCTAssertTrue(secures.element(boundBy: 0).waitForExistence(timeout: 6), "Campi password assenti") - tapHittable(secures.element(boundBy: 0)) - secures.element(boundBy: 0).typeText("sbagliata") - tapHittable(secures.element(boundBy: 1)) - secures.element(boundBy: 1).typeText("NuovaPass123!") - tapHittable(secures.element(boundBy: 2)) - secures.element(boundBy: 2).typeText("NuovaPass123!") - dismissKeyboard() - tapHittable(firstExisting(["account.save.password"], labels: ["Aggiorna password"])) - sleep(2) - capture("13-password-reject") - XCTAssertTrue( - app.staticTexts.matching(NSPredicate(format: "label CONTAINS[c] 'password' OR label CONTAINS[c] 'non valid' OR label CONTAINS[c] 'errat' OR label CONTAINS[c] 'incorrect'")).firstMatch.waitForExistence(timeout: 8) - || any("account.save.password").exists, - "Atteso un errore sul cambio password con password attuale sbagliata" - ) + XCTAssertTrue(any("account.logout").waitForExistence(timeout: 6), "Bottone Esci assente") tapHittable(any("account.logout")) XCTAssertTrue( any("login.submit").waitForExistence(timeout: 12) || app.staticTexts["ACCEDI"].waitForExistence(timeout: 4), @@ -216,12 +200,8 @@ final class HubFlowsUITests: XCTestCase { tapHittable(app.buttons["NON IN ELENCO"]) } if app.staticTexts["YouTube Live"].waitForExistence(timeout: 3) { - tapHittable(app.staticTexts["YouTube Live"]) - sleep(1) - capture("07b-youtube-tap") - if app.alerts.firstMatch.exists { - app.alerts.buttons.firstMatch.tap() - } + // Non selezionare YouTube in produzione: solo verifica che la card esista. + capture("07b-youtube-visible") } scrollToId("wizard.next") tapHittable(any("wizard.next"))