From aed415bcb561ac55ea05b3b37a9a89a4a53aa36b Mon Sep 17 00:00:00 2001 From: Gronod Date: Thu, 10 Sep 2026 07:13:18 +0100 Subject: [PATCH] refactor: extract launchApp helper in AboutHelpUITests - Add private launchApp() method with wait(for:timeout:) fallback to activate() - Replace duplicate app.launch()/activate() calls in both test methods - Improves test reliability by ensuring app reaches runningForeground state before activation --- Tests/ICCeryUITests/AboutHelpUITests.swift | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Tests/ICCeryUITests/AboutHelpUITests.swift b/Tests/ICCeryUITests/AboutHelpUITests.swift index 9585623..1080883 100644 --- a/Tests/ICCeryUITests/AboutHelpUITests.swift +++ b/Tests/ICCeryUITests/AboutHelpUITests.swift @@ -35,9 +35,15 @@ final class AboutHelpUITests: XCTestCase { return el } - func testAboutDialogShowsVersionAndBuildDate() throws { + private func launchApp() { app.launch() - app.activate() + if !app.wait(for: .runningForeground, timeout: 10) { + app.activate() + } + } + + func testAboutDialogShowsVersionAndBuildDate() throws { + launchApp() let openAbout = app.buttons["openAboutBtn"] XCTAssertTrue(openAbout.waitForExistence(timeout: 10)) @@ -54,8 +60,7 @@ final class AboutHelpUITests: XCTestCase { } func testHelpOverlaysDoNotChangeSidebarHeight() throws { - app.launch() - app.activate() + launchApp() let toggle = app.buttons["btnToggleAllHelp"] XCTAssertTrue(toggle.waitForExistence(timeout: 10)) -- 2.39.5