From 0187ef2b828a3456aa52e16ba2b243786191b8c4 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Tue, 11 Nov 2025 12:47:09 +0000 Subject: [PATCH] =?UTF-8?q?Make=20sure=20the=20integration=20tests=20stop?= =?UTF-8?q?=20when=20running=20out=20of=20WAS=20retries=20=F0=9F=99=88=20(?= =?UTF-8?q?#4730)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IntegrationTests/Sources/Common.swift | 7 ++++++- IntegrationTests/Sources/UserFlowTests.swift | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/IntegrationTests/Sources/Common.swift b/IntegrationTests/Sources/Common.swift index f5ba55f87..234a2aa8e 100644 --- a/IntegrationTests/Sources/Common.swift +++ b/IntegrationTests/Sources/Common.swift @@ -8,10 +8,14 @@ import XCTest +enum IntegrationTestsError: Error { + case webAuthenticationSessionFailure +} + extension XCUIApplication { private var doesNotExistPredicate: NSPredicate { NSPredicate(format: "exists == 0") } - func login(currentTestCase: XCTestCase) { + func login(currentTestCase: XCTestCase) throws { let getStartedButton = buttons[A11yIdentifiers.authenticationStartScreen.signIn] XCTAssertTrue(getStartedButton.waitForExistence(timeout: 10.0)) @@ -55,6 +59,7 @@ extension XCUIApplication { remainingAttempts -= 1 if remainingAttempts <= 0 { XCTFail("Failed to present the web authentication session.") + throw IntegrationTestsError.webAuthenticationSessionFailure } if alerts.count > 0 { diff --git a/IntegrationTests/Sources/UserFlowTests.swift b/IntegrationTests/Sources/UserFlowTests.swift index 8cfa10a81..22e73b743 100644 --- a/IntegrationTests/Sources/UserFlowTests.swift +++ b/IntegrationTests/Sources/UserFlowTests.swift @@ -8,15 +8,16 @@ import XCTest +@MainActor class UserFlowTests: XCTestCase { private static let integrationTestsRoomName = "Element X iOS Integration Tests" private static let integrationTestsMessage = "Go down in flames!" private var app: XCUIApplication! - override func setUp() { + override func setUp() async throws { app = Application.launch() - app.login(currentTestCase: self) + try app.login(currentTestCase: self) } func testUserFlow() {