I'm adding a child view to my view programmatically, and when I do I attach all accessibility params to it:
[labelView setAccessibilityLabel:@"label"];
[labelView setIsAccessibilityElement:YES];
[labelView setUserInteractionEnabled:YES];
But when I query the UI like this:
let app = XCUIApplication()
app.staticTexts["label"]
The test fails because it couldn't find the view.
How do I deal with this, how to make dynamically added views available for UI Testing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…