fix: UI test helpers for nested license window sheet #179
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user