How do I test whether a view is hidden using XCUITest? A view is sometimes hidden (set in Xcode like this: Hidden view)
How do I test for that in XCUITest using Swift? In my case, the view is just a label. I tried something like this: XCTAssertFalse(app.staticTexts["pushNotificationInstruction"].accessibilityElementsHidden)
. But that's not it. accessibilityElementsHidden is not the same as the view is hidden. Thanks.
Unfortunately, this is not currently possible using XCUITest. Here is a developer forum thread where an Apple engineer suggested filing a radar for this exact issue:
https://forums.developer.apple.com/message/46271
I have personally filed a couple radars relating to the limitations imposed by not being able to access certain properties of UIViews from within an XCUITest. I encourage you to do the same and provide details of the scenarios you are blocked from testing because of this deficiency in XCUITest.