fix: UI test helpers for nested license window sheet #179

Merged
gronod merged 1 commits from feat/31-license-attribution into develop 2026-09-15 01:23:33 +01:00
2 changed files with 9 additions and 0 deletions
+2
View File
@@ -117,6 +117,7 @@ See: https://git.i3omb.com/gronod/argyllcms/releases
.accessibilityIdentifier("agplIsolationNote") .accessibilityIdentifier("agplIsolationNote")
} }
.padding(.horizontal, 4) .padding(.horizontal, 4)
.accessibilityElement(children: .contain)
.accessibilityIdentifier("attributionSection") .accessibilityIdentifier("attributionSection")
} }
.padding(24) .padding(24)
@@ -124,6 +125,7 @@ See: https://git.i3omb.com/gronod/argyllcms/releases
.frame(minWidth: 600, minHeight: 500) .frame(minWidth: 600, minHeight: 500)
.background(Theme.panel) .background(Theme.panel)
} }
.accessibilityElement(children: .contain)
.accessibilityIdentifier("licenseWindow") .accessibilityIdentifier("licenseWindow")
} }
@@ -20,6 +20,13 @@ final class AboutHelpUITests: XCTestCase {
private func element(_ id: String) -> XCUIElement { private func element(_ id: String) -> XCUIElement {
let inApp = app.descendants(matching: .any)[id].firstMatch let inApp = app.descendants(matching: .any)[id].firstMatch
if inApp.exists { return inApp } 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 return app.sheets.firstMatch.descendants(matching: .any)[id].firstMatch
} }