I am trying to create a XCUITest where I like to verify that iOS' Status Bar is either:
- hidden; or
- visible.
But I cannot 'find' it... for example:
func testExample() throws {
let app = XCUIApplication()
app.launch()
let statusBar1 = app.descendants(matching: .statusBar)
let statusBar2 = app.statusBars.element(boundBy: 0)
}
When do po statusBar1
in the console I get an empty result:
Find: Target Application 'com.domain.TestStatusBar'
↪︎Find: Descendants matching type StatusBar
Any clue of how to find it?
Thanks!