I would like to be able to assert against either a descendant or ancestor of an element visually selected for assertion. Sometimes the attributes or classes that capture state are not on the element that is actually clickable, either on a hidden child or somewhere up the DOM tree as an ancestor.
For example, I have a complex checkbox component with a hidden input. I cannot select the outermost container element which captures state, nor the hidden input element which captures state, only an element in the middle that is just a container element and has no state associated with it. I would like to select this element and perhaps provide a CSS selector to search within the element or up the tree to pick the element I actually want to assert against.