From b11438e38dba2d15b764c0044113444c1dbf252b Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 12 Feb 2026 23:54:41 +0100 Subject: [PATCH] fix auth tests --- .../AuthenticationFlowCoordinatorTests.swift | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/UITests/Sources/AuthenticationFlowCoordinatorTests.swift b/UITests/Sources/AuthenticationFlowCoordinatorTests.swift index 410fa54da..7fdd1f41c 100644 --- a/UITests/Sources/AuthenticationFlowCoordinatorTests.swift +++ b/UITests/Sources/AuthenticationFlowCoordinatorTests.swift @@ -26,8 +26,11 @@ class AuthenticationFlowCoordinatorUITests: XCTestCase { // Server Selection: Clear the default, enter OIDC server and continue. app.textFields[A11yIdentifiers.changeServerScreen.server].clearAndTypeText("example.com\n", app: app) + // Await for the button to be hittable, since a loader may appear + let serverConfirmationContinueButton = app.buttons[A11yIdentifiers.serverConfirmationScreen.continue] + XCTAssertTrue(serverConfirmationContinueButton.wait(for: \.isHittable, toEqual: true, timeout: 2.0)) // Server Confirmation: Tap continue button - app.buttons[A11yIdentifiers.serverConfirmationScreen.continue].tap() + serverConfirmationContinueButton.tap() // Login Screen: Wait for continue button to appear let continueButton = app.buttons[A11yIdentifiers.loginScreen.continue] @@ -56,8 +59,11 @@ class AuthenticationFlowCoordinatorUITests: XCTestCase { // Server Selection: Clear the default, enter OIDC server and continue. app.textFields[A11yIdentifiers.changeServerScreen.server].clearAndTypeText("example.com\n", app: app) + // Await for the button to be hittable, since a loader may appear + let serverConfirmationContinueButton = app.buttons[A11yIdentifiers.serverConfirmationScreen.continue] + XCTAssertTrue(serverConfirmationContinueButton.wait(for: \.isHittable, toEqual: true, timeout: 2.0)) // Server Confirmation: Tap continue button - app.buttons[A11yIdentifiers.serverConfirmationScreen.continue].tap() + serverConfirmationContinueButton.tap() // Login Screen: Wait for continue button to appear let continueButton = app.buttons[A11yIdentifiers.loginScreen.continue] @@ -88,8 +94,11 @@ class AuthenticationFlowCoordinatorUITests: XCTestCase { // Server Selection: Clear the default, enter OIDC server and continue. app.textFields[A11yIdentifiers.changeServerScreen.server].clearAndTypeText("example.com\n", app: app) + // Await for the button to be hittable, since a loader may appear + let serverConfirmationContinueButton = app.buttons[A11yIdentifiers.serverConfirmationScreen.continue] + XCTAssertTrue(serverConfirmationContinueButton.wait(for: \.isHittable, toEqual: true, timeout: 2.0)) // Server Confirmation: Tap continue button - app.buttons[A11yIdentifiers.serverConfirmationScreen.continue].tap() + serverConfirmationContinueButton.tap() // Login Screen: Wait for continue button to appear let continueButton = app.buttons[A11yIdentifiers.loginScreen.continue]