matches

fun matches(id: String? = null, text: String? = null, containsText: String? = null): Boolean(source)

Returns whether this element matches every non-null selector.

id matches the full resource name, the resource entry name, or the content description (Compose test tags exposed with testTagsAsResourceId appear as entry names). text matches the text or content description exactly; containsText matches either one by substring. With no selectors, every element matches.

Return

true when every given selector matches.

Parameters

id

An ID to match.

text

An exact label to match.

containsText

A label fragment to match.