This is for MacOS My app posts errors during its operation. Two years ago the following used to be able to test whether the alert was correct (or missing)
func isRightAlert(alertImgStr: String, target: String) -> Bool{
let app = XCUIApplication()
let ackdialog = app.dialogs["alert"]
let imageexists = ackdialog.images[alertImgStr/*"CaptureEclipse alert"*/].exists
//let full = app.debugDescription
XCTAssert(imageexists)
let acklist = ackdialog.children(matching: .staticText)
//NSLog( String(acklist.count))
var found = false
NSLog("Alert>>>>>>>>>>>")
for index in 0...acklist.count - 1{
<see if is is one of the expected ones>
}
<other tests>
}
Now that I am on Ventura with XCode 14.3 it is no longer able to detect the alert. ackdialog returns as not found. imageexists is false which triggers the Assert The alert is on the screen when the timeouts I added trigger
app.debugDescription justs lists all of my menu entries
These are my own alerts (NSAlert) and not system alerts.