I'm trying to add UI tests to my MacOS application. But XCUIApplication doesn't see any elements. If I start UI test, pause it with a breakpoint and run `po XCUIApplication().windows.count` or `XCUIApplication().buttons.count` it always returns 0. When running recording, it generates code where it just click on a window, which is mysteriously found by the name, while if I run the same command with `po` it shows me nothing.
I've tried creating empty mac app and added a few buttons there - it works ok an sees all the elements perfectly.
What may be wrong? Is there anything that I'm missing?