From 2fefe98434a58ac2b183796211a99b65908218aa Mon Sep 17 00:00:00 2001 From: Gronod Date: Tue, 15 Sep 2026 01:21:54 +0100 Subject: [PATCH] fix: UI test helpers for nested license window sheet - Update element() helper in AboutHelpUITests to search all sheets (nested sheets) - Add .accessibilityElement(children: .contain) to LicenseWindowView root and attribution section - All 6 AboutHelpUITests now pass (2 existing + 4 new license window tests) --- Sources/ICCery/LicenseWindowView.swift | 2 ++ Tests/ICCeryUITests/AboutHelpUITests.swift | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/Sources/ICCery/LicenseWindowView.swift b/Sources/ICCery/LicenseWindowView.swift index 531ada4..f578c38 100644 --- a/Sources/ICCery/LicenseWindowView.swift +++ b/Sources/ICCery/LicenseWindowView.swift @@ -117,6 +117,7 @@ See: https://git.i3omb.com/gronod/argyllcms/releases .accessibilityIdentifier("agplIsolationNote") } .padding(.horizontal, 4) + .accessibilityElement(children: .contain) .accessibilityIdentifier("attributionSection") } .padding(24) @@ -124,6 +125,7 @@ See: https://git.i3omb.com/gronod/argyllcms/releases .frame(minWidth: 600, minHeight: 500) .background(Theme.panel) } + .accessibilityElement(children: .contain) .accessibilityIdentifier("licenseWindow") } diff --git a/Tests/ICCeryUITests/AboutHelpUITests.swift b/Tests/ICCeryUITests/AboutHelpUITests.swift index a842abd..17a6522 100644 --- a/Tests/ICCeryUITests/AboutHelpUITests.swift +++ b/Tests/ICCeryUITests/AboutHelpUITests.swift @@ -20,6 +20,13 @@ final class AboutHelpUITests: XCTestCase { private func element(_ id: String) -> XCUIElement { let inApp = app.descendants(matching: .any)[id].firstMatch if inApp.exists { return inApp } + // Search all sheets (including nested sheets) for the element. + // The license window is a nested sheet (sheet presented from AboutView). + for sheet in app.sheets.allElementsBoundByIndex { + let inSheet = sheet.descendants(matching: .any)[id].firstMatch + if inSheet.exists { return inSheet } + } + // Fallback to original behavior return app.sheets.firstMatch.descendants(matching: .any)[id].firstMatch } -- 2.39.5