descendants(matching:)
Returns a query for all descendants of the element matching the type you specify.
Declaration
func descendants(matching type: XCUIElement.ElementType) -> XCUIElementQueryDiscussion
Because XCUIElement conforms to the XCUIElementTypeQueryProvider protocol, you can use the protocol’s properties as shorthand for calling descendants(matching:) for different element types. For example, rather than calling table.descendants(matching: .cell), you can use the cells property from the protocol to retrieve table.cells.