XCUIElement's Print Statement Not Including Nested Button

Example Image:

Expected Behavior: When an XCUIElement is rendered from a screen with (Initial Conditions): An ImageView with..

isUserInteractionEnabled = YES…
IsAccessibilityElement = YES…
A nested button…
isUserInteractionEnabled = YES…
IsAccessibilityElement = YES…

Assigned to the ImageViews accessibility elements array XCUIElement’s print statement includes the nested button

Current Behavior: When an XCUIElement is rendered from a screen with: (above Initial Conditions) XCUIElement’s print statement only include the ImageView

Attempted Fixes: Combinations of the Initial Conditions: Attempted all combinations of Initial Condition variable values. (ie:

myImageView.accessibilityElements = [imageView, nestedButton]
myImageView.accessibilityElements = [nestedButton]
isUserInteractionEnabled = YES/NO [for both]
IsAccessibilityElement = YES/NO [for both]

etc…)

Debug Print: Image View with No Descendants - Image, 0x7fa875d23e80, {{172.7, 292.7}, {45.0, 41.7}}, label: 'demo image' po element.images and po element.buttons -

Find: Descendants matching type Image
    Output: {
      Image, 0x7fa876e14e70, {{-8.0, 99.0}, {136.7, 109.3}}
      Image, 0x7fa876e14f80, {{-8.0, 741.7}, {136.7, 102.3}}
      Image, 0x7fa876e13da0, {{269.7, 737.0}, {136.3, 123.0}}
      Image, 0x7fa876e1a060, {{172.7, 292.7}, {45.0, 41.7}}, label: 'demo image'
    }

Output: {
      Button, 0x7fa875c12740, {{0.0, 47.0}, {68.0, 44.0}}, label: 'myApp UIKit'
      Button, 0x7fa875c24f00, {{338.0, 47.0}, {44.0, 44.0}}, identifier: 'Settings Button', label: 'Settings'
      Button, 0x7fa875c2c800, {{175.0, 533.0}, {40.0, 40.0}}
      Button, 0x7fa875c2cf30, {{183.0, 541.0}, {24.0, 24.0}}
      Button, 0x7fa875c2fa20, {{40.0, 659.3}, {153.0, 44.0}}, label: 'Left'
      Button, 0x7fa875c30cd0, {{197.0, 659.3}, {153.0, 44.0}}, label: 'Right'
    } 

Comparing the coordinates of the parent image view and the nested button, the button isn't here. The 24x24 button that appears comes from another view on the same screen, noting the ample y coordinate from the parent image view.

Request: Request that Apple, in the spirit of XCUI framework being to be near to human experience include this common design case

You can use Accessibility Inspector to perform an Accessibility Audit of your app while it is running, which will report if the Accessibility hierarchy has any errors in it. For instance, if an element is available but disconnected from the hierarchy, the Audit will inform you of that.

XCUIElement's Print Statement Not Including Nested Button
 
 
Q