-[XCUIElement exists] returns YES for element with zero alpha or empty frame if element is inside UITableViewCell
| Originator: | nickolas.pohilets | ||
| Number: | rdar://33267409 | Date Originated: | July 12 2017 |
| Status: | Closed | Resolved: | Won't Fix |
| Product: | Developer Tools | Product Version: | 9.0 beta 3 (9M174d) |
| Classification: | Bug | Reproducible: | Always |
Summary: See attached project that reproduces the problem: https://filebin.ca/3T8fZNbKFBrC/TestZeroAlpha.zip Test app consists of the two screens, each screen contains 4 text fields: 1) visible 2) hidden by setting -[UIView setHidden:YES] 3) hidden by setting -[UIView setAlpha:0] 4) hidden by setting -[UIView setFrame:CGMakeRect(..., ..., 0, 0)] On the first screen, text fields are added as direct subviews. On the second screen, they are inside a UITableViewCell. Switching between screens is performed by tapping a button in the bottom of the first screen. Attached UI tests contain two tests. The first one validates the existence of the text fields on the first screen and passes. The second one validates the existence of the text fields on the second screen and fails. On the first screen, only text field #1 is considered to exist, which is the expected behaviour. On the second screen, text fields #1, #3 and #4 are reported as existing, which is a bug. An existence of the fields on the second screen should be reported in the same way as it is reported on the first screen. Steps to Reproduce: Open attached project file and run included UI tests Expected Results: Tests should pass. Existence should be reported consistently. Elements with alpha = 0 or empty frame should be reported as non-existent regardless of their location in the view hierarchy. Observed Results: Tests fail. Existence is reported inconsistently. Version: Version 9.0 beta 3 (9M174d) macOS Sierra 10.12.5 Simulator: iOS 10.1 (14B72), iPhone 6s
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!